Skip to content

Commit

Permalink
Fix and rollback
Browse files Browse the repository at this point in the history
  • Loading branch information
mjwitte committed Jun 19, 2024
1 parent dd05f9b commit c8aa4b3
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 39 deletions.
30 changes: 15 additions & 15 deletions src/EnergyPlus/DataSizing.hh
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/EnergyPlus/OutputReportTabular.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
12 changes: 6 additions & 6 deletions src/EnergyPlus/ReportCoilSelection.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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;
}
}
Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -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;
}
}
Expand Down
14 changes: 7 additions & 7 deletions src/EnergyPlus/SimAirServingZones.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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);
}
Expand Down Expand Up @@ -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);
}
Expand Down
8 changes: 4 additions & 4 deletions src/EnergyPlus/SizingManager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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
Expand Down Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion tst/EnergyPlus/unit/DesiccantDehumidifiers.unit.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
7 changes: 2 additions & 5 deletions tst/EnergyPlus/unit/OutputReportTabular.unit.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

5 comments on commit c8aa4b3

@nrel-bot
Copy link

Choose a reason for hiding this comment

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

SpaceSizingHVACPart4 (mjwitte) - Win64-Windows-10-VisualStudio-16: OK (2808 of 2808 tests passed, 0 test warnings)

Build Badge Test Badge

@nrel-bot-3
Copy link

Choose a reason for hiding this comment

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

SpaceSizingHVACPart4 (mjwitte) - x86_64-MacOS-10.18-clang-15.0.0: OK (3597 of 3597 tests passed, 0 test warnings)

Build Badge Test 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.

SpaceSizingHVACPart4 (mjwitte) - x86_64-Linux-Ubuntu-22.04-gcc-11.4: OK (3638 of 3638 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.

SpaceSizingHVACPart4 (mjwitte) - x86_64-Linux-Ubuntu-22.04-gcc-11.4-IntegrationCoverage-Debug: OK (792 of 792 tests passed, 0 test warnings)

Build Badge Test Badge Coverage 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.

SpaceSizingHVACPart4 (mjwitte) - x86_64-Linux-Ubuntu-22.04-gcc-11.4-UnitTestsCoverage-Debug: OK (2019 of 2019 tests passed, 0 test warnings)

Build Badge Test Badge Coverage Badge

Please sign in to comment.