Skip to content

Commit

Permalink
Merge pull request #10915 from NREL/10888_ChillerMinPLRReport
Browse files Browse the repository at this point in the history
#10888 - Chiller minimum load ratio is set in the IDF however does not appear in eplustbl.htm for Chiller:Electric:EIR and Chiller:Electric:ReformulatedEIR
  • Loading branch information
Myoldmopar authored Feb 5, 2025
2 parents 0898934 + eb331c0 commit e44b85d
Show file tree
Hide file tree
Showing 4 changed files with 441 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/EnergyPlus/ChillerElectricEIR.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1673,7 +1673,7 @@ void ElectricEIRChillerSpecs::size(EnergyPlusData &state)
this->CDPlantLoc.loopNum > 0
? state.dataPlnt->PlantLoop(this->CDPlantLoc.loopNum).LoopSide(this->CDPlantLoc.loopSideNum).Branch(this->CDPlantLoc.branchNum).Name
: "N/A");
OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchChillerMinPLR, this->Name, this->ChillerEIRFPLRMin);
OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchChillerMinPLR, this->Name, this->MinPartLoadRat);
OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchChillerFuelType, this->Name, "Electricity");
OutputReportPredefined::PreDefTableEntry(
state, state.dataOutRptPredefined->pdchChillerRatedEntCondTemp, this->Name, this->TempRefCondIn); // Rated==Ref?
Expand Down
2 changes: 1 addition & 1 deletion src/EnergyPlus/ChillerReformulatedEIR.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1469,7 +1469,7 @@ void ReformulatedEIRChillerSpecs::size(EnergyPlusData &state)
this->CDPlantLoc.loopNum > 0
? state.dataPlnt->PlantLoop(this->CDPlantLoc.loopNum).LoopSide(this->CDPlantLoc.loopSideNum).Branch(this->CDPlantLoc.branchNum).Name
: "N/A");
OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchChillerMinPLR, this->Name, this->ChillerEIRFPLRPLRMin);
OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchChillerMinPLR, this->Name, this->MinPartLoadRat);
OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchChillerFuelType, this->Name, "Electricity");
OutputReportPredefined::PreDefTableEntry(
state, state.dataOutRptPredefined->pdchChillerRatedEntCondTemp, this->Name, this->TempRefCondIn); // Rated==Ref?
Expand Down
209 changes: 209 additions & 0 deletions tst/EnergyPlus/unit/ChillerElectricEIR.unit.cc
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
#include <EnergyPlus/DataSizing.hh>
#include <EnergyPlus/FluidProperties.hh>
#include <EnergyPlus/General.hh>
#include <EnergyPlus/OutputReportPredefined.hh>
#include <EnergyPlus/Plant/DataPlant.hh>
#include <EnergyPlus/Plant/Enums.hh>
#include <EnergyPlus/Psychrometrics.hh>
Expand Down Expand Up @@ -607,3 +608,211 @@ TEST_F(EnergyPlusFixture, ChillerElectricEIR_WaterCooledChillerVariableSpeedCond

// Test
}

