Skip to content

Commit

Permalink
Add global control of heat index method choice
Browse files Browse the repository at this point in the history
  • Loading branch information
Yujie Xu committed Sep 26, 2024
1 parent 23c3005 commit ec88e02
Show file tree
Hide file tree
Showing 6 changed files with 65 additions and 1 deletion.
11 changes: 11 additions & 0 deletions idd/Energy+.idd.in
Original file line number Diff line number Diff line change
Expand Up @@ -977,6 +977,17 @@ HVACSystemRootFindingAlgorithm,
\type integer
\default 5

HeatIndexAlgorithm,
\memo Specify whether the simplified or the extended method should be used
\memo Simplified: based on regression analysis carried out by Lans P. Rothfusz
\memo Extended: Based on paper by Lu & Romps
\unique-object
A1 ; \field Algorithm
\type choice
\key Simplified
\key Extended
\default Simplified

\group Compliance Objects

Compliance:Building,
Expand Down
14 changes: 14 additions & 0 deletions src/EnergyPlus/DataHeatBalance.hh
Original file line number Diff line number Diff line change
Expand Up @@ -547,6 +547,19 @@ namespace DataHeatBalance {
{
}
};

enum class HeatIndexMethod : int
{
Invalid = -1,
Simplified,
Extended,
Num
};
static constexpr std::array<std::string_view, static_cast<int>(HeatIndexMethod::Num)> HeatIndexMethodUC = {
"SIMPLIFIED",
"EXTENDED",
};

struct ZoneData : ZoneSpaceData
{
// Members
Expand Down Expand Up @@ -1847,6 +1860,7 @@ struct HeatBalanceData : BaseGlobalStruct
bool NoRegularMaterialsUsed = true;
bool DoLatentSizing = false; // true when latent sizing is performed during zone sizing
bool isAnyLatentLoad = false;
DataHeatBalance::HeatIndexMethod heatIndexMethod = DataHeatBalance::HeatIndexMethod::Simplified;

Array1D<Real64> ZoneListSNLoadHeatEnergy;
Array1D<Real64> ZoneListSNLoadCoolEnergy;
Expand Down
34 changes: 34 additions & 0 deletions src/EnergyPlus/HeatBalanceManager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,8 @@ namespace HeatBalanceManager {

GetIncidentSolarMultiplier(state, ErrorsFound);

GetHeatIndexMethod(state, ErrorsFound);

// Added SV 6/26/2013 to load scheduled surface gains
GetScheduledSurfaceGains(state, ErrorsFound);

Expand Down Expand Up @@ -2165,6 +2167,38 @@ namespace HeatBalanceManager {
}
}

void GetHeatIndexMethod(EnergyPlusData &state, bool &ErrorsFound)
{
static constexpr std::string_view RoutineName("GetHeatIndexMethod: ");

Array1D_string Alphas(1);
Array1D<Real64> Numbers(1);
int NumAlpha;
int NumNumber;
int IOStat;

state.dataHeatBalMgr->CurrentModuleObject = "HeatIndexAlgorithm";
int NumObjects = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, state.dataHeatBalMgr->CurrentModuleObject);
if (NumObjects > 0) {
state.dataInputProcessing->inputProcessor->getObjectItem(state,
state.dataHeatBalMgr->CurrentModuleObject,
1,
Alphas,
NumAlpha,
Numbers,
NumNumber,
IOStat,
state.dataIPShortCut->lNumericFieldBlanks,
state.dataIPShortCut->lAlphaFieldBlanks,
state.dataIPShortCut->cAlphaFieldNames,
state.dataIPShortCut->cNumericFieldNames);
if (NumAlpha > 0) {
state.dataHeatBal->heatIndexMethod =
static_cast<DataHeatBalance::HeatIndexMethod>(getEnumValue(DataHeatBalance::HeatIndexMethodUC, Util::makeUPPER(Alphas(1))));
}
}
}

void GetZoneLocalEnvData(EnergyPlusData &state, bool &ErrorsFound) // Error flag indicator (true if errors found)
{
// SUBROUTINE INFORMATION:
Expand Down
2 changes: 2 additions & 0 deletions src/EnergyPlus/HeatBalanceManager.hh
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,8 @@ namespace HeatBalanceManager {

void GetIncidentSolarMultiplier(EnergyPlusData &state, bool &ErrorsFound);

void GetHeatIndexMethod(EnergyPlusData &state, bool &ErrorsFound);

void GetScheduledSurfaceGains(EnergyPlusData &state, bool &ErrorsFound); // If errors found in input

void CheckScheduledSurfaceGains(EnergyPlusData &state, int const ZoneNum); // Zone number for which error check will be performed
Expand Down
2 changes: 1 addition & 1 deletion src/EnergyPlus/HeatBalanceSurfaceManager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5522,7 +5522,7 @@ void CalcThermalResilience(EnergyPlusData &state)
Real64 const ZoneW = state.dataZoneTempPredictorCorrector->zoneHeatBalance(ZoneNum).airHumRatAvg;
Real64 const ZoneRH = Psychrometrics::PsyRhFnTdbWPb(state, ZoneT, ZoneW, state.dataEnvrn->OutBaroPress) * 100.0;
Real64 const ZoneTF = ZoneT * (9.0 / 5.0) + 32.0;
if (ZoneTF * 3.0 + ZoneRH * 100.0 - 340.0 < 0.0) {
if (state.dataHeatBal->heatIndexMethod == DataHeatBalance::HeatIndexMethod::Simplified) {
Real64 constexpr c1 = -42.379;
Real64 constexpr c2 = 2.04901523;
Real64 constexpr c3 = 10.14333127;
Expand Down
3 changes: 3 additions & 0 deletions testfiles/1ZoneUncontrolled_Win_ASH55_Thermal_Comfort.idf
Original file line number Diff line number Diff line change
Expand Up @@ -653,6 +653,9 @@
7.5, !- Y-Coordinate of Reference Point {m}
0.7; !- Z-Coordinate of Reference Point {m}

HeatIndexAlgorithm,
Simplified;

Output:Variable,*,Site Outdoor Air Barometric Pressure,hourly;

Output:Variable,*,Site Outdoor Air Drybulb Temperature,hourly;
Expand Down

3 comments on commit ec88e02

@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 (Unknown) - Win64-Windows-10-VisualStudio-16: OK (2899 of 2901 tests passed, 0 test warnings)

Failures:\n

EnergyPlusFixture Test Summary

  • Passed: 1609
  • Failed: 2

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 (Unknown) - x86_64-Linux-Ubuntu-22.04-gcc-11.4: OK (2921 of 2923 tests passed, 0 test warnings)

Failures:\n

EnergyPlusFixture Test Summary

  • Passed: 1611
  • Failed: 2

Build Badge Test Badge

@nrel-bot-2c
Copy link

Choose a reason for hiding this comment

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

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

Failures:\n

EnergyPlusFixture Test Summary

  • Passed: 1611
  • Failed: 2

Build Badge Test Badge Coverage Badge

Please sign in to comment.