Commit 4867e26e authored by Jeff Webb's avatar Jeff Webb

Tweak Pulmonary Resistance calculation to be more correct.

Now based on mouth pressure rather than environment in case there is something between the environment and mouth (e.g., anesthsia machine or mechanical ventilator).
parent 2eb18b79
......@@ -356,6 +356,7 @@ void Respiratory::SetUp()
//Circuits
m_RespiratoryCircuit = &m_data.GetCircuits().GetRespiratoryCircuit();
//Nodes
m_Mouth = m_RespiratoryCircuit->GetNode(pulse::RespiratoryNode::Mouth);
m_LeftAlveoli = m_RespiratoryCircuit->GetNode(pulse::RespiratoryNode::LeftAlveoli);
m_LeftDeadSpace = m_RespiratoryCircuit->GetNode(pulse::RespiratoryNode::LeftAnatomicDeadSpace);
m_LeftPleural = m_RespiratoryCircuit->GetNode(pulse::RespiratoryNode::LeftPleural);
......@@ -1719,9 +1720,9 @@ void Respiratory::CalculateVitalSigns()
GetInspiratoryFlow().SetValue(tracheaFlow_L_Per_s, VolumePerTimeUnit::L_Per_s);
GetExpiratoryFlow().SetValue(-tracheaFlow_L_Per_s, VolumePerTimeUnit::L_Per_s);
double dEnvironmentPressure = m_Environment->GetPressure(PressureUnit::cmH2O);
double dMouthPressure = m_Mouth->GetPressure(PressureUnit::cmH2O);
double dAlveolarPressure = (m_LeftAlveoli->GetNextPressure().GetValue(PressureUnit::cmH2O) + m_RightAlveoli->GetNextPressure().GetValue(PressureUnit::cmH2O)) / 2.0; //Average of L and R
GetPulmonaryResistance().SetValue((dEnvironmentPressure - dAlveolarPressure) / tracheaFlow_L_Per_s, FlowResistanceUnit::cmH2O_s_Per_L);
GetPulmonaryResistance().SetValue((dMouthPressure - dAlveolarPressure) / tracheaFlow_L_Per_s, FlowResistanceUnit::cmH2O_s_Per_L);
double dPleuralPressure_cmH2O = (m_LeftPleural->GetNextPressure().GetValue(PressureUnit::cmH2O) + m_RightPleural->GetNextPressure().GetValue(PressureUnit::cmH2O)) / 2.0; //Average of L and R
GetTranspulmonaryPressure().SetValue(dAlveolarPressure - dPleuralPressure_cmH2O, PressureUnit::cmH2O);
......
......@@ -182,6 +182,7 @@ private:
//Circuits
SEFluidCircuit* m_RespiratoryCircuit;
//Nodes
SEFluidCircuitNode* m_Mouth;
SEFluidCircuitNode* m_LeftAlveoli;
SEFluidCircuitNode* m_LeftDeadSpace;
SEFluidCircuitNode* m_LeftPleural;
......
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