Pulse adds COVID-19 Simulation Support
×
Cardiovascular.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/SECardiovascularSystem.h"
7 #include "substance/SESubstanceTransport.h"
8 class SEPatient;
10 class SEGasCompartment;
14 class SEFluidCircuit;
15 class SEFluidCircuitNode;
16 class SEFluidCircuitPath;
18 
32 {
33  friend class PBPulsePhysiology;//friend the serialization class
34  friend class PulseController;
35  friend class PulseEngineTest;
36 protected:
39 
40 public:
41  virtual ~Cardiovascular();
42 
43  void Clear();
44 
45 protected:
46  // Set members to a stable homeostatic state
47  void Initialize();
48  // Set pointers and other member varialbes common to both homeostatic initialization and loading a state
49  void SetUp();
50 
51  void AtSteadyState();
52  void PreProcess();
53  void Process();
54  void PostProcess();
55 
56  //Condition Methods
57  void ChronicRenalStenosis();
58  void ChronicAnemia();
59  void ChronicHeartFailure();
60  void ChronicPericardialEffusion();
61 
62  // PreProcess:
63  void HeartDriver();
64  void AdjustVascularTone();
65  void BeginCardiacCycle();
66  void CalculateHeartElastance();
67  void UpdateHeartRhythm();
68  // IF STABILIZING
69  void TuneCircuit();
70  void TunePaths(double systemicResistanceScale, double systemicComplianceScale, double aortaResistanceScale, double aortaComplianceScale, double rightHeartResistanceScale, double venaCavaComplianceScale);
71  // ELSE
72  void MetabolicToneResponse();
73  void ProcessActions();
74  //Action methods
75  void CPR();
76  /****/void CalculateAndSetCPRcompressionForce();
77  void Hemorrhage();
78  void InternalHemorrhagePressureApplication();
79  void PericardialEffusion();
80  void PericardialEffusionPressureApplication();
81  void CardiacArrest();
82  void TraumaticBrainInjury();
83  //Respiratory effects
84  void CalculatePleuralCavityVenousEffects();
85 
86  // Process:
87  void CalculateVitalSigns();
88  void CalculateHeartRate();
89  void RecordAndResetCardiacCycle();
90 
91  // Serializable member variables (Set in Initialize and in schema)
92  //Driver
95  bool m_EnterCardiacArrest;// Can't go into cardiac arrest during the middle of a cycle
97  double m_CurrentCardiacCycleDuration_s; // How long have we been in this heart beat
98  double m_LeftHeartElastanceModifier;// from Heart Failure and such
105  //CPR
109  //Hemorrhage
110  std::vector<SEFluidCircuitPath*> m_HemorrhagePaths;
111  std::vector<SEFluidCircuitPath*> m_InternalHemorrhagePaths;
112  std::vector<SELiquidCompartmentLink*> m_HemorrhageLinks;
113  std::vector<SELiquidCompartmentLink*> m_InternalHemorrhageLinks;
114  // Vitals and Averages
116  double m_CardiacCycleDiastolicVolume_mL; // Maximum left heart volume for the current cardiac cycle
117  double m_CardiacCycleAortaPressureLow_mmHg; // The current low for this cycle - Reset at the start of systole
118  double m_CardiacCycleAortaPressureHigh_mmHg; // The current high for this cycle - Reset at the start of systole
122  double m_CardiacCycleStrokeVolume_mL; // Total volume of the left heart flow for the current cardiac cycle
131 
132  // Stateless member variable (Set in SetUp())
133  double m_dT_s;
134  bool m_TuneCircuit = true;
135  std::string m_TuningFile;
136 
138 
141 
144 
148 
153 
158 
175 
183 
186 
189 
192 
208 
211 
212  std::vector<SEFluidCircuitPath*> m_systemicResistancePaths;
213  std::vector<SEFluidCircuitPath*> m_systemicCompliancePaths;
214 };
215 
216 
217 
218 
bool m_StartSystole
Definition: Cardiovascular.h:93
SEFluidCircuitPath * m_RightPulmonaryArteriesToVeins
Definition: Cardiovascular.h:156
SELiquidCompartment * m_RightPulmonaryCapillaries
Definition: Cardiovascular.h:204
double m_CompressionTime_s
Definition: Cardiovascular.h:106
std::string m_TuningFile
Definition: Cardiovascular.h:135
SEFluidCircuitPath * m_pMyocardiumToVenaCava
Definition: Cardiovascular.h:169
SERunningAverage * m_CardiacCyclePulmonaryCapillariesFlow_mL_Per_s
Definition: Cardiovascular.h:126
double m_LeftHeartElastanceModifier
Definition: Cardiovascular.h:98
bool m_EnterCardiacArrest
Definition: Cardiovascular.h:95
double m_RightHeartElastanceMin_mmHg_Per_mL
Definition: Cardiovascular.h:104
Definition: SEPatient.h:12
SEFluidCircuitPath * m_pAortaToLargeIntestine
Definition: Cardiovascular.h:165
Definition: SEGasCompartment.h:12
SEFluidCircuitPath * m_pBrainToVenaCava
Definition: Cardiovascular.h:162
SEFluidCircuitPath * m_pAortaToLeftKidney
Definition: Cardiovascular.h:164
SEFluidCircuitPath * m_pAortaToMyocardium
Definition: Cardiovascular.h:168
SERunningAverage * m_CardiacCyclePulmonaryArteryPressure_mmHg
Definition: Cardiovascular.h:128
SEFluidCircuitPath * m_pAortaToBone
Definition: Cardiovascular.h:160
SEFluidCircuitPath * m_pLeftHeart
Definition: Cardiovascular.h:181
SELiquidCompartment * m_Pericardium
Definition: Cardiovascular.h:202
SELiquidCompartmentGraph * m_CirculatoryGraph
Definition: Cardiovascular.h:143
Manages and controls execution of all data/systems in Pulse.
Definition: Controller.h:51
SEFluidCircuitPath * m_pGndToAbdominalCavity
Definition: Cardiovascular.h:190
SEFluidCircuitPath * m_pAortaToLiver
Definition: Cardiovascular.h:163
Definition: SEFluidCircuitPath.h:8
SEGasCompartment * m_leftPleuralCavity
Definition: Cardiovascular.h:209
SELiquidCompartment * m_RightHeart
Definition: Cardiovascular.h:203
SELiquidCompartment * m_Brain
Definition: Cardiovascular.h:196
std::vector< SEFluidCircuitPath * > m_systemicCompliancePaths
Definition: Cardiovascular.h:213
Definition: PulsePhysiologySystems.h:19
SEFluidCircuitPath * m_pMuscleToVenaCava
Definition: Cardiovascular.h:167
std::vector< SEFluidCircuitPath * > m_HemorrhagePaths
Definition: Cardiovascular.h:110
double m_CurrentCardiacCycleDuration_s
Definition: Cardiovascular.h:97
std::vector< SELiquidCompartmentLink * > m_HemorrhageLinks
Definition: Cardiovascular.h:112
double m_dT_s
Definition: Cardiovascular.h:133
SEFluidCircuitNode * m_LeftHeart2
Definition: Cardiovascular.h:146
SELiquidCompartment * m_AbdominalCavity
Definition: Cardiovascular.h:193
SEFluidCircuitPath * m_LeftHeartToAorta
Definition: Cardiovascular.h:182
SELiquidCompartment * m_LeftPulmonaryArteries
Definition: Cardiovascular.h:200
double m_CurrentCardiacCycleTime_s
Definition: Cardiovascular.h:115
virtual void SetUp()=0
Definition: SECardiovascularSystem.h:11
Definition: SERunningAverage.h:7
double m_RightHeartElastance_mmHg_Per_mL
Definition: Cardiovascular.h:102
SELiquidTransporter * m_transporter
Definition: Cardiovascular.h:140
SEFluidCircuitPath * m_pAortaToMuscle
Definition: Cardiovascular.h:166
Definition: SELiquidSubstanceQuantity.h:11
SEFluidCircuitPath * m_pAortaToSpleen
Definition: Cardiovascular.h:174
SEFluidCircuitPath * m_VenaCavaCompliance
Definition: Cardiovascular.h:151
SEFluidCircuitPath * m_pAortaToSmallIntestine
Definition: Cardiovascular.h:172
double m_minIndividialSystemicResistance__mmHg_s_Per_mL
Definition: Cardiovascular.h:137
SEFluidCircuitCalculator * m_circuitCalculator
Definition: Cardiovascular.h:139
The Cardiovascular system utilizes circuit methodology to characterize the intravascular fluid dynami...
Definition: Cardiovascular.h:31
SERunningAverage * m_CardiacCycleArterialPressure_mmHg
Definition: Cardiovascular.h:123
double m_LastCardiacCycleMeanArterialCO2PartialPressure_mmHg
Definition: Cardiovascular.h:121
SEGasCompartment * m_rightPleuralCavity
Definition: Cardiovascular.h:210
SEFluidCircuitPath * m_pAortaToBrain
Definition: Cardiovascular.h:161
SEFluidCircuitPath * m_pPericardiumToGnd
Definition: Cardiovascular.h:177
Generic class for handling the Pulse stabilization methodology.
Definition: System.h:10
virtual void Clear()
Definition: SECardiovascularSystem.cpp:56
SELiquidCompartment * m_LeftPulmonaryCapillaries
Definition: Cardiovascular.h:199
std::vector< SEFluidCircuitPath * > m_systemicResistancePaths
Definition: Cardiovascular.h:212
SELiquidCompartment * m_Aorta
Definition: Cardiovascular.h:194
Definition: PBPulsePhysiology.h:18
Definition: SELiquidCompartment.h:10
SELiquidCompartment * m_Groundcmpt
Definition: Cardiovascular.h:197
double m_CardiacCyclePulmonaryArteryPressureHigh_mmHg
Definition: Cardiovascular.h:120
double m_CompressionRatio
Definition: Cardiovascular.h:107
SEFluidCircuitPath * m_pAortaToRightKidney
Definition: Cardiovascular.h:170
std::vector< SEFluidCircuitPath * > m_InternalHemorrhagePaths
Definition: Cardiovascular.h:111
SEFluidCircuitPath * m_pAbdominalCavityToGnd
Definition: Cardiovascular.h:191
SERunningAverage * m_CardiacCycleSkinFlow_mL_Per_s
Definition: Cardiovascular.h:130
virtual void Initialize()
Default system values to their homeostatic values
Definition: System.h:16
SEFluidCircuitPath * m_pRightHeart
Definition: Cardiovascular.h:179
double m_CardiacCyclePulmonaryArteryPressureLow_mmHg
Definition: Cardiovascular.h:119
double m_LeftHeartElastance_mmHg_Per_mL
Definition: Cardiovascular.h:99
Definition: SEFluidCircuitNode.h:7
Definition: SEFluidCircuit.h:11
SEFluidCircuitPath * m_pBrainResistanceDownstream
Definition: Cardiovascular.h:185
double m_LeftHeartElastanceMin_mmHg_Per_mL
Definition: Cardiovascular.h:101
SEFluidCircuitPath * m_InternalHemorrhageToAorta
Definition: Cardiovascular.h:159
double m_LeftHeartElastanceMax_mmHg_Per_mL
Definition: Cardiovascular.h:100
SERunningAverage * m_CardiacCycleCentralVenousPressure_mmHg
Definition: Cardiovascular.h:129
bool m_HeartFlowDetected
Definition: Cardiovascular.h:94
SERunningAverage * m_CardiacCycleArterialCO2PartialPressure_mmHg
Definition: Cardiovascular.h:124
virtual void AtSteadyState()
Notify systems that steady state has been achieved.
Definition: System.h:20
SEFluidCircuitPath * m_pLeftHeartToGnd
Definition: Cardiovascular.h:180
double m_CardiacCycleAortaPressureHigh_mmHg
Definition: Cardiovascular.h:118
Definition: SESubstanceTransport.h:107
SELiquidCompartment * m_LeftPulmonaryVeins
Definition: Cardiovascular.h:201
SELiquidSubstanceQuantity * m_AortaCO2
Definition: Cardiovascular.h:195
double m_CardiacCyclePeriod_s
Definition: Cardiovascular.h:96
Definition: SELiquidCompartmentGraph.h:11
SEFluidCircuit * m_CirculatoryCircuit
Definition: Cardiovascular.h:142
SELiquidCompartment * m_RightPulmonaryVeins
Definition: Cardiovascular.h:206
virtual void PostProcess()=0
SEFluidCircuitPath * m_LeftPulmonaryArteriesToVeins
Definition: Cardiovascular.h:154
SELiquidCompartment * m_VenaCava
Definition: Cardiovascular.h:207
SERunningAverage * m_CardiacCyclePulmonaryShuntFlow_mL_Per_s
Definition: Cardiovascular.h:127
SEFluidCircuitPath * m_pRightHeartToGnd
Definition: Cardiovascular.h:178
SEFluidCircuitPath * m_pBrainResistanceUpstream
Definition: Cardiovascular.h:184
double m_CardiacCycleStrokeVolume_mL
Definition: Cardiovascular.h:122
SEFluidCircuitPath * m_pAortaToSkin
Definition: Cardiovascular.h:171
double m_CardiacCycleDiastolicVolume_mL
Definition: Cardiovascular.h:116
SERunningAverage * m_CardiacCyclePulmonaryCapillariesWedgePressure_mmHg
Definition: Cardiovascular.h:125
SEFluidCircuitPath * m_rightRenalArteryPath
Definition: Cardiovascular.h:188
Definition: EngineTest.h:28
SEFluidCircuitNode * m_Ground
Definition: Cardiovascular.h:147
double m_CardiacCycleAortaPressureLow_mmHg
Definition: Cardiovascular.h:117
PulseController & m_data
Definition: Cardiovascular.h:38
double m_RightHeartElastanceMax_mmHg_Per_mL
Definition: Cardiovascular.h:103
std::vector< SELiquidCompartmentLink * > m_InternalHemorrhageLinks
Definition: Cardiovascular.h:113
SEFluidCircuitPath * m_LeftPulmonaryArteriesToCapillaries
Definition: Cardiovascular.h:155
SEFluidCircuitPath * m_AortaCompliance
Definition: Cardiovascular.h:149
SEFluidCircuitPath * m_pAortaToSplanchnic
Definition: Cardiovascular.h:173
SELiquidCompartment * m_RightPulmonaryArteries
Definition: Cardiovascular.h:205
virtual void Process()=0
SEFluidCircuitPath * m_RightPulmonaryArteriesToCapillaries
Definition: Cardiovascular.h:157
SEFluidCircuitPath * m_RightHeartResistance
Definition: Cardiovascular.h:152
virtual void PreProcess()=0
Definition: SEFluidCircuitCalculator.h:9
SEFluidCircuitPath * m_AortaResistance
Definition: Cardiovascular.h:150
SEFluidCircuitPath * m_leftRenalArteryPath
Definition: Cardiovascular.h:187
SEFluidCircuitPath * m_pGndToPericardium
Definition: Cardiovascular.h:176
SEFluidCircuitNode * m_MainPulmonaryArteries
Definition: Cardiovascular.h:145
SELiquidCompartment * m_LeftHeart
Definition: Cardiovascular.h:198
double m_CompressionPeriod_s
Definition: Cardiovascular.h:108

Distributed under the Apache License, Version 2.0.

See accompanying NOTICE file for details.