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

#include <Saturation.h>

Inheritance diagram for biogears::SaturationCalculator:

Public Member Functions

virtual ~SaturationCalculator ()
 
void Initialize (SESubstanceManager &substances)
 
void SetBodyState (const SEScalarMassPerVolume &AlbuminConcentration, const SEScalarFraction &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 biogears::Loggable
 Loggable ()
 
 Loggable (Logger *log)
 
virtual ~Loggable ()
 
virtual LoggerGetLogger () const
 

Protected Member Functions

 SaturationCalculator (BioGears &bg)
 
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 by oxygen and carbon dioxide. More...
 
bool DistributeHemoglobinBySaturation ()
 Distributes hemoglobin species for a given pair of oxygen and carbon dioxide saturation fractions. More...
 
- Protected Member Functions inherited from biogears::Loggable
virtual void Debug (const std::string &msg, const std::string &origin=empty) const
 
virtual void Debug (std::stringstream &msg, const std::string &origin=empty) const
 
virtual void Debug (std::ostream &msg, const std::string &origin=empty) const
 
virtual void Info (const std::string &msg, const std::string &origin=empty) const
 
virtual void Info (std::stringstream &msg, const std::string &origin=empty) const
 
virtual void Info (const std::stringstream &msg, const std::string &origin=empty) const
 
virtual void Info (std::ostream &msg, const std::string &origin=empty) const
 
virtual void Warning (const std::string &msg, const std::string &origin=empty) const
 
virtual void Warning (std::stringstream &msg, const std::string &origin=empty) const
 
virtual void Warning (std::ostream &msg, const std::string &origin=empty) const
 
virtual void Error (const char *msg, const char *origin="") const
 
virtual void Error (const std::string msg, const std::string origin=empty) const
 
virtual void Error (std::stringstream &msg, const std::string &origin=empty) const
 
virtual void Error (std::ostream &msg, const std::string &origin=empty) const
 
virtual void Fatal (const std::string &msg, const std::string &origin=empty) const
 
virtual void Fatal (std::stringstream &msg, const std::string &origin=empty) const
 
virtual void Fatal (std::ostream &msg, const std::string &origin=empty) const
 

Protected Attributes

BioGearsm_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 biogears::Loggable
Loggerm_Logger
 

Friends

struct error_functor
 
class BioGears
 
class BioGearsEngineTest
 

Additional Inherited Members

- Static Public Attributes inherited from biogears::Loggable
static const std::string empty
 
static const char * empty_cStr
 

Detailed Description

The SaturationCalculator class holds the blood gas distribution model.

Constructor & Destructor Documentation

biogears::SaturationCalculator::SaturationCalculator ( BioGears bg)
protected
biogears::SaturationCalculator::~SaturationCalculator ( )
virtual

Member Function Documentation

void biogears::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.

void biogears::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 [35] 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.

void biogears::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 by oxygen and carbon dioxide.

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

bool biogears::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.

void biogears::SaturationCalculator::Initialize ( SESubstanceManager substances)
void biogears::SaturationCalculator::SetBodyState ( const SEScalarMassPerVolume AlbuminConcentration,
const SEScalarFraction Hematocrit,
const SEScalarTemperature Temperature,
const SEScalarAmountPerVolume StrongIonDifference,
const SEScalarAmountPerVolume Phosphate 
)

Friends And Related Function Documentation

friend class BioGears
friend
friend class BioGearsEngineTest
friend
friend struct error_functor
friend

Member Data Documentation

double biogears::SaturationCalculator::m_albumin_g_per_L
protected
SELiquidCompartment* biogears::SaturationCalculator::m_cmpt
protected
SESubstance* biogears::SaturationCalculator::m_CO
protected
SESubstance* biogears::SaturationCalculator::m_CO2
protected
double biogears::SaturationCalculator::m_CO2_g_Per_mol
protected
BioGears& biogears::SaturationCalculator::m_data
protected
SESubstance* biogears::SaturationCalculator::m_Hb
protected
double biogears::SaturationCalculator::m_Hb_g_Per_mol
protected
SESubstance* biogears::SaturationCalculator::m_HbCO
protected
SESubstance* biogears::SaturationCalculator::m_HbCO2
protected
double biogears::SaturationCalculator::m_HbCO2_g_Per_mol
protected
SESubstance* biogears::SaturationCalculator::m_HbO2
protected
double biogears::SaturationCalculator::m_HbO2_g_Per_mol
protected
SESubstance* biogears::SaturationCalculator::m_HbO2CO2
protected
double biogears::SaturationCalculator::m_HbO2CO2_g_Per_mol
protected
SESubstance* biogears::SaturationCalculator::m_HCO3
protected
double biogears::SaturationCalculator::m_HCO3_g_Per_mol
protected
double biogears::SaturationCalculator::m_hematocrit
protected
SESubstance* biogears::SaturationCalculator::m_O2
protected
double biogears::SaturationCalculator::m_O2_g_Per_mol
protected
double biogears::SaturationCalculator::m_Phosphate_mmol_Per_L
protected
double biogears::SaturationCalculator::m_StrongIonDifference_mmol_Per_L
protected
SELiquidSubstanceQuantity* biogears::SaturationCalculator::m_subCO2Q
protected
SELiquidSubstanceQuantity* biogears::SaturationCalculator::m_subCOQ
protected
SELiquidSubstanceQuantity* biogears::SaturationCalculator::m_subHbCO2Q
protected
SELiquidSubstanceQuantity* biogears::SaturationCalculator::m_subHbCOQ
protected
SELiquidSubstanceQuantity* biogears::SaturationCalculator::m_subHbO2CO2Q
protected
SELiquidSubstanceQuantity* biogears::SaturationCalculator::m_subHbO2Q
protected
SELiquidSubstanceQuantity* biogears::SaturationCalculator::m_subHbQ
protected
SELiquidSubstanceQuantity* biogears::SaturationCalculator::m_subHCO3Q
protected
SELiquidSubstanceQuantity* biogears::SaturationCalculator::m_subO2Q
protected
double biogears::SaturationCalculator::m_temperature_C
protected