From c8aa4b3c68c71bd64660884af62175b6c451b9b4 Mon Sep 17 00:00:00 2001 From: "Michael J. Witte" Date: Wed, 19 Jun 2024 08:06:43 -0500 Subject: [PATCH] Fix and rollback --- src/EnergyPlus/DataSizing.hh | 30 +++++++++---------- src/EnergyPlus/OutputReportTabular.cc | 2 +- src/EnergyPlus/ReportCoilSelection.cc | 12 ++++---- src/EnergyPlus/SimAirServingZones.cc | 14 ++++----- src/EnergyPlus/SizingManager.cc | 8 ++--- .../unit/DesiccantDehumidifiers.unit.cc | 2 +- .../unit/OutputReportTabular.unit.cc | 7 ++--- 7 files changed, 36 insertions(+), 39 deletions(-) diff --git a/src/EnergyPlus/DataSizing.hh b/src/EnergyPlus/DataSizing.hh index 394c973082e..63d7d2a9e56 100644 --- a/src/EnergyPlus/DataSizing.hh +++ b/src/EnergyPlus/DataSizing.hh @@ -784,13 +784,13 @@ namespace DataSizing { struct SystemSizingInputData { // Members - std::string AirPriLoopName; // name of an AirLoopHVAC object - int AirLoopNum = 0; // index number of air loop - LoadSizing loadSizingType = LoadSizing::Invalid; // type of load to size on sensible, latent, total, ventilation - DataSizing::Concurrence concurrenceMethod = DataSizing::Concurrence::Invalid; // noncoincident, coincident - OAControl CoolOAOption = OAControl::Invalid; // 1 = use 100% outside air; 2 = use min OA; for cooling sizing - OAControl HeatOAOption = OAControl::Invalid; // 1 = use 100% outside air; 2 = use min OA; for heating sizing - Real64 DesOutAirVolFlow = 0.0; // design (minimum) outside air flow rate [m3/s] + std::string AirPriLoopName; // name of an AirLoopHVAC object + int AirLoopNum = 0; // index number of air loop + LoadSizing loadSizingType = LoadSizing::Invalid; // type of load to size on sensible, latent, total, ventilation + DataSizing::Concurrence SizingOption = DataSizing::Concurrence::NonCoincident; // noncoincident, coincident + OAControl CoolOAOption = OAControl::Invalid; // 1 = use 100% outside air; 2 = use min OA; for cooling sizing + OAControl HeatOAOption = OAControl::Invalid; // 1 = use 100% outside air; 2 = use min OA; for heating sizing + Real64 DesOutAirVolFlow = 0.0; // design (minimum) outside air flow rate [m3/s] Real64 SysAirMinFlowRat = 0.0; // minimum system air flow ratio for heating, Central Heating Maximum System Air Flow Ratio bool SysAirMinFlowRatWasAutoSized = false; // true if central heating maximum system air flow ratio was autosize on input Real64 PreheatTemp = 0.0; // preheat design set temperature [C] @@ -836,14 +836,14 @@ namespace DataSizing { struct SystemSizingData // Contains data for system sizing { // Members - std::string AirPriLoopName; // name of an AirLoopHVAC object - std::string CoolDesDay; // name of a cooling design day - std::string HeatDesDay; // name of a heating design day - LoadSizing loadSizingType = LoadSizing::Invalid; // type of load to size on Sensible, Latent, Total, Ventilation - DataSizing::Concurrence concurrenceMethod = DataSizing::Concurrence::Invalid; // noncoincident, coincident. - OAControl CoolOAOption = OAControl::Invalid; // 1 = use 100% outside air; 2 = use min OA; for cooling sizing - OAControl HeatOAOption = OAControl::Invalid; // 1 = use 100% outside air; 2 = use min OA; for heating sizing - Real64 DesOutAirVolFlow = 0.0; // design (minimum) outside air flow rate [m3/s] + std::string AirPriLoopName; // name of an AirLoopHVAC object + std::string CoolDesDay; // name of a cooling design day + std::string HeatDesDay; // name of a heating design day + LoadSizing loadSizingType = LoadSizing::Invalid; // type of load to size on Sensible, Latent, Total, Ventilation + DataSizing::Concurrence SizingOption = DataSizing::Concurrence::NonCoincident; // noncoincident, coincident. + OAControl CoolOAOption = OAControl::Invalid; // 1 = use 100% outside air; 2 = use min OA; for cooling sizing + OAControl HeatOAOption = OAControl::Invalid; // 1 = use 100% outside air; 2 = use min OA; for heating sizing + Real64 DesOutAirVolFlow = 0.0; // design (minimum) outside air flow rate [m3/s] Real64 SysAirMinFlowRat = 0.0; // minimum system air flow ratio for heating, Central Heating Maximum System Air Flow Ratio bool SysAirMinFlowRatWasAutoSized = false; // true if central heating maximum system air flow ratio was autosize on input Real64 PreheatTemp = 0.0; // preheat design set temperature diff --git a/src/EnergyPlus/OutputReportTabular.cc b/src/EnergyPlus/OutputReportTabular.cc index 54bec06f4ea..821fc171110 100644 --- a/src/EnergyPlus/OutputReportTabular.cc +++ b/src/EnergyPlus/OutputReportTabular.cc @@ -15351,7 +15351,7 @@ void WriteLoadComponentSummaryTables(EnergyPlusData &state) } for (int SysSizIndex = 1; SysSizIndex <= state.dataSize->NumSysSizInput; ++SysSizIndex) { if (state.dataSize->SysSizInput(SysSizIndex).AirLoopNum != iAirLoop) continue; - if (state.dataSize->SysSizInput(SysSizIndex).concurrenceMethod == DataSizing::Concurrence::Coincident) { + if (state.dataSize->SysSizInput(SysSizIndex).SizingOption == DataSizing::Concurrence::Coincident) { airLoopCoolTable.peakDesSensLoad = finalSysSizing.SysCoolCoinSpaceSens; airLoopCoolTable.designPeakLoad = finalSysSizing.SysDesCoolLoad; diff --git a/src/EnergyPlus/ReportCoilSelection.cc b/src/EnergyPlus/ReportCoilSelection.cc index 64eaa9d801b..50841801321 100644 --- a/src/EnergyPlus/ReportCoilSelection.cc +++ b/src/EnergyPlus/ReportCoilSelection.cc @@ -1264,7 +1264,7 @@ void ReportCoilSelection::setCoilCoolingCapacity( c->oaPeakHumRat = finalSysSizing.OutHumRatAtCoolPeak; c->raPeakTemp = finalSysSizing.RetTempAtCoolPeak; c->raPeakHumRat = finalSysSizing.RetHumRatAtCoolPeak; - c->coilSizingMethodConcurrence = finalSysSizing.concurrenceMethod; + c->coilSizingMethodConcurrence = finalSysSizing.SizingOption; c->coilSizingMethodCapacity = finalSysSizing.CoolingCapMethod; c->coilSizingMethodAirFlow = finalSysSizing.ScaleCoolSAFMethod; // DesOutAirVolFlow @@ -1475,9 +1475,9 @@ void ReportCoilSelection::setCoilCoolingCapacity( for (int airLoopNum = 0; airLoopNum < state.dataAirLoopHVACDOAS->airloopDOAS[DOASSysNum].NumOfAirLoops; ++airLoopNum) { int actualAirLoopNum = state.dataAirLoopHVACDOAS->airloopDOAS[DOASSysNum].m_AirLoopNum[airLoopNum]; if (airLoopNum == 0) { - sizMethod = state.dataSize->FinalSysSizing(actualAirLoopNum).concurrenceMethod; + sizMethod = state.dataSize->FinalSysSizing(actualAirLoopNum).SizingOption; } else { - if (sizMethod != state.dataSize->FinalSysSizing(actualAirLoopNum).concurrenceMethod) { + if (sizMethod != state.dataSize->FinalSysSizing(actualAirLoopNum).SizingOption) { sizMethodsAreTheSame = false; } } @@ -1533,7 +1533,7 @@ void ReportCoilSelection::setCoilHeatingCapacity( c->oaPeakVolFlow = finalSysSizing.DesOutAirVolFlow; c->raPeakTemp = finalSysSizing.HeatRetTemp; c->raPeakHumRat = finalSysSizing.HeatRetHumRat; - c->coilSizingMethodConcurrence = finalSysSizing.concurrenceMethod; + c->coilSizingMethodConcurrence = finalSysSizing.SizingOption; c->coilSizingMethodCapacity = finalSysSizing.HeatingCapMethod; c->coilSizingMethodAirFlow = finalSysSizing.ScaleHeatSAFMethod; @@ -1772,9 +1772,9 @@ void ReportCoilSelection::setCoilHeatingCapacity( for (int airLoopNum = 0; airLoopNum < state.dataAirLoopHVACDOAS->airloopDOAS[DOASSysNum].NumOfAirLoops; ++airLoopNum) { int actualAirLoopNum = state.dataAirLoopHVACDOAS->airloopDOAS[DOASSysNum].m_AirLoopNum[airLoopNum]; if (airLoopNum == 0) { - sizMethod = state.dataSize->FinalSysSizing(actualAirLoopNum).concurrenceMethod; + sizMethod = state.dataSize->FinalSysSizing(actualAirLoopNum).SizingOption; } else { - if (sizMethod != state.dataSize->FinalSysSizing(actualAirLoopNum).concurrenceMethod) { + if (sizMethod != state.dataSize->FinalSysSizing(actualAirLoopNum).SizingOption) { sizMethodsAreTheSame = false; } } diff --git a/src/EnergyPlus/SimAirServingZones.cc b/src/EnergyPlus/SimAirServingZones.cc index 20acbda6bee..494351d0478 100644 --- a/src/EnergyPlus/SimAirServingZones.cc +++ b/src/EnergyPlus/SimAirServingZones.cc @@ -4162,7 +4162,7 @@ void SetUpSysSizingArrays(EnergyPlusData &state) sysSizing.HeatSupTemp = sysSizInput.HeatSupTemp; sysSizing.CoolSupHumRat = sysSizInput.CoolSupHumRat; sysSizing.HeatSupHumRat = sysSizInput.HeatSupHumRat; - sysSizing.concurrenceMethod = sysSizInput.concurrenceMethod; + sysSizing.SizingOption = sysSizInput.SizingOption; if (primaryAirSystems.isAllOA) { sysSizing.CoolOAOption = OAControl::AllOA; sysSizing.HeatOAOption = OAControl::AllOA; @@ -4223,7 +4223,7 @@ void SetUpSysSizingArrays(EnergyPlusData &state) finalSysSizing.HeatSupTemp = sysSizInput.HeatSupTemp; finalSysSizing.CoolSupHumRat = sysSizInput.CoolSupHumRat; finalSysSizing.HeatSupHumRat = sysSizInput.HeatSupHumRat; - finalSysSizing.concurrenceMethod = sysSizInput.concurrenceMethod; + finalSysSizing.SizingOption = sysSizInput.SizingOption; finalSysSizing.CoolAirDesMethod = sysSizInput.CoolAirDesMethod; finalSysSizing.HeatAirDesMethod = sysSizInput.HeatAirDesMethod; finalSysSizing.ScaleCoolSAFMethod = sysSizInput.ScaleCoolSAFMethod; @@ -4270,7 +4270,7 @@ void SetUpSysSizingArrays(EnergyPlusData &state) calcSysSizing.HeatSupTemp = sysSizInput.HeatSupTemp; calcSysSizing.CoolSupHumRat = sysSizInput.CoolSupHumRat; calcSysSizing.HeatSupHumRat = sysSizInput.HeatSupHumRat; - calcSysSizing.concurrenceMethod = sysSizInput.concurrenceMethod; + calcSysSizing.SizingOption = sysSizInput.SizingOption; calcSysSizing.CoolAirDesMethod = sysSizInput.CoolAirDesMethod; calcSysSizing.HeatAirDesMethod = sysSizInput.HeatAirDesMethod; calcSysSizing.ScaleCoolSAFMethod = sysSizInput.ScaleCoolSAFMethod; @@ -5509,7 +5509,7 @@ void UpdateSysSizing(EnergyPlusData &state, Constant::CallIndicator const CallIn int NumZonesHeated = state.dataAirLoop->AirToZoneNodeInfo(AirLoopNum).NumZonesHeated; auto &sysSizing = state.dataSize->SysSizing(state.dataSize->CurOverallSimDay, AirLoopNum); - switch (sysSizing.concurrenceMethod) { + switch (sysSizing.SizingOption) { case DataSizing::Concurrence::Coincident: { if (finalSysSizing.SystemOAMethod == SysOAMethod::ZoneSum) { sysSizing.DesCoolVolFlow = sysSizing.CoinCoolMassFlow / state.dataEnvrn->StdRhoAir; @@ -6540,7 +6540,7 @@ void UpdateSysSizing(EnergyPlusData &state, Constant::CallIndicator const CallIn } // move the noncoincident results into the system sizing array - if (state.dataSize->CalcSysSizing(AirLoopNum).concurrenceMethod == DataSizing::Concurrence::NonCoincident) { + if (state.dataSize->CalcSysSizing(AirLoopNum).SizingOption == DataSizing::Concurrence::NonCoincident) { // But first check to see if the noncoincident result is actually bigger than the coincident (for 100% outside air) if (!(state.dataSize->FinalSysSizing(AirLoopNum).CoolOAOption == OAControl::AllOA && SysSensCoolCap <= 0.0)) { // CoolOAOption = Yes 100% OA @@ -6762,7 +6762,7 @@ void UpdateSysSizing(EnergyPlusData &state, Constant::CallIndicator const CallIn } state.dataSize->TermUnitFinalZoneSizing(TermUnitSizingIndex).scaleZoneCooling(ZoneOARatio); } else if ((SysCoolSizingRat > 1.0) || - (SysCoolSizingRat < 1.0 && finalSysSizing.concurrenceMethod == DataSizing::Concurrence::NonCoincident)) { + (SysCoolSizingRat < 1.0 && finalSysSizing.SizingOption == DataSizing::Concurrence::NonCoincident)) { // size on user input system design flows state.dataSize->TermUnitFinalZoneSizing(TermUnitSizingIndex).scaleZoneCooling(SysCoolSizingRat); } @@ -6823,7 +6823,7 @@ void UpdateSysSizing(EnergyPlusData &state, Constant::CallIndicator const CallIn ZoneOARatio *= (1.0 + state.dataSize->TermUnitSizing(TermUnitSizingIndex).InducRat); termUnitFinalZoneSizing.scaleZoneHeating(ZoneOARatio); } else if ((SysHeatSizingRat > 1.0) || - (SysHeatSizingRat < 1.0 && finalSysSizing.concurrenceMethod == DataSizing::Concurrence::NonCoincident)) { + (SysHeatSizingRat < 1.0 && finalSysSizing.SizingOption == DataSizing::Concurrence::NonCoincident)) { // size on user input system design flows termUnitFinalZoneSizing.scaleZoneHeating(SysHeatSizingRat); } diff --git a/src/EnergyPlus/SizingManager.cc b/src/EnergyPlus/SizingManager.cc index 330dd875faa..8d5234b82bf 100644 --- a/src/EnergyPlus/SizingManager.cc +++ b/src/EnergyPlus/SizingManager.cc @@ -1115,7 +1115,7 @@ void ManageSystemSizingAdjustments(EnergyPlusData &state) if (allocated(FinalSysSizing)) { // correct sizing design heating volume flow rate based on finalized air terminal unit operation - if (FinalSysSizing(AirLoopNum).concurrenceMethod == + if (FinalSysSizing(AirLoopNum).SizingOption == DataSizing::Concurrence::NonCoincident) { // If non-coincident sizing method for this air loop, the we can use these sum's from // air terminals directly FinalSysSizing(AirLoopNum).DesHeatVolFlow = max(airLoopHeatingMaximumFlowRateSum, FinalSysSizing(AirLoopNum).DesHeatVolFlow); @@ -1127,7 +1127,7 @@ void ManageSystemSizingAdjustments(EnergyPlusData &state) FinalSysSizing(AirLoopNum).DesCoolVolFlow = max(airLoopHeatingMinimumFlowRateSum, FinalSysSizing(AirLoopNum).DesCoolVolFlow); FinalSysSizing(AirLoopNum).MassFlowAtCoolPeak = FinalSysSizing(AirLoopNum).DesCoolVolFlow * state.dataEnvrn->StdRhoAir; } - } else if (FinalSysSizing(AirLoopNum).concurrenceMethod == DataSizing::Concurrence::Coincident) { + } else if (FinalSysSizing(AirLoopNum).SizingOption == DataSizing::Concurrence::Coincident) { if (FinalSysSizing(AirLoopNum).sysSizeCoolingDominant) { // use minimum heating flow sum from air terminals // know that minimum heating flow is a hard minimum regardless of concurrence situation, so make sure that design is at @@ -3579,9 +3579,9 @@ void GetSystemSizingInput(EnergyPlusData &state) { std::string const &sizingOption = state.dataIPShortCut->cAlphaArgs(iSizingOptionAlphaNum); if (sizingOption == "COINCIDENT") { - SysSizInput(SysSizIndex).concurrenceMethod = DataSizing::Concurrence::Coincident; + SysSizInput(SysSizIndex).SizingOption = DataSizing::Concurrence::Coincident; } else if (sizingOption == "NONCOINCIDENT") { - SysSizInput(SysSizIndex).concurrenceMethod = DataSizing::Concurrence::NonCoincident; + SysSizInput(SysSizIndex).SizingOption = DataSizing::Concurrence::NonCoincident; } else { ShowSevereError(state, format("{}=\"{}\", invalid data.", cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(iNameAlphaNum))); ShowContinueError(state, diff --git a/tst/EnergyPlus/unit/DesiccantDehumidifiers.unit.cc b/tst/EnergyPlus/unit/DesiccantDehumidifiers.unit.cc index 7b11550948c..56544d221fa 100644 --- a/tst/EnergyPlus/unit/DesiccantDehumidifiers.unit.cc +++ b/tst/EnergyPlus/unit/DesiccantDehumidifiers.unit.cc @@ -2898,7 +2898,7 @@ TEST_F(EnergyPlusFixture, DesiccantDehum_OnOASystemTest) auto &finalSysSizing = state->dataSize->FinalSysSizing(1); auto &sysSizPeakDDNum = state->dataSize->SysSizPeakDDNum(1); EXPECT_ENUM_EQ(finalSysSizing.coolingPeakLoad, DataSizing::PeakLoad::SensibleCooling); - EXPECT_EQ(finalSysSizing.SizingOption, DataSizing::NonCoincident); + EXPECT_ENUM_EQ(finalSysSizing.SizingOption, DataSizing::Concurrence::NonCoincident); EXPECT_EQ(sysSizPeakDDNum.SensCoolPeakDD, coolPeakDD); int timeStepIndexAtPeakCoolLoad = sysSizPeakDDNum.TimeStepAtSensCoolPk(coolPeakDD); EXPECT_EQ(sysSizPeakDDNum.TimeStepAtTotCoolPk(coolPeakDD), timeStepIndexAtPeakCoolLoad); diff --git a/tst/EnergyPlus/unit/OutputReportTabular.unit.cc b/tst/EnergyPlus/unit/OutputReportTabular.unit.cc index 8f97d12ae42..122a0ec7450 100644 --- a/tst/EnergyPlus/unit/OutputReportTabular.unit.cc +++ b/tst/EnergyPlus/unit/OutputReportTabular.unit.cc @@ -7233,11 +7233,8 @@ TEST_F(SQLiteFixture, OutputReportTabular_WriteLoadComponentSummaryTables_AirLoo state->dataSize->NumSysSizInput = 1; state->dataSize->SysSizInput.allocate(state->dataSize->NumSysSizInput); state->dataSize->SysSizInput(1).AirLoopNum = 1; - state->dataSize->SysSizInput(1).SizingOption = DataSizing::NonCoincident; - auto degC_to_F = [](Real64 celsius) constexpr - { - return celsius * (9.0 / 5.0) + 32.0; - }; + state->dataSize->SysSizInput(1).SizingOption = DataSizing::Concurrence::NonCoincident; + auto degC_to_F = [](Real64 celsius) constexpr { return celsius * (9.0 / 5.0) + 32.0; }; constexpr Real64 coolMixTempSys = 26.2; constexpr Real64 coolMixTempSysIP = degC_to_F(coolMixTempSys); constexpr Real64 heatMixTempSys = -1.7;