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

Prevent division by zero in WAHP heating design day calculations #10141

Merged
merged 1 commit into from
Aug 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
16 changes: 8 additions & 8 deletions src/EnergyPlus/WaterToAirHeatPumpSimple.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1240,16 +1240,16 @@ namespace WaterToAirHeatPumpSimple {
Real64 VolFlowRate;
Real64 CoolCapAtPeak; // Load on the cooling coil at cooling design conditions
Real64 HeatCapAtPeak; // Load on the heating coil at heating design conditions
Real64 PeakTotCapTempModFac = 0.0; // Peak total cooling capacity curve modifier
Real64 RatedTotCapTempModFac = 0.0; // Rated total cooling capacity curve modifier
Real64 PeakHeatCapTempModFac = 0.0; // Peak heating capacity curve modifier
Real64 PeakTotCapTempModFac = 1.0; // Peak total cooling capacity curve modifier
Real64 RatedTotCapTempModFac = 1.0; // Rated total cooling capacity curve modifier
Real64 PeakHeatCapTempModFac = 1.0; // Peak heating capacity curve modifier
Real64 DesignEntWaterTemp; // Design entering coil water temperature
Real64 SensCapAtPeak; // Sensible load on the cooling coil at cooling design conditions
Real64 PeakSensCapTempModFac = 0.0; // Peak sensible cooling capacity curve modifier
Real64 RatedSensCapTempModFac = 0.0; // Rated sensible cooling capacity curve modifier
Real64 RatedHeatCapTempModFac = 0.0; // Rated heating capacity curve modifier
Real64 RatedCoolPowerTempModFac = 0.0; // Rated cooling power curve modifier
Real64 RatedHeatPowerTempModFac = 0.0; // Rated heating power curve modifier
Real64 PeakSensCapTempModFac = 1.0; // Peak sensible cooling capacity curve modifier
Real64 RatedSensCapTempModFac = 1.0; // Rated sensible cooling capacity curve modifier
Real64 RatedHeatCapTempModFac = 1.0; // Rated heating capacity curve modifier
Real64 RatedCoolPowerTempModFac = 1.0; // Rated cooling power curve modifier
Real64 RatedHeatPowerTempModFac = 1.0; // Rated heating power curve modifier
Comment on lines +1243 to +1252
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Curve modifiers are initialized to 1.0 instead of 0 to avoid division by zero.

Copy link
Contributor

Choose a reason for hiding this comment

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

This seems like a reasonable change.

Copy link
Member

Choose a reason for hiding this comment

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

Agreed, this looks fine.

Real64 RatedCapCoolTotalDesCDD; // Rated total cooling coil capacity determined at cooling design conditions
constexpr Real64 Tref(283.15); // Refrence Temperature for performance curves,10C [K]
int TimeStepNumAtMax;
Expand Down
2 changes: 1 addition & 1 deletion tst/EnergyPlus/unit/WaterToAirHeatPumpSimple.unit.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1547,7 +1547,7 @@ TEST_F(EnergyPlusFixture, WaterToAirHeatPumpSimpleTest_SizeHVACWaterToAirRatedCo
state->dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(2).RatioRatedHeatRatedTotCoolCap = 1.23;

state->dataSize->FinalZoneSizing(state->dataSize->CurZoneEqNum).DesCoolVolFlow = 0.20;
state->dataSize->FinalZoneSizing(state->dataSize->CurZoneEqNum).DesHeatVolFlow = 0.0;
state->dataSize->FinalZoneSizing(state->dataSize->CurZoneEqNum).DesHeatVolFlow = 0.0004;
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Use an air flow that very small but greater than 0.

state->dataSize->FinalZoneSizing(state->dataSize->CurZoneEqNum).CoolDesTemp = 13.0;
state->dataSize->FinalZoneSizing(state->dataSize->CurZoneEqNum).HeatDesTemp = 40;
state->dataSize->FinalZoneSizing(state->dataSize->CurZoneEqNum).CoolDesHumRat = 0.0075;
Expand Down