Skip to content

Commit

Permalink
Fix PartLoadRatioReport, initialize cooling speed to 1, assert if 0.
Browse files Browse the repository at this point in the history
  • Loading branch information
tanaya-mankad committed Feb 16, 2024
1 parent 4716bfb commit b992bd8
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 12 deletions.
4 changes: 3 additions & 1 deletion src/EnergyPlus/Coils/CoilCoolingDX.cc
Original file line number Diff line number Diff line change
Expand Up @@ -672,6 +672,8 @@ void CoilCoolingDX::simulate(EnergyPlusData &state,
bool const singleMode,
Real64 const LoadSHR)
{
assert(speedNum != 0);

if (this->myOneTimeInitFlag) {
this->oneTimeInit(state);
this->myOneTimeInitFlag = false;
Expand Down Expand Up @@ -777,7 +779,7 @@ void CoilCoolingDX::simulate(EnergyPlusData &state,
this->wasteHeatEnergyRate = this->performance.wasteHeatRate;
this->wasteHeatEnergy = this->performance.wasteHeatRate * reportingConstant;

this->partLoadRatioReport = speedNum == 1 ? 1.0 : speedRatio;
this->partLoadRatioReport = speedNum > 1 ? 1.0 : speedRatio;
this->speedNumReport = speedNum;
this->speedRatioReport = speedRatio;

Expand Down
21 changes: 11 additions & 10 deletions src/EnergyPlus/UnitarySystem.cc
Original file line number Diff line number Diff line change
Expand Up @@ -11660,24 +11660,25 @@ namespace UnitarySystems {
} break;
case DataHVACGlobals::CoilDX_Cooling: { // CoilCoolingDX
bool const singleMode = (this->m_SingleMode == 1);
CoilPLR = 0.0;
if (this->m_ControlType == UnitarySysCtrlType::Setpoint) {
if (CompressorOn == DataHVACGlobals::CompressorOperation::On) {
CoilPLR = (this->m_CoolingSpeedNum > 1) ? 1.0 : PartLoadRatio;
} else
CoilPLR = 0.0;
}
} else {
if (this->m_EMSOverrideCoilSpeedNumOn) {
CoilPLR = this->m_CoolingSpeedRatio;
} else {
if (CompressorOn == DataHVACGlobals::CompressorOperation::Off) {
this->m_CoolingSpeedNum = 1; // Bypass mixed-speed calculations in called functions
CoilPLR = 0.0;
} else {
if (singleMode) {
CoilPLR = (m_CoolingSpeedNum == 1) ? PartLoadRatio
: 0.0; // singleMode allows cycling, but not part load operation at higher speeds
if (state.dataUnitarySystems->CoolingLoad) {
if (CompressorOn == DataHVACGlobals::CompressorOperation::Off) {
this->m_CoolingSpeedNum = 1; // Bypass mixed-speed calculations in called functions
} else {
CoilPLR = PartLoadRatio;
if (singleMode) {
CoilPLR = (m_CoolingSpeedNum == 1) ? PartLoadRatio
: 0.0; // singleMode allows cycling, but not part load operation at higher speeds
} else {
CoilPLR = PartLoadRatio;
}
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/EnergyPlus/UnitarySystem.hh
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ namespace UnitarySystems {

Real64 m_CoolingCycRatio = 0.0;
Real64 m_CoolingSpeedRatio = 0.0;
int m_CoolingSpeedNum = 0;
int m_CoolingSpeedNum = 1;

int m_EconoSpeedNum = 0;
Real64 m_EconoPartLoadRatio = 0;
Expand Down

5 comments on commit b992bd8

@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.

merge-coil-load-ratios (bigladder) - x86_64-Linux-Ubuntu-22.04-gcc-11.4: OK (3333 of 3587 tests passed, 14 test warnings)

Messages:\n

  • 254 tests had: Table big diffs.
  • 6 tests had: ESO small diffs.
  • 6 tests had: MTR small diffs.
  • 2 tests had: ERR diffs.
  • 1 test had: EDD diffs.
  • 14 tests had: Table small diffs.
  • 5 tests had: EIO diffs.
  • 2 tests had: ESO big diffs.
  • 2 tests had: MTR big diffs.

Failures:\n

regression Test Summary

  • Passed: 552
  • Failed: 254

Build Badge Test Badge

@nrel-bot
Copy link

Choose a reason for hiding this comment

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

merge-coil-load-ratios (bigladder) - Win64-Windows-10-VisualStudio-16: OK (2759 of 2759 tests passed, 0 test warnings)

Build Badge Test Badge

@nrel-bot-3
Copy link

Choose a reason for hiding this comment

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

merge-coil-load-ratios (bigladder) - x86_64-MacOS-10.18-clang-15.0.0: OK (3292 of 3546 tests passed, 14 test warnings)

Messages:\n

  • 253 tests had: Table big diffs.
  • 6 tests had: ESO small diffs.
  • 6 tests had: MTR small diffs.
  • 2 tests had: ERR diffs.
  • 1 test had: EDD diffs.
  • 14 tests had: Table small diffs.
  • 5 tests had: EIO diffs.
  • 2 tests had: ESO big diffs.
  • 2 tests had: MTR big diffs.

Failures:\n

regression Test Summary

  • Passed: 533
  • Failed: 253

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.

merge-coil-load-ratios (bigladder) - x86_64-Linux-Ubuntu-22.04-gcc-11.4-UnitTestsCoverage-Debug: OK (1971 of 1972 tests passed, 0 test warnings)

Failures:\n

EnergyPlusFixture Test Summary

  • Passed: 1484
  • Subprocess aborted: 1

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.

merge-coil-load-ratios (bigladder) - x86_64-Linux-Ubuntu-22.04-gcc-11.4-IntegrationCoverage-Debug: OK (771 of 790 tests passed, 0 test warnings)

Failures:\n

integration Test Summary

  • Passed: 771
  • Failed: 19

Build Badge Test Badge Coverage Badge

Please sign in to comment.