Pulse adds COVID-19 Simulation Support
×
Tissue.h
1 /* Distributed under the Apache License, Version 2.0.
2  See accompanying NOTICE file for details.*/
3 
4 #pragma once
5 #include "PulsePhysiologySystems.h"
6 #include "system/physiology/SETissueSystem.h"
7 class SESubstance;
11 class SEGasCompartment;
14 
22 class PULSE_DECL Tissue : public PulseTissueSystem
23 {
24  friend class PulseData;
25  friend class PBPulsePhysiology;//friend the serialization class
26  friend class PulseEngineTest;
27 protected:
28  Tissue(PulseData& data);
30 
31 public:
32  virtual ~Tissue();
33 
34  void Clear();
35 
36  // Set members to a stable homeostatic state
37  void Initialize();
38  // Set pointers and other member variables common to both homeostatic initialization and loading a state
39  void SetUp();
40 
41  void AtSteadyState();
42  void PreProcess();
43  void Process(bool solve_and_transport=true);
44  void PostProcess(bool solve_and_transport=true);
45 
46 protected:
47  void ComputeExposedModelParameters() override;
48 
49  // Preprocess Methods
50  void ProduceAlbumin(double duration_s);
51 
52  /*Tissue System*/
53  void CalculateMetabolicConsumptionAndProduction(double time);
54  void GlucoseLipidControl(double time);
55 
56  /*Process Methods*/
57  void CalculateDiffusion();
58  void CalculatePulmonaryCapillarySubstanceTransfer();
59  void CalculateVitals();
60 
61  /*Postprocess Methods*/
62 
63  /*Diffusion Utilities*/
64  void DistributeMassbyVolumeWeighted(SELiquidCompartment& cmpt, const SESubstance& sub, double mass, const MassUnit& unit);
65  void DistributeMassbyMassWeighted(SELiquidCompartment& cmpt, const SESubstance& sub, double mass, const MassUnit& unit);
66 
67  double PerfusionLimitedDiffusion(SETissueCompartment& tissue, SELiquidCompartment& vascular, const SESubstance& sub, double partitionCoeff, double timestep_s);
68  void AlveolarPartialPressureGradientDiffusion(SEGasCompartment& pulmonary, SELiquidCompartment& vascular, SESubstance& sub, double DiffusingCapacityO2_mL_Per_s_mmHg, double timestep_s);
69 
70  double MoveMassByInstantDiffusion(SELiquidCompartment& source, SELiquidCompartment& target, const SESubstance& sub, double timestep_s);
71  double MoveMassBySimpleDiffusion(SELiquidCompartment& source, SELiquidCompartment& target, const SESubstance& sub, double permeabilityCofficient_mL_Per_s, double timestep_s);
72  double MoveMassByFacilitatedDiffusion(SELiquidCompartment& source, SELiquidCompartment& target, const SESubstance& sub, double combinedCoefficient_g_Per_s, double timestep_s);
73  double MoveMassByActiveTransport(SELiquidCompartment& source, SELiquidCompartment& target, const SESubstance& sub, double DiffusingCapacityO2_mL_Per_s_mmHg, double timestep_s);
74 
75  // Serializable member variables (Set in Initialize and in schema
82 
83  // Stateless member variable (Set in SetUp())
84  double m_dt_s;
98 
101 
112 
118 
123 
124  std::map<SETissueCompartment*, SELiquidCompartment*> m_TissueToVascular;
125  std::vector<SETissueCompartment*> m_ConsumptionProdutionTissues;
126 };
std::map< SETissueCompartment *, SELiquidCompartment * > m_TissueToVascular
Definition: Tissue.h:124
SELiquidCompartment * m_MuscleVascular
Definition: Tissue.h:116
SEFluidCircuitNode * m_GutT1
Definition: Tissue.h:99
SELiquidCompartment * m_RightPulmonaryCapillaries
Definition: Tissue.h:122
double m_RestingTissueGlucose_g
Definition: Tissue.h:76
double m_RestingPatientMass_kg
Definition: Tissue.h:80
SELiquidSubstanceQuantity * m_FatVascularLipid
Definition: Tissue.h:114
SETissueCompartment * m_LeftLungTissue
Definition: Tissue.h:104
Definition: SEGasCompartment.h:12
SELiquidCompartment * m_FatVascular
Definition: Tissue.h:113
SELiquidCompartment * m_FatIntracellular
Definition: Tissue.h:111
SEGasCompartment * m_LeftAlveoli
Definition: Tissue.h:119
std::vector< SETissueCompartment * > m_ConsumptionProdutionTissues
Definition: Tissue.h:125
SESubstance * m_Insulin
Definition: Tissue.h:97
double m_AlbuminProdutionRate_g_Per_s
Definition: Tissue.h:85
Definition: SEFluidCircuitPath.h:8
double m_RestingBloodInsulin_mg_Per_mL
Definition: Tissue.h:79
Definition: PulsePhysiologySystems.h:246
Definition: Controller.h:64
double m_RestingFluidMass_kg
Definition: Tissue.h:81
SESubstance * m_O2
Definition: Tissue.h:89
virtual void ComputeExposedModelParameters()=0
virtual void SetUp()=0
SELiquidCompartment * m_LiverIntracellular
Definition: Tissue.h:109
Definition: SELiquidSubstanceQuantity.h:11
SEGasCompartment * m_RightAlveoli
Definition: Tissue.h:120
SETissueCompartment * m_FatTissue
Definition: Tissue.h:110
SESubstance * m_CO
Definition: Tissue.h:91
virtual void Process(bool solve_and_transport=true)=0
SETissueCompartment * m_MuscleTissue
Definition: Tissue.h:106
SELiquidSubstanceQuantity * m_LiverAcetoacetate
Definition: Tissue.h:102
SELiquidSubstanceQuantity * m_LiverTissueAlbumin
Definition: Tissue.h:103
Definition: PBPulsePhysiology.h:18
Definition: SELiquidCompartment.h:10
This class encapsulates logic necessary to connect independent systems together.
Definition: Tissue.h:22
virtual void Initialize()
Default system values to their homeostatic values
Definition: System.h:13
Definition: SETissueCompartment.h:8
SELiquidSubstanceQuantity * m_LiverVascularGlucose
Definition: Tissue.h:115
Definition: SEFluidCircuitNode.h:7
SESubstance * m_Creatinine
Definition: Tissue.h:94
SEFluidCircuitPath * m_GutT1ToGutT3
Definition: Tissue.h:100
SETissueCompartment * m_LiverTissue
Definition: Tissue.h:108
SESubstance * m_Tristearin
Definition: Tissue.h:88
SELiquidSubstanceQuantity * m_MuscleVascularGlucose
Definition: Tissue.h:117
SESubstance * m_Sodium
Definition: Tissue.h:95
virtual void PostProcess(bool solve_and_transport=true)=0
SESubstance * m_Lactate
Definition: Tissue.h:92
SELiquidCompartment * m_LeftPulmonaryCapillaries
Definition: Tissue.h:121
double m_RestingBloodGlucose_mg_Per_mL
Definition: Tissue.h:77
SESubstance * m_Glucose
Definition: Tissue.h:87
Definition: EngineTest.h:28
SESubstance * m_CO2
Definition: Tissue.h:90
double m_dt_s
Definition: Tissue.h:84
PulseData & m_data
Definition: Tissue.h:29
SETissueCompartment * m_RightLungTissue
Definition: Tissue.h:105
Definition: SEScalarMass.h:7
double m_RestingBloodLipid_mg_Per_mL
Definition: Tissue.h:78
virtual void PreProcess()=0
SESubstance * m_Calcium
Definition: Tissue.h:96
Definition: SESubstance.h:14
SESubstance * m_Acetoacetate
Definition: Tissue.h:93
SESubstance * m_Albumin
Definition: Tissue.h:86
virtual void Clear()
Definition: SETissueSystem.cpp:25
virtual void AtSteadyState()=0
Notify systems that steady state has been achieved.
SELiquidCompartment * m_MuscleIntracellular
Definition: Tissue.h:107

Distributed under the Apache License, Version 2.0.

See accompanying NOTICE file for details.