Skip to content

Commit 4576521

Browse files
ntatum94StevenAWhite
authored andcommitted
Added tuning parameters
1 parent dc68d3a commit 4576521

File tree

4 files changed

+37
-29
lines changed

4 files changed

+37
-29
lines changed

projects/biogears/libBiogears/src/engine/Controller/BioGears.cpp

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5598,41 +5598,43 @@ void BioGears::SetupInternalTemperature()
55985598
/*Metabolic heat generation, leading to a heat source into the core*/
55995599
SEThermalCircuitPath& TemperatureGroundToCore = cIntemperature.CreatePath(Ground, Core, BGE::InternalTemperaturePath::GroundToInternalCore);
56005600
TemperatureGroundToCore.GetHeatSourceBaseline().SetValue(0.0, PowerUnit::W);
5601+
5602+
double skinCapTuningFactor = 6.0;
56015603

56025604
SEThermalCircuitNode& TorsoSkin = cIntemperature.CreateNode(BGE::InternalTemperatureNode::InternalTorsoSkin);
56035605
TorsoSkin.GetTemperature().SetValue(33.0, TemperatureUnit::C);
56045606
SEThermalCircuitPath& TorsoSkinToTemperatureGround = cIntemperature.CreatePath(TorsoSkin, Ground, BGE::InternalTemperaturePath::InternalTorsoSkinToTemperatureGround);
5605-
TorsoSkinToTemperatureGround.GetCapacitanceBaseline().SetValue(1.3 * 31.43, HeatCapacitanceUnit::kcal_Per_C);
5607+
TorsoSkinToTemperatureGround.GetCapacitanceBaseline().SetValue(skinCapTuningFactor * 1.21, HeatCapacitanceUnit::kcal_Per_C);
56065608
TorsoSkin.GetHeatBaseline().SetValue(TorsoSkinToTemperatureGround.GetCapacitanceBaseline().GetValue(HeatCapacitanceUnit::J_Per_K) * TorsoSkin.GetTemperature().GetValue(TemperatureUnit::K), EnergyUnit::J);
56075609

56085610
SEThermalCircuitNode& HeadSkin = cIntemperature.CreateNode(BGE::InternalTemperatureNode::InternalHeadSkin);
56095611
HeadSkin.GetTemperature().SetValue(33.0, TemperatureUnit::C);
56105612
SEThermalCircuitPath& HeadSkinToTemperatureGround = cIntemperature.CreatePath(HeadSkin, Ground, BGE::InternalTemperaturePath::InternalHeadSkinToTemperatureGround);
5611-
HeadSkinToTemperatureGround.GetCapacitanceBaseline().SetValue(1.3 * 3.01, HeatCapacitanceUnit::kcal_Per_C);
5613+
HeadSkinToTemperatureGround.GetCapacitanceBaseline().SetValue(skinCapTuningFactor * 0.24, HeatCapacitanceUnit::kcal_Per_C);
56125614
HeadSkin.GetHeatBaseline().SetValue(HeadSkinToTemperatureGround.GetCapacitanceBaseline().GetValue(HeatCapacitanceUnit::J_Per_K) * HeadSkin.GetTemperature().GetValue(TemperatureUnit::K), EnergyUnit::J);
56135615

56145616
SEThermalCircuitNode& LeftArmSkin = cIntemperature.CreateNode(BGE::InternalTemperatureNode::InternalLeftArmSkin);
56155617
LeftArmSkin.GetTemperature().SetValue(33.0, TemperatureUnit::C);
56165618
SEThermalCircuitPath& LeftArmSkinToTemperatureGround = cIntemperature.CreatePath(LeftArmSkin, Ground, BGE::InternalTemperaturePath::InternalLeftArmSkinToTemperatureGround);
5617-
LeftArmSkinToTemperatureGround.GetCapacitanceBaseline().SetValue(1.3 * 2.73, HeatCapacitanceUnit::kcal_Per_C);
5619+
LeftArmSkinToTemperatureGround.GetCapacitanceBaseline().SetValue(skinCapTuningFactor * 0.30, HeatCapacitanceUnit::kcal_Per_C);
56185620
LeftArmSkin.GetHeatBaseline().SetValue(LeftArmSkinToTemperatureGround.GetCapacitanceBaseline().GetValue(HeatCapacitanceUnit::J_Per_K) * LeftArmSkin.GetTemperature().GetValue(TemperatureUnit::K), EnergyUnit::J);
56195621

