Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consolidate speed-dependent coil load ratio input parameters into a single parameter. #10369

Open
wants to merge 36 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
e404a0d
Ported function signature changes.
tanaya-mankad Jan 9, 2024
64088c6
Fix clang-format.
tanaya-mankad Jan 16, 2024
ad6d7b6
Remove extra function parameter in tests.
tanaya-mankad Jan 29, 2024
6d3cc5c
Merge branch 'develop' of https://github.com/NREL/EnergyPlus into mer…
tanaya-mankad Jan 29, 2024
45ddc48
Revert CoilPLR to m_CoolingSpeedRatio.
tanaya-mankad Jan 29, 2024
e2fade2
Pass locally-calculated CoilPLR to CoilDX simulate inside calcUnitary…
tanaya-mankad Jan 31, 2024
4b62938
Modify input CoilPLR calculation prior to DXCoil simulate() call.
tanaya-mankad Feb 9, 2024
9f8815b
Merge branch 'develop' of https://github.com/NREL/EnergyPlus into mer…
tanaya-mankad Feb 9, 2024
4716bfb
Correct parameters in call to DXCoil simulate.
tanaya-mankad Feb 9, 2024
cf346b1
Merge branch 'develop' of https://github.com/NREL/EnergyPlus into mer…
tanaya-mankad Feb 12, 2024
b992bd8
Fix PartLoadRatioReport, initialize cooling speed to 1, assert if 0.
tanaya-mankad Feb 16, 2024
374707a
Merge branch 'develop' of https://github.com/NREL/EnergyPlus into mer…
tanaya-mankad Feb 19, 2024
7ab582b
Update test IDF.
tanaya-mankad Feb 21, 2024
cb92a78
Merge from NREL develop.
tanaya-mankad Jul 21, 2024
d4ac8d1
Merge from remote.
tanaya-mankad Jul 22, 2024
b05f869
Merge branch 'merge-coil-load-ratios' of https://github.com/bigladder…
tanaya-mankad Jul 22, 2024
a087d67
Merge from nonzero-speed branch.
tanaya-mankad Jul 22, 2024
4a83d3d
Fix formatting.
tanaya-mankad Jul 23, 2024
30bf1ab
Merge branch 'develop' of https://github.com/NREL/EnergyPlus into mer…
tanaya-mankad Jul 30, 2024
f7e0e51
Small corrections after develop merge.
tanaya-mankad Jul 30, 2024
8590971
Merge branch 'nonzero-cooling-speed-num' of https://github.com/NREL/E…
tanaya-mankad Jul 31, 2024
37ddbeb
Allow coil speed == 0.
tanaya-mankad Jul 31, 2024
12eedcf
Remove zero-speed unit test.
tanaya-mankad Aug 1, 2024
02faaef
Merge branch 'develop' of https://github.com/NREL/EnergyPlus into mer…
tanaya-mankad Aug 1, 2024
c63253d
Remove line from accidental merge.
tanaya-mankad Aug 1, 2024
641d623
Simplify PLR assignment.
tanaya-mankad Aug 6, 2024
3042fae
Merge branch 'develop' into merge-coil-load-ratios
tanaya-mankad Aug 18, 2024
f118192
Merge from nonzero-cooling-speed-num.
tanaya-mankad Aug 26, 2024
5505f01
Merge branch 'develop' of https://github.com/NREL/EnergyPlus into mer…
tanaya-mankad Aug 26, 2024
cb8806f
Merge branch 'merge-coil-load-ratios' of https://github.com/bigladder…
tanaya-mankad Aug 26, 2024
deab5a2
Merge branch 'develop' of https://github.com/NREL/EnergyPlus into mer…
tanaya-mankad Oct 4, 2024
45b87e5
Fix clang-format.
tanaya-mankad Oct 4, 2024
59b222f
Reassess how singlemode interprets PLR.
tanaya-mankad Oct 9, 2024
d7db59e
Merge branch 'develop' of https://github.com/NREL/EnergyPlus into mer…
tanaya-mankad Nov 6, 2024
e3d4abe
Fix setpoint-based plr.
tanaya-mankad Nov 10, 2024
be230f3
Allow speed=0 if compressor is off.
tanaya-mankad Nov 18, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 6 additions & 10 deletions src/EnergyPlus/Coils/CoilCoolingDX.cc
Original file line number Diff line number Diff line change
Expand Up @@ -665,13 +665,12 @@ void CoilCoolingDX::size(EnergyPlusData &state)
}

