Commit 09282e61 authored by Jeff Webb's avatar Jeff Webb
Browse files

Added pleural cavity venous effects.

This is to model the increased venous return resistance with pneumothorax / collapsed lungs.
parent e43d1bec
......@@ -34,6 +34,7 @@
#include "circuit/fluid/SEFluidCircuit.h"
#include "circuit/fluid/SEFluidCircuitCalculator.h"
#include "compartment/fluid/SELiquidCompartmentGraph.h"
#include "compartment/fluid/SEGasCompartment.h"
#include "compartment/substances/SELiquidSubstanceQuantity.h"
#include "properties/SEScalar0To1.h"
#include "properties/SEScalarPressure.h"
......@@ -157,6 +158,9 @@ void Cardiovascular::Clear()
m_VenaCava = nullptr;
m_AbdominalCavity = nullptr;
m_leftPleuralCavity = nullptr;
m_rightPleuralCavity = nullptr;
m_CardiacCycleArterialPressure_mmHg->Clear();
m_CardiacCycleArterialCO2PartialPressure_mmHg->Clear();
m_CardiacCyclePulmonaryCapillariesWedgePressure_mmHg->Clear();
......@@ -283,6 +287,9 @@ void Cardiovascular::SetUp()
m_LeftHeart = m_data.GetCompartments().GetLiquidCompartment(pulse::VascularCompartment::LeftHeart);
m_RightHeart = m_data.GetCompartments().GetLiquidCompartment(pulse::VascularCompartment::RightHeart);
m_AbdominalCavity = m_data.GetCompartments().GetLiquidCompartment(pulse::VascularCompartment::AbdominalCavity);
//Respiratory Compartments
m_leftPleuralCavity = m_data.GetCompartments().GetGasCompartment(pulse::PulmonaryCompartment::LeftPleuralCavity);
m_rightPleuralCavity = m_data.GetCompartments().GetGasCompartment(pulse::PulmonaryCompartment::RightPleuralCavity);
//Nodes
m_MainPulmonaryArteries = m_CirculatoryCircuit->GetNode(pulse::CardiovascularNode::MainPulmonaryArteries);
m_LeftHeart2 = m_CirculatoryCircuit->GetNode(pulse::CardiovascularNode::LeftHeart2);
......@@ -596,6 +603,7 @@ void Cardiovascular::PreProcess()
HeartDriver();
ProcessActions();
UpdateHeartRhythm();
CalculatePleuralCavityVenousEffects();
}
//--------------------------------------------------------------------------------------------------
......@@ -2106,4 +2114,39 @@ void Cardiovascular::UpdateHeartRhythm()
{
SetHeartRhythm(eHeartRhythm::NormalSinus);
}
}
\ No newline at end of file
}
//--------------------------------------------------------------------------------------------------
/// \brief
/// Increased pleural cavity pressures hinders venous return through increased resistance.
///
/// \details
/// When a lung collapses (as with pneumothorax), increased pleural cavity pressure pushes on the
/// mediastinum and great veins. As an effect, the mediastinum is displaced and the great veins
/// become kinked, leading to decreased venous return to the heart. This leads to increasing cardiac
/// and respiratory embarrasment. http://medind.nic.in/jac/t08/i1/jact08i1p42.pdf
//--------------------------------------------------------------------------------------------------
void Cardiovascular::CalculatePleuralCavityVenousEffects()
{
//The left and right pleural pressures are likely to have large differences only due to a pneumothorax
//Pressure difference causes a mediastinum shift
double pleuralCavityPressureDiff_cmH2O = abs(m_leftPleuralCavity->GetPressure(PressureUnit::cmH2O) - m_rightPleuralCavity->GetPressure(PressureUnit::cmH2O));
double maxPressureDiff_cmH2O = 40.0;
double maxResistanceMultiplier = 10.0;
pleuralCavityPressureDiff_cmH2O = min(pleuralCavityPressureDiff_cmH2O, maxPressureDiff_cmH2O);
//Interpolate into a parabola to effect things much more at larger differences
double min = 1.0;
double max = maxResistanceMultiplier;
double a = max - min;
double factor = pleuralCavityPressureDiff_cmH2O / maxPressureDiff_cmH2O;
double resistanceMultiplier = a * factor * factor + min;
double rightHeartResistance_mmHg_s_Per_mL = m_RightHeartResistance->GetNextResistance(FlowResistanceUnit::mmHg_s_Per_mL);
m_RightHeartResistance->GetNextResistance().SetValue(rightHeartResistance_mmHg_s_Per_mL * resistanceMultiplier, FlowResistanceUnit::mmHg_s_Per_mL);
//For tuning
//m_data.GetDataTrack().Probe("pleuralCavityPressureDiff_cmH2O", pleuralCavityPressureDiff_cmH2O);
//m_data.GetDataTrack().Probe("resistanceMultiplier", resistanceMultiplier);
}
......@@ -6,6 +6,7 @@
#include "system/physiology/SECardiovascularSystem.h"
class SEPatient;
class SELiquidCompartment;
class SEGasCompartment;
class SELiquidSubstanceQuantity;
class SELiquidCompartmentGraph;
class SELiquidCompartmentLink;
......@@ -79,6 +80,8 @@ protected:
/**/void PericardialEffusionPressureApplication();
/**/void CardiacArrest();
/**/void TraumaticBrainInjury();
//Respiratory effects
void CalculatePleuralCavityVenousEffects();
// Process:
void CalculateVitalSigns();
......@@ -205,6 +208,9 @@ protected:
SELiquidCompartment* m_RightPulmonaryVeins;
SELiquidCompartment* m_VenaCava;
SEGasCompartment* m_leftPleuralCavity;
SEGasCompartment* m_rightPleuralCavity;
std::vector<SEFluidCircuitPath*> m_systemicResistancePaths;
std::vector<SEFluidCircuitPath*> m_systemicCompliancePaths;
};
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment