From 49f5ade1990ea290301128331fa6e7ac42cdf131 Mon Sep 17 00:00:00 2001 From: Matt Larson Date: Mon, 24 May 2021 12:43:58 -0600 Subject: [PATCH 1/6] Modify PLHP concurrent companion operation from a warning to severe error. --- src/EnergyPlus/PlantLoopHeatPumpEIR.cc | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/EnergyPlus/PlantLoopHeatPumpEIR.cc b/src/EnergyPlus/PlantLoopHeatPumpEIR.cc index 82b60c44e8c..c2890453442 100644 --- a/src/EnergyPlus/PlantLoopHeatPumpEIR.cc +++ b/src/EnergyPlus/PlantLoopHeatPumpEIR.cc @@ -1221,7 +1221,7 @@ void EIRPlantLoopHeatPump::processInputForEIRPLHP(EnergyPlusData &state) void EIRPlantLoopHeatPump::checkConcurrentOperation(EnergyPlusData &state) { - // This will do a recurring warning for concurrent companion operation. + // This will do a severe error for concurrent companion operation. // This function should be called at the end of the time-step to ensure any iteration-level operation // is worked out and the results are final. // This function does not try to be intelligent about only reporting for one of the companions. The only @@ -1234,9 +1234,17 @@ void EIRPlantLoopHeatPump::checkConcurrentOperation(EnergyPlusData &state) continue; } if (thisPLHP.running && thisPLHP.companionHeatPumpCoil->running) { - ShowRecurringWarningErrorAtEnd(state, - "Companion heat pump objects running concurrently, check operation. Base object name: " + thisPLHP.name, - thisPLHP.recurringConcurrentOperationWarningIndex); + ShowSevereError(state, "Concurrent plant loop heat pump companion operation."); + ShowContinueErrorTimeStamp(state, ""); + ShowContinueError(state, "PLHP name= " + thisPLHP.name); + ShowContinueError(state, format("PLHP source side inlet temperature= {:.2R} {{C}}", thisPLHP.sourceSideInletTemp)); + ShowContinueError(state, format("PLHP source side outlet temperature= {:.2R} {{C}}", thisPLHP.sourceSideOutletTemp)); + ShowContinueError(state, format("PLHP source side heat transfer rate= {:.2R} {{W}}", thisPLHP.sourceSideHeatTransfer)); + ShowContinueError(state, "PLHP companion coil name= " + thisPLHP.companionHeatPumpCoil->name); + ShowContinueError(state, format("PLHP companion coil source side inlet temperature= {:.2R} {{C}}", thisPLHP.companionHeatPumpCoil->sourceSideInletTemp)); + ShowContinueError(state, format("PLHP companion coil source side outlet temperature= {:.2R} {{C}}", thisPLHP.companionHeatPumpCoil->sourceSideOutletTemp)); + ShowContinueError(state, format("PLHP companion coil source side heat transfer rate= {:.2R} {{W}}", thisPLHP.companionHeatPumpCoil->sourceSideHeatTransfer)); + ShowFatalError(state, "CheckConcurrentOperation: Simulation terminated because of problems in plant loop heat pump operation"); } } } From 3288cd13906b0048d5aa66281d096e16d658f5f6 Mon Sep 17 00:00:00 2001 From: Matt Larson Date: Mon, 24 May 2021 14:41:51 -0600 Subject: [PATCH 2/6] Update unit test for PLHP concurrent companion operation. --- tst/EnergyPlus/unit/PlantLoopHeatPumpEIR.unit.cc | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/tst/EnergyPlus/unit/PlantLoopHeatPumpEIR.unit.cc b/tst/EnergyPlus/unit/PlantLoopHeatPumpEIR.unit.cc index 3224508bc89..dd64c381e2e 100644 --- a/tst/EnergyPlus/unit/PlantLoopHeatPumpEIR.unit.cc +++ b/tst/EnergyPlus/unit/PlantLoopHeatPumpEIR.unit.cc @@ -1740,15 +1740,9 @@ TEST_F(EnergyPlusFixture, TestConcurrentOperationChecking) coil3->running = true; coil4->running = true; - // check to warn about concurrent operation - EIRPlantLoopHeatPump::checkConcurrentOperation(*state); - - // that will just add a recurring warning to the end, so to check whether - // a warning was actually made, I'll just check the warning index values - ASSERT_EQ(0, coil1->recurringConcurrentOperationWarningIndex); - ASSERT_EQ(0, coil2->recurringConcurrentOperationWarningIndex); - ASSERT_EQ(1, coil3->recurringConcurrentOperationWarningIndex); - ASSERT_EQ(1, coil4->recurringConcurrentOperationWarningIndex); + // check fatal error about concurrent operation + EXPECT_THROW(EIRPlantLoopHeatPumps::EIRPlantLoopHeatPump::checkConcurrentOperation(*state), std::runtime_error); + } TEST_F(EnergyPlusFixture, ConstructionFullObjectsHeatingAndCooling_AirSource) From 476b43f0eccc9763ac4904c26e2b1f02f9a2e056 Mon Sep 17 00:00:00 2001 From: Matt Larson Date: Wed, 26 May 2021 12:01:03 -0600 Subject: [PATCH 3/6] Fix clang format in unit test. --- tst/EnergyPlus/unit/PlantLoopHeatPumpEIR.unit.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tst/EnergyPlus/unit/PlantLoopHeatPumpEIR.unit.cc b/tst/EnergyPlus/unit/PlantLoopHeatPumpEIR.unit.cc index dd64c381e2e..89a738d0f0c 100644 --- a/tst/EnergyPlus/unit/PlantLoopHeatPumpEIR.unit.cc +++ b/tst/EnergyPlus/unit/PlantLoopHeatPumpEIR.unit.cc @@ -1741,7 +1741,7 @@ TEST_F(EnergyPlusFixture, TestConcurrentOperationChecking) coil4->running = true; // check fatal error about concurrent operation - EXPECT_THROW(EIRPlantLoopHeatPumps::EIRPlantLoopHeatPump::checkConcurrentOperation(*state), std::runtime_error); + EXPECT_THROW(EIRPlantLoopHeatPump::checkConcurrentOperation(*state), std::runtime_error); } From ed1bd8710dbc47d467f3db33db278d8ae90c9575 Mon Sep 17 00:00:00 2001 From: Matt Larson Date: Wed, 26 May 2021 13:05:47 -0600 Subject: [PATCH 4/6] Update unit brackets. --- src/EnergyPlus/PlantLoopHeatPumpEIR.cc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/EnergyPlus/PlantLoopHeatPumpEIR.cc b/src/EnergyPlus/PlantLoopHeatPumpEIR.cc index c2890453442..68de2fb13ef 100644 --- a/src/EnergyPlus/PlantLoopHeatPumpEIR.cc +++ b/src/EnergyPlus/PlantLoopHeatPumpEIR.cc @@ -1237,13 +1237,13 @@ void EIRPlantLoopHeatPump::checkConcurrentOperation(EnergyPlusData &state) ShowSevereError(state, "Concurrent plant loop heat pump companion operation."); ShowContinueErrorTimeStamp(state, ""); ShowContinueError(state, "PLHP name= " + thisPLHP.name); - ShowContinueError(state, format("PLHP source side inlet temperature= {:.2R} {{C}}", thisPLHP.sourceSideInletTemp)); - ShowContinueError(state, format("PLHP source side outlet temperature= {:.2R} {{C}}", thisPLHP.sourceSideOutletTemp)); - ShowContinueError(state, format("PLHP source side heat transfer rate= {:.2R} {{W}}", thisPLHP.sourceSideHeatTransfer)); + ShowContinueError(state, format("PLHP source side inlet temperature= {:.2R} [C]", thisPLHP.sourceSideInletTemp)); + ShowContinueError(state, format("PLHP source side outlet temperature= {:.2R} [C]", thisPLHP.sourceSideOutletTemp)); + ShowContinueError(state, format("PLHP source side heat transfer rate= {:.2R} [W]", thisPLHP.sourceSideHeatTransfer)); ShowContinueError(state, "PLHP companion coil name= " + thisPLHP.companionHeatPumpCoil->name); - ShowContinueError(state, format("PLHP companion coil source side inlet temperature= {:.2R} {{C}}", thisPLHP.companionHeatPumpCoil->sourceSideInletTemp)); - ShowContinueError(state, format("PLHP companion coil source side outlet temperature= {:.2R} {{C}}", thisPLHP.companionHeatPumpCoil->sourceSideOutletTemp)); - ShowContinueError(state, format("PLHP companion coil source side heat transfer rate= {:.2R} {{W}}", thisPLHP.companionHeatPumpCoil->sourceSideHeatTransfer)); + ShowContinueError(state, format("PLHP companion coil source side inlet temperature= {:.2R} [C]", thisPLHP.companionHeatPumpCoil->sourceSideInletTemp)); + ShowContinueError(state, format("PLHP companion coil source side outlet temperature= {:.2R} [C]", thisPLHP.companionHeatPumpCoil->sourceSideOutletTemp)); + ShowContinueError(state, format("PLHP companion coil source side heat transfer rate= {:.2R} [W]", thisPLHP.companionHeatPumpCoil->sourceSideHeatTransfer)); ShowFatalError(state, "CheckConcurrentOperation: Simulation terminated because of problems in plant loop heat pump operation"); } } From f80115ae3c9815afcdc409d25c41c3bbdfe9befc Mon Sep 17 00:00:00 2001 From: Matt Larson Date: Wed, 26 May 2021 13:06:07 -0600 Subject: [PATCH 5/6] Remove extra line in unit test. --- tst/EnergyPlus/unit/PlantLoopHeatPumpEIR.unit.cc | 1 - 1 file changed, 1 deletion(-) diff --git a/tst/EnergyPlus/unit/PlantLoopHeatPumpEIR.unit.cc b/tst/EnergyPlus/unit/PlantLoopHeatPumpEIR.unit.cc index 89a738d0f0c..9543109a017 100644 --- a/tst/EnergyPlus/unit/PlantLoopHeatPumpEIR.unit.cc +++ b/tst/EnergyPlus/unit/PlantLoopHeatPumpEIR.unit.cc @@ -1742,7 +1742,6 @@ TEST_F(EnergyPlusFixture, TestConcurrentOperationChecking) // check fatal error about concurrent operation EXPECT_THROW(EIRPlantLoopHeatPump::checkConcurrentOperation(*state), std::runtime_error); - } TEST_F(EnergyPlusFixture, ConstructionFullObjectsHeatingAndCooling_AirSource) From 4ae1abe00ff381a4a8cfc29eb2b2a0aea4fe920b Mon Sep 17 00:00:00 2001 From: Matt Larson Date: Wed, 26 May 2021 13:16:09 -0600 Subject: [PATCH 6/6] Fix clang format. --- src/EnergyPlus/PlantLoopHeatPumpEIR.cc | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/EnergyPlus/PlantLoopHeatPumpEIR.cc b/src/EnergyPlus/PlantLoopHeatPumpEIR.cc index 68de2fb13ef..5b9402801a6 100644 --- a/src/EnergyPlus/PlantLoopHeatPumpEIR.cc +++ b/src/EnergyPlus/PlantLoopHeatPumpEIR.cc @@ -1241,9 +1241,14 @@ void EIRPlantLoopHeatPump::checkConcurrentOperation(EnergyPlusData &state) ShowContinueError(state, format("PLHP source side outlet temperature= {:.2R} [C]", thisPLHP.sourceSideOutletTemp)); ShowContinueError(state, format("PLHP source side heat transfer rate= {:.2R} [W]", thisPLHP.sourceSideHeatTransfer)); ShowContinueError(state, "PLHP companion coil name= " + thisPLHP.companionHeatPumpCoil->name); - ShowContinueError(state, format("PLHP companion coil source side inlet temperature= {:.2R} [C]", thisPLHP.companionHeatPumpCoil->sourceSideInletTemp)); - ShowContinueError(state, format("PLHP companion coil source side outlet temperature= {:.2R} [C]", thisPLHP.companionHeatPumpCoil->sourceSideOutletTemp)); - ShowContinueError(state, format("PLHP companion coil source side heat transfer rate= {:.2R} [W]", thisPLHP.companionHeatPumpCoil->sourceSideHeatTransfer)); + ShowContinueError( + state, format("PLHP companion coil source side inlet temperature= {:.2R} [C]", thisPLHP.companionHeatPumpCoil->sourceSideInletTemp)); + ShowContinueError( + state, + format("PLHP companion coil source side outlet temperature= {:.2R} [C]", thisPLHP.companionHeatPumpCoil->sourceSideOutletTemp)); + ShowContinueError( + state, + format("PLHP companion coil source side heat transfer rate= {:.2R} [W]", thisPLHP.companionHeatPumpCoil->sourceSideHeatTransfer)); ShowFatalError(state, "CheckConcurrentOperation: Simulation terminated because of problems in plant loop heat pump operation"); } }