56205622
SEThermalCircuitNode& RightArmSkin = cIntemperature.CreateNode(BGE::InternalTemperatureNode::InternalRightArmSkin);
56215623
RightArmSkin.GetTemperature().SetValue(33.0, TemperatureUnit::C);
56225624
SEThermalCircuitPath& RightArmSkinToTemperatureGround = cIntemperature.CreatePath(RightArmSkin, Ground, BGE::InternalTemperaturePath::InternalRightArmSkinToTemperatureGround);
5623-
RightArmSkinToTemperatureGround.GetCapacitanceBaseline().SetValue(1.3 * 2.73, HeatCapacitanceUnit::kcal_Per_C);
5625+
RightArmSkinToTemperatureGround.GetCapacitanceBaseline().SetValue(skinCapTuningFactor * 0.30, HeatCapacitanceUnit::kcal_Per_C);
56245626
RightArmSkin.GetHeatBaseline().SetValue(RightArmSkinToTemperatureGround.GetCapacitanceBaseline().GetValue(HeatCapacitanceUnit::J_Per_K) * RightArmSkin.GetTemperature().GetValue(TemperatureUnit::K), EnergyUnit::J);
56255627

56265628
SEThermalCircuitNode& LeftLegSkin = cIntemperature.CreateNode(BGE::InternalTemperatureNode::InternalLeftLegSkin);
56275629
LeftLegSkin.GetTemperature().SetValue(33.0, TemperatureUnit::C);
56285630
SEThermalCircuitPath& LeftLegSkinToTemperatureGround = cIntemperature.CreatePath(LeftLegSkin, Ground, BGE::InternalTemperaturePath::InternalLeftLegSkinToTemperatureGround);
5629-
LeftLegSkinToTemperatureGround.GetCapacitanceBaseline().SetValue(1.3 * 7.96, HeatCapacitanceUnit::kcal_Per_C);
5631+
LeftLegSkinToTemperatureGround.GetCapacitanceBaseline().SetValue(skinCapTuningFactor * 0.7, HeatCapacitanceUnit::kcal_Per_C);
56305632
LeftLegSkin.GetHeatBaseline().SetValue(LeftLegSkinToTemperatureGround.GetCapacitanceBaseline().GetValue(HeatCapacitanceUnit::J_Per_K) * LeftLegSkin.GetTemperature().GetValue(TemperatureUnit::K), EnergyUnit::J);
56315633

56325634
SEThermalCircuitNode& RightLegSkin = cIntemperature.CreateNode(BGE::InternalTemperatureNode::InternalRightLegSkin);
56335635
RightLegSkin.GetTemperature().SetValue(33.0, TemperatureUnit::C);
56345636
SEThermalCircuitPath& RightLegSkinToTemperatureGround = cIntemperature.CreatePath(RightLegSkin, Ground, BGE::InternalTemperaturePath::InternalRightLegSkinToTemperatureGround);
5635-
RightLegSkinToTemperatureGround.GetCapacitanceBaseline().SetValue(1.3 * 7.96, HeatCapacitanceUnit::kcal_Per_C);
5637+
RightLegSkinToTemperatureGround.GetCapacitanceBaseline().SetValue(skinCapTuningFactor * 0.7, HeatCapacitanceUnit::kcal_Per_C);
56365638
RightLegSkin.GetHeatBaseline().SetValue(RightLegSkinToTemperatureGround.GetCapacitanceBaseline().GetValue(HeatCapacitanceUnit::J_Per_K) * RightLegSkin.GetTemperature().GetValue(TemperatureUnit::K), EnergyUnit::J);
56375639