TEST_F(EnergyPlusFixture, ChillerElectricEIR_OutputReport)
{

bool RunFlag(true);
state->dataPlnt->TotNumLoops = 3;
state->dataEnvrn->OutBaroPress = 101325.0;
state->dataEnvrn->StdRhoAir = 1.20;
state->dataGlobal->TimeStepsInHour = 1;
state->dataGlobal->TimeStep = 1;
state->dataGlobal->MinutesInTimeStep = 60;
state->dataGlobal->HourOfDay = 1;
state->dataEnvrn->DayOfWeek = 1;
state->dataEnvrn->Month = 1;
state->dataEnvrn->DayOfMonth = 1;
state->dataEnvrn->DayOfYear_Schedule = General::OrdinalDay(state->dataEnvrn->Month, state->dataEnvrn->DayOfMonth, 1);
Psychrometrics::InitializePsychRoutines(*state);

std::string const idf_objects = delimited_string({
"Chiller:Electric:EIR,",
" WaterChiller, !- Name",
" autosize, !- Reference Capacity {W}",
" 3.5, !- Reference COP {W/W}",
" 5.67, !- Reference Leaving Chilled Water Temperature {C}",
" 28.40, !- Reference Entering Condenser Fluid Temperature {C}",
" autosize, !- Reference Chilled Water Flow Rate {m3/s}",
" autosize, !- Reference Condenser Fluid Flow Rate {m3/s}",
" DummyCapfT, !- Cooling Capacity Function of Temperature Curve Name",
" DummyEIRfT, !- Electric Input to Cooling Output Ratio Function of Temperature Curve Name",
" DummyEIRfPLR, !- Electric Input to Cooling Output Ratio Function of Part Load Ratio Curve Name",
" 0.10, !- Minimum Part Load Ratio",
" 1.00, !- Maximum Part Load Ratio",
" 1.00, !- Optimum Part Load Ratio",
" 0.25, !- Minimum Unloading Ratio",
" CHW Inlet Node, !- Chilled Water Inlet Node Name",
" CHW Outlet Node, !- Chilled Water Outlet Node Name",
" Condenser Inlet Node, !- Condenser Inlet Node Name",
" Condenser Outlet Node, !- Condenser Outlet Node Name",
" WaterCooled, !- Condenser Type",
" 0.04, !- Condenser Fan Power Ratio {W/W}",
" 1.00, !- Fraction of Compressor Electric Consumption Rejected by Condenser",
" 5.00, !- Leaving Chilled Water Lower Temperature Limit {C}",
" NotModulated, !- Chiller Flow Mode",
" autosize, !- Design Heat Recovery Water Flow Rate {m3/s}",
" HetRec Inlet Node, !- Heat Recovery Inlet Node Name",
" HetRec Outlet Node, !- Heat Recovery Outlet Node Name",
" 1.00, !- Sizing Factor",
" 0.00, !- Basin Heater Capacity {W/K}",
" 2.00, !- Basin Heater Setpoint Temperature {C}",
" , !- Basin Heater Operating Schedule Name",
" 0.30, !- Condenser Heat Recovery Relative Capacity Fraction",
" , !- Heat Recovery Inlet High Temperature Limit Schedule Name",
" HetRec Outlet Node, !- Heat Recovery Leaving Temperature Setpoint Node Name",
" , !- End-Use Subcategory",
" ModulatedLoopPLR, !- Condenser Flow Control",
" Y=F(X), !- Condenser Loop Flow Rate Fraction Function of Loop Part Load Ratio Curve Name",
" CondenserdT, !- Temperature Difference Across Condenser Schedule Name",
" 0.35; !- Condenser Minimum Flow Fraction",
"Curve:Linear,Y=F(X),0,1,0,1;",
"Schedule:Constant,CondenserdT,,10;"
"Curve:Biquadratic, DummyCapfT, 1, 0, 0, 0, 0, 0, 5, 10, 24, 35, , , , , ;",
"Curve:Biquadratic, DummyEIRfT, 1, 0, 0, 0, 0, 0, 5, 10, 24, 35, , , , , ;",
"Curve:Quadratic, DummyEIRfPLR, 1, 0, 0, 0, 1, , , , ;",

});

EXPECT_TRUE(process_idf(idf_objects, false));

OutputReportPredefined::SetPredefinedTables(*state);

state->dataPlnt->PlantLoop.allocate(state->dataPlnt->TotNumLoops);
state->dataPlnt->PlantLoop.allocate(state->dataPlnt->TotNumLoops);
state->dataSize->PlantSizData.allocate(state->dataPlnt->TotNumLoops);
for (int l = 1; l <= state->dataPlnt->TotNumLoops; ++l) {
auto &loopside(state->dataPlnt->PlantLoop(l).LoopSide(DataPlant::LoopSideLocation::Demand));
loopside.TotalBranches = 1;
loopside.Branch.allocate(1);
auto &loopsidebranch(state->dataPlnt->PlantLoop(l).LoopSide(DataPlant::LoopSideLocation::Demand).Branch(1));
loopsidebranch.TotalComponents = 1;
loopsidebranch.Comp.allocate(1);
}

Curve::GetCurveInput(*state); // Avoid overriding state.dataIPShortCut->lNumericFieldBlank
GetElectricEIRChillerInput(*state);
auto &thisChiller = state->dataChillerElectricEIR->ElectricEIRChiller(1);
int constexpr num_nodes = 10;
state->dataLoopNodes->Node.allocate(num_nodes);

state->dataPlnt->PlantLoop(1).Name = "ChilledWaterLoop";
state->dataPlnt->PlantLoop(1).PlantSizNum = 1;
state->dataPlnt->PlantLoop(1).FluidName = "WATER";
state->dataPlnt->PlantLoop(1).glycol = Fluid::GetWater(*state);
state->dataPlnt->PlantLoop(1).TempSetPointNodeNum = 10;
state->dataPlnt->PlantLoop(1).LoopSide(DataPlant::LoopSideLocation::Demand).Branch(1).Name = "WaterChiller Supply Branch";
state->dataPlnt->PlantLoop(1).LoopSide(DataPlant::LoopSideLocation::Demand).Branch(1).Comp(1).Name = thisChiller.Name;
state->dataPlnt->PlantLoop(1).LoopSide(DataPlant::LoopSideLocation::Demand).Branch(1).Comp(1).Type =
DataPlant::PlantEquipmentType::Chiller_ElectricEIR;
state->dataPlnt->PlantLoop(1).LoopSide(DataPlant::LoopSideLocation::Demand).Branch(1).Comp(1).NodeNumIn = thisChiller.EvapInletNodeNum;
state->dataPlnt->PlantLoop(1).LoopSide(DataPlant::LoopSideLocation::Demand).Branch(1).Comp(1).NodeNumOut = thisChiller.EvapOutletNodeNum;
state->dataPlnt->PlantLoop(1).LoopDemandCalcScheme = DataPlant::LoopDemandCalcScheme::SingleSetPoint;
state->dataPlnt->PlantLoop(1).LoopSide(EnergyPlus::DataPlant::LoopSideLocation::Demand).TempSetPoint = 4.4;

state->dataSize->PlantSizData(1).DesVolFlowRate = 0.02;
state->dataSize->PlantSizData(1).DeltaT = 5.0;

state->dataPlnt->PlantLoop(2).Name = "CondenserWaterLoop";
state->dataPlnt->PlantLoop(2).PlantSizNum = 2;
state->dataPlnt->PlantLoop(2).FluidName = "WATER";
state->dataPlnt->PlantLoop(2).glycol = Fluid::GetWater(*state);
state->dataPlnt->PlantLoop(2).LoopSide(DataPlant::LoopSideLocation::Demand).Branch(1).Name = "WaterChiller Condenser Branch";
state->dataPlnt->PlantLoop(2).LoopSide(DataPlant::LoopSideLocation::Demand).Branch(1).Comp(1).Name = thisChiller.Name;
state->dataPlnt->PlantLoop(2).LoopSide(DataPlant::LoopSideLocation::Demand).Branch(1).Comp(1).Type =
DataPlant::PlantEquipmentType::Chiller_ElectricEIR;
state->dataPlnt->PlantLoop(2).LoopSide(DataPlant::LoopSideLocation::Demand).Branch(1).Comp(1).NodeNumIn = thisChiller.CondInletNodeNum;
state->dataPlnt->PlantLoop(2).LoopSide(DataPlant::LoopSideLocation::Demand).Branch(1).Comp(1).NodeNumOut = thisChiller.CondOutletNodeNum;

state->dataSize->PlantSizData(2).DesVolFlowRate = 0.03;
state->dataSize->PlantSizData(2).DeltaT = 5.0;

state->dataPlnt->PlantLoop(3).Name = "HecRecWaterLoop";
state->dataPlnt->PlantLoop(3).PlantSizNum = 3;
state->dataPlnt->PlantLoop(3).FluidName = "WATER";
state->dataPlnt->PlantLoop(3).glycol = Fluid::GetWater(*state);
state->dataPlnt->PlantLoop(3).LoopSide(DataPlant::LoopSideLocation::Demand).Branch(1).Name = "WaterChiller HecRec Branch";
state->dataPlnt->PlantLoop(3).LoopSide(DataPlant::LoopSideLocation::Demand).Branch(1).Comp(1).Name = thisChiller.Name;
state->dataPlnt->PlantLoop(3).LoopSide(DataPlant::LoopSideLocation::Demand).Branch(1).Comp(1).Type =
DataPlant::PlantEquipmentType::Chiller_ElectricEIR;
state->dataPlnt->PlantLoop(3).LoopSide(DataPlant::LoopSideLocation::Demand).Branch(1).Comp(1).NodeNumIn = thisChiller.HeatRecInletNodeNum;
state->dataPlnt->PlantLoop(3).LoopSide(DataPlant::LoopSideLocation::Demand).Branch(1).Comp(1).NodeNumOut = thisChiller.HeatRecOutletNodeNum;
state->dataPlnt->PlantLoop(3).LoopDemandCalcScheme = DataPlant::LoopDemandCalcScheme::SingleSetPoint;
state->dataLoopNodes->Node(thisChiller.HeatRecOutletNodeNum).TempSetPoint = 60.0;

state->dataSize->PlantSizData(3).DesVolFlowRate = 0.03;
state->dataSize->PlantSizData(3).DeltaT = 5.0;

for (int n = 1; n <= num_nodes; ++n) {
state->dataLoopNodes->Node(n).MassFlowRateMaxAvail = 2.0;
state->dataLoopNodes->Node(n).MassFlowRateMax = 2.0;
}

state->dataPlnt->PlantFirstSizesOkayToFinalize = true;
state->dataPlnt->PlantFirstSizesOkayToReport = true;
state->dataPlnt->PlantFinalSizesOkayToReport = false;

Real64 MyLoad(0.0);
thisChiller.initialize(*state, RunFlag, MyLoad);
thisChiller.size(*state);
// run through init again after sizing is complete to set mass flow rate
MyLoad = -thisChiller.RefCap;
state->dataSize->PlantSizData(1).DesCapacity = std::abs(MyLoad) * 2;
Sched::UpdateScheduleVals(*state);
state->dataGlobal->BeginEnvrnFlag = true;
state->dataPlnt->PlantFinalSizesOkayToReport = true;
thisChiller.initialize(*state, RunFlag, MyLoad);
thisChiller.size(*state);

compare_err_stream("");
auto &orp = *state->dataOutRptPredefined;
std::string const ChillerName = thisChiller.Name;
// Type
EXPECT_EQ("Chiller:Electric:EIR", OutputReportPredefined::RetrievePreDefTableEntry(*state, orp.pdchChillerType, ChillerName));
// Reference Capacity[W]
EXPECT_EQ("419750.18", OutputReportPredefined::RetrievePreDefTableEntry(*state, orp.pdchChillerRefCap, ChillerName));
// Reference Efficiency [W/W]
EXPECT_EQ("3.50", OutputReportPredefined::RetrievePreDefTableEntry(*state, orp.pdchChillerRefEff, ChillerName));
// Rated Capacity [W]
EXPECT_EQ("419750.18", OutputReportPredefined::RetrievePreDefTableEntry(*state, orp.pdchChillerRatedCap, ChillerName));
// Rated Efficiency [W/W]
EXPECT_EQ("3.50", OutputReportPredefined::RetrievePreDefTableEntry(*state, orp.pdchChillerRatedEff, ChillerName));
// IPLV in SI Units [W/W]
EXPECT_EQ("2.03", OutputReportPredefined::RetrievePreDefTableEntry(*state, orp.pdchChillerIPLVinSI, ChillerName));
// IPLV in IP Units [Btu/W-h]
EXPECT_EQ("2.03", OutputReportPredefined::RetrievePreDefTableEntry(*state, orp.pdchChillerIPLVinIP, ChillerName));
// Minimum Part Load Ratio
EXPECT_EQ("0.10", OutputReportPredefined::RetrievePreDefTableEntry(*state, orp.pdchChillerMinPLR, ChillerName));
// Fuel Type
EXPECT_EQ("Electricity", OutputReportPredefined::RetrievePreDefTableEntry(*state, orp.pdchChillerFuelType, ChillerName));
// NOTE: Rated = Ref here
// Rated Entering Condenser Temperature [C]
EXPECT_EQ("28.40", OutputReportPredefined::RetrievePreDefTableEntry(*state, orp.pdchChillerRatedEntCondTemp, ChillerName));
// Rated Leaving Evaporator Temperature [C]
EXPECT_EQ("5.67", OutputReportPredefined::RetrievePreDefTableEntry(*state, orp.pdchChillerRatedLevEvapTemp, ChillerName));
// Reference Entering Condenser Temperature [C]
EXPECT_EQ("28.40", OutputReportPredefined::RetrievePreDefTableEntry(*state, orp.pdchChillerRefEntCondTemp, ChillerName));
// Reference Leaving Evaporator Temperature [C]
EXPECT_EQ("5.67", OutputReportPredefined::RetrievePreDefTableEntry(*state, orp.pdchChillerRefLevEvapTemp, ChillerName));
// Design Size Reference Chilled Water Flow Rate [kg/s]
EXPECT_EQ("20.00", OutputReportPredefined::RetrievePreDefTableEntry(*state, orp.pdchChillerDesSizeRefCHWFlowRate, ChillerName));
// Design Size Reference Condenser Fluid Flow Rate [kg/s]
EXPECT_EQ("25.82", OutputReportPredefined::RetrievePreDefTableEntry(*state, orp.pdchChillerDesSizeRefCondFluidFlowRate, ChillerName));
// Plantloop Name
EXPECT_EQ("ChilledWaterLoop", OutputReportPredefined::RetrievePreDefTableEntry(*state, orp.pdchChillerPlantloopName, ChillerName));
// Plantloop Branch Name
EXPECT_EQ("WaterChiller Supply Branch",
OutputReportPredefined::RetrievePreDefTableEntry(*state, orp.pdchChillerPlantloopBranchName, ChillerName));
// Condenser Loop Name
EXPECT_EQ("CondenserWaterLoop", OutputReportPredefined::RetrievePreDefTableEntry(*state, orp.pdchChillerCondLoopName, ChillerName));
// Condenser Loop Branch Name
EXPECT_EQ("WaterChiller Condenser Branch",
OutputReportPredefined::RetrievePreDefTableEntry(*state, orp.pdchChillerCondLoopBranchName, ChillerName));
// Heat Recovery Plantloop Name
EXPECT_EQ("HecRecWaterLoop", OutputReportPredefined::RetrievePreDefTableEntry(*state, orp.pdchChillerHeatRecPlantloopName, ChillerName));
// Heat Recovery Plantloop Branch Name
EXPECT_EQ("WaterChiller HecRec Branch",
OutputReportPredefined::RetrievePreDefTableEntry(*state, orp.pdchChillerHeatRecPlantloopBranchName, ChillerName));
// Recovery Relative Capacity Fraction
EXPECT_EQ("0.30", OutputReportPredefined::RetrievePreDefTableEntry(*state, orp.pdchChillerRecRelCapFrac, ChillerName));
}
Loading

3 comments on commit e44b85d

@nrel-bot-2
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.3: OK (2955 of 2955 tests passed, 0 test warnings)

Build Badge Test Badge

@nrel-bot-2
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.3-UnitTestsCoverage-RelWithDebInfo: OK (2137 of 2137 tests passed, 0 test warnings)

Build Badge Test Badge Coverage Badge

@nrel-bot-2
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.3-IntegrationCoverage-RelWithDebInfo: OK (802 of 802 tests passed, 0 test warnings)

Build Badge Test Badge Coverage Badge

Please sign in to comment.