Skip to content

Commit

Permalink
Merge remote-tracking branch 'remotes/origin/develop' into fix9302Zon…
Browse files Browse the repository at this point in the history
…eFloorArea
  • Loading branch information
mjwitte committed Mar 3, 2022
2 parents a9a1430 + ef1342a commit 9d73076
Show file tree
Hide file tree
Showing 5 changed files with 56 additions and 7 deletions.
20 changes: 19 additions & 1 deletion src/EnergyPlus/Coils/CoilCoolingDXCurveFitOperatingMode.cc
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,17 @@ 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)) {
outletNode.Temp = inletNode.Temp;
outletNode.HumRat = inletNode.HumRat;
outletNode.Enthalpy = inletNode.Enthalpy;
outletNode.Press = inletNode.Press;
OpModeRTF = 0.0;
OpModePower = 0.0;
OpModeWasteHeat = 0.0;
return;
}

if (condInletNode.Press <= 0.0) {
condInletNode.Press = state.dataEnvrn->OutBaroPress;
}
Expand Down Expand Up @@ -350,8 +361,15 @@ void CoilCoolingDXCurveFitOperatingMode::CalcOperatingMode(EnergyPlus::EnergyPlu
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.Temp = Psychrometrics::PsyTdbFnHW(outletNode.Enthalpy, outletNode.HumRat);

// Check for saturation error and modify temperature at constant enthalpy
Real64 tsat = Psychrometrics::PsyTsatFnHPb(state, outletNode.Enthalpy, inletNode.Press, RoutineName);
if (outletNode.Temp < tsat) {
outletNode.Temp = tsat;
outletNode.HumRat = Psychrometrics::PsyWFnTdbH(state, tsat, outletNode.Enthalpy);
}
}
outletNode.Temp = Psychrometrics::PsyTdbFnHW(outletNode.Enthalpy, outletNode.HumRat);

OpModeRTF = thisspeed.RTF;
OpModePower = thisspeed.fullLoadPower * thisspeed.RTF;
Expand Down
7 changes: 7 additions & 0 deletions src/EnergyPlus/Coils/CoilCoolingDXCurveFitPerformance.cc
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ void CoilCoolingDXCurveFitPerformance::simulate(EnergyPlus::EnergyPlusData &stat
bool const singleMode,
Real64 LoadSHR)
{
static constexpr std::string_view RoutineName = "CoilCoolingDXCurveFitPerformance::simulate";
Real64 reportingConstant = state.dataHVACGlobal->TimeStepSys * DataGlobalConstants::SecInHour;
this->recoveredEnergyRate = 0.0;
this->NormalSHR = 0.0;
Expand Down Expand Up @@ -326,6 +327,12 @@ void CoilCoolingDXCurveFitPerformance::simulate(EnergyPlus::EnergyPlusData &stat
this->OperatingMode = 1;
this->recoveredEnergyRate = 0.0;
}
// Check for saturation error and modify temperature at constant enthalpy
Real64 tsat = Psychrometrics::PsyTsatFnHPb(state, outletNode.Enthalpy, inletNode.Press, RoutineName);
if (outletNode.Temp < tsat) {
outletNode.Temp = tsat;
outletNode.HumRat = Psychrometrics::PsyWFnTdbH(state, tsat, outletNode.Enthalpy);
}
}
} else if (useAlternateMode == DataHVACGlobals::coilEnhancedMode) {
this->calculate(
Expand Down
6 changes: 6 additions & 0 deletions src/EnergyPlus/Coils/CoilCoolingDXCurveFitSpeed.cc
Original file line number Diff line number Diff line change
Expand Up @@ -572,6 +572,12 @@ void CoilCoolingDXCurveFitSpeed::CalcSpeedOutput(EnergyPlus::EnergyPlusData &sta
}
outletNode.Temp = Psychrometrics::PsyTdbFnHW(outletNode.Enthalpy, outletNode.HumRat);
}
// Check for saturation error and modify temperature at constant enthalpy
Real64 tsat = Psychrometrics::PsyTsatFnHPb(state, outletNode.Enthalpy, inletNode.Press, RoutineName);
if (outletNode.Temp < tsat) {
outletNode.Temp = tsat;
outletNode.HumRat = Psychrometrics::PsyWFnTdbH(state, tsat, outletNode.Enthalpy);
}
}

