Skip to content

Commit

Permalink
Merge pull request #10793 from NREL/chillerEIRrepairs
Browse files Browse the repository at this point in the history
Fix chiller chilling when it is off
  • Loading branch information
Myoldmopar authored Dec 4, 2024
2 parents 12781b3 + bbcd4ce commit 3659604
Show file tree
Hide file tree
Showing 7 changed files with 91 additions and 16 deletions.
3 changes: 3 additions & 0 deletions src/EnergyPlus/ChillerAbsorption.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
9 changes: 8 additions & 1 deletion src/EnergyPlus/ChillerElectricASHRAE205.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
10 changes: 5 additions & 5 deletions src/EnergyPlus/ChillerElectricEIR.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down
5 changes: 4 additions & 1 deletion src/EnergyPlus/ChillerIndirectAbsorption.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
}
Expand Down
7 changes: 6 additions & 1 deletion src/EnergyPlus/ChillerReformulatedEIR.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
32 changes: 28 additions & 4 deletions src/EnergyPlus/PlantChillers.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down
41 changes: 37 additions & 4 deletions tst/EnergyPlus/unit/ChillerElectricEIR.unit.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

3 comments on commit 3659604

@nrel-bot-2c
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

develop (Myoldmopar) - x86_64-Linux-Ubuntu-24.04-gcc-13.2: OK (2917 of 2917 tests passed, 0 test warnings)

Build Badge Test Badge

@nrel-bot-2c
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

develop (Myoldmopar) - x86_64-Linux-Ubuntu-24.04-gcc-13.2-UnitTestsCoverage-RelWithDebInfo: OK (2099 of 2099 tests passed, 0 test warnings)

Build Badge Test Badge Coverage Badge

@nrel-bot-2c
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

develop (Myoldmopar) - x86_64-Linux-Ubuntu-24.04-gcc-13.2-IntegrationCoverage-RelWithDebInfo: OK (801 of 801 tests passed, 0 test warnings)

Build Badge Test Badge Coverage Badge

Please sign in to comment.