From 9e6fe4b21f3f26f5ca4cac916a24b90177aa9b13 Mon Sep 17 00:00:00 2001 From: KarenWGard Date: Thu, 31 Aug 2023 15:32:42 -0400 Subject: [PATCH 1/8] when the heat pump is air source, there isn't currently a check to make sure that the inlet node and outlet node are different nodes. (defect 9740) --- src/EnergyPlus/PlantLoopHeatPumpEIR.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/EnergyPlus/PlantLoopHeatPumpEIR.cc b/src/EnergyPlus/PlantLoopHeatPumpEIR.cc index 815735f5c38..961e6a3b8eb 100644 --- a/src/EnergyPlus/PlantLoopHeatPumpEIR.cc +++ b/src/EnergyPlus/PlantLoopHeatPumpEIR.cc @@ -1272,7 +1272,6 @@ void EIRPlantLoopHeatPump::processInputForEIRPLHP(EnergyPlusData &state) std::string condenserType = UtilityRoutines::makeUPPER(fields.at("condenser_type").get()); std::string sourceSideInletNodeName = UtilityRoutines::makeUPPER(fields.at("source_side_inlet_node_name").get()); std::string sourceSideOutletNodeName = UtilityRoutines::makeUPPER(fields.at("source_side_outlet_node_name").get()); - thisPLHP.companionCoilName = UtilityRoutines::makeUPPER( state.dataInputProcessing->inputProcessor->getAlphaFieldValue(fields, schemaProps, "companion_heat_pump_name")); @@ -1471,6 +1470,12 @@ void EIRPlantLoopHeatPump::processInputForEIRPLHP(EnergyPlusData &state) condenserNodeType = DataLoopNode::NodeFluidType::Air; condenserNodeConnectionType_Inlet = DataLoopNode::ConnectionType::OutsideAir; condenserNodeConnectionType_Outlet = DataLoopNode::ConnectionType::OutsideAir; + if (sourceSideInletNodeName == sourceSideOutletNodeName) { + ShowSevereError(state, format("PlantLoopHeatPump {} has the same inlet and outlet node.", thisObjectName)); + ShowContinueError(state, format("Node Name: {}", sourceSideInletNodeName)); + ShowFatalError(state, "Previous condition causes termination."); + errorsFound = true; + } } else { // Again, this should be protected by the input processor ShowErrorMessage( From 74aa3be7a99bbb6c4b1152dd5121ab2c9b2badf1 Mon Sep 17 00:00:00 2001 From: KarenWGard Date: Thu, 31 Aug 2023 16:13:12 -0400 Subject: [PATCH 2/8] develop unit test to check for fatal error if source nodes are the same --- .../unit/PlantLoopHeatPumpEIR.unit.cc | 65 +++++++++++++++++++ 1 file changed, 65 insertions(+) diff --git a/tst/EnergyPlus/unit/PlantLoopHeatPumpEIR.unit.cc b/tst/EnergyPlus/unit/PlantLoopHeatPumpEIR.unit.cc index d8296ee0b0e..73f27dd30c5 100644 --- a/tst/EnergyPlus/unit/PlantLoopHeatPumpEIR.unit.cc +++ b/tst/EnergyPlus/unit/PlantLoopHeatPumpEIR.unit.cc @@ -400,6 +400,70 @@ TEST_F(EnergyPlusFixture, CatchErrorsOnBadCurves) EXPECT_THROW(EIRPlantLoopHeatPump::factory(*state, DataPlant::PlantEquipmentType::HeatPumpEIRCooling, "HP COOLING SIDE"), std::runtime_error); } +TEST_F(EnergyPlusFixture, processInputForEIRPLHP_TestAirSourceDuplicateNodes) +{ + std::string const idf_objects = delimited_string({"HeatPump:PlantLoop:EIR:Cooling,", + " hp cooling side,", + " node 1,", + " node 2,", + " AirSource,", + " node 3,", + " node 3,", + " ,", + " 0.001,", + " 0.001,", + " 1000,", + " 3.14,", + " ,", + " dummyCurve,", + " dummyCurve,", + " dummyCurve;", + "Curve:Linear,", + " dummyCurve,", + " 1,", + " 0,", + " 1,", + " 1;"}); + ASSERT_TRUE(process_idf(idf_objects)); + + // set up the plant loops + // first the load side + state->dataPlnt->TotNumLoops = 2; + state->dataPlnt->PlantLoop.allocate(2); + + state->dataPlnt->PlantLoop(1).LoopSide(DataPlant::LoopSideLocation::Supply).TotalBranches = 1; + state->dataPlnt->PlantLoop(1).LoopSide(DataPlant::LoopSideLocation::Supply).Branch.allocate(1); + state->dataPlnt->PlantLoop(1).LoopSide(DataPlant::LoopSideLocation::Supply).Branch(1).TotalComponents = 1; + state->dataPlnt->PlantLoop(1).LoopSide(DataPlant::LoopSideLocation::Supply).Branch(1).Comp.allocate(1); + auto &PLHPPlantLoadSideComp = state->dataPlnt->PlantLoop(1).LoopSide(DataPlant::LoopSideLocation::Supply).Branch(1).Comp(1); + PLHPPlantLoadSideComp.Type = DataPlant::PlantEquipmentType::HeatPumpEIRCooling; + // then the source side + + state->dataPlnt->PlantLoop(2).LoopSide(DataPlant::LoopSideLocation::Demand).TotalBranches = 1; + state->dataPlnt->PlantLoop(2).LoopSide(DataPlant::LoopSideLocation::Demand).Branch.allocate(1); + state->dataPlnt->PlantLoop(2).LoopSide(DataPlant::LoopSideLocation::Demand).Branch(1).TotalComponents = 1; + state->dataPlnt->PlantLoop(2).LoopSide(DataPlant::LoopSideLocation::Demand).Branch(1).Comp.allocate(1); + auto &PLHPPlantLoadSourceComp = state->dataPlnt->PlantLoop(2).LoopSide(DataPlant::LoopSideLocation::Demand).Branch(1).Comp(1); + PLHPPlantLoadSourceComp.Type = DataPlant::PlantEquipmentType::HeatPumpEIRCooling; + + // the init call expects a "from" calling point + PlantLocation myLocation = PlantLocation(1, DataPlant::LoopSideLocation::Supply, 1, 1); + + // call the factory with a valid name to trigger reading inputs + // expects fatal error due to same node names + EXPECT_THROW(EIRPlantLoopHeatPump::factory(*state, DataPlant::PlantEquipmentType::HeatPumpEIRCooling, "HP COOLING SIDE");, std::runtime_error); + // expect error related to same node names + std::string error_msg = delimited_string({ + " ** Severe ** PlantLoopHeatPump hp cooling side has the same inlet and outlet node.", + " ** ~~~ ** Node Name: NODE 3", + " ** Fatal ** Previous condition causes termination.", + " ...Summary of Errors that led to program termination:", + " ..... Reference severe error count=1", + " ..... Last severe error=PlantLoopHeatPump hp cooling side has the same inlet and outlet node.", + }); + EXPECT_TRUE(compare_err_stream(error_msg)); +} + TEST_F(EnergyPlusFixture, Initialization) { std::string const idf_objects = delimited_string({"HeatPump:PlantLoop:EIR:Cooling,", @@ -500,6 +564,7 @@ TEST_F(EnergyPlusFixture, Initialization) EXPECT_NEAR(expectedSourceSideMassFlow, state->dataLoopNodes->Node(thisCoolingPLHP->sourceSideNodes.inlet).MassFlowRateMaxAvail, flowTol); } + TEST_F(EnergyPlusFixture, TestSizing_FullyAutosizedCoolingWithCompanion_WaterSource) { std::string const idf_objects = delimited_string({"HeatPump:PlantLoop:EIR:Cooling,", From 125b5d50ba82ea679959e3db7b31ef5f5f1114ab Mon Sep 17 00:00:00 2001 From: KarenWGard Date: Fri, 1 Sep 2023 18:01:53 -0400 Subject: [PATCH 3/8] provide severe error if the OA Inlet node is not an OutdoorAirNode. & create unit test to to check for the error --- src/EnergyPlus/PlantLoopHeatPumpEIR.cc | 10 +++ .../unit/PlantLoopHeatPumpEIR.unit.cc | 72 +++++++++++++++++-- 2 files changed, 76 insertions(+), 6 deletions(-) diff --git a/src/EnergyPlus/PlantLoopHeatPumpEIR.cc b/src/EnergyPlus/PlantLoopHeatPumpEIR.cc index 961e6a3b8eb..3598b9db5b0 100644 --- a/src/EnergyPlus/PlantLoopHeatPumpEIR.cc +++ b/src/EnergyPlus/PlantLoopHeatPumpEIR.cc @@ -74,6 +74,7 @@ #include #include #include +#include namespace EnergyPlus::EIRPlantLoopHeatPumps { @@ -1491,6 +1492,15 @@ void EIRPlantLoopHeatPump::processInputForEIRPLHP(EnergyPlusData &state) condenserNodeConnectionType_Inlet, NodeInputManager::CompFluidStream::Secondary, DataLoopNode::ObjectIsNotParent); + if (condenserNodeType == DataLoopNode::NodeFluidType::Air) { + if (!OutAirNodeManager::CheckOutAirNodeNumber(state, thisPLHP.sourceSideNodes.inlet)) { + ShowSevereError( + state, + format( + "Air Source PlantLoop:HeatPump: {} inlet node: {} is not an OutdoorAir:Node.", thisPLHP.name, sourceSideInletNodeName)); + ShowContinueError(state, "Confirm that this is the intended source for the outdoor air stream."); + } + } thisPLHP.sourceSideNodes.outlet = NodeInputManager::GetOnlySingleNode(state, sourceSideOutletNodeName, nodeErrorsFound, diff --git a/tst/EnergyPlus/unit/PlantLoopHeatPumpEIR.unit.cc b/tst/EnergyPlus/unit/PlantLoopHeatPumpEIR.unit.cc index 73f27dd30c5..856ac5a6744 100644 --- a/tst/EnergyPlus/unit/PlantLoopHeatPumpEIR.unit.cc +++ b/tst/EnergyPlus/unit/PlantLoopHeatPumpEIR.unit.cc @@ -335,15 +335,15 @@ TEST_F(EnergyPlusFixture, CoolingConstructionFullyAutoSized_WaterSource) " hp cooling side,", " node 1,", " node 2,", - " WaterSource,", + " AirSource,", + " node 3,", " node 3,", - " node 4,", " ,", - " Autosize,", - " Autosize,", - " Autosize,", + " 0.001,", + " 0.001,", + " 1000,", + " 3.14,", " ,", - " 1,", " dummyCurve,", " dummyCurve,", " dummyCurve;", @@ -464,6 +464,66 @@ TEST_F(EnergyPlusFixture, processInputForEIRPLHP_TestAirSourceDuplicateNodes) EXPECT_TRUE(compare_err_stream(error_msg)); } +TEST_F(EnergyPlusFixture, processInputForEIRPLHP_TestAirSourceNoOANode) +{ + std::string const idf_objects = delimited_string({"HeatPump:PlantLoop:EIR:Cooling,", + " hp cooling side,", + " node 1,", + " node 2,", + " AirSource,", + " node 3,", + " node 4,", + " ,", + " Autosize,", + " Autosize,", + " Autosize,", + " 1.0,", + " 1,", + " dummyCurve,", + " dummyCurve,", + " dummyCurve;", + "Curve:Linear,", + " dummyCurve,", + " 1,", + " 0,", + " 1,", + " 1;"}); + ASSERT_TRUE(process_idf(idf_objects)); + + // set up the plant loops + // first the load side + state->dataPlnt->TotNumLoops = 2; + state->dataPlnt->PlantLoop.allocate(2); + + state->dataPlnt->PlantLoop(1).LoopSide(DataPlant::LoopSideLocation::Supply).TotalBranches = 1; + state->dataPlnt->PlantLoop(1).LoopSide(DataPlant::LoopSideLocation::Supply).Branch.allocate(1); + state->dataPlnt->PlantLoop(1).LoopSide(DataPlant::LoopSideLocation::Supply).Branch(1).TotalComponents = 1; + state->dataPlnt->PlantLoop(1).LoopSide(DataPlant::LoopSideLocation::Supply).Branch(1).Comp.allocate(1); + auto &PLHPPlantLoadSideComp = state->dataPlnt->PlantLoop(1).LoopSide(DataPlant::LoopSideLocation::Supply).Branch(1).Comp(1); + PLHPPlantLoadSideComp.Type = DataPlant::PlantEquipmentType::HeatPumpEIRCooling; + // then the source side + + state->dataPlnt->PlantLoop(2).LoopSide(DataPlant::LoopSideLocation::Demand).TotalBranches = 1; + state->dataPlnt->PlantLoop(2).LoopSide(DataPlant::LoopSideLocation::Demand).Branch.allocate(1); + state->dataPlnt->PlantLoop(2).LoopSide(DataPlant::LoopSideLocation::Demand).Branch(1).TotalComponents = 1; + state->dataPlnt->PlantLoop(2).LoopSide(DataPlant::LoopSideLocation::Demand).Branch(1).Comp.allocate(1); + auto &PLHPPlantLoadSourceComp = state->dataPlnt->PlantLoop(2).LoopSide(DataPlant::LoopSideLocation::Demand).Branch(1).Comp(1); + PLHPPlantLoadSourceComp.Type = DataPlant::PlantEquipmentType::HeatPumpEIRCooling; + + // the init call expects a "from" calling point + PlantLocation myLocation = PlantLocation(1, DataPlant::LoopSideLocation::Supply, 1, 1); + + // call the factory with a valid name to trigger reading inputs + // expects fatal error due to same node names + EIRPlantLoopHeatPump::factory(*state, DataPlant::PlantEquipmentType::HeatPumpEIRCooling, "HP COOLING SIDE"); + // expect error related to same node names + std::string error_msg = delimited_string({ + " ** Severe ** Air Source PlantLoop:HeatPump: HP COOLING SIDE inlet node: NODE 3 is not an OutdoorAir:Node.", + " ** ~~~ ** Confirm that this is the intended source for the outdoor air stream.", + }); + EXPECT_TRUE(compare_err_stream(error_msg)); +} + TEST_F(EnergyPlusFixture, Initialization) { std::string const idf_objects = delimited_string({"HeatPump:PlantLoop:EIR:Cooling,", From 1781aace28dd3c9eb80bc6dc8425ebc0188a5829 Mon Sep 17 00:00:00 2001 From: KarenWGard Date: Sat, 2 Sep 2023 05:50:15 -0400 Subject: [PATCH 4/8] this unit test got polluted in the last commit - reverted. --- .../unit/PlantLoopHeatPumpEIR.unit.cc | 29 +++++++++---------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/tst/EnergyPlus/unit/PlantLoopHeatPumpEIR.unit.cc b/tst/EnergyPlus/unit/PlantLoopHeatPumpEIR.unit.cc index 856ac5a6744..3fa495a8347 100644 --- a/tst/EnergyPlus/unit/PlantLoopHeatPumpEIR.unit.cc +++ b/tst/EnergyPlus/unit/PlantLoopHeatPumpEIR.unit.cc @@ -65,6 +65,7 @@ #include #include #include +#include using namespace EnergyPlus; using namespace EnergyPlus::EIRPlantLoopHeatPumps; @@ -335,15 +336,15 @@ TEST_F(EnergyPlusFixture, CoolingConstructionFullyAutoSized_WaterSource) " hp cooling side,", " node 1,", " node 2,", - " AirSource,", - " node 3,", + " WaterSource,", " node 3,", + " node 4,", " ,", - " 0.001,", - " 0.001,", - " 1000,", - " 3.14,", + " Autosize,", + " Autosize,", + " Autosize,", " ,", + " 1,", " dummyCurve,", " dummyCurve,", " dummyCurve;", @@ -464,7 +465,7 @@ TEST_F(EnergyPlusFixture, processInputForEIRPLHP_TestAirSourceDuplicateNodes) EXPECT_TRUE(compare_err_stream(error_msg)); } -TEST_F(EnergyPlusFixture, processInputForEIRPLHP_TestAirSourceNoOANode) +TEST_F(EnergyPlusFixture, processInputForEIRPLHP_TestAirSourceOANode) { std::string const idf_objects = delimited_string({"HeatPump:PlantLoop:EIR:Cooling,", " hp cooling side,", @@ -487,7 +488,9 @@ TEST_F(EnergyPlusFixture, processInputForEIRPLHP_TestAirSourceNoOANode) " 1,", " 0,", " 1,", - " 1;"}); + " 1;", + "OutdoorAir:NodeList,", + " node 3;"}); ASSERT_TRUE(process_idf(idf_objects)); // set up the plant loops @@ -512,16 +515,12 @@ TEST_F(EnergyPlusFixture, processInputForEIRPLHP_TestAirSourceNoOANode) // the init call expects a "from" calling point PlantLocation myLocation = PlantLocation(1, DataPlant::LoopSideLocation::Supply, 1, 1); - + // setup the outdoor air nodes + OutAirNodeManager::SetOutAirNodes(*state); // call the factory with a valid name to trigger reading inputs // expects fatal error due to same node names EIRPlantLoopHeatPump::factory(*state, DataPlant::PlantEquipmentType::HeatPumpEIRCooling, "HP COOLING SIDE"); - // expect error related to same node names - std::string error_msg = delimited_string({ - " ** Severe ** Air Source PlantLoop:HeatPump: HP COOLING SIDE inlet node: NODE 3 is not an OutdoorAir:Node.", - " ** ~~~ ** Confirm that this is the intended source for the outdoor air stream.", - }); - EXPECT_TRUE(compare_err_stream(error_msg)); + EXPECT_TRUE(compare_err_stream("")); } TEST_F(EnergyPlusFixture, Initialization) From 0dd64a201872e293842fa64f2328c812550c6050 Mon Sep 17 00:00:00 2001 From: KarenWGard Date: Sat, 2 Sep 2023 05:50:41 -0400 Subject: [PATCH 5/8] craete unit test to make sure that no errors are generated if the OA Inlet node is, in fact an OutdoorAirNode --- .../unit/PlantLoopHeatPumpEIR.unit.cc | 60 +++++++++++++++++++ 1 file changed, 60 insertions(+) diff --git a/tst/EnergyPlus/unit/PlantLoopHeatPumpEIR.unit.cc b/tst/EnergyPlus/unit/PlantLoopHeatPumpEIR.unit.cc index 3fa495a8347..8d53084f6d2 100644 --- a/tst/EnergyPlus/unit/PlantLoopHeatPumpEIR.unit.cc +++ b/tst/EnergyPlus/unit/PlantLoopHeatPumpEIR.unit.cc @@ -523,6 +523,66 @@ TEST_F(EnergyPlusFixture, processInputForEIRPLHP_TestAirSourceOANode) EXPECT_TRUE(compare_err_stream("")); } +TEST_F(EnergyPlusFixture, processInputForEIRPLHP_TestAirSourceNoOANode) +{ + std::string const idf_objects = delimited_string({"HeatPump:PlantLoop:EIR:Cooling,", + " hp cooling side,", + " node 1,", + " node 2,", + " AirSource,", + " node 3,", + " node 4,", + " ,", + " Autosize,", + " Autosize,", + " Autosize,", + " 1.0,", + " 1,", + " dummyCurve,", + " dummyCurve,", + " dummyCurve;", + "Curve:Linear,", + " dummyCurve,", + " 1,", + " 0,", + " 1,", + " 1;"}); + ASSERT_TRUE(process_idf(idf_objects)); + + // set up the plant loops + // first the load side + state->dataPlnt->TotNumLoops = 2; + state->dataPlnt->PlantLoop.allocate(2); + + state->dataPlnt->PlantLoop(1).LoopSide(DataPlant::LoopSideLocation::Supply).TotalBranches = 1; + state->dataPlnt->PlantLoop(1).LoopSide(DataPlant::LoopSideLocation::Supply).Branch.allocate(1); + state->dataPlnt->PlantLoop(1).LoopSide(DataPlant::LoopSideLocation::Supply).Branch(1).TotalComponents = 1; + state->dataPlnt->PlantLoop(1).LoopSide(DataPlant::LoopSideLocation::Supply).Branch(1).Comp.allocate(1); + auto &PLHPPlantLoadSideComp = state->dataPlnt->PlantLoop(1).LoopSide(DataPlant::LoopSideLocation::Supply).Branch(1).Comp(1); + PLHPPlantLoadSideComp.Type = DataPlant::PlantEquipmentType::HeatPumpEIRCooling; + // then the source side + + state->dataPlnt->PlantLoop(2).LoopSide(DataPlant::LoopSideLocation::Demand).TotalBranches = 1; + state->dataPlnt->PlantLoop(2).LoopSide(DataPlant::LoopSideLocation::Demand).Branch.allocate(1); + state->dataPlnt->PlantLoop(2).LoopSide(DataPlant::LoopSideLocation::Demand).Branch(1).TotalComponents = 1; + state->dataPlnt->PlantLoop(2).LoopSide(DataPlant::LoopSideLocation::Demand).Branch(1).Comp.allocate(1); + auto &PLHPPlantLoadSourceComp = state->dataPlnt->PlantLoop(2).LoopSide(DataPlant::LoopSideLocation::Demand).Branch(1).Comp(1); + PLHPPlantLoadSourceComp.Type = DataPlant::PlantEquipmentType::HeatPumpEIRCooling; + + // the init call expects a "from" calling point + PlantLocation myLocation = PlantLocation(1, DataPlant::LoopSideLocation::Supply, 1, 1); + + // call the factory with a valid name to trigger reading inputs + // expects fatal error due to same node names + EIRPlantLoopHeatPump::factory(*state, DataPlant::PlantEquipmentType::HeatPumpEIRCooling, "HP COOLING SIDE"); + // expect error related to OA node not being an OutdoorAirNode + std::string error_msg = delimited_string({ + " ** Severe ** Air Source PlantLoop:HeatPump: HP COOLING SIDE inlet node: NODE 3 is not an OutdoorAir:Node.", + " ** ~~~ ** Confirm that this is the intended source for the outdoor air stream.", + }); + EXPECT_TRUE(compare_err_stream(error_msg)); +} + TEST_F(EnergyPlusFixture, Initialization) { std::string const idf_objects = delimited_string({"HeatPump:PlantLoop:EIR:Cooling,", From 906b27e2e2b0ae3ebf6bdb75e55687738f399606 Mon Sep 17 00:00:00 2001 From: KarenWGard Date: Thu, 14 Sep 2023 09:16:37 -0400 Subject: [PATCH 6/8] change condenserNodeConnectionType_Inlet and Outlet to DataLoopNode::ConnectionType::Inlet and Outlet to let the standard node checking take care of OutdoorAir Node --- src/EnergyPlus/PlantLoopHeatPumpEIR.cc | 13 ++----------- tst/EnergyPlus/unit/PlantLoopHeatPumpEIR.unit.cc | 13 ++++++++++--- 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/src/EnergyPlus/PlantLoopHeatPumpEIR.cc b/src/EnergyPlus/PlantLoopHeatPumpEIR.cc index 3598b9db5b0..a553683cc1b 100644 --- a/src/EnergyPlus/PlantLoopHeatPumpEIR.cc +++ b/src/EnergyPlus/PlantLoopHeatPumpEIR.cc @@ -1469,8 +1469,8 @@ void EIRPlantLoopHeatPump::processInputForEIRPLHP(EnergyPlusData &state) } else if (condenserType == "AIRSOURCE") { thisPLHP.airSource = true; condenserNodeType = DataLoopNode::NodeFluidType::Air; - condenserNodeConnectionType_Inlet = DataLoopNode::ConnectionType::OutsideAir; - condenserNodeConnectionType_Outlet = DataLoopNode::ConnectionType::OutsideAir; + condenserNodeConnectionType_Inlet = DataLoopNode::ConnectionType::Inlet; + condenserNodeConnectionType_Outlet = DataLoopNode::ConnectionType::Outlet; if (sourceSideInletNodeName == sourceSideOutletNodeName) { ShowSevereError(state, format("PlantLoopHeatPump {} has the same inlet and outlet node.", thisObjectName)); ShowContinueError(state, format("Node Name: {}", sourceSideInletNodeName)); @@ -1492,15 +1492,6 @@ void EIRPlantLoopHeatPump::processInputForEIRPLHP(EnergyPlusData &state) condenserNodeConnectionType_Inlet, NodeInputManager::CompFluidStream::Secondary, DataLoopNode::ObjectIsNotParent); - if (condenserNodeType == DataLoopNode::NodeFluidType::Air) { - if (!OutAirNodeManager::CheckOutAirNodeNumber(state, thisPLHP.sourceSideNodes.inlet)) { - ShowSevereError( - state, - format( - "Air Source PlantLoop:HeatPump: {} inlet node: {} is not an OutdoorAir:Node.", thisPLHP.name, sourceSideInletNodeName)); - ShowContinueError(state, "Confirm that this is the intended source for the outdoor air stream."); - } - } thisPLHP.sourceSideNodes.outlet = NodeInputManager::GetOnlySingleNode(state, sourceSideOutletNodeName, nodeErrorsFound, diff --git a/tst/EnergyPlus/unit/PlantLoopHeatPumpEIR.unit.cc b/tst/EnergyPlus/unit/PlantLoopHeatPumpEIR.unit.cc index 8d53084f6d2..7a0671fff6f 100644 --- a/tst/EnergyPlus/unit/PlantLoopHeatPumpEIR.unit.cc +++ b/tst/EnergyPlus/unit/PlantLoopHeatPumpEIR.unit.cc @@ -66,6 +66,7 @@ #include #include #include +#include using namespace EnergyPlus; using namespace EnergyPlus::EIRPlantLoopHeatPumps; @@ -575,10 +576,17 @@ TEST_F(EnergyPlusFixture, processInputForEIRPLHP_TestAirSourceNoOANode) // call the factory with a valid name to trigger reading inputs // expects fatal error due to same node names EIRPlantLoopHeatPump::factory(*state, DataPlant::PlantEquipmentType::HeatPumpEIRCooling, "HP COOLING SIDE"); + bool ErrFound = false; + BranchNodeConnections::CheckNodeConnections(*state, ErrFound); // expect error related to OA node not being an OutdoorAirNode std::string error_msg = delimited_string({ - " ** Severe ** Air Source PlantLoop:HeatPump: HP COOLING SIDE inlet node: NODE 3 is not an OutdoorAir:Node.", - " ** ~~~ ** Confirm that this is the intended source for the outdoor air stream.", + " ** Severe ** Node Connection Error, Node=\"NODE 1\", Inlet node did not find an appropriate matching \"outlet\" node.", + " ** ~~~ ** If this is an outdoor air inlet node, it must be listed in an OutdoorAir:Node or OutdoorAir:NodeList object.", + " ** ~~~ ** Reference Object=HeatPump:PlantLoop:EIR:Cooling, Name=HP COOLING SIDE", + " ** Severe ** Node Connection Error, Node=\"NODE 3\", Inlet node did not find an appropriate matching \"outlet\" node.", + " ** ~~~ ** If this is an outdoor air inlet node, it must be listed in an OutdoorAir:Node or OutdoorAir:NodeList object.", + " ** ~~~ ** Reference Object=HeatPump:PlantLoop:EIR:Cooling, Name=HP COOLING SIDE", + }); EXPECT_TRUE(compare_err_stream(error_msg)); } @@ -683,7 +691,6 @@ TEST_F(EnergyPlusFixture, Initialization) EXPECT_NEAR(expectedSourceSideMassFlow, state->dataLoopNodes->Node(thisCoolingPLHP->sourceSideNodes.inlet).MassFlowRateMaxAvail, flowTol); } - TEST_F(EnergyPlusFixture, TestSizing_FullyAutosizedCoolingWithCompanion_WaterSource) { std::string const idf_objects = delimited_string({"HeatPump:PlantLoop:EIR:Cooling,", From a387e17ac5de28af61f00d3e7ff6c44f77e84ecf Mon Sep 17 00:00:00 2001 From: KarenWGard Date: Thu, 14 Sep 2023 09:37:10 -0400 Subject: [PATCH 7/8] formatting --- src/EnergyPlus/PlantLoopHeatPumpEIR.cc | 2 +- tst/EnergyPlus/unit/PlantLoopHeatPumpEIR.unit.cc | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/EnergyPlus/PlantLoopHeatPumpEIR.cc b/src/EnergyPlus/PlantLoopHeatPumpEIR.cc index a553683cc1b..849030b9d9e 100644 --- a/src/EnergyPlus/PlantLoopHeatPumpEIR.cc +++ b/src/EnergyPlus/PlantLoopHeatPumpEIR.cc @@ -66,6 +66,7 @@ #include #include #include +#include #include #include #include @@ -74,7 +75,6 @@ #include #include #include -#include namespace EnergyPlus::EIRPlantLoopHeatPumps { diff --git a/tst/EnergyPlus/unit/PlantLoopHeatPumpEIR.unit.cc b/tst/EnergyPlus/unit/PlantLoopHeatPumpEIR.unit.cc index 7a0671fff6f..8c2ea041bdb 100644 --- a/tst/EnergyPlus/unit/PlantLoopHeatPumpEIR.unit.cc +++ b/tst/EnergyPlus/unit/PlantLoopHeatPumpEIR.unit.cc @@ -57,16 +57,16 @@ // EnergyPlus Headers #include "Fixtures/EnergyPlusFixture.hh" +#include #include #include #include #include +#include #include #include #include #include -#include -#include using namespace EnergyPlus; using namespace EnergyPlus::EIRPlantLoopHeatPumps; From 99a7f6aa79c9afb799d37c68b76a5fb7079c7172 Mon Sep 17 00:00:00 2001 From: KarenWGard Date: Thu, 14 Sep 2023 10:23:37 -0400 Subject: [PATCH 8/8] remove ShowFatalError - fatal will be produced later & update unit test to match --- src/EnergyPlus/PlantLoopHeatPumpEIR.cc | 1 - tst/EnergyPlus/unit/PlantLoopHeatPumpEIR.unit.cc | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/EnergyPlus/PlantLoopHeatPumpEIR.cc b/src/EnergyPlus/PlantLoopHeatPumpEIR.cc index 849030b9d9e..d22091b5421 100644 --- a/src/EnergyPlus/PlantLoopHeatPumpEIR.cc +++ b/src/EnergyPlus/PlantLoopHeatPumpEIR.cc @@ -1474,7 +1474,6 @@ void EIRPlantLoopHeatPump::processInputForEIRPLHP(EnergyPlusData &state) if (sourceSideInletNodeName == sourceSideOutletNodeName) { ShowSevereError(state, format("PlantLoopHeatPump {} has the same inlet and outlet node.", thisObjectName)); ShowContinueError(state, format("Node Name: {}", sourceSideInletNodeName)); - ShowFatalError(state, "Previous condition causes termination."); errorsFound = true; } } else { diff --git a/tst/EnergyPlus/unit/PlantLoopHeatPumpEIR.unit.cc b/tst/EnergyPlus/unit/PlantLoopHeatPumpEIR.unit.cc index 8c2ea041bdb..03f85c50b8c 100644 --- a/tst/EnergyPlus/unit/PlantLoopHeatPumpEIR.unit.cc +++ b/tst/EnergyPlus/unit/PlantLoopHeatPumpEIR.unit.cc @@ -458,7 +458,7 @@ TEST_F(EnergyPlusFixture, processInputForEIRPLHP_TestAirSourceDuplicateNodes) std::string error_msg = delimited_string({ " ** Severe ** PlantLoopHeatPump hp cooling side has the same inlet and outlet node.", " ** ~~~ ** Node Name: NODE 3", - " ** Fatal ** Previous condition causes termination.", + " ** Fatal ** Previous EIR PLHP errors cause program termination", " ...Summary of Errors that led to program termination:", " ..... Reference severe error count=1", " ..... Last severe error=PlantLoopHeatPump hp cooling side has the same inlet and outlet node.",