The SaturationCalculator class holds the blood gas distribution model. More...

#include <Saturation.h>

Inherits Loggable.

Public Member Functions

virtual ~SaturationCalculator ()
 
void Initialize (SESubstanceManager &substances)
 
void SetBodyState (const SEScalarMassPerVolume &AlbuminConcentration, const SEScalar0To1 &Hematocrit, const SEScalarTemperature &Temperature, const SEScalarAmountPerVolume &StrongIonDifference, const SEScalarAmountPerVolume &Phosphate)
 
void CalculateBloodGasDistribution (SELiquidCompartment &cmpt)
 Determines species distribution of oxygen and carbon dioxide in a vascular compartment. More...
 
void CalculateCarbonMonoxideSpeciesDistribution (SELiquidCompartment &cmpt)
 Determines the carbon monoxide (CO) species distribution in a compartment and sets the CO saturation. More...
 
- Public Member Functions inherited from Loggable
 Loggable ()
 
 Loggable (Logger *log)
 
virtual ~Loggable ()
 
virtual LoggerGetLogger () const
 
virtual void Debug (std::string const &msg, std::string const &origin=empty) const
 
virtual void Debug (std::stringstream &msg, std::string const &origin=empty) const
 
virtual void Debug (std::ostream &msg, std::string const &origin=empty) const
 
virtual void Info (std::string const &msg, std::string const &origin=empty) const
 
virtual void Info (std::stringstream &msg, std::string const &origin=empty) const
 
virtual void Info (const std::stringstream &msg, std::string const &origin=empty) const
 
virtual void Info (std::ostream &msg, std::string const &origin=empty) const
 
virtual void Warning (std::string const &msg, std::string const &origin=empty) const
 
virtual void Warning (std::stringstream &msg, std::string const &origin=empty) const
 
virtual void Warning (std::ostream &msg, std::string const &origin=empty) const
 
virtual void Error (std::string const &msg, std::string const &origin=empty) const
 
virtual void Error (std::stringstream &msg, std::string const &origin=empty) const
 
virtual void Error (std::ostream &msg, std::string const &origin=empty) const
 
virtual void Fatal (std::string const &msg, std::string const &origin=empty) const
 
virtual void Fatal (std::stringstream &msg, std::string const &origin=empty) const
 
virtual void Fatal (std::ostream &msg, std::string const &origin=empty) const
 

Protected Member Functions

 SaturationCalculator (PulseController &data)
 
void CalculateHemoglobinSaturations (double O2PartialPressureGuess_mmHg, double CO2PartialPressureGuess_mmHg, double pH, double temperature_C, double hematocrit, double &OxygenSaturation, double &CarbonDioxideSaturation, double CO2_scaling_factor)
 Computes the percent saturation of hemoglobin of oxygen and carbon dioxide. More...
 
bool DistributeHemoglobinBySaturation ()
 Distributes hemoglobin species for a given pair of oxygen and carbon dioxide saturation fractions. More...
 

Protected Attributes

friend error_functor
 
friend PulseController
 
PulseControllerm_data
 
SESubstancem_O2
 
SESubstancem_Hb
 
SESubstancem_HbO2
 
SESubstancem_HbO2CO2
 
SESubstancem_CO2
 
SESubstancem_CO
 
SESubstancem_HbCO
 
SESubstancem_HCO3
 
SESubstancem_HbCO2
 
double m_O2_g_Per_mol
 
double m_CO2_g_Per_mol
 
double m_HCO3_g_Per_mol
 
double m_Hb_g_Per_mol
 
double m_HbO2_g_Per_mol
 
double m_HbCO2_g_Per_mol
 
double m_HbO2CO2_g_Per_mol
 
SELiquidCompartmentm_cmpt
 
SELiquidSubstanceQuantitym_subO2Q
 
SELiquidSubstanceQuantitym_subCO2Q
 