void CoilCoolingDX::simulate(EnergyPlusData &state,
int useAlternateMode,
Real64 PLR,
int speedNum,
Real64 speedRatio,
int const useAlternateMode,
int const speedNum,
Real64 const speedRatio,
int const fanOpMode,
bool const singleMode,
Real64 LoadSHR)
Real64 const LoadSHR)
{
if (this->myOneTimeInitFlag) {
this->oneTimeInit(state);
Expand Down Expand Up @@ -704,7 +703,6 @@ void CoilCoolingDX::simulate(EnergyPlusData &state,
evapInletNode,
evapOutletNode,
useAlternateMode,
PLR,
speedNum,
speedRatio,
fanOpMode,
Expand Down Expand Up @@ -788,7 +786,7 @@ void CoilCoolingDX::simulate(EnergyPlusData &state,
this->wasteHeatEnergyRate = this->performance.wasteHeatRate;
this->wasteHeatEnergy = this->performance.wasteHeatRate * reportingConstant;

this->partLoadRatioReport = PLR;
this->partLoadRatioReport = speedNum == 1 ? 1.0 : speedRatio;
Copy link
Contributor

@rraustad rraustad Jan 16, 2024

Choose a reason for hiding this comment

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

What this says is at speed = 1 the coil/compressor does not cycle (i.e., PLR = 1) and at higher speeds PLR is equal to the upper stage cycling ratio. Both of these are incorrect. Background: PLR started as a single-speed compressor cycling variable. Then variable speed coils were added and CyclingRatio and SpeedRatio were introduced. For the variable speed coils the CyclingRatio shows how the compressor cycles at speed = 1, which is the same as what the PLR variable shows for this and other coil types. So PLR and CyclingRatio are synonymous for the VS coil. At speeds > 1, the PLR and CyclingRatio = 1. At the higher speeds the highest compressor stage that is operating can cycle. This operation is shown in SpeedRatio. The CyclingRatio and SpeedRatio variables where added to the new cooling coil model to represent VS coils. Ex, at speed = 2, PLR and CyclingRatio = 1 and SpeedRatio = what the upper stage cycling ratio is. What I have thought about doing in the past is to delete the CyclingRatio variable and replace it with PLR, and leave SpeedRatio alone to represent what it does now. Another way to look at this is PLR represents how long the compressor operates during the time step. SpeedRatio represents the fraction of the time step the upper stage compressor is operating with lower speed compressor(s) operating the entire time step. There is some nuance to consider with the staged Tstat (on/off at specific speed) and Capacity Control Method = discrete/continuous for the new coil model.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@rraustad thank you so much for the comment. I was trying to back this information out of the code, as my notes from our last conversation were spotty. I'll have another go-around.

this->speedNumReport = speedNum;
this->speedRatioReport = speedRatio;

Expand Down Expand Up @@ -855,10 +853,9 @@ void CoilCoolingDX::simulate(EnergyPlusData &state,
DataLoopNode::NodeData dummyEvapOutlet;
DataLoopNode::NodeData dummyCondInlet;
DataLoopNode::NodeData dummyCondOutlet;
Real64 dummyPLR = 1.0;
int dummySpeedNum = 1;
Real64 dummySpeedRatio = 1.0;
int dummyFanOpMode = 1.0;
int dummyFanOpMode = 1;
bool dummySingleMode = false;

Real64 constexpr RatedInletAirTemp(26.6667); // 26.6667C or 80F
Expand Down Expand Up @@ -897,7 +894,6 @@ void CoilCoolingDX::simulate(EnergyPlusData &state,
dummyEvapInlet,
dummyEvapOutlet,
false,
dummyPLR,
dummySpeedNum,
dummySpeedRatio,
dummyFanOpMode,
Expand Down
10 changes: 2 additions & 8 deletions src/EnergyPlus/Coils/CoilCoolingDX.hh
Original file line number Diff line number Diff line change
Expand Up @@ -84,14 +84,8 @@ struct CoilCoolingDX
static void reportAllStandardRatings(EnergyPlusData &state);
void instantiateFromInputSpec(EnergyPlusData &state, const CoilCoolingDXInputSpecification &input_data);
void oneTimeInit(EnergyPlusData &state);
void simulate(EnergyPlusData &state,
int useAlternateMode,
Real64 PLR,
int speedNum,
Real64 speedRatio,
int const fanOpMode,
bool const singleMode,
Real64 LoadSHR = -1.0);
void
simulate(EnergyPlusData &state, int useAlternateMode, int speedNum, Real64 speedRatio, int fanOpMode, bool singleMode, Real64 LoadSHR = -1.0);
void setData(int fanIndex, int fanType, std::string const &fanName, int airLoopNum);
void getFixedData(int &evapInletNodeIndex,
int &evapOutletNodeIndex,
Expand Down
29 changes: 13 additions & 16 deletions src/EnergyPlus/Coils/CoilCoolingDXCurveFitOperatingMode.cc
Original file line number Diff line number Diff line change
Expand Up @@ -278,9 +278,8 @@ void CoilCoolingDXCurveFitOperatingMode::size(EnergyPlus::EnergyPlusData &state)
void CoilCoolingDXCurveFitOperatingMode::CalcOperatingMode(EnergyPlus::EnergyPlusData &state,
const DataLoopNode::NodeData &inletNode,
DataLoopNode::NodeData &outletNode,
Real64 &PLR,
int &speedNum,
Real64 &speedRatio,
int const speedNum,
Real64 const speedRatio,
int const fanOpMode,
DataLoopNode::NodeData &condInletNode,
[[maybe_unused]] DataLoopNode::NodeData &condOutletNode,
Expand All @@ -291,7 +290,7 @@ void CoilCoolingDXCurveFitOperatingMode::CalcOperatingMode(EnergyPlus::EnergyPlu
// Currently speedNum is 1-based, while this->speeds are zero-based
auto &thisspeed(this->speeds[max(speedNum - 1, 0)]);

if (((speedNum == 1) && (PLR == 0.0)) || (inletNode.MassFlowRate == 0.0)) {
if (((speedNum == 1) && (speedRatio == 0.0)) || (inletNode.MassFlowRate == 0.0)) {
outletNode.Temp = inletNode.Temp;
outletNode.HumRat = inletNode.HumRat;
outletNode.Enthalpy = inletNode.Enthalpy;
Expand All @@ -314,8 +313,8 @@ void CoilCoolingDXCurveFitOperatingMode::CalcOperatingMode(EnergyPlus::EnergyPlu
thisspeed.ambPressure = condInletNode.Press;
thisspeed.AirMassFlow = inletNode.MassFlowRate;
if (fanOpMode == DataHVACGlobals::CycFanCycCoil && speedNum == 1) {
if (PLR > 0.0) {
thisspeed.AirMassFlow = thisspeed.AirMassFlow / PLR;
if (speedRatio > 0.0) {
thisspeed.AirMassFlow = thisspeed.AirMassFlow / speedRatio;
} else {
thisspeed.AirMassFlow = 0.0;
}
Expand All @@ -331,12 +330,12 @@ void CoilCoolingDXCurveFitOperatingMode::CalcOperatingMode(EnergyPlus::EnergyPlu
}

// If multispeed, evaluate high speed first using speedRatio as PLR
Real64 plr1 = PLR;
if (speedNum > 1) {
plr1 = speedRatio;
}
// Real64 plr1 = PLR;
// if (speedNum > 1) {
// plr1 = speedRatio;
//}

thisspeed.CalcSpeedOutput(state, inletNode, outletNode, plr1, fanOpMode, this->condInletTemp);
thisspeed.CalcSpeedOutput(state, inletNode, outletNode, speedRatio, fanOpMode, this->condInletTemp);

// the outlet node conditions are based on it running at the truncated flow, we need to merge the bypassed air back in and ramp up flow rate
if (thisspeed.adjustForFaceArea) {
Expand All @@ -360,8 +359,8 @@ void CoilCoolingDXCurveFitOperatingMode::CalcOperatingMode(EnergyPlus::EnergyPlu
Real64 outSpeed1Enthalpy = outletNode.Enthalpy;

if (fanOpMode == DataHVACGlobals::ContFanCycCoil) {
outletNode.HumRat = outletNode.HumRat * plr1 + (1.0 - plr1) * inletNode.HumRat;
outletNode.Enthalpy = outletNode.Enthalpy * plr1 + (1.0 - plr1) * inletNode.Enthalpy;
outletNode.HumRat = outletNode.HumRat * speedRatio + (1.0 - speedRatio) * inletNode.HumRat;
outletNode.Enthalpy = outletNode.Enthalpy * speedRatio + (1.0 - speedRatio) * inletNode.Enthalpy;
outletNode.Temp = Psychrometrics::PsyTdbFnHW(outletNode.Enthalpy, outletNode.HumRat);

// Check for saturation error and modify temperature at constant enthalpy
Expand All @@ -382,7 +381,7 @@ void CoilCoolingDXCurveFitOperatingMode::CalcOperatingMode(EnergyPlus::EnergyPlu
auto &lowerspeed(this->speeds[max(speedNum - 2, 0)]);
lowerspeed.AirMassFlow = state.dataHVACGlobal->MSHPMassFlowRateLow * lowerspeed.active_fraction_of_face_coil_area;

lowerspeed.CalcSpeedOutput(state, inletNode, outletNode, PLR, fanOpMode, condInletTemp); // out
lowerspeed.CalcSpeedOutput(state, inletNode, outletNode, 1.0f, fanOpMode, condInletTemp); // out

if (lowerspeed.adjustForFaceArea) {
lowerspeed.AirMassFlow /= lowerspeed.active_fraction_of_face_coil_area;
Expand All @@ -406,8 +405,6 @@ void CoilCoolingDXCurveFitOperatingMode::CalcOperatingMode(EnergyPlus::EnergyPlu
outletNode.Enthalpy =
(outSpeed1Enthalpy * speedRatio * thisspeed.AirMassFlow + (1.0 - speedRatio) * outletNode.Enthalpy * lowerspeed.AirMassFlow) /
inletNode.MassFlowRate;
// outletNode.HumRat = outSpeed1HumRat * speedRatio + (1.0 - speedRatio) * outletNode.HumRat;
// outletNode.Enthalpy = outSpeed1Enthalpy * speedRatio + (1.0 - speedRatio) * outletNode.Enthalpy;
outletNode.Temp = Psychrometrics::PsyTdbFnHW(outletNode.Enthalpy, outletNode.HumRat);

this->OpModePower += (1.0 - thisspeed.RTF) * lowerspeed.fullLoadPower;
Expand Down
9 changes: 4 additions & 5 deletions src/EnergyPlus/Coils/CoilCoolingDXCurveFitOperatingMode.hh
Original file line number Diff line number Diff line change
Expand Up @@ -92,13 +92,12 @@ struct CoilCoolingDXCurveFitOperatingMode
void CalcOperatingMode(EnergyPlusData &state,
const DataLoopNode::NodeData &inletNode,
DataLoopNode::NodeData &outletNode,
Real64 &PLR,
int &speedNum,
Real64 &speedRatio,
int const fanOpMode,
int speedNum,
Real64 speedRatio,
int fanOpMode,
DataLoopNode::NodeData &condInletNode,
DataLoopNode::NodeData &condOutletNode,
bool const singleMode);
bool singleMode);

std::string name;
Real64 ratedGrossTotalCap = 0.0; // [W]
Expand Down
38 changes: 12 additions & 26 deletions src/EnergyPlus/Coils/CoilCoolingDXCurveFitPerformance.cc
Original file line number Diff line number Diff line change
Expand Up @@ -205,10 +205,9 @@ CoilCoolingDXCurveFitPerformance::CoilCoolingDXCurveFitPerformance(EnergyPlus::E
void CoilCoolingDXCurveFitPerformance::simulate(EnergyPlus::EnergyPlusData &state,
const DataLoopNode::NodeData &inletNode,
DataLoopNode::NodeData &outletNode,
int useAlternateMode,
Real64 &PLR,
int &speedNum,
Real64 &speedRatio,
int const useAlternateMode,
int const speedNum,
Real64 const speedRatio,
int const fanOpMode,
DataLoopNode::NodeData &condInletNode,
DataLoopNode::NodeData &condOutletNode,
Expand All @@ -234,8 +233,7 @@ void CoilCoolingDXCurveFitPerformance::simulate(EnergyPlus::EnergyPlusData &stat
Real64 EnthalpyNorOut;
Real64 modeRatio;

this->calculate(
state, this->normalMode, inletNode, outletNode, PLR, speedNum, speedRatio, fanOpMode, condInletNode, condOutletNode, singleMode);
this->calculate(state, this->normalMode, inletNode, outletNode, speedNum, speedRatio, fanOpMode, condInletNode, condOutletNode, singleMode);

// this->OperatingMode = 1;
CalcComponentSensibleLatentOutput(
Expand All @@ -248,7 +246,7 @@ void CoilCoolingDXCurveFitPerformance::simulate(EnergyPlus::EnergyPlusData &stat
this->wasteHeatRate = this->normalMode.OpModeWasteHeat;
}

if ((PLR != 0.0) && (LoadSHR != 0.0)) {
if ((speedRatio != 0.0) && (LoadSHR != 0.0)) {
if (totalCoolingRate == 0.0) {
SysNorSHR = 1.0;
} else {
Expand All @@ -261,17 +259,8 @@ void CoilCoolingDXCurveFitPerformance::simulate(EnergyPlus::EnergyPlusData &stat

if (LoadSHR < SysNorSHR) {
outletNode.MassFlowRate = inletNode.MassFlowRate;
this->calculate(state,
this->alternateMode,
inletNode,
outletNode,
PLR,
speedNum,
speedRatio,
fanOpMode,
condInletNode,
condOutletNode,
singleMode);
this->calculate(
state, this->alternateMode, inletNode, outletNode, speedNum, speedRatio, fanOpMode, condInletNode, condOutletNode, singleMode);
CalcComponentSensibleLatentOutput(outletNode.MassFlowRate,
inletNode.Temp,
inletNode.HumRat,
Expand All @@ -287,7 +276,6 @@ void CoilCoolingDXCurveFitPerformance::simulate(EnergyPlus::EnergyPlusData &stat
this->alternateMode2,
inletNode,
outletNode,
PLR,
speedNum,
speedRatio,
fanOpMode,
Expand Down Expand Up @@ -348,14 +336,13 @@ void CoilCoolingDXCurveFitPerformance::simulate(EnergyPlus::EnergyPlusData &stat
}
} else if (useAlternateMode == DataHVACGlobals::coilEnhancedMode) {
this->calculate(
state, this->alternateMode, inletNode, outletNode, PLR, speedNum, speedRatio, fanOpMode, condInletNode, condOutletNode, singleMode);
state, this->alternateMode, inletNode, outletNode, speedNum, speedRatio, fanOpMode, condInletNode, condOutletNode, singleMode);
this->OperatingMode = 2;
this->powerUse = this->alternateMode.OpModePower;
this->RTF = this->alternateMode.OpModeRTF;
this->wasteHeatRate = this->alternateMode.OpModeWasteHeat;
} else {
this->calculate(
state, this->normalMode, inletNode, outletNode, PLR, speedNum, speedRatio, fanOpMode, condInletNode, condOutletNode, singleMode);
this->calculate(state, this->normalMode, inletNode, outletNode, speedNum, speedRatio, fanOpMode, condInletNode, condOutletNode, singleMode);
this->OperatingMode = 1;
this->powerUse = this->normalMode.OpModePower;
this->RTF = this->normalMode.OpModeRTF;
Expand Down Expand Up @@ -419,17 +406,16 @@ void CoilCoolingDXCurveFitPerformance::calculate(EnergyPlus::EnergyPlusData &sta
CoilCoolingDXCurveFitOperatingMode &currentMode,
const DataLoopNode::NodeData &inletNode,
DataLoopNode::NodeData &outletNode,
Real64 &PLR,
int &speedNum,
Real64 &speedRatio,
int const speedNum,
Real64 const speedRatio,
int const fanOpMode,
DataLoopNode::NodeData &condInletNode,
DataLoopNode::NodeData &condOutletNode,
bool const singleMode)
{

// calculate the performance at this mode/speed
currentMode.CalcOperatingMode(state, inletNode, outletNode, PLR, speedNum, speedRatio, fanOpMode, condInletNode, condOutletNode, singleMode);
currentMode.CalcOperatingMode(state, inletNode, outletNode, speedNum, speedRatio, fanOpMode, condInletNode, condOutletNode, singleMode);
}

void CoilCoolingDXCurveFitPerformance::calcStandardRatings210240(EnergyPlus::EnergyPlusData &state)
Expand Down
20 changes: 10 additions & 10 deletions src/EnergyPlus/Coils/CoilCoolingDXCurveFitPerformance.hh
Original file line number Diff line number Diff line change
Expand Up @@ -89,27 +89,27 @@ struct CoilCoolingDXCurveFitPerformance
const DataLoopNode::NodeData &inletNode,
DataLoopNode::NodeData &outletNode,
int useAlternateMode,
Real64 &PLR,
int &speedNum,
Real64 &speedRatio,
int const fanOpMode,
int speedNum,
Real64 speedRatio,
int fanOpMode,
DataLoopNode::NodeData &condInletNode,
DataLoopNode::NodeData &condOutletNode,
bool const singleMode,
bool singleMode,
Real64 LoadSHR = 0.0);

void calculate(EnergyPlusData &state,
CoilCoolingDXCurveFitOperatingMode &currentMode,
const DataLoopNode::NodeData &inletNode,
DataLoopNode::NodeData &outletNode,
Real64 &PLR,
int &speedNum,
Real64 &speedRatio,
int const fanOpMode,
int speedNum,
Real64 speedRatio,
int fanOpMode,
DataLoopNode::NodeData &condInletNode,
DataLoopNode::NodeData &condOutletNode,
bool const singleMode);
bool singleMode);

void calcStandardRatings210240(EnergyPlusData &state);

CoilCoolingDXCurveFitPerformanceInputSpecification original_input_specs;
CoilCoolingDXCurveFitPerformance() = default;
explicit CoilCoolingDXCurveFitPerformance(EnergyPlusData &state, const std::string &name);
Expand Down
2 changes: 1 addition & 1 deletion src/EnergyPlus/Coils/CoilCoolingDXCurveFitSpeed.cc
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ void CoilCoolingDXCurveFitSpeed::size(EnergyPlus::EnergyPlusData &state)
void CoilCoolingDXCurveFitSpeed::CalcSpeedOutput(EnergyPlus::EnergyPlusData &state,
const DataLoopNode::NodeData &inletNode,
DataLoopNode::NodeData &outletNode,
Real64 &_PLR,
Real64 const _PLR,
int const fanOpMode,
const Real64 condInletTemp)
{
Expand Down
2 changes: 1 addition & 1 deletion src/EnergyPlus/Coils/CoilCoolingDXCurveFitSpeed.hh
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ struct CoilCoolingDXCurveFitSpeed
void CalcSpeedOutput(EnergyPlusData &state,
const DataLoopNode::NodeData &inletNode,
DataLoopNode::NodeData &outletNode,
Real64 &PLR,
Real64 PLR,
int const fanOpMode,
Real64 condInletTemp);
void size(EnergyPlusData &state);
Expand Down
Loading
Loading