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

Conversation

lymereJ
Copy link
Collaborator

@lymereJ lymereJ commented Aug 7, 2023

Pull request overview

The fix is demonstrated through an update to an exiting test. Also, the defect file was run with this branch, the simulation complete successfully and the expected capacity is reported:

Component Sizing Information, COIL:HEATING:WATERTOAIRHEATPUMP:EQUATIONFIT, DATACENTER_TOP_ZN_6 ZN PSZ-AC DATA CENTER WATER-TO-AIR HP HTG COIL, Design Size Rated Heating Capacity [W], 8540.49707

NOTE: ENHANCEMENTS MUST FOLLOW A SUBMISSION PROCESS INCLUDING A FEATURE PROPOSAL AND DESIGN DOCUMENT PRIOR TO SUBMITTING CODE

Pull Request Author

Add to this list or remove from it as applicable. This is a simple templated set of guidelines.

  • Title of PR should be user-synopsis style (clearly understandable in a standalone changelog context)
  • Label the PR with at least one of: Defect, Refactoring, NewFeature, Performance, and/or DoNoPublish
  • Pull requests that impact EnergyPlus code must also include unit tests to cover enhancement or defect repair
  • Author should provide a "walkthrough" of relevant code changes using a GitHub code review comment process
  • If any diffs are expected, author must demonstrate they are justified using plots and descriptions
  • If changes fix a defect, the fix should be demonstrated in plots and descriptions

Reviewer

This will not be exhaustively relevant to every PR.

  • Perform a Code Review on GitHub
  • If branch is behind develop, merge develop and build locally to check for side effects of the merge
  • If defect, verify by running develop branch and reproducing defect, then running PR and reproducing fix
  • If feature, test running new feature, try creative ways to break it
  • CI status: all green or justified
  • Check that performance is not impacted (CI Linux results include performance check)
  • Run Unit Test(s) locally
  • Check any new function arguments for performance impacts
  • Verify IDF naming conventions and styles, memos and notes and defaults
  • If new idf included, locally check the err file and other outputs

@lymereJ lymereJ added the Defect Includes code to repair a defect in EnergyPlus label Aug 7, 2023
@lymereJ lymereJ added this to the EnergyPlus 23.2 IOFreeze milestone Aug 7, 2023
Comment on lines +1243 to +1252
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
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.

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

@lymereJ
Copy link
Collaborator Author

lymereJ commented Aug 7, 2023

The diffs are expected and reflect the change in initial modifier value.

Comment on lines +1243 to +1252
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
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.

@Myoldmopar
Copy link
Member

This looks good. Table diffs are showing in 3 files, but it's just the coil sizing showing up instead of being zero. No math diffs or anything else. Thanks @lymereJ for the fix and @rraustad for looking it over. Merging.

@Myoldmopar Myoldmopar merged commit d0d8fa7 into develop Aug 16, 2023
17 checks passed
@Myoldmopar Myoldmopar deleted the fix_inf_cap_for_wahp branch August 16, 2023 13:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Defect Includes code to repair a defect in EnergyPlus
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Water to air heat pump are still sized to an infinite capacity
8 participants