56385640
// Only using basal values for now - See if this is worth it
@@ -5649,21 +5651,22 @@ void BioGears::SetupInternalTemperature()
56495651
SEThermalCircuitPath& TemperatureGroundToSkinRightLeg = cIntemperature.CreatePath(Ground, RightLegSkin, BGE::InternalTemperaturePath::GroundToInternalRightLegSkin);
56505652
TemperatureGroundToSkinRightLeg.GetHeatSourceBaseline().SetValue(1.805, PowerUnit::kcal_Per_hr);
56515653

5654+
double coreToSkinTuningParam = 1.0;
56525655
SEThermalCircuitPath& CoreToTemperatureGround = cIntemperature.CreatePath(Core, Ground, BGE::InternalTemperaturePath::InternalCoreToGround);
56535656
CoreToTemperatureGround.GetCapacitanceBaseline().SetValue((1.0 - skinMassFraction) * m_Patient->GetWeight(MassUnit::kg) * GetConfiguration().GetBodySpecificHeat(HeatCapacitancePerMassUnit::J_Per_K_kg), HeatCapacitanceUnit::J_Per_K);
56545657
Core.GetHeatBaseline().SetValue(CoreToTemperatureGround.GetCapacitanceBaseline().GetValue(HeatCapacitanceUnit::J_Per_K) * Core.GetTemperature().GetValue(TemperatureUnit::K), EnergyUnit::J);
56555658
SEThermalCircuitPath& CoreToTorsoSkin = cIntemperature.CreatePath(Core, TorsoSkin, BGE::InternalTemperaturePath::InternalCoreToInternalTorsoSkin);
5656-
CoreToTorsoSkin.GetResistanceBaseline().SetValue(1.0 * 2.315, HeatResistanceUnit::C_s_Per_kcal);
5659+
CoreToTorsoSkin.GetResistanceBaseline().SetValue(coreToSkinTuningParam * 2.315, HeatResistanceUnit::C_s_Per_kcal);
56575660
SEThermalCircuitPath& CoreToHeadSkin = cIntemperature.CreatePath(Core, HeadSkin, BGE::InternalTemperaturePath::InternalCoreToInternalHeadSkin);
5658-
CoreToHeadSkin.GetResistanceBaseline().SetValue(1.0 * 2.257, HeatResistanceUnit::C_s_Per_kcal);
5661+
CoreToHeadSkin.GetResistanceBaseline().SetValue(coreToSkinTuningParam * 2.257, HeatResistanceUnit::C_s_Per_kcal);
56595662
SEThermalCircuitPath& CoreToLeftArmSkin = cIntemperature.CreatePath(Core, LeftArmSkin, BGE::InternalTemperaturePath::InternalCoreToInternalLeftArmSkin);
5660-
CoreToLeftArmSkin.GetResistanceBaseline().SetValue(1.0 * 0.826, HeatResistanceUnit::C_s_Per_kcal);
5663+
CoreToLeftArmSkin.GetResistanceBaseline().SetValue(coreToSkinTuningParam * 0.826, HeatResistanceUnit::C_s_Per_kcal);
56615664
SEThermalCircuitPath& CoreToRightArmSkin = cIntemperature.CreatePath(Core, RightArmSkin, BGE::InternalTemperaturePath::InternalCoreToInternalRightArmSkin);
5662-
CoreToRightArmSkin.GetResistanceBaseline().SetValue(1.0 * 0.826, HeatResistanceUnit::C_s_Per_kcal);
5665+
CoreToRightArmSkin.GetResistanceBaseline().SetValue(coreToSkinTuningParam * 0.826, HeatResistanceUnit::C_s_Per_kcal);
56635666
SEThermalCircuitPath& CoreToLeftLegSkin = cIntemperature.CreatePath(Core, LeftLegSkin, BGE::InternalTemperaturePath::InternalCoreToInternalLeftLegSkin);
5664-
CoreToLeftLegSkin.GetResistanceBaseline().SetValue(1.0 * 0.351, HeatResistanceUnit::C_s_Per_kcal);
5667+
CoreToLeftLegSkin.GetResistanceBaseline().SetValue(coreToSkinTuningParam * 0.351, HeatResistanceUnit::C_s_Per_kcal);
56655668
SEThermalCircuitPath& CoreToRightLegSkin = cIntemperature.CreatePath(Core, RightLegSkin, BGE::InternalTemperaturePath::InternalCoreToInternalRightLegSkin);
5666-
CoreToRightLegSkin.GetResistanceBaseline().SetValue(1.0 * 0.351, HeatResistanceUnit::C_s_Per_kcal);
5669+
CoreToRightLegSkin.GetResistanceBaseline().SetValue(coreToSkinTuningParam * 0.351, HeatResistanceUnit::C_s_Per_kcal);
56675670

