Skip to content

Commit

Permalink
revert abs(Q_coil), reduce h_IU_cond_in label230, fix Q_evap_req neg
Browse files Browse the repository at this point in the history
per Mike's comment,
#10649 (comment),
Q_coil should not be negative, remove the abs(Q_coil) fix

Q_evap_req will be negative if Q_cond_req <
CompEvaporatingPWRSpd(CounterCompSpdTemp). This leads to negative compressor
speed. Temtatively fix it like this.

According to comment here
#10649 (comment),
The h_comp_out and h_comp_out_new could keep getting farther and farther from
each other if h_cond_IU_in can only increase in the iteration. Addressing this
by adding a direction where h_cond_IU can decrease as well.
  • Loading branch information
Yujie Xu committed Aug 22, 2024
1 parent ae3fec6 commit cabd9e6
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions src/EnergyPlus/HVACVariableRefrigerantFlow.cc
Original file line number Diff line number Diff line change
Expand Up @@ -11942,10 +11942,17 @@ void VRFCondenserEquipment::CalcVRFCondenser_FluidTCtrl(EnergyPlusData &state)
//* Update h_comp_out in iteration (Label230)
h_comp_out_new = Ncomp / (m_ref_IU_evap + m_ref_OU_evap) + h_comp_in;

if ((std::abs(h_comp_out - h_comp_out_new) > Tolerance * h_comp_out) && (h_IU_cond_in < h_IU_cond_in_up)) {
h_IU_cond_in = h_IU_cond_in + 0.1 * (h_IU_cond_in_up - h_IU_cond_in_low);
if ((std::abs(h_comp_out - h_comp_out_new) > Tolerance * h_comp_out) && (h_IU_cond_in < h_IU_cond_in_up) &&
(h_IU_cond_in_low < h_IU_cond_in)) {
Real64 h_IU_cond_in_old = h_IU_cond_in;
if (h_comp_out < h_comp_out_new) {
h_IU_cond_in = h_IU_cond_in + 0.1 * (h_IU_cond_in_up - h_IU_cond_in_low);
} else {
h_IU_cond_in = h_IU_cond_in - 0.1 * (h_IU_cond_in_up - h_IU_cond_in_low);
}
goto Label230;
}

if (h_IU_cond_in > h_IU_cond_in_up) {
h_IU_cond_in = 0.5 * (h_IU_cond_in_up + h_IU_cond_in_low);
}
Expand Down Expand Up @@ -13288,7 +13295,7 @@ Real64 VRFCondenserEquipment::VRFOU_FlowRate(EnergyPlusData &state,
deltaT = this->C3Tc * pow_2(SHSC) + this->C2Tc * SHSC + this->C1Tc;
T_coil_surf = TeTc - deltaT;
T_coil_out = T_coil_in + (T_coil_surf - T_coil_in) * (1 - BF);
m_air = abs(Q_coil) / (T_coil_out - T_coil_in) / 1005.0;
m_air = Q_coil / (T_coil_out - T_coil_in) / 1005.0;

} else if (OperationMode == HXOpMode::EvapMode) {
// IU Heating: OperationMode 1
Expand Down Expand Up @@ -13727,7 +13734,7 @@ void VRFCondenserEquipment::VRFOU_CompSpd(
CompEvaporatingCAPSpd(CounterCompSpdTemp) =
this->CoffEvapCap * this->RatedEvapCapacity * CurveValue(state, this->OUCoolingCAPFT(CounterCompSpdTemp), T_discharge, T_suction);

Q_evap_req = Q_cond_req - CompEvaporatingPWRSpd(CounterCompSpdTemp);
Q_evap_req = max(0.0, Q_cond_req - CompEvaporatingPWRSpd(CounterCompSpdTemp));

if (Q_evap_req * C_cap_operation <= CompEvaporatingCAPSpd(CounterCompSpdTemp)) {
// Compressor speed stage CounterCompSpdTemp need not to be increased, finish Iteration DoName1
Expand Down

4 comments on commit cabd9e6

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

fixVRFnegativeFanPower (Unknown) - x86_64-Linux-Ubuntu-22.04-gcc-11.4: OK (3344 of 3698 tests passed, 8 test warnings)

Messages:\n

  • 354 tests had: Table big diffs.
  • 6 tests had: AUD diffs.
  • 5 tests had: BND diffs.
  • 17 tests had: EIO diffs.
  • 17 tests had: ESO big diffs.
  • 3 tests had: MTD diffs.
  • 11 tests had: MTR big diffs.
  • 17 tests had: Table string diffs.
  • 4 tests had: Table small diffs.
  • 8 tests had: ESO small diffs.
  • 8 tests had: MTR small diffs.
  • 2 tests had: ERR diffs.
  • 1 test had: RDD diffs.
  • 1 test had: MDD diffs.
  • 1 test had: IDF diffs.

Failures:\n

regression Test Summary

  • Passed: 458
  • Failed: 354

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.

fixVRFnegativeFanPower (Unknown) - Win64-Windows-10-VisualStudio-16: OK (2864 of 2864 tests passed, 0 test warnings)

Build Badge Test Badge

@nrel-bot-2b
Copy link

Choose a reason for hiding this comment

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

fixVRFnegativeFanPower (Unknown) - x86_64-Linux-Ubuntu-22.04-gcc-11.4-IntegrationCoverage-Debug: OK (796 of 796 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.

fixVRFnegativeFanPower (Unknown) - x86_64-Linux-Ubuntu-22.04-gcc-11.4-UnitTestsCoverage-Debug: OK (2071 of 2071 tests passed, 0 test warnings)

Build Badge Test Badge Coverage Badge

Please sign in to comment.