Skip to content
10 changes: 2 additions & 8 deletions src/EnergyPlus/Autosizing/WaterHeatingCoilUASizing.cc
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ Real64 WaterHeatingCoilUASizer::size(EnergyPlusData &state, Real64 _originalValu
};
General::SolveRoot(state, Acc, MaxIte, SolFla, this->autoSizedValue, f, UA0, UA1);
if (SolFla == -1) {
errorsFound = true;
std::string msg = "Autosizing of heating coil UA failed for Coil:Heating:Water \"" + this->compName + "\"";
this->addErrorMessage(msg);
ShowSevereError(state, msg);
Expand Down Expand Up @@ -141,10 +140,7 @@ Real64 WaterHeatingCoilUASizer::size(EnergyPlusData &state, Real64 _originalValu
this->addErrorMessage(msg);
ShowContinueError(state, msg);
}
this->dataErrorsFound = true;
} else if (SolFla == -2) {
this->errorType = AutoSizingResultType::ErrorType1;
errorsFound = true;
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Failed SolveRoot with a -1 for iterations exceeded or -2 for bad limits are now not an error but instead a diagnostic, with messages and sizing data to aid the user in a resolution,

std::string msg = "Autosizing of heating coil UA failed for Coil:Heating:Water \"" + this->compName + "\"";
this->addErrorMessage(msg);
ShowSevereError(state, msg);
Expand Down Expand Up @@ -217,7 +213,7 @@ Real64 WaterHeatingCoilUASizer::size(EnergyPlusData &state, Real64 _originalValu
this->addErrorMessage(msg);
ShowContinueError(state, msg);
}
this->dataErrorsFound = true;
this->autoSizedValue = UA1;
}
} else {
this->autoSizedValue = 1.0;
Expand Down Expand Up @@ -258,7 +254,6 @@ Real64 WaterHeatingCoilUASizer::size(EnergyPlusData &state, Real64 _originalValu
};
General::SolveRoot(state, Acc, MaxIte, SolFla, this->autoSizedValue, f, UA0, UA1);
if (SolFla == -1) {
errorsFound = true;
std::string msg = "Autosizing of heating coil UA failed for Coil:Heating:Water \"" + this->compName + "\"";
this->addErrorMessage(msg);
ShowSevereError(state, msg);
Expand Down Expand Up @@ -301,7 +296,6 @@ Real64 WaterHeatingCoilUASizer::size(EnergyPlusData &state, Real64 _originalValu
this->addErrorMessage(msg);
ShowContinueError(state, msg);
}
this->dataErrorsFound = true;
} else if (SolFla == -2) {
this->errorType = AutoSizingResultType::ErrorType1;
errorsFound = true;
Expand Down Expand Up @@ -361,7 +355,7 @@ Real64 WaterHeatingCoilUASizer::size(EnergyPlusData &state, Real64 _originalValu
this->addErrorMessage(msg);
ShowContinueError(state, msg);
}
this->dataErrorsFound = true;
this->autoSizedValue = UA1;
}
} else {
this->autoSizedValue = 1.0;
Expand Down
38 changes: 37 additions & 1 deletion src/EnergyPlus/SingleDuct.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3000,7 +3000,43 @@ void SingleDuctAirTerminal::SizeSys(EnergyPlusData &state)
}
}
}

