Commit a04c305b authored by Rachel Clipp's avatar Rachel Clipp
Browse files

Changed the calculation for the max resistance for hemorrhage to scale with the compartment choice.

parent 1efd3d13
......@@ -983,10 +983,7 @@ void Cardiovascular::TraumaticBrainInjury()
/// with the new value. Compartments can overlap.
//--------------------------------------------------------------------------------------------------
void Cardiovascular::Hemorrhage()
{
//Maximum resistance for hemorrhage paths to eliminate flow
double maxResistanceForNoFlow__mmHg_min_Per_L = 750.0;
{
/// \todo Enforce limits and remove fatal errors.
//Check all existing hemorrhage paths, if has a flow source or a resistance (covers both types of hemorrhage), then set to zero
......@@ -1281,12 +1278,12 @@ void Cardiovascular::Hemorrhage()
//The minimum resistance is associated with the maximum flow rate across the hemorrhage path
//Check to see if there is a resistance baseline
double deltaPressure_mmHg = (node->GetNextPressure().GetValue(PressureUnit::mmHg) - hemorrhagePath->GetTargetNode().GetNextPressure().GetValue(PressureUnit::mmHg));
double resistanceBaseline_mmHg_min_Per_L = deltaPressure_mmHg / (0.98 * flowRate_L_per_min);
double resistanceBaseline_mmHg_min_Per_L = deltaPressure_mmHg / (2.75 * flowRate_L_per_min);
hemorrhagePath->GetResistanceBaseline().SetValue(resistanceBaseline_mmHg_min_Per_L, PressureTimePerVolumeUnit::mmHg_min_Per_L);
}
double resistanceBaseline_mmHg_min_Per_L = hemorrhagePath->GetResistanceBaseline().GetValue(PressureTimePerVolumeUnit::mmHg_min_Per_L);
//use the severity to calculate the resistance
double resistance_mmHg_min_Per_L = GeneralMath::LinearInterpolator(0.0, 1.0, maxResistanceForNoFlow__mmHg_min_Per_L / h->GetSeverity().GetValue(), resistanceBaseline_mmHg_min_Per_L, h->GetSeverity().GetValue());
double resistance_mmHg_min_Per_L = GeneralMath::LinearInterpolator(0.0, 1.0, (2 * resistanceBaseline_mmHg_min_Per_L) / h->GetSeverity().GetValue(), resistanceBaseline_mmHg_min_Per_L, h->GetSeverity().GetValue());
hemorrhagePath->GetNextResistance().SetValue(resistance_mmHg_min_Per_L, PressureTimePerVolumeUnit::mmHg_min_Per_L);
if (hemorrhagePath->HasNextFlow())
{
......@@ -1338,9 +1335,9 @@ void Cardiovascular::Hemorrhage()
InternalHemorrhagePressureApplication();
//Debugging hemorrhage
/*m_BloodVolumeEstimate -= (TotalLossRate_mL_Per_s * m_dT_s);
m_BloodVolumeEstimate -= (TotalLossRate_mL_Per_s * m_dT_s);
m_data.GetDataTrack().Probe("BloodLossRate", TotalLossRate_mL_Per_s);
m_data.GetDataTrack().Probe("BloodVolumeEstimate", m_BloodVolumeEstimate);*/
m_data.GetDataTrack().Probe("BloodVolumeEstimate", m_BloodVolumeEstimate);
}
//--------------------------------------------------------------------------------------------------
......
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