SELiquidSubstanceQuantity.h
1/* Distributed under the Apache License, Version 2.0.
2 See accompanying NOTICE file for details.*/
3
4#pragma once
5#include "cdm/compartment/substances/SESubstanceQuantity.h"
6#include "cdm/substance/SESubstanceTransport.h"
8
9enum class BalanceLiquidBy { Mass, Concentration, Molarity, PartialPressure };
10
12{
13 friend class PBSubstanceQuantity;//friend the serialization class
14 friend class SELiquidCompartment;
15protected:
17public:
19
20 void Clear() override;
21
22 virtual std::string GetCompartmentName() override;
23
24 void SetToZero() override;
25 const SEScalar* GetScalar(const std::string& name) override;
26
27 virtual void Balance(BalanceLiquidBy e);// Balance Substance based on a specific property
28
29 virtual bool HasConcentration() const;
30 virtual SEScalarMassPerVolume& GetConcentration();
31 virtual double GetConcentration(const MassPerVolumeUnit& unit) const;
32
33 virtual bool HasMass() const;
34 virtual SEScalarMass& GetMass();
35 virtual double GetMass(const MassUnit& unit) const;
36
37 virtual bool HasMassCleared() const;
38 virtual SEScalarMass& GetMassCleared();
39 virtual double GetMassCleared(const MassUnit& unit) const;
40
41 virtual bool HasMassDeposited() const;
42 virtual SEScalarMass& GetMassDeposited();
43 virtual double GetMassDeposited(const MassUnit& unit) const;
44
45 virtual bool HasMassExcreted() const;
46 virtual SEScalarMass& GetMassExcreted();
47 virtual double GetMassExcreted(const MassUnit& unit) const;
48
49 virtual bool HasMolarity() const;
50 virtual SEScalarAmountPerVolume& GetMolarity();
51 virtual double GetMolarity(const AmountPerVolumeUnit& unit) const;
52
53 virtual bool HasPartialPressure() const;
54 virtual SEScalarPressure& GetPartialPressure();
55 virtual double GetPartialPressure(const PressureUnit& unit) const;
56
57 virtual bool HasSaturation() const;
58 virtual SEScalar0To1& GetSaturation();
59 virtual double GetSaturation() const;
60 virtual void SetHemoglobins(const SESubstance& Hb, const SESubstance& HbO2, const SESubstance& HbCO2, const SESubstance& HbO2CO2, const SESubstance& HbCO);
61
62protected:
63 virtual void AddChild(SELiquidSubstanceQuantity& subQ);
64
65 bool HasExtensive() const override { return HasMass(); }
66 SEScalarMass& GetExtensive() override { return GetMass(); }
67
68 bool HasIntensive() const override { return HasConcentration(); }
69 SEScalarMassPerVolume& GetIntensive() override { return GetConcentration(); }
70
79
81 std::vector<SELiquidSubstanceQuantity*> m_Children;
82
83 bool m_isO2;
84 bool m_isCO;
85 bool m_isCO2;
86 // Inorder to caluclate a hierarchical saturation, we need these substances
92};
Definition: SEScalarAmountPerVolume.h:8
Definition: SEScalarMassPerVolume.h:8
Definition: SEScalarMass.h:8
Definition: PBSubstanceQuantity.h:11
Definition: SEScalarPressure.h:8
Definition: SELiquidCompartment.h:11
friend class SELiquidSubstanceQuantity
Definition: SELiquidCompartment.h:15
virtual void AddChild(SELiquidCompartment &child)
Definition: SELiquidCompartment.cpp:159
virtual void Balance(BalanceLiquidBy e)
Definition: SELiquidCompartment.cpp:54
Definition: SELiquidSubstanceQuantity.h:12
SEScalar0To1 * m_Saturation
Definition: SELiquidSubstanceQuantity.h:78
const SESubstance * m_HbCO
Definition: SELiquidSubstanceQuantity.h:91
bool m_isCO2
Definition: SELiquidSubstanceQuantity.h:85
SEScalarMass * m_Mass
Definition: SELiquidSubstanceQuantity.h:72
const SESubstance * m_HbCO2
Definition: SELiquidSubstanceQuantity.h:89
std::vector< SELiquidSubstanceQuantity * > m_Children
Definition: SELiquidSubstanceQuantity.h:81
bool m_isO2
Definition: SELiquidSubstanceQuantity.h:83
SEScalarAmountPerVolume * m_Molarity
Definition: SELiquidSubstanceQuantity.h:76
bool HasExtensive() const override
Definition: SELiquidSubstanceQuantity.h:65
SEScalarPressure * m_PartialPressure
Definition: SELiquidSubstanceQuantity.h:77
SEScalarMass * m_MassCleared
Definition: SELiquidSubstanceQuantity.h:73
bool HasIntensive() const override
Definition: SELiquidSubstanceQuantity.h:68
SEScalarMass * m_MassDeposited
Definition: SELiquidSubstanceQuantity.h:74
bool m_isCO
Definition: SELiquidSubstanceQuantity.h:84
SELiquidCompartment & m_Compartment
Definition: SELiquidSubstanceQuantity.h:80
const SESubstance * m_Hb
Definition: SELiquidSubstanceQuantity.h:87
const SESubstance * m_HbO2CO2
Definition: SELiquidSubstanceQuantity.h:90
const SESubstance * m_HbO2
Definition: SELiquidSubstanceQuantity.h:88
SEScalarMassPerVolume * m_Concentration
Definition: SELiquidSubstanceQuantity.h:71
SEScalarMass * m_MassExcreted
Definition: SELiquidSubstanceQuantity.h:75
SEScalarMass & GetExtensive() override
Definition: SELiquidSubstanceQuantity.h:66
SEScalarMassPerVolume & GetIntensive() override
Definition: SELiquidSubstanceQuantity.h:69
Definition: SEScalar0To1.h:8
Definition: SEScalarAmountPerVolume.h:31
Definition: SEScalar.h:19
Definition: SEScalarMass.h:28
Definition: SEScalarMassPerVolume.h:37
Definition: SEScalarPressure.h:29
Definition: SESubstance.h:15
Definition: SESubstanceQuantity.h:8
virtual const SEScalar * GetScalar(const std::string &name)=0
virtual void Clear()=0
virtual void SetToZero()=0
virtual std::string GetCompartmentName()=0
Definition: SESubstanceTransport.h:14

Distributed under the Apache License, Version 2.0.

See accompanying NOTICE file for details.