Real64 CoilCoolingDXCurveFitSpeed::CalcBypassFactor(EnergyPlus::EnergyPlusData &state,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ TEST_F(CoilCoolingDXTest, CoilCoolingDXCurveFitSpeedTest)

thisSpeed.PLR = 1.0;
thisSpeed.ambPressure = 101325.0;
inletNode.Press = thisSpeed.ambPressure;
thisSpeed.AirFF = 1.0;
thisSpeed.rated_total_capacity = 3000.0;
thisSpeed.RatedAirMassFlowRate = 1.0;
Expand Down
29 changes: 23 additions & 6 deletions tst/EnergyPlus/unit/UnitarySystem.unit.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14741,6 +14741,12 @@ TEST_F(EnergyPlusFixture, Test_UnitarySystemModel_SubcoolReheatCoil)
EXPECT_NEAR(thisSys->CoilSHR, thisSys->LoadSHR, 0.001);
EXPECT_NEAR(SenOutput, -227.705, 0.1);
EXPECT_NEAR(LatOutput, -1531, 0.1);
// Check outlet for temperature below saturation
Real64 coilOutletTemp = state->dataCoilCooingDX->coilCoolingDXs[0].outletAirDryBulbTemp;
Real64 coilOutletHumRat = state->dataCoilCooingDX->coilCoolingDXs[0].outletAirHumRat;
Real64 coilOutletEnthalpy = Psychrometrics::PsyHFnTdbW(coilOutletTemp, coilOutletHumRat);
Real64 coilOutletTSat = Psychrometrics::PsyTsatFnHPb(*state, coilOutletEnthalpy, state->dataEnvrn->OutBaroPress);
EXPECT_TRUE(coilOutletTemp >= coilOutletTSat);

// OperatingMode 3 with mode ratio < 1
thisSys->m_ZoneSequenceCoolingNum = 0;
Expand Down Expand Up @@ -14770,11 +14776,17 @@ TEST_F(EnergyPlusFixture, Test_UnitarySystemModel_SubcoolReheatCoil)
SenOutput,
LatOutput);
EXPECT_EQ(state->dataCoilCooingDX->coilCoolingDXs[0].performance.OperatingMode, 3);
EXPECT_NEAR(state->dataCoilCooingDX->coilCoolingDXs[0].performance.ModeRatio, 0.55356, 0.001);
EXPECT_NEAR(state->dataCoilCooingDX->coilCoolingDXs[0].performance.ModeRatio, 0.1991, 0.001);
EXPECT_NEAR(thisSys->LoadSHR, 0.57154, 0.001);
EXPECT_NEAR(thisSys->CoilSHR, 0.4578, 0.001);
EXPECT_NEAR(SenOutput, -397.162, 0.1);
EXPECT_NEAR(LatOutput, -495.2, 0.1);
EXPECT_NEAR(thisSys->CoilSHR, 0.5266, 0.001);
EXPECT_NEAR(SenOutput, -397.032, 0.1);
EXPECT_NEAR(LatOutput, -338.8, 0.1);
// Check outlet for temperature below saturation
coilOutletTemp = state->dataCoilCooingDX->coilCoolingDXs[0].outletAirDryBulbTemp;
coilOutletHumRat = state->dataCoilCooingDX->coilCoolingDXs[0].outletAirHumRat;
coilOutletEnthalpy = Psychrometrics::PsyHFnTdbW(coilOutletTemp, coilOutletHumRat);
coilOutletTSat = Psychrometrics::PsyTsatFnHPb(*state, coilOutletEnthalpy, state->dataEnvrn->OutBaroPress);
EXPECT_TRUE(coilOutletTemp >= coilOutletTSat);