if (state.dataSize->TermUnitFinalZoneSizing.size() > 0 && this->DamperHeatingAction == Action::ReverseWithLimits &&
TermUnitSizing(state.dataSize->CurTermUnitSizingNum).AirVolFlow <
state.dataSize->TermUnitFinalZoneSizing(state.dataSize->CurTermUnitSizingNum).DesHeatVolFlow) {
ShowMessage(state, format("SizeHVACSingleDuct: Potential issue with equipment sizing for {} = \"{}\".", this->sysType, this->SysName));
ShowContinueError(state,
format("Terminal unit design air flow rate during Reheat of {:.5R} [m3/s]",
TermUnitSizing(state.dataSize->CurTermUnitSizingNum).AirVolFlow));
ShowContinueError(state,
format("is less than the zone design heating air flow rate of {:.5R} [m3/s]",
state.dataSize->TermUnitFinalZoneSizing(state.dataSize->CurTermUnitSizingNum).DesHeatVolFlow));
ShowContinueError(state,
format("For reference the zone design cooling air flow rate is {:.5R} [m3/s]",
state.dataSize->TermUnitFinalZoneSizing(state.dataSize->CurTermUnitSizingNum).DesCoolVolFlow));
ShowContinueError(state,
format("For reference the zone design minimum cooling air flow rate is {:.5R} [m3/s]",
state.dataSize->TermUnitFinalZoneSizing(state.dataSize->CurTermUnitSizingNum).DesCoolVolFlowMin));
int zoneNum = state.dataSize->TermUnitFinalZoneSizing(state.dataSize->CurTermUnitSizingNum).ZoneNum;
if (zoneNum > 0) {
int SizingInputNum =
Util::FindItemInList(state.dataHeatBal->Zone(zoneNum).Name, state.dataSize->ZoneSizingInput, &ZoneSizingInputData::ZoneName);
if (SizingInputNum == 0) {
SizingInputNum = 1;
}
if (state.dataSize->ZoneSizingInput.size() > 0 && state.dataSize->ZoneSizingInput(SizingInputNum).DesHeatMaxAirFlowFrac < 1.0) {
ShowContinueError(state,
format("Sizing:Zone Heating Maximum Air Flow Fraction = {:.5R}",
state.dataSize->ZoneSizingInput(SizingInputNum).DesHeatMaxAirFlowFrac));
ShowContinueError(state,
format("Sizing:Zone Heating Maximum Air Flow per Zone Floor Area = {:.5R} [m3/s/m2]",
state.dataSize->ZoneSizingInput(SizingInputNum).DesHeatMaxAirFlowPerArea));
ShowContinueError(state,
format("For reference the zone design maximum heating air flow rate is {:.5R} [m3/s]",
state.dataSize->TermUnitFinalZoneSizing(state.dataSize->CurTermUnitSizingNum).DesHeatVolFlowMax));
}
}
ShowContinueError(state, "Verify that the values entered are intended and are consistent with other components.");
}
if (TermUnitSizing(state.dataSize->CurTermUnitSizingNum).AirVolFlow > SmallAirVolFlow) {
if (this->DamperHeatingAction == Action::ReverseWithLimits) {
TermUnitSizing(state.dataSize->CurTermUnitSizingNum).ReheatAirFlowMult =
Expand Down
16 changes: 8 additions & 8 deletions tst/EnergyPlus/unit/Autosizing/WaterHeatingCoilUASizing.unit.cc
Original file line number Diff line number Diff line change
Expand Up @@ -176,12 +176,12 @@ TEST_F(AutoSizingFixture, WaterHeatingCoilUASizingGauntlet)
state->dataSize->ZoneSizingInput(1).ZoneNum = 1;
sizer.initializeWithinEP(*this->state, HVAC::cAllCoilTypes(HVAC::Coil_HeatingWater), "MyWaterCoil", printFlag, routineName);
sizedValue = sizer.size(*state, inputValue, errorsFound);
EXPECT_TRUE(errorsFound);
EXPECT_TRUE(state->dataSize->DataErrorsFound);
EXPECT_TRUE(sizer.dataErrorsFound);
EXPECT_ENUM_EQ(AutoSizingResultType::ErrorType1, sizer.errorType);
EXPECT_FALSE(errorsFound);
EXPECT_FALSE(state->dataSize->DataErrorsFound);
EXPECT_FALSE(sizer.dataErrorsFound);
EXPECT_ENUM_EQ(AutoSizingResultType::NoError, sizer.errorType);
EXPECT_TRUE(sizer.wasAutoSized);
EXPECT_NEAR(3.0, sizedValue, 0.01); // 0.1% of 3000 W capacity
EXPECT_NEAR(3000.0, sizedValue, 0.01); // 100% of 3000 W capacity
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

If HW coil UA sizing fails with -2, the maximum UA limit is now used to size the coil. Previously the lower limit was used (because that's what gets returned from SolveRoot when that function fails with -2) and the coil was severely undersized (with associated error and a fatal).

state->dataWaterCoils->WaterCoil(1).InletAirTemp = 21.0;
state->dataSize->DataErrorsFound = false;
sizer.dataErrorsFound = false;
Expand Down Expand Up @@ -272,9 +272,9 @@ TEST_F(AutoSizingFixture, WaterHeatingCoilUASizingGauntlet)
EXPECT_ENUM_EQ(AutoSizingResultType::ErrorType1, sizer.errorType);
EXPECT_TRUE(sizer.wasAutoSized);
EXPECT_TRUE(errorsFound);
EXPECT_TRUE(state->dataSize->DataErrorsFound);
EXPECT_TRUE(sizer.dataErrorsFound);
EXPECT_NEAR(3.0, sizedValue, 0.01); // 0.1% of 3000 W capacity
EXPECT_FALSE(state->dataSize->DataErrorsFound);
EXPECT_FALSE(sizer.dataErrorsFound);
EXPECT_NEAR(3000.0, sizedValue, 0.01); // 100% of 3000 W capacity
state->dataWaterCoils->WaterCoil(1).InletAirTemp = 21.0;
state->dataSize->DataErrorsFound = false;
sizer.dataErrorsFound = false;
Expand Down
Loading