Skip to content

Commit 75c69bb

Browse files
authored
Merge pull request #11104 from NREL/11061MissingNodesinWaterHeaterMixedErrorMessageLevel
Correct Error Message Level when Node Types are Undefined
2 parents 97e3209 + 51d6f61 commit 75c69bb

File tree

3 files changed

+44
-2
lines changed

3 files changed

+44
-2
lines changed

src/EnergyPlus/SimulationManager.cc

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2192,6 +2192,7 @@ namespace SimulationManager {
21922192
static constexpr std::string_view Format_723 =
21932193
"! <Zone Equipment Component>,<Component Count>,<Component Type>,<Component Name>,<Zone Name>,<Heating "
21942194
"Priority>,<Cooling Priority>";
2195+
bool nodeConnectionErrorFlag = false;
21952196

21962197
// Report outside air node names on the Branch-Node Details file
21972198
print(state.files.bnd, "{}\n", "! ===============================================================");
@@ -2256,12 +2257,13 @@ namespace SimulationManager {
22562257
"been retrieved.");
22572258
state.dataSimulationManager->WarningOut = false;
22582259
}
2259-
ShowWarningError(
2260+
ShowSevereError(
22602261
state,
22612262
format("Potential Node Connection Error for object {}, name={}", CType, state.dataBranchNodeConnections->CompSets(Count).CName));
22622263
ShowContinueError(state, " Node Types are still UNDEFINED -- See Branch/Node Details file for further information");
22632264
ShowContinueError(state, format(" Inlet Node : {}", state.dataBranchNodeConnections->CompSets(Count).InletNodeName));
22642265
ShowContinueError(state, format(" Outlet Node: {}", state.dataBranchNodeConnections->CompSets(Count).OutletNodeName));
2266+
nodeConnectionErrorFlag = true;
22652267
++state.dataBranchNodeConnections->NumNodeConnectionErrors;
22662268
}
22672269
}
@@ -2723,6 +2725,10 @@ namespace SimulationManager {
27232725
}
27242726

27252727
state.dataErrTracking->AskForConnectionsReport = false;
2728+
2729+
if (nodeConnectionErrorFlag) {
2730+
ShowFatalError(state, "Please see severe error(s) and correct either the branch nodes or the component nodes so that they match.");
2731+
}
27262732
}
27272733

27282734
void PostIPProcessing(EnergyPlusData &state)

testfiles/ASHRAE901_OfficeSmall_STD2019_Denver.idf

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5257,7 +5257,11 @@
52575257
1.205980747, !- On Cycle Loss Coefficient to Ambient Temperature {W/K}
52585258
, !- On Cycle Loss Fraction to Zone
52595259
4.048e-06, !- Peak Use Flow Rate {m3/s}
5260-
BLDG_SWH_SCH; !- Use Flow Rate Fraction Schedule Name
5260+
BLDG_SWH_SCH, !- Use Flow Rate Fraction Schedule Name
5261+
, !- Cold Water Supply Temperature Schedule Name
5262+
SHWSys1 Pump-SHWSys1 Water HeaterNode, !- Use Side Inlet Node Name
5263+
SHWSys1 Supply Equipment Outlet Node; !- Use Side Outlet Node Name
5264+
52615265

52625266
!- =========== ALL OBJECTS IN CLASS: PLANTLOOP ===========
52635267

tst/EnergyPlus/unit/SimulationManager.unit.cc

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050

5151
// EnergyPlus Headers
5252
#include "Fixtures/EnergyPlusFixture.hh"
53+
#include <EnergyPlus/DataBranchNodeConnections.hh>
5354
#include <EnergyPlus/DataEnvironment.hh>
5455
#include <EnergyPlus/DataGlobals.hh>
5556
#include <EnergyPlus/DataReportingFlags.hh>
@@ -551,3 +552,34 @@ TEST_F(EnergyPlusFixture, Test_SimulationControl_PureLoadCalc)
551552

552553
EXPECT_TRUE(compare_err_stream(error_string, true));
553554
}
555+
556+
TEST_F(EnergyPlusFixture, SimulationManager_ReportLoopConnectionsTest)
557+
{
558+
// Unit Test for Defect #11061: Test Error Message (modified level of message)
559+
state->dataBranchNodeConnections->NumCompSets = 1;
560+
state->dataBranchNodeConnections->CompSets.allocate(1);
561+
state->dataBranchNodeConnections->CompSets(1).ParentObjectType = DataLoopNode::ConnectionObjectType::WaterHeaterMixed;
562+
state->dataBranchNodeConnections->CompSets(1).ComponentObjectType = DataLoopNode::ConnectionObjectType::WaterHeaterMixed;
563+
state->dataBranchNodeConnections->CompSets(1).CName = "WaterHeaterMixed1";
564+
state->dataBranchNodeConnections->CompSets(1).ParentObjectType == DataLoopNode::ConnectionObjectType::Undefined;
565+
state->dataBranchNodeConnections->CompSets(1).InletNodeName = "MixedWaterHeater1Inlet";
566+
state->dataBranchNodeConnections->CompSets(1).OutletNodeName = "MixedWaterHeater1Outlet";
567+
state->dataSimulationManager->WarningOut = false;
568+
state->dataBranchNodeConnections->CompSets(1).Description = "UNDEFINED";
569+
570+
EXPECT_THROW(EnergyPlus::SimulationManager::ReportLoopConnections(*state), std::runtime_error);
571+
572+
std::string const error_string = delimited_string({
573+
" ** Severe ** Potential Node Connection Error for object WATERHEATER:MIXED, name=WaterHeaterMixed1",
574+
" ** ~~~ ** Node Types are still UNDEFINED -- See Branch/Node Details file for further information",
575+
" ** ~~~ ** Inlet Node : MixedWaterHeater1Inlet",
576+
" ** ~~~ ** Outlet Node: MixedWaterHeater1Outlet",
577+
" ************* There was 1 node connection error noted.",
578+
" ** Fatal ** Please see severe error(s) and correct either the branch nodes or the component nodes so that they match.",
579+
" ...Summary of Errors that led to program termination:",
580+
" ..... Reference severe error count=1",
581+
" ..... Last severe error=Potential Node Connection Error for object WATERHEATER:MIXED, name=WaterHeaterMixed1",
582+
});
583+
584+
EXPECT_TRUE(compare_err_stream(error_string, true));
585+
}

0 commit comments

Comments
 (0)