// OperatingMode 2
thisSys->m_ZoneSequenceCoolingNum = 0;
Expand All @@ -14797,9 +14809,14 @@ TEST_F(EnergyPlusFixture, Test_UnitarySystemModel_SubcoolReheatCoil)
EXPECT_EQ(state->dataCoilCooingDX->coilCoolingDXs[0].performance.OperatingMode, 1);
EXPECT_EQ(state->dataCoilCooingDX->coilCoolingDXs[0].performance.ModeRatio, 0.0);
EXPECT_NEAR(thisSys->LoadSHR, 0.98533, 0.001);
EXPECT_NEAR(thisSys->CoilSHR, 0.97702, 0.001);
EXPECT_NEAR(thisSys->CoilSHR, 0.98246, 0.001);
EXPECT_NEAR(SenOutput, -2000.0, 0.5);
EXPECT_NEAR(LatOutput, -346.1, 0.1);
EXPECT_NEAR(LatOutput, -1077.6, 0.1);
coilOutletTemp = state->dataCoilCooingDX->coilCoolingDXs[0].outletAirDryBulbTemp;
coilOutletHumRat = state->dataCoilCooingDX->coilCoolingDXs[0].outletAirHumRat;
coilOutletEnthalpy = Psychrometrics::PsyHFnTdbW(coilOutletTemp, coilOutletHumRat);
coilOutletTSat = Psychrometrics::PsyTsatFnHPb(*state, coilOutletEnthalpy, state->dataEnvrn->OutBaroPress);
EXPECT_TRUE(coilOutletTemp >= coilOutletTSat);
}

// This issue tests for GetInput with respect to Autosizing, especially for issue #7771 where
Expand Down

5 comments on commit 9d73076

@nrel-bot
Copy link

Choose a reason for hiding this comment

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

fix9302ZoneFloorArea (mjwitte) - Win64-Windows-10-VisualStudio-16: OK (2469 of 2470 tests passed, 0 test warnings)

Failures:\n

EnergyPlusFixture Test Summary

  • Passed: 1241
  • Failed: 1

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.

fix9302ZoneFloorArea (mjwitte) - x86_64-MacOS-10.15-clang-11.0.0: OK (3232 of 3234 tests passed, 0 test warnings)

Messages:\n

  • 1 test had: EIO diffs.
  • 1 test had: ERR diffs.
  • 1 test had: ESO small diffs.
  • 1 test had: MTR small diffs.
  • 1 test had: ZSZ small diffs.
  • 1 test had: Table big diffs.

Failures:\n

EnergyPlusFixture Test Summary

  • Passed: 1243
  • Failed: 1

regression Test Summary

  • Passed: 741
  • Failed: 1

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.

fix9302ZoneFloorArea (mjwitte) - x86_64-Linux-Ubuntu-18.04-gcc-7.5: OK (3273 of 3275 tests passed, 0 test warnings)

Messages:\n

  • 1 test had: EIO diffs.
  • 1 test had: ERR diffs.
  • 1 test had: ESO small diffs.
  • 1 test had: MTR small diffs.
  • 1 test had: ZSZ small diffs.
  • 1 test had: Table big diffs.

Failures:\n

EnergyPlusFixture Test Summary

  • Passed: 1243
  • Failed: 1

regression Test Summary

  • Passed: 761
  • Failed: 1

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.

fix9302ZoneFloorArea (mjwitte) - x86_64-Linux-Ubuntu-18.04-gcc-7.5-UnitTestsCoverage-Debug: OK (1748 of 1749 tests passed, 0 test warnings)

Failures:\n

EnergyPlusFixture Test Summary

  • Passed: 1243
  • Failed: 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.

fix9302ZoneFloorArea (mjwitte) - x86_64-Linux-Ubuntu-18.04-gcc-7.5-IntegrationCoverage-Debug: OK (746 of 746 tests passed, 0 test warnings)

Build Badge Test Badge Coverage Badge

Please sign in to comment.