Pulse adds COVID-19 Simulation Support
×

Generic mechanical ventilator for positive pressure ventilation. More...

#include <MechanicalVentilator.h>

Inherits PulseMechanicalVentilator.

Public Member Functions

virtual ~MechanicalVentilator ()
 
void Clear ()
 
void Initialize ()
 Initializes system properties to valid homeostatic values. More...
 
void SetUp ()
 Initializes parameters for the mechanical ventilator class. More...
 
void StateChange ()
 
void AtSteadyState ()
 Notify systems that steady state has been achieved. More...
 
void PreProcess ()
 Mechanical ventilator preprocess function. More...
 
void Process (bool solve_and_transport=true)
 Mechanical ventilator process function. More...
 
void PostProcess (bool solve_and_transport=true)
 Mechanical ventilator postprocess function. More...
 
- Public Member Functions inherited from PulseMechanicalVentilator
 PulseMechanicalVentilator (Logger *logger)
 
virtual ~PulseMechanicalVentilator ()=default
 
virtual const SEScalarGetScalar (const std::string &name) override
 
- Public Member Functions inherited from SEMechanicalVentilator
 SEMechanicalVentilator (Logger *logger)
 
virtual ~SEMechanicalVentilator ()
 
bool SerializeToString (std::string &output, SerializationFormat m) const
 
bool SerializeToFile (const std::string &filename) const
 
bool SerializeFromString (const std::string &src, SerializationFormat m, const SESubstanceManager &subMgr)
 
bool SerializeFromFile (const std::string &filename, const SESubstanceManager &subMgr)
 
virtual eMechanicalVentilator_Connection GetConnection () const
 
virtual bool HasEndotrachealTubeResistance () const
 
virtual SEScalarPressureTimePerVolumeGetEndotrachealTubeResistance ()
 
virtual double GetEndotrachealTubeResistance (const PressureTimePerVolumeUnit &unit) const
 
virtual bool HasPositiveEndExpiredPressure () const
 
virtual SEScalarPressureGetPositiveEndExpiredPressure ()
 
virtual double GetPositiveEndExpiredPressure (const PressureUnit &unit) const
 
virtual bool HasFunctionalResidualCapacity () const
 
virtual SEScalarPressureGetFunctionalResidualCapacity ()
 
virtual double GetFunctionalResidualCapacity (const PressureUnit &unit) const
 
virtual bool HasExpirationCycleFlow () const
 
virtual SEScalarVolumePerTimeGetExpirationCycleFlow ()
 
virtual double GetExpirationCycleFlow (const VolumePerTimeUnit &unit) const
 
virtual bool HasExpirationCyclePressure () const
 
virtual SEScalarPressureGetExpirationCyclePressure ()
 
virtual double GetExpirationCyclePressure (const PressureUnit &unit) const
 
virtual bool HasExpirationCycleVolume () const
 
virtual SEScalarVolumeGetExpirationCycleVolume ()
 
virtual double GetExpirationCycleVolume (const VolumeUnit &unit) const
 
virtual bool HasExpirationCycleTime () const
 
virtual SEScalarTimeGetExpirationCycleTime ()
 
virtual double GetExpirationCycleTime (const TimeUnit &unit) const
 
virtual bool HasExpirationTubeResistance () const
 
virtual SEScalarPressureTimePerVolumeGetExpirationTubeResistance ()
 
virtual double GetExpirationTubeResistance (const PressureTimePerVolumeUnit &unit) const
 
virtual bool HasExpirationValveResistance () const
 
virtual SEScalarPressureTimePerVolumeGetExpirationValveResistance ()
 
virtual double GetExpirationValveResistance (const PressureTimePerVolumeUnit &unit) const
 
virtual eMechanicalVentilator_DriverWaveform GetExpirationWaveform () const
 
virtual void SetExpirationWaveform (eMechanicalVentilator_DriverWaveform w)
 
virtual bool HasInspirationLimitFlow () const
 
virtual SEScalarVolumePerTimeGetInspirationLimitFlow ()
 
virtual double GetInspirationLimitFlow (const VolumePerTimeUnit &unit) const
 
virtual bool HasInspirationLimitPressure () const
 
virtual SEScalarPressureGetInspirationLimitPressure ()
 
virtual double GetInspirationLimitPressure (const PressureUnit &unit) const
 
