From a102526ea48c3e69dd3acaa5ce9cd6ab31e998a3 Mon Sep 17 00:00:00 2001 From: Rick Strand Date: Thu, 12 Jun 2025 15:59:51 -0500 Subject: [PATCH 1/4] Testing Out What Happens in the Test Suite Just a little experiment with our test suite to see if there are any other failures of this kind... --- src/EnergyPlus/SimulationManager.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/EnergyPlus/SimulationManager.cc b/src/EnergyPlus/SimulationManager.cc index d1d3790726c..d0071770554 100644 --- a/src/EnergyPlus/SimulationManager.cc +++ b/src/EnergyPlus/SimulationManager.cc @@ -2256,12 +2256,13 @@ namespace SimulationManager { "been retrieved."); state.dataSimulationManager->WarningOut = false; } - ShowWarningError( + ShowSevereError( state, format("Potential Node Connection Error for object {}, name={}", CType, state.dataBranchNodeConnections->CompSets(Count).CName)); ShowContinueError(state, " Node Types are still UNDEFINED -- See Branch/Node Details file for further information"); ShowContinueError(state, format(" Inlet Node : {}", state.dataBranchNodeConnections->CompSets(Count).InletNodeName)); ShowContinueError(state, format(" Outlet Node: {}", state.dataBranchNodeConnections->CompSets(Count).OutletNodeName)); + ShowFatalError(state, "Testing this out for funsies"); ++state.dataBranchNodeConnections->NumNodeConnectionErrors; } } From aad8987f18ebb3f7d61870b7f23b1b514629bb30 Mon Sep 17 00:00:00 2001 From: Rick Strand Date: Fri, 20 Jun 2025 09:08:55 -0500 Subject: [PATCH 2/4] Correction of message and IDF This commit corrects the temporary text of the fatal error. It also corrects the input file that now causes a severe/fatal error. This input file will have different results than develop because the node issue has been fixed in this input file. --- src/EnergyPlus/SimulationManager.cc | 2 +- testfiles/ASHRAE901_OfficeSmall_STD2019_Denver.idf | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/EnergyPlus/SimulationManager.cc b/src/EnergyPlus/SimulationManager.cc index d0071770554..bdbbab27732 100644 --- a/src/EnergyPlus/SimulationManager.cc +++ b/src/EnergyPlus/SimulationManager.cc @@ -2262,7 +2262,7 @@ namespace SimulationManager { ShowContinueError(state, " Node Types are still UNDEFINED -- See Branch/Node Details file for further information"); ShowContinueError(state, format(" Inlet Node : {}", state.dataBranchNodeConnections->CompSets(Count).InletNodeName)); ShowContinueError(state, format(" Outlet Node: {}", state.dataBranchNodeConnections->CompSets(Count).OutletNodeName)); - ShowFatalError(state, "Testing this out for funsies"); + ShowFatalError(state, "Please correct either the branch nodes or the component nodes so that they match."); ++state.dataBranchNodeConnections->NumNodeConnectionErrors; } } diff --git a/testfiles/ASHRAE901_OfficeSmall_STD2019_Denver.idf b/testfiles/ASHRAE901_OfficeSmall_STD2019_Denver.idf index 4ec20c9c9c3..965cb33ea14 100644 --- a/testfiles/ASHRAE901_OfficeSmall_STD2019_Denver.idf +++ b/testfiles/ASHRAE901_OfficeSmall_STD2019_Denver.idf @@ -5257,7 +5257,11 @@ 1.205980747, !- On Cycle Loss Coefficient to Ambient Temperature {W/K} , !- On Cycle Loss Fraction to Zone 4.048e-06, !- Peak Use Flow Rate {m3/s} - BLDG_SWH_SCH; !- Use Flow Rate Fraction Schedule Name + BLDG_SWH_SCH, !- Use Flow Rate Fraction Schedule Name + , !- Cold Water Supply Temperature Schedule Name + SHWSys1 Pump-SHWSys1 Water HeaterNode, !- Use Side Inlet Node Name + SHWSys1 Supply Equipment Outlet Node; !- Use Side Outlet Node Name + !- =========== ALL OBJECTS IN CLASS: PLANTLOOP =========== From 0999f4952772e37883edfed05647cfd32e4ec1bf Mon Sep 17 00:00:00 2001 From: Rick Strand Date: Fri, 20 Jun 2025 12:44:16 -0500 Subject: [PATCH 3/4] Unit Test for Error Message This unit test causes the error message that was changed and tests to make sure that it is being correctly reported at the correct level. --- tst/EnergyPlus/unit/SimulationManager.unit.cc | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/tst/EnergyPlus/unit/SimulationManager.unit.cc b/tst/EnergyPlus/unit/SimulationManager.unit.cc index 94acb66c1d5..c9063456316 100644 --- a/tst/EnergyPlus/unit/SimulationManager.unit.cc +++ b/tst/EnergyPlus/unit/SimulationManager.unit.cc @@ -50,6 +50,7 @@ // EnergyPlus Headers #include "Fixtures/EnergyPlusFixture.hh" +#include #include #include #include @@ -551,3 +552,33 @@ TEST_F(EnergyPlusFixture, Test_SimulationControl_PureLoadCalc) EXPECT_TRUE(compare_err_stream(error_string, true)); } + +TEST_F(EnergyPlusFixture, SimulationManager_ReportLoopConnectionsTest) +{ + // Unit Test for Defect #11061: Test Error Message (modified level of message) + state->dataBranchNodeConnections->NumCompSets = 1; + state->dataBranchNodeConnections->CompSets.allocate(1); + state->dataBranchNodeConnections->CompSets(1).ParentObjectType = DataLoopNode::ConnectionObjectType::WaterHeaterMixed; + state->dataBranchNodeConnections->CompSets(1).ComponentObjectType = DataLoopNode::ConnectionObjectType::WaterHeaterMixed; + state->dataBranchNodeConnections->CompSets(1).CName = "WaterHeaterMixed1"; + state->dataBranchNodeConnections->CompSets(1).ParentObjectType == DataLoopNode::ConnectionObjectType::Undefined; + state->dataBranchNodeConnections->CompSets(1).InletNodeName = "MixedWaterHeater1Inlet"; + state->dataBranchNodeConnections->CompSets(1).OutletNodeName = "MixedWaterHeater1Outlet"; + state->dataSimulationManager->WarningOut = false; + state->dataBranchNodeConnections->CompSets(1).Description = "UNDEFINED"; + + EXPECT_THROW(EnergyPlus::SimulationManager::ReportLoopConnections(*state), std::runtime_error); + + std::string const error_string = delimited_string({ + " ** Severe ** Potential Node Connection Error for object WATERHEATER:MIXED, name=WaterHeaterMixed1", + " ** ~~~ ** Node Types are still UNDEFINED -- See Branch/Node Details file for further information", + " ** ~~~ ** Inlet Node : MixedWaterHeater1Inlet", + " ** ~~~ ** Outlet Node: MixedWaterHeater1Outlet", + " ** Fatal ** Please correct either the branch nodes or the component nodes so that they match.", + " ...Summary of Errors that led to program termination:", + " ..... Reference severe error count=1", + " ..... Last severe error=Potential Node Connection Error for object WATERHEATER:MIXED, name=WaterHeaterMixed1", + }); + + EXPECT_TRUE(compare_err_stream(error_string, true)); +} From ee7138b3e4e109a0d751d69ceefe96835ce0f070 Mon Sep 17 00:00:00 2001 From: Rick Strand Date: Mon, 7 Jul 2025 13:06:50 -0500 Subject: [PATCH 4/4] Correction based on Reviewer Comment Corrected a problem where the original IDF that revealed the problem was crashing after the fix was made. This commit corrects the problem and updates the unit test to reflect this change. --- src/EnergyPlus/SimulationManager.cc | 7 ++++++- tst/EnergyPlus/unit/SimulationManager.unit.cc | 3 ++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/EnergyPlus/SimulationManager.cc b/src/EnergyPlus/SimulationManager.cc index bdbbab27732..392166f1db9 100644 --- a/src/EnergyPlus/SimulationManager.cc +++ b/src/EnergyPlus/SimulationManager.cc @@ -2192,6 +2192,7 @@ namespace SimulationManager { static constexpr std::string_view Format_723 = "! ,,,,,,"; + bool nodeConnectionErrorFlag = false; // Report outside air node names on the Branch-Node Details file print(state.files.bnd, "{}\n", "! ==============================================================="); @@ -2262,7 +2263,7 @@ namespace SimulationManager { ShowContinueError(state, " Node Types are still UNDEFINED -- See Branch/Node Details file for further information"); ShowContinueError(state, format(" Inlet Node : {}", state.dataBranchNodeConnections->CompSets(Count).InletNodeName)); ShowContinueError(state, format(" Outlet Node: {}", state.dataBranchNodeConnections->CompSets(Count).OutletNodeName)); - ShowFatalError(state, "Please correct either the branch nodes or the component nodes so that they match."); + nodeConnectionErrorFlag = true; ++state.dataBranchNodeConnections->NumNodeConnectionErrors; } } @@ -2724,6 +2725,10 @@ namespace SimulationManager { } state.dataErrTracking->AskForConnectionsReport = false; + + if (nodeConnectionErrorFlag) { + ShowFatalError(state, "Please see severe error(s) and correct either the branch nodes or the component nodes so that they match."); + } } void PostIPProcessing(EnergyPlusData &state) diff --git a/tst/EnergyPlus/unit/SimulationManager.unit.cc b/tst/EnergyPlus/unit/SimulationManager.unit.cc index c9063456316..bb7513fcabc 100644 --- a/tst/EnergyPlus/unit/SimulationManager.unit.cc +++ b/tst/EnergyPlus/unit/SimulationManager.unit.cc @@ -574,7 +574,8 @@ TEST_F(EnergyPlusFixture, SimulationManager_ReportLoopConnectionsTest) " ** ~~~ ** Node Types are still UNDEFINED -- See Branch/Node Details file for further information", " ** ~~~ ** Inlet Node : MixedWaterHeater1Inlet", " ** ~~~ ** Outlet Node: MixedWaterHeater1Outlet", - " ** Fatal ** Please correct either the branch nodes or the component nodes so that they match.", + " ************* There was 1 node connection error noted.", + " ** Fatal ** Please see severe error(s) and correct either the branch nodes or the component nodes so that they match.", " ...Summary of Errors that led to program termination:", " ..... Reference severe error count=1", " ..... Last severe error=Potential Node Connection Error for object WATERHEATER:MIXED, name=WaterHeaterMixed1",