56685671
cIntemperature.SetNextAndCurrentFromBaselines();
56695672
cIntemperature.StateChange();

projects/biogears/libBiogears/src/engine/Systems/BloodChemistry.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -911,7 +911,7 @@ void BloodChemistry::CheckBloodSubstanceLevels()
911911
patient.SetEvent(CDM::enumPatientEvent::BrainOxygenDeficit, true, m_data.GetSimulationTime());
912912

913913
// Irreversible damage occurs if the deficit has gone on too long
914-
if (patient.GetEventDuration(CDM::enumPatientEvent::BrainOxygenDeficit, TimeUnit::s) > 1800) {
914+
if (patient.GetEventDuration(CDM::enumPatientEvent::BrainOxygenDeficit, TimeUnit::s) > 1800.) {
915915
m_ss << "Brain Oxygen partial pressure is " << m_brainO2->GetPartialPressure(PressureUnit::mmHg) << " and has been below the danger threshold for " << patient.GetEventDuration(CDM::enumPatientEvent::BrainOxygenDeficit, TimeUnit::s) << " seconds. Damage is irreversible.";
916916
Warning(m_ss);
917917
/// \irreversible Brain oxygen pressure has been dangerously low for more than 30 minutes.
@@ -928,15 +928,15 @@ void BloodChemistry::CheckBloodSubstanceLevels()
928928
if (m_brainO2->GetPartialPressure(PressureUnit::mmHg) < 10.0) {
929929
/// \event Patient: Critical Brain Oxygen Deficit Event. The oxygen partial pressure in the brain has dropped to a critically low level.
930930
patient.SetEvent(CDM::enumPatientEvent::CriticalBrainOxygenDeficit, true, m_data.GetSimulationTime());
931-
} else if (m_brainO2->GetPartialPressure(PressureUnit::mmHg) > 12.0) {
931+
} else if (patient.IsEventActive(CDM::enumPatientEvent::CriticalBrainOxygenDeficit) && m_brainO2->GetPartialPressure(PressureUnit::mmHg) > 12.0) {
932932
/// \event Patient: End Brain Oxygen Deficit Event. The oxygen partial pressure has risen above 12 mmHg in the brain. If this occurs when the patient has a critical brain oxygen deficit event, it will reverse the event.
933933
/// The brain is not in a critical oxygen deficit.
934934
patient.SetEvent(CDM::enumPatientEvent::CriticalBrainOxygenDeficit, false, m_data.GetSimulationTime());
935935
}
936936

937937
// Irreversible damage occurs if the critical deficit has gone on too long
938-
if (patient.GetEventDuration(CDM::enumPatientEvent::CriticalBrainOxygenDeficit, TimeUnit::s) > 600) {
939-
m_ss << "Brain Oxygen partial pressure is " << m_brainO2->GetPartialPressure(PressureUnit::mmHg) << " and has been below the critical threshold for " << patient.GetEventDuration(CDM::enumPatientEvent::BrainOxygenDeficit, TimeUnit::s) << " seconds. Damage is irreversible.";
938+
if (patient.IsEventActive(CDM::enumPatientEvent::CriticalBrainOxygenDeficit) && patient.GetEventDuration(CDM::enumPatientEvent::CriticalBrainOxygenDeficit, TimeUnit::s) > 600.) {
939+
m_ss << "Brain Oxygen partial pressure is " << m_brainO2->GetPartialPressure(PressureUnit::mmHg) << " and has been below the critical threshold for " << patient.GetEventDuration(CDM::enumPatientEvent::CriticalBrainOxygenDeficit, TimeUnit::s) << " seconds. Damage is irreversible.";
940940
Warning(m_ss);
941941
/// \irreversible Brain oxygen pressure has been critically low for more than 10 minutes.
942942
if (!m_PatientActions->HasOverride()) {

projects/biogears/libBiogears/src/engine/Systems/Energy.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -682,12 +682,12 @@ void Energy::UpdateHeatResistance()
682682
double skinBloodFlow_m3_Per_s = m_data.GetCardiovascular().GetMeanSkinFlow().GetValue(VolumePerTimeUnit::m3_Per_s);
683683
std::vector<double> segmentedSkinBloodFlows;
684684
// mean * 6 compts * compartmental fraction for each segments blood flow
685-
segmentedSkinBloodFlows.push_back(6.0 * skinBloodFlow_m3_Per_s * (220.66 / 302.91)); // Trunk
686-
segmentedSkinBloodFlows.push_back(6.0 * skinBloodFlow_m3_Per_s * (46.69 / 302.91)); // Head
687-
segmentedSkinBloodFlows.push_back(6.0 * skinBloodFlow_m3_Per_s * (5.06 / 302.91)); // LArm
688-
segmentedSkinBloodFlows.push_back(6.0 * skinBloodFlow_m3_Per_s * (5.06 / 302.91)); // RArm
689-
segmentedSkinBloodFlows.push_back(6.0 * skinBloodFlow_m3_Per_s * (12.72 / 302.91)); // LLeg
690-
segmentedSkinBloodFlows.push_back(6.0 * skinBloodFlow_m3_Per_s * (12.72 / 302.91)); // RLeg
685+
segmentedSkinBloodFlows.push_back(6.0 * skinBloodFlow_m3_Per_s * (2.10 / 11.89)); // Trunk
686+
segmentedSkinBloodFlows.push_back(6.0 * skinBloodFlow_m3_Per_s * (1.44 / 11.89)); // Head
687+
segmentedSkinBloodFlows.push_back(6.0 * skinBloodFlow_m3_Per_s * (1.25 / 11.89)); // LArm
688+
segmentedSkinBloodFlows.push_back(6.0 * skinBloodFlow_m3_Per_s * (1.25 / 11.89)); // RArm
689+
segmentedSkinBloodFlows.push_back(6.0 * skinBloodFlow_m3_Per_s * (2.925 / 11.89)); // LLeg
690+
segmentedSkinBloodFlows.push_back(6.0 * skinBloodFlow_m3_Per_s * (2.925 / 11.89)); // RLeg
691691
int index = 0;
692692
for (SEThermalCircuitPath* coreToSkinPath : m_coreToSkinPaths) {
693693
double bloodDensity_kg_Per_m3 = m_data.GetBloodChemistry().GetBloodDensity().GetValue(MassPerVolumeUnit::kg_Per_m3);

projects/biogears/libBiogears/src/engine/Systems/Environment.cpp

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -270,12 +270,13 @@ void Environment::PreProcess()
270270
// 1 is head, gets no clo (0.01, assume not hat/hair for now)
271271
// arms each get 5 percent of clo
272272
// legs each get 25 percent of clo
273-
m_SkinToClothingPaths[0]->GetNextResistance().SetValue(skinToClothingResistance / m_cloSegmentation[0], HeatResistanceUnit::K_Per_W);
274-
m_SkinToClothingPaths[1]->GetNextResistance().SetValue(skinToClothingResistance / m_cloSegmentation[1], HeatResistanceUnit::K_Per_W);
275-
m_SkinToClothingPaths[2]->GetNextResistance().SetValue(skinToClothingResistance / m_cloSegmentation[2], HeatResistanceUnit::K_Per_W);
276-
m_SkinToClothingPaths[3]->GetNextResistance().SetValue(skinToClothingResistance / m_cloSegmentation[3], HeatResistanceUnit::K_Per_W);
277-
m_SkinToClothingPaths[4]->GetNextResistance().SetValue(skinToClothingResistance / m_cloSegmentation[4], HeatResistanceUnit::K_Per_W);
278-
m_SkinToClothingPaths[5]->GetNextResistance().SetValue(skinToClothingResistance / m_cloSegmentation[5], HeatResistanceUnit::K_Per_W);
273+
double clotTest = 1.0;
274+
m_SkinToClothingPaths[0]->GetNextResistance().SetValue(clotTest * skinToClothingResistance * m_cloSegmentation[0], HeatResistanceUnit::K_Per_W);
275+
m_SkinToClothingPaths[1]->GetNextResistance().SetValue(clotTest * skinToClothingResistance * m_cloSegmentation[1], HeatResistanceUnit::K_Per_W);
276+
m_SkinToClothingPaths[2]->GetNextResistance().SetValue(clotTest * skinToClothingResistance * m_cloSegmentation[2], HeatResistanceUnit::K_Per_W);
277+
m_SkinToClothingPaths[3]->GetNextResistance().SetValue(clotTest * skinToClothingResistance * m_cloSegmentation[3], HeatResistanceUnit::K_Per_W);
278+
m_SkinToClothingPaths[4]->GetNextResistance().SetValue(clotTest * skinToClothingResistance * m_cloSegmentation[4], HeatResistanceUnit::K_Per_W);
279+
m_SkinToClothingPaths[5]->GetNextResistance().SetValue(clotTest * skinToClothingResistance * m_cloSegmentation[5], HeatResistanceUnit::K_Per_W);
279280

280281
//Set the skin heat loss
281282
double dSkinHeatLoss_W = 0.0;
@@ -296,6 +297,7 @@ void Environment::PreProcess()
296297

297298
//Record heat fluxes after we have processed all actions
298299
double dTotalHeatLoss_W = 0.0;
300+
double eHeatLoss_W = 0.0;
299301
if (m_ClothingToEnclosurePath->HasHeatTransferRate()) {
300302
dTotalHeatLoss_W = m_ClothingToEnclosurePath->GetHeatTransferRate().GetValue(PowerUnit::W);
301303
}
@@ -306,9 +308,12 @@ void Environment::PreProcess()
306308
GetConvectiveHeatLoss().SetValue(dTotalHeatLoss_W, PowerUnit::W);
307309
for (SEThermalCircuitPath* envSkinToGround : m_EnvironmentSkinToGroundPaths) {
308310
if (envSkinToGround->HasHeatTransferRate()) {
309-
dTotalHeatLoss_W += envSkinToGround->GetHeatTransferRate().GetValue(PowerUnit::W);
311+
eHeatLoss_W += envSkinToGround->GetHeatTransferRate().GetValue(PowerUnit::W);
310312
}
311313
}
314+
if (eHeatLoss_W > 0.) {
315+
dTotalHeatLoss_W = eHeatLoss_W;
316+
}
312317
GetEvaporativeHeatLoss().SetValue(dTotalHeatLoss_W, PowerUnit::W);
313318
}
314319

0 commit comments

Comments
 (0)