Skip to content

Commit

Permalink
restrict domain of extended HI application
Browse files Browse the repository at this point in the history
  • Loading branch information
yujiex committed Sep 13, 2024
1 parent b96c3a5 commit 58a77d9
Showing 1 changed file with 31 additions and 3 deletions.
34 changes: 31 additions & 3 deletions src/EnergyPlus/HeatBalanceSurfaceManager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5520,10 +5520,38 @@ void CalcThermalResilience(EnergyPlusData &state)
for (int ZoneNum = 1; ZoneNum <= state.dataGlobal->NumOfZones; ++ZoneNum) {
Real64 const ZoneT = state.dataZoneTempPredictorCorrector->zoneHeatBalance(ZoneNum).ZTAV;
Real64 const ZoneW = state.dataZoneTempPredictorCorrector->zoneHeatBalance(ZoneNum).airHumRatAvg;
Real64 const ZoneRH = Psychrometrics::PsyRhFnTdbWPb(state, ZoneT, ZoneW, state.dataEnvrn->OutBaroPress);
Real64 const ZoneRH = Psychrometrics::PsyRhFnTdbWPb(state, ZoneT, ZoneW, state.dataEnvrn->OutBaroPress) * 100.0;
Real64 const ZoneTF = ZoneT * (9.0 / 5.0) + 32.0;
// calculate extended heat index
state.dataHeatBal->Resilience(ZoneNum).ZoneHeatIndex = ExtendedHI::heatindex(state, ZoneT + Constant::Kelvin, ZoneRH) - Constant::Kelvin;
if (ZoneTF * 2.7 + 109.1 - ZoneRH * 100.0 > 0.0) {
Real64 constexpr c1 = -42.379;
Real64 constexpr c2 = 2.04901523;
Real64 constexpr c3 = 10.14333127;
Real64 constexpr c4 = -.22475541;
Real64 constexpr c5 = -.00683783;
Real64 constexpr c6 = -.05481717;
Real64 constexpr c7 = .00122874;
Real64 constexpr c8 = .00085282;
Real64 constexpr c9 = -.00000199;
Real64 HI;

if (ZoneTF < 80) {
HI = 0.5 * (ZoneTF + 61.0 + (ZoneTF - 68.0) * 1.2 + (ZoneRH * 0.094));
} else {
HI = c1 + c2 * ZoneTF + c3 * ZoneRH + c4 * ZoneTF * ZoneRH + c5 * ZoneTF * ZoneTF + c6 * ZoneRH * ZoneRH +
c7 * ZoneTF * ZoneTF * ZoneRH + c8 * ZoneTF * ZoneRH * ZoneRH + c9 * ZoneTF * ZoneTF * ZoneRH * ZoneRH;
if (ZoneRH < 13 && ZoneTF < 112) {
HI -= (13 - ZoneRH) / 4 * std::sqrt((17 - abs(ZoneTF - 95)) / 17);
} else if (ZoneRH > 85 && ZoneTF < 87) {
HI += (ZoneRH - 85) / 10 * (87 - ZoneTF) / 5;
}
}
HI = (HI - 32.0) * (5.0 / 9.0);
state.dataHeatBal->Resilience(ZoneNum).ZoneHeatIndex = HI;
} else {
// calculate extended heat index
state.dataHeatBal->Resilience(ZoneNum).ZoneHeatIndex =
ExtendedHI::heatindex(state, ZoneT + Constant::Kelvin, ZoneRH / 100.0) - Constant::Kelvin;
}
}
}
if (state.dataHeatBalSurfMgr->reportVarHumidex || state.dataOutRptTab->displayThermalResilienceSummary) {
Expand Down

4 comments on commit 58a77d9

@nrel-bot-2
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

extendedHIspeedFix (yujiex) - x86_64-Linux-Ubuntu-22.04-gcc-11.4: OK (2923 of 2923 tests passed, 0 test warnings)

Build Badge Test Badge

@nrel-bot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

extendedHIspeedFix (yujiex) - Win64-Windows-10-VisualStudio-16: OK (2901 of 2901 tests passed, 0 test warnings)

Build Badge Test Badge

@nrel-bot-2b
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

extendedHIspeedFix (yujiex) - x86_64-Linux-Ubuntu-22.04-gcc-11.4-IntegrationCoverage-RelWithDebInfo: OK (799 of 799 tests passed, 0 test warnings)

Build Badge Test Badge Coverage Badge

@nrel-bot-2
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

extendedHIspeedFix (yujiex) - x86_64-Linux-Ubuntu-22.04-gcc-11.4-UnitTestsCoverage-RelWithDebInfo: OK (2107 of 2107 tests passed, 0 test warnings)

Build Badge Test Badge Coverage Badge

Please sign in to comment.