SELiquidSubstanceQuantitym_subCOQ
 
SELiquidSubstanceQuantitym_subHbCOQ
 
SELiquidSubstanceQuantitym_subHCO3Q
 
SELiquidSubstanceQuantitym_subHbQ
 
SELiquidSubstanceQuantitym_subHbO2Q
 
SELiquidSubstanceQuantitym_subHbCO2Q
 
SELiquidSubstanceQuantitym_subHbO2CO2Q
 
double m_albumin_g_per_L
 
double m_hematocrit
 
double m_temperature_C
 
double m_StrongIonDifference_mmol_Per_L
 
double m_Phosphate_mmol_Per_L
 
- Protected Attributes inherited from Loggable
Loggerm_Logger
 

Friends

class PulseEngineTest
 

Additional Inherited Members

- Static Public Attributes inherited from Loggable
static const std::string empty
 

Detailed Description

The SaturationCalculator class holds the blood gas distribution model.

Constructor & Destructor Documentation

◆ SaturationCalculator()

SaturationCalculator::SaturationCalculator ( PulseController data)
protected

◆ ~SaturationCalculator()

SaturationCalculator::~SaturationCalculator ( )
virtual

Member Function Documentation

◆ CalculateBloodGasDistribution()

void SaturationCalculator::CalculateBloodGasDistribution ( SELiquidCompartment cmpt)

Determines species distribution of oxygen and carbon dioxide in a vascular compartment.

This method computes the distribution of dissolved and hemoglobin-bound oxygen and carbon dioxide in the blood and also the fraction of total carbon dioxide that is in bicarbonate form. The method uses the Eigen HybridNonLinearSolver to solve the system of equations described in bloodchemistry-approach.

◆ CalculateCarbonMonoxideSpeciesDistribution()

void SaturationCalculator::CalculateCarbonMonoxideSpeciesDistribution ( SELiquidCompartment cmpt)

Determines the carbon monoxide (CO) species distribution in a compartment and sets the CO saturation.

This method computes the fraction of hemoglobin that is bound with carbon monoxide (CO). Conservation of mass and the Haldane relationship described in [27] are used to compute the distribution of carbon monoxide species in a compartment. The hemoglobin available for oxygen binding is then decremented with the assumption that CO binds first to deoxyhemoglobin, then to oxyhemoglobin, then to oxycarbaminohemoglobin, and finally to carbaminohemoglobin. In binding to the relative hemoglobin species, CO converts the species to carboxyhemoglobin. Currently, the small mass of gas bound to the non-deoxy species is lost. This is a known limitation that does not affect the resultant steady-state gas distribution.

◆ CalculateHemoglobinSaturations()

void SaturationCalculator::CalculateHemoglobinSaturations ( double  O2PartialPressureGuess_mmHg,
double  CO2PartialPressureGuess_mmHg,
double  pH,
double  temperature_C,
double  hematocrit,
double &  OxygenSaturation,
double &  CarbonDioxideSaturation,
double  CO2_scaling_factor 
)
protected

Computes the percent saturation of hemoglobin of oxygen and carbon dioxide.

This code is adapted directly from the model described in [44].

◆ DistributeHemoglobinBySaturation()

bool SaturationCalculator::DistributeHemoglobinBySaturation ( )
protected

Distributes hemoglobin species for a given pair of oxygen and carbon dioxide saturation fractions.

Because oxycarbaminohemoglobin includes both oxygen and carbon dioxide, the species distribution of hemoglobins at a given fraction of O2 and CO2 saturation is an under-constrained problem. The method first attempts an assumed solution. If the assumed solution requires more hemoglobin than is available, the method steps towards a solution that minimizes total hemoglobin use.

◆ Initialize()

void SaturationCalculator::Initialize ( SESubstanceManager substances)

◆ SetBodyState()