virtual bool HasInspirationLimitVolume () const
 
virtual SEScalarVolumeGetInspirationLimitVolume ()
 
virtual double GetInspirationLimitVolume (const VolumeUnit &unit) const
 
virtual bool HasInspirationPauseTime () const
 
virtual SEScalarTimeGetInspirationPauseTime ()
 
virtual double GetInspirationPauseTime (const TimeUnit &unit) const
 
virtual bool HasPeakInspiratoryPressure () const
 
virtual SEScalarPressureGetPeakInspiratoryPressure ()
 
virtual double GetPeakInspiratoryPressure (const PressureUnit &unit) const
 
virtual bool HasInspirationTargetFlow () const
 
virtual SEScalarVolumePerTimeGetInspirationTargetFlow ()
 
virtual double GetInspirationTargetFlow (const VolumePerTimeUnit &unit) const
 
virtual bool HasInspirationMachineTriggerTime () const
 
virtual SEScalarTimeGetInspirationMachineTriggerTime ()
 
virtual double GetInspirationMachineTriggerTime (const TimeUnit &unit) const
 
virtual bool HasInspirationPatientTriggerFlow () const
 
virtual SEScalarVolumePerTimeGetInspirationPatientTriggerFlow ()
 
virtual double GetInspirationPatientTriggerFlow (const VolumePerTimeUnit &unit) const
 
virtual bool HasInspirationPatientTriggerPressure () const
 
virtual SEScalarPressureGetInspirationPatientTriggerPressure ()
 
virtual double GetInspirationPatientTriggerPressure (const PressureUnit &unit) const
 
virtual bool HasInspirationTubeResistance () const
 
virtual SEScalarPressureTimePerVolumeGetInspirationTubeResistance ()
 
virtual double GetInspirationTubeResistance (const PressureTimePerVolumeUnit &unit) const
 
virtual bool HasInspirationValveResistance () const
 
virtual SEScalarPressureTimePerVolumeGetInspirationValveResistance ()
 
virtual double GetInspirationValveResistance (const PressureTimePerVolumeUnit &unit) const
 
virtual eMechanicalVentilator_DriverWaveform GetInspirationWaveform () const
 
virtual void SetInspirationWaveform (eMechanicalVentilator_DriverWaveform w)
 
bool HasFractionInspiredGas () const
 
bool HasFractionInspiredGas (const SESubstance &substance) const
 
const std::vector< SESubstanceFraction * > & GetFractionInspiredGases ()
 
const std::vector< const SESubstanceFraction * > & GetFractionInspiredGases () const
 
SESubstanceFractionGetFractionInspiredGas (const SESubstance &substance)
 
const SESubstanceFractionGetFractionInspiredGas (const SESubstance &substance) const
 
void RemoveFractionInspiredGas (const SESubstance &substance)
 
void RemoveFractionInspiredGases ()
 
bool HasConcentrationInspiredAerosol () const
 
bool HasConcentrationInspiredAerosol (const SESubstance &substance) const
 
const std::vector< SESubstanceConcentration * > & GetConcentrationInspiredAerosols ()
 
const std::vector< const SESubstanceConcentration * > & GetConcentrationInspiredAerosols () const
 
SESubstanceConcentrationGetConcentrationInspiredAerosol (const SESubstance &substance)
 
const SESubstanceConcentrationGetConcentrationInspiredAerosol (const SESubstance &substance) const
 
void RemoveConcentrationInspiredAerosol (const SESubstance &substance)
 
void RemoveConcentrationInspiredAerosols ()
 
- Public Member Functions inherited from SEEquipment
 SEEquipment (Logger *logger)
 
virtual ~SEEquipment ()
 
- Public Member Functions inherited from SESystem
 SESystem (Logger *logger)
 
virtual ~SESystem ()
 
- Public Member Functions inherited from Loggable
 Loggable (Logger *logger=nullptr)
 
 Loggable (std::string const &logfile)
 
virtual ~Loggable ()
 
virtual LoggerGetLogger () const
 
virtual void SetLogger (Logger &logger)
 
virtual void Debug (std::string const &msg, std::string const &origin=empty) const
 
virtual void Debug (std::stringstream &msg, std::string const &origin=empty) const
 
virtual void Debug (std::ostream &msg, std::string const &origin=empty) const
 
virtual void Info (std::string const &msg, std::string const &origin=empty) const
 
