Commit 5a408d29 authored by Jeff Webb's avatar Jeff Webb
Browse files

Switched internal hemorrhage to use a pressure source pressing on the back of...

Switched internal hemorrhage to use a pressure source pressing on the back of the aorta compliance, rather than a resistor.
Moved Internal HemorrhagePressureApplication to be called once.
Other formatting cleanup.
parent 78e332ac
......@@ -386,8 +386,8 @@ namespace pulse {
DEFINE_STATIC_STRING_EX(LeftLeg, LeftLegVasculature);
DEFINE_STATIC_STRING_EX(RightArm, RightArmVasculature);
DEFINE_STATIC_STRING_EX(RightLeg, RightLegVasculature);
DEFINE_STATIC_STRING(Abdomen);
DEFINE_STATIC_STRING(AbdominalCavity);
DEFINE_STATIC_STRING(Abdomen);
/**/DEFINE_STATIC_STRING(AbdominalCavity);
DEFINE_STATIC_STRING(Ground);
......
......@@ -360,9 +360,9 @@ DEFINE_STATIC_STRING_EX(GroundToConnection, MechanicalVentilatorGroundToConnecti
DEFINE_STATIC_STRING(Aorta1);
DEFINE_STATIC_STRING(Aorta2);
DEFINE_STATIC_STRING(Aorta3);
//DEFINE_STATIC_STRING(Aorta4);
DEFINE_STATIC_STRING(Aorta4);
DEFINE_STATIC_STRING(AbdominalCavity1);
DEFINE_STATIC_STRING(AbdominalCavity1);
DEFINE_STATIC_STRING(Bone1);
DEFINE_STATIC_STRING(Bone2);
......@@ -448,19 +448,18 @@ DEFINE_STATIC_STRING_EX(GroundToConnection, MechanicalVentilatorGroundToConnecti
DEFINE_STATIC_STRING(LeftPulmonaryVeinsToLeftIntermediatePulmonaryVeins);
DEFINE_STATIC_STRING(LeftPulmonaryVeinsToGround);
DEFINE_STATIC_STRING(LeftIntermediatePulmonaryVeinsToLeftHeart2)
DEFINE_STATIC_STRING(LeftHeart2ToLeftHeart1);
DEFINE_STATIC_STRING(LeftHeart2ToLeftHeart1);
DEFINE_STATIC_STRING(LeftHeart1ToLeftHeart3);
DEFINE_STATIC_STRING(LeftHeart3ToGround);
DEFINE_STATIC_STRING(LeftHeart1ToAorta2);
DEFINE_STATIC_STRING(Aorta2ToAorta3);
DEFINE_STATIC_STRING(Aorta3ToAorta1);
DEFINE_STATIC_STRING(Aorta1ToGround);
DEFINE_STATIC_STRING(Aorta1ToAorta4);
// Abdominal Cavity
DEFINE_STATIC_STRING(InternalHemorrhageToAorta);
//DEFINE_STATIC_STRING(Aorta1ToAorta4);
DEFINE_STATIC_STRING(AbdominalCavity1ToGround);
DEFINE_STATIC_STRING(GroundToAbdominalCavity1);
// Abdominal Cavity
DEFINE_STATIC_STRING(GroundToAorta4);
DEFINE_STATIC_STRING(AbdominalCavity1ToGround);
DEFINE_STATIC_STRING(GroundToAbdominalCavity1);
// Brain
DEFINE_STATIC_STRING(Aorta1ToBrain1);
......
......@@ -1206,6 +1206,7 @@ void PulseController::SetupCardiovascular()
SEFluidCircuitNode& Aorta1 = cCardiovascular.CreateNode(pulse::CardiovascularNode::Aorta1);
SEFluidCircuitNode& Aorta2 = cCardiovascular.CreateNode(pulse::CardiovascularNode::Aorta2);
SEFluidCircuitNode& Aorta3 = cCardiovascular.CreateNode(pulse::CardiovascularNode::Aorta3);
SEFluidCircuitNode& Aorta4 = cCardiovascular.CreateNode(pulse::CardiovascularNode::Aorta4);
Aorta1.GetVolumeBaseline().SetValue(VolumeFractionAorta*bloodVolume_mL, VolumeUnit::mL);
Aorta1.GetPressure().SetValue(VascularPressureTargetAorta, PressureUnit::mmHg);
//SEFluidCircuitNode& Aorta4 = cCardiovascular.CreateNode(pulse::CardiovascularNode::Aorta4);
......@@ -1387,8 +1388,8 @@ void PulseController::SetupCardiovascular()
SEFluidCircuitPath& Aorta2ToAorta3 = cCardiovascular.CreatePath(Aorta2, Aorta3, pulse::CardiovascularPath::Aorta2ToAorta3);
SEFluidCircuitPath& Aorta3ToAorta1 = cCardiovascular.CreatePath(Aorta3, Aorta1, pulse::CardiovascularPath::Aorta3ToAorta1);
Aorta3ToAorta1.GetResistanceBaseline().SetValue(ResistanceAorta, FlowResistanceUnit::mmHg_s_Per_mL);
SEFluidCircuitPath& Aorta1ToGround = cCardiovascular.CreatePath(Aorta1, Ground, pulse::CardiovascularPath::Aorta1ToGround);
Aorta1ToGround.GetComplianceBaseline().SetValue(0.0, FlowComplianceUnit::mL_Per_mmHg);
SEFluidCircuitPath& Aorta1ToAorta4 = cCardiovascular.CreatePath(Aorta1, Aorta4, pulse::CardiovascularPath::Aorta1ToAorta4);
Aorta1ToAorta4.GetComplianceBaseline().SetValue(0.0, FlowComplianceUnit::mL_Per_mmHg);
SEFluidCircuitPath& Aorta1ToBrain1 = cCardiovascular.CreatePath(Aorta1, Brain1, pulse::CardiovascularPath::Aorta1ToBrain1);
Aorta1ToBrain1.GetResistanceBaseline().SetValue(systemicResistanceModifier*ResistanceBrain, FlowResistanceUnit::mmHg_s_Per_mL);
......@@ -1532,9 +1533,8 @@ void PulseController::SetupCardiovascular()
SEFluidCircuitPath& GroundToAbdominalCavity = cCardiovascular.CreatePath(Ground, AbdominalCavity, pulse::CardiovascularPath::GroundToAbdominalCavity1);
GroundToAbdominalCavity.GetFlowSourceBaseline().SetValue(0.0, VolumePerTimeUnit::mL_Per_s);
//SEFluidCircuitPath& Aorta1ToAorta4 = cCardiovascular.CreatePath(Aorta1, Aorta4, pulse::CardiovascularPath::Aorta1ToAorta4);
//SEFluidCircuitPath& InternalHemorrhageToAorta = cCardiovascular.CreatePath(Ground, Spleen, pulse::CardiovascularPath::InternalHemorrhageToAorta);
//InternalHemorrhageToAorta.GetPressureSourceBaseline().SetValue(0.0, PressureUnit::mmHg);
SEFluidCircuitPath& GroundToAorta4 = cCardiovascular.CreatePath(Ground, Aorta4, pulse::CardiovascularPath::GroundToAorta4);
GroundToAorta4.GetPressureSourceBaseline().SetValue(0.0, PressureUnit::mmHg);
SEFluidCircuitPath& VenaCavaToGround = cCardiovascular.CreatePath(VenaCava, Ground, pulse::CardiovascularPath::VenaCavaToGround);
VenaCavaToGround.GetComplianceBaseline().SetValue(0.0, FlowComplianceUnit::mL_Per_mmHg);
......@@ -1582,7 +1582,7 @@ void PulseController::SetupCardiovascular()
double VolumeModifierVenaCava = 0.66932*1.134447;
//And also modify the compliances
Aorta1ToGround.GetComplianceBaseline().SetValue(largeArteriesComplianceModifier*Aorta1ToGround.GetComplianceBaseline(FlowComplianceUnit::mL_Per_mmHg), FlowComplianceUnit::mL_Per_mmHg);
Aorta1ToAorta4.GetComplianceBaseline().SetValue(largeArteriesComplianceModifier*Aorta1ToAorta4.GetComplianceBaseline(FlowComplianceUnit::mL_Per_mmHg), FlowComplianceUnit::mL_Per_mmHg);
//For Internal Hemorrhage
AbdominalCavityToGround.GetComplianceBaseline().SetValue(100.0, FlowComplianceUnit::mL_Per_mmHg);
......@@ -1686,7 +1686,7 @@ void PulseController::SetupCardiovascular()
vAorta.MapNode(Aorta1);
vAorta.MapNode(Aorta2);
vAorta.MapNode(Aorta3);
//vAorta.MapNode(Aorta4);
vAorta.MapNode(Aorta4);
///////////
// Abdominal Cavity //
SELiquidCompartment& vAbdominalCavity = m_Compartments->CreateLiquidCompartment(pulse::VascularCompartment::AbdominalCavity);
......
......@@ -287,7 +287,7 @@ void Cardiovascular::SetUp()
m_RightPulmonaryArteriesToVeins = m_CirculatoryCircuit->GetPath(pulse::CardiovascularPath::RightPulmonaryArteriesToRightPulmonaryVeins);
m_RightPulmonaryArteriesToCapillaries = m_CirculatoryCircuit->GetPath(pulse::CardiovascularPath::RightPulmonaryArteriesToRightPulmonaryCapillaries);
m_InternalHemorrhageToAorta = m_CirculatoryCircuit->GetPath(pulse::CardiovascularPath::Aorta3ToAorta1);
m_InternalHemorrhageToAorta = m_CirculatoryCircuit->GetPath(pulse::CardiovascularPath::GroundToAorta4);
m_pAortaToBone = m_CirculatoryCircuit->GetPath(pulse::CardiovascularPath::Aorta1ToBone1);
m_pAortaToBrain = m_CirculatoryCircuit->GetPath(pulse::CardiovascularPath::Aorta1ToBrain1);
m_pBrainToVenaCava = m_CirculatoryCircuit->GetPath(pulse::CardiovascularPath::Brain1ToBrain2);
......@@ -352,7 +352,7 @@ void Cardiovascular::SetUp()
SEFluidCircuitPath* p = m_CirculatoryCircuit->GetPath(pulse::CardiovascularPath::PortalVeinToLiver1);
if (!Contains(m_systemicResistancePaths, (*p)))
m_systemicResistancePaths.push_back(p);
m_AortaCompliance = m_CirculatoryCircuit->GetPath(pulse::CardiovascularPath::Aorta1ToGround);
m_AortaCompliance = m_CirculatoryCircuit->GetPath(pulse::CardiovascularPath::Aorta1ToAorta4);
m_AortaResistance = m_CirculatoryCircuit->GetPath(pulse::CardiovascularPath::Aorta3ToAorta1);
m_VenaCavaCompliance = m_CirculatoryCircuit->GetPath(pulse::CardiovascularPath::VenaCavaToGround);
m_RightHeartResistance = m_CirculatoryCircuit->GetPath(pulse::CardiovascularPath::VenaCavaToRightHeart2);
......@@ -1024,7 +1024,11 @@ void Cardiovascular::Hemorrhage()
}
}
TotalLossRate_mL_Per_s += rate_mL_Per_s;
if (h->GetType() == eHemorrhage_Type::External)
{
//Only mass is merely transfered if it is an internal bleed
TotalLossRate_mL_Per_s += rate_mL_Per_s;
}
//Get all circuit nodes in this compartment
std::vector<SEFluidCircuitNode*> nodes;
......@@ -1174,9 +1178,6 @@ void Cardiovascular::Hemorrhage()
}
m_pAbdominalCavityToGnd->GetNextCompliance().SetValue(compliance_mL_Per_mmHg, FlowComplianceUnit::mL_Per_mmHg);
InternalHemorrhagePressureApplication();
}
// Remove any invalid hemorrhages
......@@ -1203,6 +1204,9 @@ void Cardiovascular::Hemorrhage()
hIter++;
}
//Effect the Aorta with internal hemorrhages
InternalHemorrhagePressureApplication();
if (TotalLossRate_mL_Per_s == 0)
return;
......@@ -1484,18 +1488,17 @@ void Cardiovascular::PericardialEffusionPressureApplication()
/// The internal pressure application function calculates the pressure applied to the aorta due to blood pooling in the abdominal cavity.
///
/// \details
/// The pressure applied to the aorta is dictated by the pressure in the abdominal cavity. The response is tuned to 40% of this value
/// to achieve the correct physiologic response. (Unvalidated at this time).
/// The pressure applied to the aorta is dictated by the pressure in the abdominal cavity. The response is tuned to 45% of this value
/// to achieve the correct physiologic response.
//--------------------------------------------------------------------------------------------------
void Cardiovascular::InternalHemorrhagePressureApplication()
{
double abdominalCavityPressureChange_mmHg = m_AbdominalCavity->GetPressure(PressureUnit::mmHg);
double abdominalCavityPressure_mmHg = m_AbdominalCavity->GetPressure(PressureUnit::mmHg);
double pressureResponseFraction = 0.45; //Tuning the pressure applied to the aorta
//Set the resistance on the aorta based on the abdominal cavity pressure
double aortaBaselineResistance_mmHg_s_Per_mL = m_InternalHemorrhageToAorta->GetResistanceBaseline().GetValue(FlowResistanceUnit::mmHg_s_Per_mL);
m_InternalHemorrhageToAorta->GetNextResistance().SetValue(pressureResponseFraction*aortaBaselineResistance_mmHg_s_Per_mL*abdominalCavityPressureChange_mmHg, FlowResistanceUnit::mmHg_s_Per_mL);
//Set the pressure on the aorta based on the abdominal cavity pressure
m_InternalHemorrhageToAorta->GetPressureSourceBaseline().SetValue(pressureResponseFraction*abdominalCavityPressure_mmHg, PressureUnit::mmHg);
}
......
......@@ -183,12 +183,13 @@ protected:
SEFluidCircuitPath* m_pBrainResistanceUpstream;
SEFluidCircuitPath* m_pBrainResistanceDownstream;
SEFluidCircuitPath* m_leftRenalArteryPath;
SEFluidCircuitPath* m_rightRenalArteryPath;
SEFluidCircuitPath* m_leftRenalArteryPath;
SEFluidCircuitPath* m_rightRenalArteryPath;
SEFluidCircuitPath* m_pGndToAbdominalCavity;
SEFluidCircuitPath* m_pAbdominalCavityToGnd;
SELiquidCompartment* m_AbdominalCavity;
SELiquidCompartment* m_Aorta;
SELiquidSubstanceQuantity* m_AortaCO2;
SELiquidCompartment* m_Brain;
......@@ -203,7 +204,6 @@ protected:
SELiquidCompartment* m_RightPulmonaryArteries;
SELiquidCompartment* m_RightPulmonaryVeins;
SELiquidCompartment* m_VenaCava;
SELiquidCompartment* m_AbdominalCavity;
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