void SaturationCalculator::SetBodyState ( const SEScalarMassPerVolume AlbuminConcentration,
const SEScalar0To1 Hematocrit,
const SEScalarTemperature Temperature,
const SEScalarAmountPerVolume StrongIonDifference,
const SEScalarAmountPerVolume Phosphate 
)

Friends And Related Function Documentation

◆ PulseEngineTest

friend class PulseEngineTest
friend

Member Data Documentation

◆ error_functor

friend SaturationCalculator::error_functor
protected

◆ m_albumin_g_per_L

double SaturationCalculator::m_albumin_g_per_L
protected

◆ m_cmpt

SELiquidCompartment* SaturationCalculator::m_cmpt
protected

◆ m_CO

SESubstance* SaturationCalculator::m_CO
protected

◆ m_CO2

SESubstance* SaturationCalculator::m_CO2
protected

◆ m_CO2_g_Per_mol

double SaturationCalculator::m_CO2_g_Per_mol
protected

◆ m_data

PulseController& SaturationCalculator::m_data
protected

◆ m_Hb

SESubstance* SaturationCalculator::m_Hb
protected

◆ m_Hb_g_Per_mol

double SaturationCalculator::m_Hb_g_Per_mol
protected

◆ m_HbCO

SESubstance* SaturationCalculator::m_HbCO
protected

◆ m_HbCO2

SESubstance* SaturationCalculator::m_HbCO2
protected

◆ m_HbCO2_g_Per_mol

double SaturationCalculator::m_HbCO2_g_Per_mol
protected

◆ m_HbO2

SESubstance* SaturationCalculator::m_HbO2
protected

◆ m_HbO2_g_Per_mol

double SaturationCalculator::m_HbO2_g_Per_mol
protected

◆ m_HbO2CO2

SESubstance* SaturationCalculator::m_HbO2CO2
protected

◆ m_HbO2CO2_g_Per_mol

double SaturationCalculator::m_HbO2CO2_g_Per_mol
protected

◆ m_HCO3

SESubstance* SaturationCalculator::m_HCO3
protected

◆ m_HCO3_g_Per_mol

double SaturationCalculator::m_HCO3_g_Per_mol
protected

◆ m_hematocrit

double SaturationCalculator::m_hematocrit
protected

◆ m_O2

SESubstance* SaturationCalculator::m_O2
protected

◆ m_O2_g_Per_mol

double SaturationCalculator::m_O2_g_Per_mol
protected

◆ m_Phosphate_mmol_Per_L

double SaturationCalculator::m_Phosphate_mmol_Per_L
protected

◆ m_StrongIonDifference_mmol_Per_L

double SaturationCalculator::m_StrongIonDifference_mmol_Per_L
protected

◆ m_subCO2Q

SELiquidSubstanceQuantity* SaturationCalculator::m_subCO2Q
protected

◆ m_subCOQ

SELiquidSubstanceQuantity* SaturationCalculator::m_subCOQ
protected

◆ m_subHbCO2Q

SELiquidSubstanceQuantity* SaturationCalculator::m_subHbCO2Q
protected

◆ m_subHbCOQ

SELiquidSubstanceQuantity* SaturationCalculator::m_subHbCOQ
protected

◆ m_subHbO2CO2Q

SELiquidSubstanceQuantity* SaturationCalculator::m_subHbO2CO2Q
protected

◆ m_subHbO2Q

SELiquidSubstanceQuantity* SaturationCalculator::m_subHbO2Q
protected

◆ m_subHbQ

SELiquidSubstanceQuantity* SaturationCalculator::m_subHbQ
protected

◆ m_subHCO3Q

SELiquidSubstanceQuantity* SaturationCalculator::m_subHCO3Q
protected

◆ m_subO2Q

SELiquidSubstanceQuantity* SaturationCalculator::m_subO2Q
protected

◆ m_temperature_C

double SaturationCalculator::m_temperature_C
protected

◆ PulseController

friend SaturationCalculator::PulseController
protected