virtual void Info (std::stringstream &msg, std::string const &origin=empty) const
 
virtual void Info (const std::stringstream &msg, std::string const &origin=empty) const
 
virtual void Info (std::ostream &msg, std::string const &origin=empty) const
 
virtual void Warning (std::string const &msg, std::string const &origin=empty) const
 
virtual void Warning (std::stringstream &msg, std::string const &origin=empty) const
 
virtual void Warning (std::ostream &msg, std::string const &origin=empty) const
 
virtual void Error (std::string const &msg, std::string const &origin=empty) const
 
virtual void Error (std::stringstream &msg, std::string const &origin=empty) const
 
virtual void Error (std::ostream &msg, std::string const &origin=empty) const
 
virtual void Fatal (std::string const &msg, std::string const &origin=empty) const
 
virtual void Fatal (std::stringstream &msg, std::string const &origin=empty) const
 
virtual void Fatal (std::ostream &msg, std::string const &origin=empty) const
 
std::string to_string (int i)
 
std::string to_string (unsigned int i)
 
std::string to_string (size_t t)
 
std::string to_string (float f)
 
std::string to_string (double d)
 

Protected Member Functions

 MechanicalVentilator (PulseData &pc)
 
void ComputeExposedModelParameters () override
 
void SetConnection ()
 Initializes gas volumes and volume fractions supplied by the mechanical ventilator depending on the airway mode. More...
 
void SetConnection (eMechanicalVentilator_Connection c)
 Connect to the patient via the ventilator mask, an endotracheal tube, or no connection. More...
 
void InvalidateConnection ()
 Removes the connection to the patient. More...
 
void CalculateInspiration ()
 Determine the instantaneous driver pressure during inspiration. More...
 
void CalculatePause ()
 Determine the instantaneous driver pressure during pause. More...
 
void CalculateExpiration ()
 Determine the instantaneous driver pressure during expiration. More...
 
void SetVentilatorDriver ()
 Set the instantaneous driver pressure or flow on the circuit source. More...
 
void CycleMode ()
 Go to next breath mode based on current mode. More...
 
void SetResistances ()
 Set ventilator circuit resistances. More...
 
- Protected Member Functions inherited from SEMechanicalVentilator
virtual void Merge (const SEMechanicalVentilator &from, SESubstanceManager &subMgr)
 
virtual void ProcessConfiguration (SEMechanicalVentilatorConfiguration &config, SESubstanceManager &subMgr)
 

Protected Attributes

PulseDatam_data
 
double m_CurrentPeriodTime_s
 
double m_DriverPressure_cmH2O
 
double m_DriverFlow_L_Per_s
 
double m_CurrentInspiratoryVolume_L
 
eBreathState m_CurrentBreathState
 
double m_dt_s
 
SEGasCompartmentm_Environment
 
SEGasCompartmentm_Ventilator
 
SELiquidCompartmentm_VentilatorAerosol
 
SEFluidCircuitNodem_VentilatorNode
 
SEFluidCircuitNodem_ConnectionNode
 
SEFluidCircuitNodem_AmbientNode
 
SEFluidCircuitPathm_EnvironmentToVentilator
 
SEFluidCircuitPathm_YPieceToConnection
 
- Protected Attributes inherited from SEMechanicalVentilator
friend SEMechanicalVentilatorConfiguration
 
eMechanicalVentilator_Connection m_Connection
 
SEScalarPressureTimePerVolumem_EndotrachealTubeResistance
 
SEScalarPressurem_PositiveEndExpiredPressure
 
SEScalarPressurem_FunctionalResidualCapacity
 
SEScalarVolumePerTimem_ExpirationCycleFlow
 
SEScalarPressurem_ExpirationCyclePressure
 
SEScalarVolumem_ExpirationCycleVolume
 
SEScalarTimem_ExpirationCycleTime
 
SEScalarPressureTimePerVolumem_ExpirationTubeResistance
 
SEScalarPressureTimePerVolumem_ExpirationValveResistance
 
eMechanicalVentilator_DriverWaveform m_ExpirationWaveform
 
SEScalarVolumePerTimem_InspirationLimitFlow
 
SEScalarPressurem_InspirationLimitPressure
 
SEScalarVolumem_InspirationLimitVolume
 
SEScalarTimem_InspirationPauseTime
 
