diff --git a/src/EnergyPlus/ChillerAbsorption.cc b/src/EnergyPlus/ChillerAbsorption.cc index 43643677124..b345c27184c 100644 --- a/src/EnergyPlus/ChillerAbsorption.cc +++ b/src/EnergyPlus/ChillerAbsorption.cc @@ -1728,6 +1728,9 @@ void BLASTAbsorberSpecs::calculate(EnergyPlusData &state, Real64 &MyLoad, bool R this->CondOutletTemp = state.dataLoopNodes->Node(this->CondInletNodeNum).Temp; this->CondMassFlowRate = 0.0; this->QCondenser = 0.0; + MyLoad = 0.0; + this->EvapMassFlowRate = 0.0; + PlantUtilities::SetComponentFlowRate(state, this->EvapMassFlowRate, this->EvapInletNodeNum, this->EvapOutletNodeNum, this->CWPlantLoc); return; // V7 plant upgrade, no longer fatal here anymore, set some things and return } diff --git a/src/EnergyPlus/ChillerElectricASHRAE205.cc b/src/EnergyPlus/ChillerElectricASHRAE205.cc index 77786d58266..2ceb1f9278c 100644 --- a/src/EnergyPlus/ChillerElectricASHRAE205.cc +++ b/src/EnergyPlus/ChillerElectricASHRAE205.cc @@ -1337,7 +1337,14 @@ void ASHRAE205ChillerSpecs::calculate(EnergyPlusData &state, Real64 &MyLoad, boo PlantUtilities::PullCompInterconnectTrigger( state, this->CWPlantLoc, this->CondMassFlowIndex, this->CDPlantLoc, DataPlant::CriteriaType::MassFlowRate, this->CondMassFlowRate); - if (this->CondMassFlowRate < DataBranchAirLoopPlant::MassFlowTolerance) return; + if (this->CondMassFlowRate < DataBranchAirLoopPlant::MassFlowTolerance) { + MyLoad = 0.0; + this->Power = standbyPower; + this->AmbientZoneGain = standbyPower; + this->EvapMassFlowRate = 0.0; + PlantUtilities::SetComponentFlowRate(state, this->EvapMassFlowRate, this->EvapInletNodeNum, this->EvapOutletNodeNum, this->CWPlantLoc); + return; + } } Real64 EvapOutletTempSetPoint(0.0); // Evaporator outlet temperature setpoint [C] switch (state.dataPlnt->PlantLoop(PlantLoopNum).LoopDemandCalcScheme) { diff --git a/src/EnergyPlus/ChillerElectricEIR.cc b/src/EnergyPlus/ChillerElectricEIR.cc index 4ffc4585300..0f301bfe2a3 100644 --- a/src/EnergyPlus/ChillerElectricEIR.cc +++ b/src/EnergyPlus/ChillerElectricEIR.cc @@ -1962,11 +1962,11 @@ void ElectricEIRChillerSpecs::calculate(EnergyPlusData &state, Real64 &MyLoad, b state, this->CWPlantLoc, this->CondMassFlowIndex, this->CDPlantLoc, DataPlant::CriteriaType::MassFlowRate, this->CondMassFlowRate); if (this->CondMassFlowRate < DataBranchAirLoopPlant::MassFlowTolerance) { - if (this->EvapMassFlowRate < DataBranchAirLoopPlant::MassFlowTolerance) { - // Use PlantUtilities::SetComponentFlowRate to decide actual flow - PlantUtilities::SetComponentFlowRate( - state, this->EvapMassFlowRate, this->EvapInletNodeNum, this->EvapOutletNodeNum, this->CWPlantLoc); - } + // Shut chiller off if there is no condenser water flow + MyLoad = 0.0; + this->EvapMassFlowRate = 0.0; + // Use PlantUtilities::SetComponentFlowRate to decide actual flow + PlantUtilities::SetComponentFlowRate(state, this->EvapMassFlowRate, this->EvapInletNodeNum, this->EvapOutletNodeNum, this->CWPlantLoc); return; } } diff --git a/src/EnergyPlus/ChillerIndirectAbsorption.cc b/src/EnergyPlus/ChillerIndirectAbsorption.cc index ca2c36ea85c..cdc74e92ba0 100644 --- a/src/EnergyPlus/ChillerIndirectAbsorption.cc +++ b/src/EnergyPlus/ChillerIndirectAbsorption.cc @@ -1604,7 +1604,7 @@ void IndirectAbsorberSpecs::sizeChiller(EnergyPlusData &state) } } -void IndirectAbsorberSpecs::calculate(EnergyPlusData &state, Real64 const MyLoad, bool const RunFlag) +void IndirectAbsorberSpecs::calculate(EnergyPlusData &state, Real64 MyLoad, bool const RunFlag) { // SUBROUTINE INFORMATION: // AUTHOR R. Raustad (FSEC) @@ -1999,6 +1999,9 @@ void IndirectAbsorberSpecs::calculate(EnergyPlusData &state, Real64 const MyLoad this->CondOutletTemp = CondInletTemp; this->CondMassFlowRate = 0.0; this->QCondenser = 0.0; + MyLoad = 0.0; + this->EvapMassFlowRate = 0.0; + PlantUtilities::SetComponentFlowRate(state, this->EvapMassFlowRate, this->EvapInletNodeNum, this->EvapOutletNodeNum, this->CWPlantLoc); return; // V7 plant upgrade, no longer fatal here anymore... set some things and return } diff --git a/src/EnergyPlus/ChillerReformulatedEIR.cc b/src/EnergyPlus/ChillerReformulatedEIR.cc index d1922a404c9..29b41dc6e17 100644 --- a/src/EnergyPlus/ChillerReformulatedEIR.cc +++ b/src/EnergyPlus/ChillerReformulatedEIR.cc @@ -2147,7 +2147,12 @@ void ReformulatedEIRChillerSpecs::calculate(EnergyPlusData &state, Real64 &MyLoa PlantUtilities::PullCompInterconnectTrigger( state, this->CWPlantLoc, this->CondMassFlowIndex, this->CDPlantLoc, DataPlant::CriteriaType::MassFlowRate, this->CondMassFlowRate); - if (this->CondMassFlowRate < DataBranchAirLoopPlant::MassFlowTolerance) return; + if (this->CondMassFlowRate < DataBranchAirLoopPlant::MassFlowTolerance) { + MyLoad = 0.0; + this->EvapMassFlowRate = 0.0; + PlantUtilities::SetComponentFlowRate(state, this->EvapMassFlowRate, this->EvapInletNodeNum, this->EvapOutletNodeNum, this->CWPlantLoc); + return; + } } Real64 FRAC = 1.0; Real64 EvapOutletTempSetPoint(0.0); // Evaporator outlet temperature setpoint [C] diff --git a/src/EnergyPlus/PlantChillers.cc b/src/EnergyPlus/PlantChillers.cc index 2db0f0df25b..0b893630bbe 100644 --- a/src/EnergyPlus/PlantChillers.cc +++ b/src/EnergyPlus/PlantChillers.cc @@ -1468,7 +1468,13 @@ namespace PlantChillers { PlantUtilities::SetComponentFlowRate(state, this->CondMassFlowRate, this->CondInletNodeNum, this->CondOutletNodeNum, this->CDPlantLoc); PlantUtilities::PullCompInterconnectTrigger( state, this->CWPlantLoc, this->CondMassFlowIndex, this->CDPlantLoc, DataPlant::CriteriaType::MassFlowRate, this->CondMassFlowRate); - if (this->CondMassFlowRate < DataBranchAirLoopPlant::MassFlowTolerance) return; + if (this->CondMassFlowRate < DataBranchAirLoopPlant::MassFlowTolerance) { + MyLoad = 0.0; + this->EvapMassFlowRate = 0.0; + PlantUtilities::SetComponentFlowRate( + state, this->EvapMassFlowRate, this->EvapInletNodeNum, this->EvapOutletNodeNum, this->CWPlantLoc); + return; + } } // LOAD LOCAL VARIABLES FROM DATA STRUCTURE (for code readability) @@ -3593,7 +3599,13 @@ namespace PlantChillers { PlantUtilities::SetComponentFlowRate(state, this->CondMassFlowRate, this->CondInletNodeNum, this->CondOutletNodeNum, this->CDPlantLoc); PlantUtilities::PullCompInterconnectTrigger( state, this->CWPlantLoc, this->CondMassFlowIndex, this->CDPlantLoc, DataPlant::CriteriaType::MassFlowRate, this->CondMassFlowRate); - if (this->CondMassFlowRate < DataBranchAirLoopPlant::MassFlowTolerance) return; + if (this->CondMassFlowRate < DataBranchAirLoopPlant::MassFlowTolerance) { + MyLoad = 0.0; + this->EvapMassFlowRate = 0.0; + PlantUtilities::SetComponentFlowRate( + state, this->EvapMassFlowRate, this->EvapInletNodeNum, this->EvapOutletNodeNum, this->CWPlantLoc); + return; + } } // LOAD LOCAL VARIABLES FROM DATA STRUCTURE (for code readability) @@ -5605,7 +5617,13 @@ namespace PlantChillers { PlantUtilities::PullCompInterconnectTrigger( state, this->CWPlantLoc, this->CondMassFlowIndex, this->CDPlantLoc, DataPlant::CriteriaType::MassFlowRate, this->CondMassFlowRate); - if (this->CondMassFlowRate < DataBranchAirLoopPlant::MassFlowTolerance) return; + if (this->CondMassFlowRate < DataBranchAirLoopPlant::MassFlowTolerance) { + MyLoad = 0.0; + this->EvapMassFlowRate = 0.0; + PlantUtilities::SetComponentFlowRate( + state, this->EvapMassFlowRate, this->EvapInletNodeNum, this->EvapOutletNodeNum, this->CWPlantLoc); + return; + } } // LOAD LOCAL VARIABLES FROM DATA STRUCTURE (for code readability) @@ -7313,7 +7331,13 @@ namespace PlantChillers { PlantUtilities::PullCompInterconnectTrigger( state, this->CWPlantLoc, this->CondMassFlowIndex, this->CDPlantLoc, DataPlant::CriteriaType::MassFlowRate, this->CondMassFlowRate); - if (this->CondMassFlowRate < DataBranchAirLoopPlant::MassFlowTolerance) return; + if (this->CondMassFlowRate < DataBranchAirLoopPlant::MassFlowTolerance) { + MyLoad = 0.0; + this->EvapMassFlowRate = 0.0; + PlantUtilities::SetComponentFlowRate( + state, this->EvapMassFlowRate, this->EvapInletNodeNum, this->EvapOutletNodeNum, this->CWPlantLoc); + return; + } } // If FlowLock is True, the new resolved mdot is used to update Power, QEvap, Qcond, and diff --git a/tst/EnergyPlus/unit/ChillerElectricEIR.unit.cc b/tst/EnergyPlus/unit/ChillerElectricEIR.unit.cc index e7da610059a..f87f43084e5 100644 --- a/tst/EnergyPlus/unit/ChillerElectricEIR.unit.cc +++ b/tst/EnergyPlus/unit/ChillerElectricEIR.unit.cc @@ -563,13 +563,46 @@ TEST_F(EnergyPlusFixture, ChillerElectricEIR_WaterCooledChillerVariableSpeedCond Real64 ActualCondFlow = 3.0 * std::abs(MyLoad) / (Cp * 10.0); EXPECT_NEAR(thisChiller.CondMassFlowRate, ActualCondFlow, 0.00001); - thisChiller.CondenserFlowControl = DataPlant::CondenserFlowControl::ConstantFlow; - thisChiller.calculate(*state, MyLoad, RunFlag); - EXPECT_NEAR(thisChiller.CondMassFlowRate, thisChiller.CondMassFlowRateMax, 0.00001); - // Test the minimum condenser flow rate MyLoad = -500; thisChiller.CondenserFlowControl = DataPlant::CondenserFlowControl::ModulatedChillerPLR; thisChiller.calculate(*state, MyLoad, RunFlag); EXPECT_NEAR(thisChiller.CondMassFlowRate, thisChiller.CondMassFlowRateMax * 0.35, 0.00001); + + // Test constant flow condenser + thisChiller.CondenserFlowControl = DataPlant::CondenserFlowControl::ConstantFlow; + MyLoad = -10000; + Real64 savedMyLoad = MyLoad; + + // test with condenser flow available + thisChiller.initialize(*state, RunFlag, MyLoad); + thisChiller.calculate(*state, MyLoad, RunFlag); + thisChiller.update(*state, MyLoad, RunFlag); + Real64 chWOutletTemp = thisChiller.EvapInletTemp + savedMyLoad / (Cp * thisChiller.EvapMassFlowRate); + Real64 condOutletTemp = thisChiller.CondInletTemp + thisChiller.QCondenser / (Cp * thisChiller.CondMassFlowRate); + EXPECT_EQ(MyLoad, savedMyLoad); + EXPECT_NEAR(thisChiller.CondMassFlowRate, thisChiller.CondMassFlowRateMax, 0.00001); + EXPECT_NEAR(thisChiller.EvapMassFlowRate, thisChiller.EvapMassFlowRateMax, 0.00001); + EXPECT_NEAR(thisChiller.EvapOutletTemp, chWOutletTemp, 0.1); + EXPECT_NEAR(thisChiller.CondOutletTemp, condOutletTemp, 0.1); + EXPECT_NEAR(thisChiller.QEvaporator, -savedMyLoad, 1.0); + EXPECT_NEAR(thisChiller.QCondenser, (-savedMyLoad + thisChiller.Power), 1.0); + EXPECT_NEAR(thisChiller.Power, 20987, 1.0); + + // test with no condenser flow available - chiller should be off + state->dataLoopNodes->Node(thisChiller.CondInletNodeNum).MassFlowRate = 0.0; + state->dataLoopNodes->Node(thisChiller.CondInletNodeNum).MassFlowRateMaxAvail = 0.0; + thisChiller.initialize(*state, RunFlag, MyLoad); + thisChiller.calculate(*state, MyLoad, RunFlag); + thisChiller.update(*state, MyLoad, RunFlag); + EXPECT_EQ(MyLoad, 0.0); + EXPECT_EQ(thisChiller.CondMassFlowRate, 0.0); + EXPECT_EQ(thisChiller.EvapMassFlowRate, 0.0); + EXPECT_EQ(thisChiller.EvapOutletTemp, thisChiller.EvapInletTemp); + EXPECT_EQ(thisChiller.CondOutletTemp, thisChiller.CondInletTemp); + EXPECT_EQ(thisChiller.QEvaporator, 0.0); + EXPECT_EQ(thisChiller.QCondenser, 0.0); + EXPECT_EQ(thisChiller.Power, 0.0); + + // Test }