Renal.h
1 /* Distributed under the Apache License, Version 2.0.
2  See accompanying NOTICE file for details.*/
3 
4 #pragma once
5 #include "controller/System.h"
6 #include "system/physiology/SERenalSystem.h"
7 class SEPatient;
8 class SESubstance;
9 class SEFluidCircuit;
10 class SEFluidCircuitNode;
11 class SEFluidCircuitPath;
15 class SEUrinalysis;
16 
20 class PULSE_DECL Renal : public SERenalSystem, public PulseRenalSystem, public PulseSystem
21 {
22  friend class PBPulsePhysiology;//friend the serialization class
23  friend class PulseController;
24  friend class PulseEngineTest;
25 protected:
26  Renal(PulseController& data);
28 
29  double m_dt;
30 
31 public:
32  virtual ~Renal();
33 
34  void Clear();
35 
36 protected:
37  // Set members to a stable homeostatic state
38  void Initialize();
39  // Set pointers and other member varialbes common to both homeostatic initialization and loading a state
40  void SetUp();
41 
42  void AtSteadyState();
43  void PreProcess();
44  void Process();
45  void PostProcess();
46 
47  // Assessments
48  bool CalculateUrinalysis(SEUrinalysis& u) const;
49 
51  {
52  public:
57  };
58 
59  // Initialization
60  void CalculateFilterability(SESubstance& sub);
61  //Conditions
62  void ConsumeMeal(double elapsedTime_s);
63 
64  //Preprocess
65  void CalculateUltrafiltrationFeedback();
66  void CalculateColloidOsmoticPressure(SEScalarMassPerVolume& albuminConcentration, SEScalarPressure& osmoticPressure);
67  void CalculateReabsorptionFeedback();
68  void CalculateOsmoreceptorFeedback();
69  void CalculateFluidPermeability();
70  void CalculateTubuloglomerularFeedback();
71  void UpdateBladderVolume();
72  void ProcessActions();
73  void Urinate();
74 
75  //Process
76  void CalculateActiveTransport();
77  void CalculateGlomerularTransport(SESubstance& sub);
78  void CalculateReabsorptionTransport(SESubstance& sub);
79  void CalculateSecretion();
80  void CalculateExcretion(SESubstance& sub);
81  void CalculateAutomaticClearance(SESubstance& sub);
82  void CalculateGluconeogenesis();
83  void CalculateVitalSigns();
84 
85  // Serializable member variables (Set in Initialize and in schema)
87  //Tubuloglomerular Feedback
92  //Events
101 
102  // Stateless member variable (Set in SetUp())
104  //Circuits
106  //Nodes
126  //Paths
149 
150  //Substances
156  //Compartments
173  // Compartment Substance Quantites
175 
180 
185 
192 
195 
196  // Configuration
199  // Ultrafiltration
201  // Tubuloglomerular Feedback
206  // Osmoreceptor Feedback
210  // Secretion
212  // Reabsorption
215 
216  // Utility/ScratchPads
219 };
double m_leftReabsorptionPermeabilityModificationFactor
Definition: Renal.h:207
SEFluidCircuitPath * m_leftReabsorptionResistancePath
Definition: Renal.h:129
SEFluidCircuitNode * m_rightNetTubulesNode
Definition: Renal.h:125
SEFluidCircuitPath * m_rightBowmansOsmoticSourcePath
Definition: Renal.h:137
Definition: SEScalarMass.h:23
SELiquidSubstanceQuantity * m_leftTubulesSodium
Definition: Renal.h:190
SETissueCompartment * m_rightKidneyTissue
Definition: Renal.h:160
SELiquidCompartment * m_venaCava
Definition: Renal.h:158
SELiquidCompartment * m_rightPeritubular
Definition: Renal.h:165
SEFluidCircuitPath * m_urethraPath
Definition: Renal.h:144
SEFluidCircuitPath * m_leftUreterPath
Definition: Renal.h:132
SEFluidCircuitNode * m_rightRenalArteryNode
Definition: Renal.h:116
SEFluidCircuitNode * m_leftBowmansNode
Definition: Renal.h:108
SEFluidCircuitPath * m_leftPeritubularOsmoticSourcePath
Definition: Renal.h:131
SEFluidCircuitNode * m_leftNetPeritubularCapillariesNode
Definition: Renal.h:120
SEFluidCircuitPath * m_leftBowmansOsmoticSourcePath
Definition: Renal.h:128
Definition: SEPatient.h:61
SESubstance * m_urea
Definition: Renal.h:152
SEFluidCircuitPath * m_leftGlomerularFilterResistancePath
Definition: Renal.h:133
SEFluidCircuitNode * m_rightNetPeritubularCapillariesNode
Definition: Renal.h:124
SESubstance * m_lactate
Definition: Renal.h:154
virtual void Clear()
Definition: SERenalSystem.cpp:89
SESubstance * m_sodium
Definition: Renal.h:151
double m_rightReabsorptionPermeabilityModificationFactor
Definition: Renal.h:208
SERunningAverage * m_sodiumExcretionRate_mg_Per_min_runningAvg
Definition: Renal.h:96
SELiquidSubstanceQuantity * m_bladderUrea
Definition: Renal.h:189
SERunningAverage * m_rightSodiumFlow_mg_Per_s_runningAvg
Definition: Renal.h:98
Definition: SEScalarMassPerVolume.h:32
SELiquidCompartment * m_leftBowmans
Definition: Renal.h:167
Manages and controls execution of all data/systems in Pulse.
Definition: Controller.h:50
SEFluidCircuitNode * m_leftNetBowmansCapsulesNode
Definition: Renal.h:119
SELiquidCompartment * m_leftPeritubular
Definition: Renal.h:163
SEFluidCircuitPath * m_rightPeritubularOsmoticSourcePath
Definition: Renal.h:139
double m_rightAfferentResistance_mmHg_s_Per_mL
Definition: Renal.h:89
Definition: SEFluidCircuitPath.h:8
double m_rightReabsorptionPermeabilitySetpoint_mL_Per_s_mmHg_m2
Definition: Renal.h:214
double m_dt
Definition: Renal.h:29
SELiquidSubstanceQuantity * m_bladderGlucose
Definition: Renal.h:186
SEFluidCircuitPath * m_rightReabsorptionResistancePath
Definition: Renal.h:135
Definition: SEScalarPressure.h:23
SEFluidCircuitPath * m_rightAfferentArteriolePath
Definition: Renal.h:142
bool m_Urinating
Definition: Renal.h:86
double m_minRightAfferentResistance_mmHg_s_Per_mL
Definition: Renal.h:205
SEFluidCircuitNode * m_leftNetTubulesNode
Definition: Renal.h:121
SELiquidCompartment * m_rightUreter
Definition: Renal.h:164
SEFluidCircuitNode * m_rightNetGlomerularCapillariesNode
Definition: Renal.h:122
SELiquidSubstanceQuantity * m_leftPeritubularPotassium
Definition: Renal.h:177
Definition: PulsePhysiologySystems.h:75
virtual void SetUp()=0
SELiquidSubstanceQuantity * m_rightPeritubularGlucose
Definition: Renal.h:181
SEFluidCircuitNode * m_leftRenalArteryNode
Definition: Renal.h:111
Definition: SERunningAverage.h:7
SELiquidSubstanceQuantity * m_leftUreterLactate
Definition: Renal.h:179
Definition: SELiquidSubstanceQuantity.h:11
double m_CVOpenResistance_mmHg_s_Per_mL
Definition: Renal.h:200
ActiveTransport m_SubstanceTransport
Definition: Renal.h:218
SELiquidCompartment * m_aorta
Definition: Renal.h:157
Definition: SERenalSystem.h:7
SELiquidSubstanceQuantity * m_rightUreterLactate
Definition: Renal.h:184
SERunningAverage * m_leftRenalArterialPressure_mmHg_runningAvg
Definition: Renal.h:99
SELiquidCompartment * m_rightTubules
Definition: Renal.h:171
SELiquidSubstanceQuantity * m_bladderPotassium
Definition: Renal.h:187
SEFluidCircuitNode * m_leftTubulesNode
Definition: Renal.h:110
SEFluidCircuitPath * m_rightTubulesOsmoticSourcePath
Definition: Renal.h:138
Generic class for handling the Pulse stabilization methodology.
Definition: System.h:10
SELiquidSubstanceQuantity * m_bladderSodium
Definition: Renal.h:188
Definition: PBPulsePhysiology.h:18
Definition: SELiquidCompartment.h:10
double m_defaultOpenResistance_mmHg_s_Per_mL
Definition: Renal.h:197
virtual void Initialize()
Default system values to their homeostatic values
Definition: System.h:16
Definition: SETissueCompartment.h:8
SELiquidCompartment * m_ground
Definition: Renal.h:172
double m_sodiumPlasmaConcentrationSetpoint_mg_Per_mL
Definition: Renal.h:209
SESubstance * m_potassium
Definition: Renal.h:155
Definition: SEFluidCircuitNode.h:7
SERunningAverage * m_leftSodiumFlow_mg_Per_s_runningAvg
Definition: Renal.h:97
Definition: SEFluidCircuit.h:11
double leftLactateExcretedMass_mg
Definition: Renal.h:55
SEScalarMass * m_spCleared
Definition: Renal.h:217
SEFluidCircuitPath * m_leftEfferentArteriolePath
Definition: Renal.h:147
double m_leftSodiumFlowSetPoint_mg_Per_s
Definition: Renal.h:90
double m_leftAfferentResistance_mmHg_s_Per_mL
Definition: Renal.h:88
PulseController & m_data
Definition: Renal.h:27
SEFluidCircuitPath * m_leftGlomerularOsmoticSourcePath
Definition: Renal.h:127
virtual void AtSteadyState()
Notify systems that steady state has been achieved.
Definition: System.h:20
double m_maxLeftAfferentResistance_mmHg_s_Per_mL
Definition: Renal.h:202
Definition: Renal.h:50
SELiquidSubstanceQuantity * m_leftKidneyIntracellularLactate
Definition: Renal.h:193
double m_defaultClosedResistance_mmHg_s_Per_mL
Definition: Renal.h:198
SEFluidCircuitPath * m_rightGlomerularOsmoticSourcePath
Definition: Renal.h:136
double leftGlucoseReabsorptionMass_mg
Definition: Renal.h:53
virtual void PostProcess()=0
SEFluidCircuitPath * m_leftAfferentArteriolePath
Definition: Renal.h:134
SELiquidCompartment * m_rightGlomerular
Definition: Renal.h:168
SEFluidCircuitNode * m_leftPeritubularNode
Definition: Renal.h:109
SELiquidSubstanceQuantity * m_leftUreterPotassium
Definition: Renal.h:178
SEFluidCircuitNode * m_rightNetBowmansCapsulesNode
Definition: Renal.h:123
double m_minLeftAfferentResistance_mmHg_s_Per_mL
Definition: Renal.h:203
SELiquidSubstanceQuantity * m_rightUreterPotassium
Definition: Renal.h:183
SELiquidSubstanceQuantity * m_rightTubulesSodium
Definition: Renal.h:191
SELiquidCompartment * m_leftGlomerular
Definition: Renal.h:166
SERunningAverage * m_sodiumConcentration_mg_Per_mL_runningAvg
Definition: Renal.h:95
double rightGlucoseReabsorptionMass_mg
Definition: Renal.h:54
SELiquidCompartment * m_leftUreter
Definition: Renal.h:162
SEFluidCircuitPath * m_leftTubulesPath
Definition: Renal.h:145
Definition: SEUrinalysis.h:36
double m_baselinePotassiumConcentration_g_Per_dL
Definition: Renal.h:211
SEFluidCircuitNode * m_rightGlomerularNode
Definition: Renal.h:112
SERunningAverage * m_rightRenalArterialPressure_mmHg_runningAvg
Definition: Renal.h:100
SETissueCompartment * m_leftKidneyTissue
Definition: Renal.h:161
double m_rightSodiumFlowSetPoint_mg_Per_s
Definition: Renal.h:91
SELiquidSubstanceQuantity * m_aortaLactate
Definition: Renal.h:174
SERunningAverage * m_urineOsmolarity_mOsm_Per_L_runningAvg
Definition: Renal.h:94
SEFluidCircuitPath * m_leftTubulesOsmoticSourcePath
Definition: Renal.h:130
SELiquidSubstanceQuantity * m_rightPeritubularPotassium
Definition: Renal.h:182
SESubstance * m_glucose
Definition: Renal.h:153
SELiquidCompartment * m_bladder
Definition: Renal.h:159
SEFluidCircuitPath * m_rightEfferentArteriolePath
Definition: Renal.h:148
double m_maxRightAfferentResistance_mmHg_s_Per_mL
Definition: Renal.h:204
SEFluidCircuitNode * m_leftGlomerularNode
Definition: Renal.h:107
SEPatient * m_patient
Definition: Renal.h:103
SEFluidCircuitPath * m_bladderToGroundPressurePath
Definition: Renal.h:143
SEFluidCircuitPath * m_rightUreterPath
Definition: Renal.h:140
SEFluidCircuitNode * m_rightBowmansNode
Definition: Renal.h:113
SEFluidCircuitPath * m_rightTubulesPath
Definition: Renal.h:146
SERunningAverage * m_urineProductionRate_mL_Per_min_runningAvg
Definition: Renal.h:93
Definition: Renal.h:20
virtual void Process()=0
double m_leftReabsorptionPermeabilitySetpoint_mL_Per_s_mmHg_m2
Definition: Renal.h:213
SEFluidCircuit * m_RenalCircuit
Definition: Renal.h:105
SEFluidCircuitNode * m_rightTubulesNode
Definition: Renal.h:115
SELiquidCompartment * m_leftTubules
Definition: Renal.h:170
virtual void PreProcess()=0
SELiquidSubstanceQuantity * m_rightKidneyIntracellularLactate
Definition: Renal.h:194
Definition: SESubstance.h:14
SELiquidCompartment * m_rightBowmans
Definition: Renal.h:169
SEFluidCircuitPath * m_rightGlomerularFilterResistancePath
Definition: Renal.h:141
SEFluidCircuitNode * m_bladderNode
Definition: Renal.h:117
SEFluidCircuitNode * m_rightPeritubularNode
Definition: Renal.h:114
SEFluidCircuitNode * m_leftNetGlomerularCapillariesNode
Definition: Renal.h:118
SELiquidSubstanceQuantity * m_leftPeritubularGlucose
Definition: Renal.h:176
double rightLactateExcretedMass_mg
Definition: Renal.h:56