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
Conversation
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 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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.
The diffs are expected and reflect the change in initial modifier value. |
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed, this looks fine.
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:
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.
Reviewer
This will not be exhaustively relevant to every PR.