This class encapsulates logic necessary to connect independent systems together.
More...
|
| Tissue (BioGears &bg) |
|
virtual void | Unload (CDM::BioGearsTissueSystemData &data) const |
|
void | SetUp () override |
| Initializes the tissue specific quantities. More...
|
|
void | ProteinStorageAndRelease () |
| Regulates blood amino acid levels by storing/releasing from muscle tissue. More...
|
|
void | FatStorageAndRelease () |
| Regulates blood triacylglyceride levels by storing/releasing in fat tissue. More...
|
|
void | CalculateDiffusion () |
| Determines the correct type of diffusion for a substance and executes the diffusion. More...
|
|
void | CalculatePulmonaryCapillarySubstanceTransfer () |
| Generic substance alveoli transfer calculations. More...
|
|
void | AlveolarPartialPressureGradientDiffusion (SEGasCompartment &pulmonary, SELiquidCompartment &vascular, SESubstance &sub, double DiffusingCapacityO2_mL_Per_s_mmHg, double timestep_s) |
| Calculates the mass transfer due to a partial pressure gradient. More...
|
|
void | CalculateVitals () |
| Computes and sets patient system level data. More...
|
|
void | CheckGlycogenLevels () |
| Checks glycogen levels and throws events if necessary. More...
|
|
void | ManageSubstancesAndSaturation () |
| Sets body state with regard to some substances and manages blood gas distribution. More...
|
|
void | Dehydrate () |
| Establishes the anemia condition by removing hemoglobin and reducing blood viscosity (simulated by vascular resistance reduction). More...
|
|
void | CalculateMetabolicConsumptionAndProduction (double time) |
| Conversions of nutrients to metabolic energy are calculated for each relevant compartment. More...
|
|
void | SetStarvationState () |
| Sets the status of nutrient stores and blood concentrations to appropriate starved values. More...
|
|
void | CalculateTissueFluidFluxes () |
| Calculates the rate of water flow due to osmotic pressure gradient between the extracellular and intracellular spaces. More...
|
|
void | CalculateOncoticPressure () |
| Calculates and sets oncotic pressure on all plasma to extracellular paths. More...
|
|
void | ProcessOverride () |
| determine override requirements from user defined inputs More...
|
|
void | OverrideControlLoop () |
|
void | Unload (CDM::TissueSystemData &data) const |
|
void | Unload (CDM::SystemData &data) const |
|
virtual void | Debug (const char *msg, const char *origin="") const |
|
virtual void | Debug (const std::string &msg, const std::string &origin=empty) const |
|
virtual void | Debug (std::ostream &msg, const std::string &origin=empty) const |
|
virtual void | Info (const char *msg, const char *origin="") const |
|
virtual void | Info (const std::string &msg, const std::string &origin=empty) const |
|
virtual void | Info (std::ostream &msg, const std::string &origin=empty) const |
|
virtual void | Warning (const char *msg, const char *origin="") const |
|
virtual void | Warning (const std::string &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::ostream &msg, const std::string &origin=empty) const |
|
virtual void | Fatal (const char *msg, const char *origin="") const |
|
virtual void | Fatal (const std::string &msg, const std::string &origin=empty) const |
|
virtual void | Fatal (std::ostream &msg, const std::string &origin=empty) const |
|
virtual void | LoadState () |
|
This class encapsulates logic necessary to connect independent systems together.
Each system calculates the behavior that occurs within its individual physiology function; however, several processes extend between two systems, i.e., alveoli transfer links the Respiratory and Anesthesia Machine Systems. To capture this behavior, the System Interactions methodology was introduced. The primary function of this system is to capture the substance transport that occurs between systems.
Calculates the mass transfer due to a partial pressure gradient.
- Parameters
-
Source | pulmonary compartment for the mass transfer. |
Target | vascular compartment for the mass transfer. |
sub | Substance being transferred. |
DiffusingCapacityO2_mL_Per_s_mmHg | the current diffusion capacity of oxygen for this alveolar exchange region. |
timestep | Time step of the engine. |
Calculates the mass transfer from a pulmonary compartment/fluid to a vascular compartment/fluid based on the partial pressure gradient of the gas in the two compartments/fluids.
We cannot balance gas compartment substance quantities on a per substance basis like we can a liquid When the gas substance volume changes, the compartment volume changes as well, which would then change the volume fraction for ALL the substances in the compartment. So it is up to the end user to call balance on the compartment when they are done updating substances on it. It would be inefficient to balance the compartment in this method, as this diffusion could be in a loop over all active substances, and we would be looping over all substance repeatedly. The alveolar exchange of any gas is computed from diffusion capacities relative to oxygen.
void biogears::Tissue::CalculateDiffusion |
( |
| ) |
|
|
protected |
Determines the correct type of diffusion for a substance and executes the diffusion.
Determines the type of diffusion for each substance and calls the function for that type of diffusion. This is executed for all compartments in the tissue system. Options include, perfusion limited diffusion, permeability limited diffusion (untested), pressure gradient diffusion, and flat rate diffusion. The appropriate diffusion methodology is chosen based on the substance parameters.
void biogears::Tissue::CalculateMetabolicConsumptionAndProduction |
( |
double |
time_s | ) |
|
|
protected |
Conversions of nutrients to metabolic energy are calculated for each relevant compartment.
The desired metabolic rate (including exercise) is used to drive the consumption of nutrients and the production of waste products in the tissues. Each compartment is given a metabolic need based on the amount of blood flow to the compartment, and the substances in the compartment are modified based on stoichiometric relationships. O2 and CO2 are consumed and produced, respectively. This method handles both aerobic and anaerobic metabolism, and it sets the Fatigue event if necessary.
The metabolic fraction for each tissue compartment is computed as the fraction of the total vascular blood flow that is going into the specific vascular compartment that is associated with the tissue compartment.
- Todo:
- Creatinine production rate should be a function of muscle mass.
- Event:
- Patient: Fatigue - Energy stores are sub-maximal, skip if beginning of cardiac cycle.
void biogears::Tissue::CalculatePulmonaryCapillarySubstanceTransfer |
( |
| ) |
|
|
protected |
Generic substance alveoli transfer calculations.
- Parameters
-
vSubstances | Alveoli transfer is completed for each substance in the input vector of substances. |
The mass transferred between the alveoli and the capillaries is calculated for all substances in the input vector. The concentration gradient between the alveoli and the capillaries, the substance-specific alveoli transfer factor, the pulmonary capillary flow, the time step, and the patient-specific alveoli transfer factor are used to calculate the mass transfer. The mass in both the alveoli and the capillaries is then updated. This represents gases moving from the respiratory to the cardiovascular systems and vice versa.
void biogears::Tissue::CalculateTissueFluidFluxes |
( |
| ) |
|
|
protected |
Calculates the rate of water flow due to osmotic pressure gradient between the extracellular and intracellular spaces.
This method was originally designed to handle extra to intra transfer and lymph flow transfer (hence "TissueFluidFluxes"). However the lymph system is currently not being used, so this method only calculates water movement associated with intracellular volume regulation. It takes the extracellular and intracellular concentrations of Na, K, and Cl and calculates the associated osmotic gradient,] which dictates the magnitude and direction of fluid flow. The flow value is set on the tissue extra to intra pathway
: Use derivative of P-V relationship in Himeno2015Mechanisms to update lymph compliance as volume changes
void biogears::Tissue::CalculateVitals |
( |
| ) |
|
|
protected |
Computes and sets patient system level data.
- Parameters
-
All of the extravascular fluid, including extravascular-intracellular and extravascular-extracellular, is computed for total volume accounting.
- Event:
- Patient: Patient is dehydrated when 3% of body mass is lost due to fluid reduction
[390]
: check for patient thirst, when plasma osmolarity increases 3 percent [48]
void biogears::Tissue::SetStarvationState |
( |
| ) |
|
|
protected |
Sets the status of nutrient stores and blood concentrations to appropriate starved values.
Liver glycogen, muscle glycogen, muscle mass, stored fat, and stored protein are set based on a linear relationship with the starvation duration. Blood concentrations of glucose and ketones are set based on second-order fits of literature values. No other substances are directly set by the starvation condition.