Skip to content

Commit

Permalink
change FanSpdRatio calculation to use enthalpy difference
Browse files Browse the repository at this point in the history
coil heating rate calculation is like the following
AirMassFlow * (OutletAirEnthalpy - InletAirEnthalpy) * PartLoadRatio

In the computation of fan speed ratio, the coil heating capacity is
FanSpdRto * Garate * 1005.0 * (Tout - Tin)

The difference between
1005.0 * (Tout - Tin) and (OutletAirEnthalpy - InletAirEnthalpy)
can cause mismatches between coil heating rate and heating demand

Here we change the fan speed ratio caculation to also use the enthalpy
difference way to compute its heating capacity to match the demand
  • Loading branch information
Yujie Xu committed Jul 29, 2024
1 parent f5c5103 commit 03d9070
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 2 deletions.
27 changes: 25 additions & 2 deletions src/EnergyPlus/DXCoils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -17481,8 +17481,10 @@ void ControlVRFIUCoil(EnergyPlusData &state,
if (QCoilSenHeatingLoad > QinSenMin1) {
// Modulate fan speed to meet room sensible load; SC is not updated
FanSpdRatioMax = 1.0;
auto f = [QCoilSenHeatingLoad, Ts_1, Tin, Garate, BF](Real64 FanSpdRto) {
return FanSpdResidualHeat(FanSpdRto, QCoilSenHeatingLoad, Ts_1, Tin, Garate, BF);
Tout = Tin + (Ts_1 - Tin) * (1 - BF);
Real64 RatedAirMassFlowRate = state.dataDXCoils->DXCoil(CoilIndex).RatedAirMassFlowRate[0];
auto f = [QCoilSenHeatingLoad, RatedAirMassFlowRate, Tout, Tin, Win](Real64 FanSpdRto) {
return FanSpdResidualHeatUsingH(FanSpdRto, QCoilSenHeatingLoad, RatedAirMassFlowRate, Tout, Tin, Win);
};
General::SolveRoot(state, 1.0e-3, MaxIter, SolFla, Ratio1, f, FanSpdRatioMin, FanSpdRatioMax);
// this will likely cause problems eventually, -1 and -2 mean different things
Expand Down Expand Up @@ -17767,6 +17769,27 @@ Real64 FanSpdResidualHeat(Real64 FanSpdRto, Real64 QCoilSenHeatingLoad, Real64 T
return (TotCap - ZnSenLoad) / ZnSenLoad;
}

Real64 FanSpdResidualHeatUsingH(Real64 FanSpdRto, Real64 QCoilSenHeatingLoad, Real64 RatedAirMassFlowRate, Real64 Tout, Real64 Tin, Real64 Win)
{

// FUNCTION INFORMATION:
// AUTHOR Yujie Xu (yujiex)
// DATE WRITTEN Jul 2024
//
// PURPOSE OF THIS FUNCTION:
// Calculates residual function (desired zone heating load - actual heating coil capacity)
// This is used to modify the fan speed to adjust the coil heating capacity to match
// the zone heating load. This one uses Hin and Hout difference rather than Tin and Tout difference
// like in FanSpdResidualHeat
//
Real64 ZnSenLoad = QCoilSenHeatingLoad;
// +-100 W minimum zone load?
if (std::abs(ZnSenLoad) < 100.0) ZnSenLoad = sign(100.0, ZnSenLoad);
Real64 Wout = Win;
Real64 TotCap = FanSpdRto * RatedAirMassFlowRate * (PsyHFnTdbW(Tout, Wout) - PsyHFnTdbW(Tin, Win));
return (TotCap - ZnSenLoad) / ZnSenLoad;
}

void SetMSHPDXCoilHeatRecoveryFlag(EnergyPlusData &state, int const DXCoilNum)
{

Expand Down
2 changes: 2 additions & 0 deletions src/EnergyPlus/DXCoils.hh
Original file line number Diff line number Diff line change
Expand Up @@ -932,6 +932,8 @@ namespace DXCoils {

Real64 FanSpdResidualHeat(Real64 FanSpdRto, Real64 QCoilSenHeatingLoad, Real64 Ts_1, Real64 Tin, Real64 Garate, Real64 BF);

Real64 FanSpdResidualHeatUsingH(Real64 FanSpdRto, Real64 QCoilSenHeatingLoad, Real64 RatedAirMassFlowRate, Real64 Tout, Real64 Tin, Real64 Win);

void SetMSHPDXCoilHeatRecoveryFlag(EnergyPlusData &state, int const DXCoilNum); // must match coil names for the coil type

void SetDXCoilAirLoopNumber(EnergyPlusData &state, std::string const &CoilName, int const AirLoopNum); // must match coil names for the coil type
Expand Down

5 comments on commit 03d9070

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

fixDocVRFheatpumpHeatRate (Unknown) - x86_64-Linux-Ubuntu-22.04-gcc-11.4: OK (3692 of 3695 tests passed, 0 test warnings)

Messages:\n

  • 3 tests had: EIO diffs.
  • 1 test had: ESO big diffs.
  • 1 test had: Table small diffs.
  • 2 tests had: ESO small diffs.
  • 2 tests had: Table big diffs.
  • 1 test had: MTR small diffs.
  • 1 test had: Table string diffs.

Failures:\n

regression Test Summary

  • Passed: 808
  • Failed: 3

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.

fixDocVRFheatpumpHeatRate (Unknown) - Win64-Windows-10-VisualStudio-16: OK (2862 of 2862 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.

fixDocVRFheatpumpHeatRate (Unknown) - x86_64-MacOS-10.18-clang-15.0.0: OK (3651 of 3654 tests passed, 0 test warnings)

Messages:\n

  • 3 tests had: EIO diffs.
  • 1 test had: ESO big diffs.
  • 1 test had: Table small diffs.
  • 2 tests had: ESO small diffs.
  • 2 tests had: Table big diffs.
  • 1 test had: MTR small diffs.
  • 1 test had: Table string diffs.

Failures:\n

regression Test Summary

  • Passed: 788
  • Failed: 3

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.

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

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

Build Badge Test Badge Coverage Badge

Please sign in to comment.