SEScalarPressurem_PeakInspiratoryPressure
 
SEScalarVolumePerTimem_InspirationTargetFlow
 
SEScalarTimem_InspirationMachineTriggerTime
 
SEScalarVolumePerTimem_InspirationPatientTriggerFlow
 
SEScalarPressurem_InspirationPatientTriggerPressure
 
SEScalarPressureTimePerVolumem_InspirationTubeResistance
 
SEScalarPressureTimePerVolumem_InspirationValveResistance
 
eMechanicalVentilator_DriverWaveform m_InspirationWaveform
 
std::vector< SESubstanceFraction * > m_FractionInspiredGases
 
std::vector< const SESubstanceFraction * > m_cFractionInspiredGases
 
std::vector< SESubstanceConcentration * > m_ConcentrationInspiredAerosols
 
std::vector< const SESubstanceConcentration * > m_cConcentrationInspiredAerosols
 
- Protected Attributes inherited from SESystem
std::stringstream m_ss
 
- Protected Attributes inherited from Loggable
bool myLogger
 
Loggerm_Logger
 

Friends

class PulseData
 
class PBPulseEquipment
 
class PulseEngineTest
 

Additional Inherited Members

- Static Public Member Functions inherited from SESystem
static const SEScalarGetScalar (const std::string &name, std::vector< SESystem *> *systems)
 
- Static Public Attributes inherited from Loggable
static const std::string empty
 

Detailed Description

Generic mechanical ventilator for positive pressure ventilation.

Constructor & Destructor Documentation

◆ MechanicalVentilator()

MechanicalVentilator::MechanicalVentilator ( PulseData pc)
protected

◆ ~MechanicalVentilator()

MechanicalVentilator::~MechanicalVentilator ( )
virtual

Member Function Documentation

◆ AtSteadyState()

void MechanicalVentilator::AtSteadyState ( )
inlinevirtual

Notify systems that steady state has been achieved.

Implements PulseSystem.

◆ CalculateExpiration()

void MechanicalVentilator::CalculateExpiration ( )
protected

Determine the instantaneous driver pressure during expiration.

Error:
Fatal: Inspiration flow trigger is not yet supported.
Error:
Fatal: No inspiration trigger defined.
Error:
Fatal: Functional residual capacity expiratory baseline not yet supported.
Error:
Fatal: Non-square waveforms are not yet supported.

◆ CalculateInspiration()

void MechanicalVentilator::CalculateInspiration ( )
protected

Determine the instantaneous driver pressure during inspiration.

Error:
Fatal: Expiration pressure cycle is not yet supported.
Error:
Fatal: Expiration flow cycle is not yet supported.
Error:
Fatal: No expiration cycle defined.
Error:
Fatal: Limits are not yet supported.
Error:
Fatal: Inspiration mode not yet supported.
Error:
Fatal: Non-square waveforms are not yet supported.

◆ CalculatePause()

void MechanicalVentilator::CalculatePause ( )
protected

Determine the instantaneous driver pressure during pause.

◆ Clear()

void MechanicalVentilator::Clear ( )
virtual

Reimplemented from SEMechanicalVentilator.

◆ ComputeExposedModelParameters()

void MechanicalVentilator::ComputeExposedModelParameters ( )
overrideprotectedvirtual

◆ CycleMode()

void MechanicalVentilator::CycleMode ( )
protected

Go to next breath mode based on current mode.

Inhale to pause, pause to exhale, or exhale to inhale.

◆ Initialize()

void MechanicalVentilator::Initialize ( )
virtual

Initializes system properties to valid homeostatic values.

Reimplemented from PulseSystem.

◆ InvalidateConnection()

void MechanicalVentilator::InvalidateConnection ( )
protected

Removes the connection to the patient.

If the mask is on or the tube is connected, it is removed and the airway mode is set to free. The action is then removed from the action manager.

◆ PostProcess()

void MechanicalVentilator::PostProcess ( bool  solve_and_transport = true)
virtual

Mechanical ventilator postprocess function.

The substance volumes and the volume fractions are updated for all of the nodes in the mechanical ventilator circuit during post process. The ventilator volumes are updated based on the previously calculated nodal analysis.

Implements PulseSystem.

◆ PreProcess()

void MechanicalVentilator::PreProcess ( )
virtual

Mechanical ventilator preprocess function.

