Pulse adds COVID-19 Simulation Support
×
MechanicalVentilator.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/SERespiratorySystem.h"
7 #include "system/equipment/mechanical_ventilator/SEMechanicalVentilator.h"
9 class SEGasCompartment;
12 class SEFluidCircuitNode;
13 class SEFluidCircuitPath;
14 
20 {
21  friend class PulseData;
22  friend class PBPulseEquipment;//friend the serialization class
23  friend class PulseEngineTest;
24 protected:
27 
28 public:
29  virtual ~MechanicalVentilator();
30 
31  void Clear();
32 
33  // Set members to a stable homeostatic state
34  void Initialize();
35  // Set pointers and other member varialbes common to both homeostatic initialization and loading a state
36  void SetUp();
37 
38  void StateChange();
39 
40  void AtSteadyState() {}
41  void PreProcess();
42  void Process(bool solve_and_transport=true);
43  void PostProcess(bool solve_and_transport=true);
44 
45 protected:
46 
47  void ComputeExposedModelParameters() override;
48 
49  void SetConnection();
50  void SetConnection(eMechanicalVentilator_Connection c);
51  void InvalidateConnection();
52 
53  void CalculateInspiration();
54  void CalculatePause();
55  void CalculateExpiration();
56  void SetVentilatorDriver();
57  void CycleMode();
58  void SetResistances();
59 
60  // Serializable member variables (Set in Initialize and in schema)
65  eBreathState m_CurrentBreathState;
66 
67  // Stateless member variable (Set in SetUp())
68  double m_dt_s;
69 
78 };
PulseData & m_data
Definition: MechanicalVentilator.h:26
double m_dt_s
Definition: MechanicalVentilator.h:68
double m_CurrentInspiratoryVolume_L
Definition: MechanicalVentilator.h:64
double m_DriverPressure_cmH2O
Definition: MechanicalVentilator.h:62
SEFluidCircuitPath * m_YPieceToConnection
Definition: MechanicalVentilator.h:77
Definition: SEGasCompartment.h:12
virtual void Clear()
Definition: SEMechanicalVentilator.cpp:64
Definition: SEFluidCircuitPath.h:8
double m_CurrentPeriodTime_s
Definition: MechanicalVentilator.h:61
Definition: PulsePhysiologySystems.h:351
Definition: Controller.h:64
SEFluidCircuitNode * m_VentilatorNode
Definition: MechanicalVentilator.h:73
virtual void SetUp()=0
virtual void ComputeExposedModelParameters()=0
virtual void Process(bool solve_and_transport=true)=0
SEGasCompartment * m_Ventilator
Definition: MechanicalVentilator.h:71
SEGasCompartment * m_Environment
Definition: MechanicalVentilator.h:70
Definition: SELiquidCompartment.h:10
virtual void StateChange()
Definition: SEMechanicalVentilator.h:44
virtual void Initialize()
Default system values to their homeostatic values
Definition: System.h:13
Definition: SEFluidCircuitNode.h:7
Generic mechanical ventilator for positive pressure ventilation.
Definition: MechanicalVentilator.h:19
double m_DriverFlow_L_Per_s
Definition: MechanicalVentilator.h:63
virtual void PostProcess(bool solve_and_transport=true)=0
SELiquidCompartment * m_VentilatorAerosol
Definition: MechanicalVentilator.h:72
SEFluidCircuitNode * m_AmbientNode
Definition: MechanicalVentilator.h:75
SEFluidCircuitPath * m_EnvironmentToVentilator
Definition: MechanicalVentilator.h:76
eBreathState m_CurrentBreathState
Definition: MechanicalVentilator.h:65
Definition: PBPulseEquipment.h:10
Definition: EngineTest.h:28
virtual void PreProcess()=0
Definition: SEGasSubstanceQuantity.h:9
void AtSteadyState()
Notify systems that steady state has been achieved.
Definition: MechanicalVentilator.h:40
virtual void SetConnection(eMechanicalVentilator_Connection c)
Definition: SEMechanicalVentilator.cpp:285
SEFluidCircuitNode * m_ConnectionNode
Definition: MechanicalVentilator.h:74
Definition: SEEquipmentActionCollection.h:32

Distributed under the Apache License, Version 2.0.

See accompanying NOTICE file for details.