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 38 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 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
182336f
Fix compound condition so compressor isn't accidentally seen as on.
tanaya-mankad Dec 9, 2024
1db2fa7
Remove unneeded calculations for local variables.
tanaya-mankad Dec 17, 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
13 changes: 5 additions & 8 deletions src/EnergyPlus/Coils/CoilCoolingDX.cc
Original file line number Diff line number Diff line change
Expand Up @@ -658,12 +658,11 @@ void CoilCoolingDX::size(EnergyPlusData &state)

void CoilCoolingDX::simulate(EnergyPlusData &state,
HVAC::CoilMode coilMode,
Real64 PLR,
int speedNum,
Real64 speedRatio,
int const speedNum,
Real64 const speedRatio,
HVAC::FanOp const fanOp,
bool const singleMode,
Real64 LoadSHR)
Real64 const LoadSHR)
{
if (this->myOneTimeInitFlag) {
this->oneTimeInit(state);
Expand Down Expand Up @@ -693,7 +692,7 @@ void CoilCoolingDX::simulate(EnergyPlusData &state,
this->performance.OperatingMode = 0;
this->performance.ModeRatio = 0.0;
this->performance.simulate(
state, evapInletNode, evapOutletNode, coilMode, PLR, speedNum, speedRatio, fanOp, condInletNode, condOutletNode, singleMode, LoadSHR);
state, evapInletNode, evapOutletNode, coilMode, speedNum, speedRatio, fanOp, condInletNode, condOutletNode, singleMode, LoadSHR);
CoilCoolingDX::passThroughNodeData(evapInletNode, evapOutletNode);

// calculate energy conversion factor
Expand Down Expand Up @@ -770,7 +769,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;
this->speedNumReport = speedNum;
this->speedRatioReport = speedRatio;

Expand Down Expand Up @@ -827,7 +826,6 @@ 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;
HVAC::FanOp dummyFanOp = HVAC::FanOp::Cycling;
Expand Down Expand Up @@ -869,7 +867,6 @@ void CoilCoolingDX::simulate(EnergyPlusData &state,
dummyEvapInlet,
dummyEvapOutlet,
HVAC::CoilMode::Normal,
dummyPLR,
dummySpeedNum,
dummySpeedRatio,
dummyFanOp,
Expand Down
3 changes: 1 addition & 2 deletions src/EnergyPlus/Coils/CoilCoolingDX.hh
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,10 @@ struct CoilCoolingDX
void oneTimeInit(EnergyPlusData &state);
void simulate(EnergyPlusData &state,
HVAC::CoilMode coilMode,
Real64 PLR,
int speedNum,
Real64 speedRatio,
HVAC::FanOp const fanOp,
bool const singleMode,
bool singleMode,
Real64 LoadSHR = -1.0);
void setData(int fanIndex, HVAC::FanType fanType, std::string const &fanName, int airLoopNum);
void getFixedData(int &evapInletNodeIndex,
Expand Down
25 changes: 9 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,
HVAC::FanOp const fanOp,
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 == 0) || ((speedNum == 1) && (PLR == 0.0)) || (inletNode.MassFlowRate == 0.0)) {
if ((speedNum == 0) || ((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 (fanOp == HVAC::FanOp::Cycling && 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,8 @@ void CoilCoolingDXCurveFitOperatingMode::CalcOperatingMode(EnergyPlus::EnergyPlu
}

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

thisspeed.CalcSpeedOutput(state, inletNode, outletNode, plr1, fanOp, this->condInletTemp);
thisspeed.CalcSpeedOutput(state, inletNode, outletNode, speedRatio, fanOp, 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 +355,8 @@ void CoilCoolingDXCurveFitOperatingMode::CalcOperatingMode(EnergyPlus::EnergyPlu
Real64 outSpeed1Enthalpy = outletNode.Enthalpy;

if (fanOp == HVAC::FanOp::Continuous) {
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 +377,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, fanOp, condInletTemp); // out
lowerspeed.CalcSpeedOutput(state, inletNode, outletNode, 1.0, fanOp, condInletTemp); // out

if (lowerspeed.adjustForFaceArea) {
lowerspeed.AirMassFlow /= lowerspeed.active_fraction_of_face_coil_area;
Expand All @@ -406,8 +401,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
7 changes: 3 additions & 4 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 speedNum,
Real64 speedRatio,
HVAC::FanOp const fanOp,
DataLoopNode::NodeData &condInletNode,
DataLoopNode::NodeData &condOutletNode,
bool const singleMode);
bool singleMode);

std::string name;
Real64 ratedGrossTotalCap = 0.0; // [W]
Expand Down
36 changes: 12 additions & 24 deletions src/EnergyPlus/Coils/CoilCoolingDXCurveFitPerformance.cc
Original file line number Diff line number Diff line change
Expand Up @@ -205,9 +205,8 @@ void CoilCoolingDXCurveFitPerformance::simulate(EnergyPlus::EnergyPlusData &stat
const DataLoopNode::NodeData &inletNode,
DataLoopNode::NodeData &outletNode,
HVAC::CoilMode currentCoilMode,
Real64 &PLR,
int &speedNum,
Real64 &speedRatio,
int const speedNum,
Real64 const speedRatio,
HVAC::FanOp const fanOp,
DataLoopNode::NodeData &condInletNode,
DataLoopNode::NodeData &condOutletNode,
Expand All @@ -233,7 +232,7 @@ void CoilCoolingDXCurveFitPerformance::simulate(EnergyPlus::EnergyPlusData &stat
Real64 EnthalpyNorOut;
Real64 modeRatio;

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

// this->OperatingMode = 1;
CalcComponentSensibleLatentOutput(
Expand All @@ -246,7 +245,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 @@ -260,7 +259,7 @@ void CoilCoolingDXCurveFitPerformance::simulate(EnergyPlus::EnergyPlusData &stat
if (LoadSHR < SysNorSHR) {
outletNode.MassFlowRate = inletNode.MassFlowRate;
this->calculate(
state, this->alternateMode, inletNode, outletNode, PLR, speedNum, speedRatio, fanOp, condInletNode, condOutletNode, singleMode);
state, this->alternateMode, inletNode, outletNode, speedNum, speedRatio, fanOp, condInletNode, condOutletNode, singleMode);
CalcComponentSensibleLatentOutput(outletNode.MassFlowRate,
inletNode.Temp,
inletNode.HumRat,
Expand All @@ -272,17 +271,8 @@ void CoilCoolingDXCurveFitPerformance::simulate(EnergyPlus::EnergyPlusData &stat
SysSubSHR = sensSubRate / totalCoolingRate;
if (LoadSHR < SysSubSHR) {
outletNode.MassFlowRate = inletNode.MassFlowRate;
this->calculate(state,
this->alternateMode2,
inletNode,
outletNode,
PLR,
speedNum,
speedRatio,
fanOp,
condInletNode,
condOutletNode,
singleMode);
this->calculate(
state, this->alternateMode2, inletNode, outletNode, speedNum, speedRatio, fanOp, condInletNode, condOutletNode, singleMode);
CalcComponentSensibleLatentOutput(outletNode.MassFlowRate,
inletNode.Temp,
inletNode.HumRat,
Expand Down Expand Up @@ -336,14 +326,13 @@ void CoilCoolingDXCurveFitPerformance::simulate(EnergyPlus::EnergyPlusData &stat
}
}
} else if (currentCoilMode == HVAC::CoilMode::Enhanced) {
this->calculate(
state, this->alternateMode, inletNode, outletNode, PLR, speedNum, speedRatio, fanOp, condInletNode, condOutletNode, singleMode);
this->calculate(state, this->alternateMode, inletNode, outletNode, speedNum, speedRatio, fanOp, 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, fanOp, condInletNode, condOutletNode, singleMode);
this->calculate(state, this->normalMode, inletNode, outletNode, speedNum, speedRatio, fanOp, condInletNode, condOutletNode, singleMode);
this->OperatingMode = 1;
this->powerUse = this->normalMode.OpModePower;
this->RTF = this->normalMode.OpModeRTF;
Expand Down Expand Up @@ -407,17 +396,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,
HVAC::FanOp const fanOp,
DataLoopNode::NodeData &condInletNode,
DataLoopNode::NodeData &condOutletNode,
bool const singleMode)
{

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

void CoilCoolingDXCurveFitPerformance::calcStandardRatings210240(EnergyPlus::EnergyPlusData &state)
Expand Down
22 changes: 14 additions & 8 deletions src/EnergyPlus/Coils/CoilCoolingDXCurveFitPerformance.hh
Original file line number Diff line number Diff line change
Expand Up @@ -84,36 +84,42 @@ struct CoilCoolingDXCurveFitPerformance
{
std::string object_name = "Coil:Cooling:DX:CurveFit:Performance";
std::string parentName;

void instantiateFromInputSpec(EnergyPlusData &state, const CoilCoolingDXCurveFitPerformanceInputSpecification &input_data);

void simulate(EnergyPlusData &state,
const DataLoopNode::NodeData &inletNode,
DataLoopNode::NodeData &outletNode,
HVAC::CoilMode currentCoilMode,
Real64 &PLR,
int &speedNum,
Real64 &speedRatio,
int speedNum,
Real64 speedRatio,
HVAC::FanOp const fanOp,
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 speedNum,
Real64 speedRatio,
HVAC::FanOp const fanOp,
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);

void size(EnergyPlusData &state);

void setOperMode(EnergyPlusData &state, CoilCoolingDXCurveFitOperatingMode &currentMode, int const mode);

std::string name;
Expand Down
Loading
Loading