Applies all the settings and calculates the instantaneous driver value.

Implements PulseSystem.

◆ Process()

void MechanicalVentilator::Process ( bool  solve_and_transport = true)
virtual

Mechanical ventilator process function.

The current Pulse implementation has no specific process functionality for the mechanical ventilator. Mechanical ventilator processing is currently done in the Respiratory System with the combined circuit methodology.

Implements PulseSystem.

◆ SetConnection() [1/2]

void MechanicalVentilator::SetConnection ( )
protected

Initializes gas volumes and volume fractions supplied by the mechanical ventilator depending on the airway mode.

The gas volumes and volume fractions are initialized and updated based on the airway mode (mask, free, or tube) and the volume associated with each airway mode.

◆ SetConnection() [2/2]

void MechanicalVentilator::SetConnection ( eMechanicalVentilator_Connection  c)
protectedvirtual

Connect to the patient via the ventilator mask, an endotracheal tube, or no connection.

Parameters
enumMechanicalVentilatorConnectionConnectoin type : Mask, tube, or off

If the enum is set to mask, then the mask is applied to the face If the enum is set to tube, then the ventilator is connected to the tube If the enum is set to off, the airway mode is set to free.

Reimplemented from SEMechanicalVentilator.

◆ SetResistances()

void MechanicalVentilator::SetResistances ( )
protected

Set ventilator circuit resistances.

If no values are specified, defaults will be used.

Todo:
Figure out how to do this without having to access the respiratory circuit

◆ SetUp()

void MechanicalVentilator::SetUp ( )
virtual

Initializes parameters for the mechanical ventilator class.

Initializes member variables and system level values on the common data model.

Implements PulseSystem.

◆ SetVentilatorDriver()

void MechanicalVentilator::SetVentilatorDriver ( )
protected

Set the instantaneous driver pressure or flow on the circuit source.

Error:
Error: Ventilator driver pressure and flow both set, only one allowed. Using the pressure value.
Error:
Error: Ventilator driver pressure or flow must be set. Using a pressure of 0.

◆ StateChange()

void MechanicalVentilator::StateChange ( )
virtual
Error:
Error: FiO2 setting + ambient fractions other than N2 is greater than 1.0. Setting FiO2 to max value

Reimplemented from SEMechanicalVentilator.

Friends And Related Function Documentation

◆ PBPulseEquipment

friend class PBPulseEquipment
friend

◆ PulseData

friend class PulseData
friend

◆ PulseEngineTest

friend class PulseEngineTest
friend

Member Data Documentation

◆ m_AmbientNode

SEFluidCircuitNode* MechanicalVentilator::m_AmbientNode
protected

◆ m_ConnectionNode

SEFluidCircuitNode* MechanicalVentilator::m_ConnectionNode
protected

◆ m_CurrentBreathState

eBreathState MechanicalVentilator::m_CurrentBreathState
protected

◆ m_CurrentInspiratoryVolume_L

double MechanicalVentilator::m_CurrentInspiratoryVolume_L
protected

◆ m_CurrentPeriodTime_s

double MechanicalVentilator::m_CurrentPeriodTime_s
protected

◆ m_data

PulseData& MechanicalVentilator::m_data
protected

◆ m_DriverFlow_L_Per_s

double MechanicalVentilator::m_DriverFlow_L_Per_s
protected

◆ m_DriverPressure_cmH2O

double MechanicalVentilator::m_DriverPressure_cmH2O
protected

◆ m_dt_s

double MechanicalVentilator::m_dt_s
protected

◆ m_Environment

SEGasCompartment* MechanicalVentilator::m_Environment
protected

◆ m_EnvironmentToVentilator

SEFluidCircuitPath* MechanicalVentilator::m_EnvironmentToVentilator
protected

◆ m_Ventilator

SEGasCompartment* MechanicalVentilator::m_Ventilator
protected

◆ m_VentilatorAerosol

SELiquidCompartment* MechanicalVentilator::m_VentilatorAerosol
protected

◆ m_VentilatorNode

SEFluidCircuitNode* MechanicalVentilator::m_VentilatorNode
protected

◆ m_YPieceToConnection

SEFluidCircuitPath* MechanicalVentilator::m_YPieceToConnection
protected

Distributed under the Apache License, Version 2.0.

See accompanying NOTICE file for details.