Pulse adds COVID-19 Simulation Support
×
Saturation.h
1 /* Distributed under the Apache License, Version 2.0.
2  See accompanying NOTICE file for details.*/
3 
4 #pragma once
5 struct error_functor;
6 class SESubstance;
10 
15 class PULSE_DECL SaturationCalculator : public Loggable
16 {
17  friend class PulseData;
18  friend error_functor;
19  friend class PulseEngineTest;
20 protected:
23 
24 public:
25  virtual ~SaturationCalculator();
26 
27  bool Setup();
28 
29  void SetBodyState(const SEScalarMassPerVolume& AlbuminConcentration, const SEScalar0To1& Hematocrit, const SEScalarTemperature& Temperature, const SEScalarAmountPerVolume& StrongIonDifference, const SEScalarAmountPerVolume& Phosphate);
30  void CalculateBloodGasDistribution(SELiquidCompartment& cmpt);
31  void CalculateCarbonMonoxideSpeciesDistribution(SELiquidCompartment& cmpt);
32 
33 protected:
34  // Stewart Model + Dash-Bassingthwaighte Model + Henderson-Hasselbach Model
35  void CalculateHemoglobinSaturations(double O2PartialPressureGuess_mmHg, double CO2PartialPressureGuess_mmHg, double pH, double temperature_C, double hematocrit, double& OxygenSaturation, double& CarbonDioxideSaturation, double CO2_scaling_factor);
36  bool DistributeHemoglobinBySaturation();
37 
38  // All properties are stateless and are set by either the Initialize method or SetBodyState method
48  // Used for conversions
56  // This is the current compartment and the quantities we are balancing
67  // The current state of the body to balance to
69  double m_hematocrit;
71  // Here is the stuff that will need to go into the CDM
72  double m_StrongIonDifference_mmol_Per_L; // BloodChemistrySystemData mmol/L
73  double m_Phosphate_mmol_Per_L; //BloodChemistryData mmol/L
74 };
Definition: SESubstanceManager.h:8
SELiquidSubstanceQuantity * m_subCO2Q
Definition: Saturation.h:59
double m_hematocrit
Definition: Saturation.h:69
SELiquidSubstanceQuantity * m_subHbCOQ
Definition: Saturation.h:61
SESubstance * m_HbCO2
Definition: Saturation.h:47
Definition: SEScalarMassPerVolume.h:32
PulseData & m_data
Definition: Saturation.h:22
SESubstance * m_HCO3
Definition: Saturation.h:46
Definition: Controller.h:64
SESubstance * m_HbO2
Definition: Saturation.h:41
friend error_functor
Definition: Saturation.h:18
SESubstance * m_O2
Definition: Saturation.h:39
Definition: SELiquidSubstanceQuantity.h:11
SELiquidSubstanceQuantity * m_subO2Q
Definition: Saturation.h:58
SELiquidSubstanceQuantity * m_subHbO2Q
Definition: Saturation.h:64
Definition: Logger.h:21
SELiquidSubstanceQuantity * m_subHbCO2Q
Definition: Saturation.h:65
Definition: SEScalarTemperature.h:22
Definition: SELiquidCompartment.h:10
double m_albumin_g_per_L
Definition: Saturation.h:68
The SaturationCalculator class holds the blood gas distribution model.
Definition: Saturation.h:15
SELiquidCompartment * m_cmpt
Definition: Saturation.h:57
SELiquidSubstanceQuantity * m_subHbO2CO2Q
Definition: Saturation.h:66
SESubstance * m_CO
Definition: Saturation.h:44
SESubstance * m_CO2
Definition: Saturation.h:43
double m_HbO2_g_Per_mol
Definition: Saturation.h:53
double m_O2_g_Per_mol
Definition: Saturation.h:49
double m_HbO2CO2_g_Per_mol
Definition: Saturation.h:55
Definition: EngineTest.h:28
double m_Hb_g_Per_mol
Definition: Saturation.h:52
Definition: SEScalarAmountPerVolume.h:25
double m_HbCO2_g_Per_mol
Definition: Saturation.h:54
double m_Phosphate_mmol_Per_L
Definition: Saturation.h:73
SELiquidSubstanceQuantity * m_subHCO3Q
Definition: Saturation.h:62
Definition: Saturation.cpp:45
SESubstance * m_HbO2CO2
Definition: Saturation.h:42
SESubstance * m_HbCO
Definition: Saturation.h:45
SELiquidSubstanceQuantity * m_subCOQ
Definition: Saturation.h:60
double m_StrongIonDifference_mmol_Per_L
Definition: Saturation.h:72
double m_temperature_C
Definition: Saturation.h:70
Definition: SESubstance.h:14
SESubstance * m_Hb
Definition: Saturation.h:40
double m_HCO3_g_Per_mol
Definition: Saturation.h:51
SELiquidSubstanceQuantity * m_subHbQ
Definition: Saturation.h:63
Definition: SEScalar0To1.h:7
double m_CO2_g_Per_mol
Definition: Saturation.h:50

Distributed under the Apache License, Version 2.0.

See accompanying NOTICE file for details.