Skip to content

Commit

Permalink
resolve err counter integer overflow
Browse files Browse the repository at this point in the history
the error message counter is a sum of all previous counter values
it overflows to negative
non-recurring warning keeps showing up after the overflow
use the counter, not the sum of counter in the predicate
  • Loading branch information
Yujie Xu committed Sep 25, 2024
1 parent 335cf0f commit 54be7dc
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/EnergyPlus/FluidProperties.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3886,9 +3886,7 @@ namespace FluidProperties {
} else { // All data is at zero: we are completely inside the saturation dome. Best thing we can do is return saturation value
++df->SatErrCountGetSupHeatDensityRefrig;
// send warning
this->errors[(int)RefrigError::SatSupDensity].count += df->SatErrCountGetSupHeatDensityRefrig;
// send warning
if (this->errors[(int)RefrigError::SatSupDensity].count <= df->RefrigErrorLimitTest) {
if (df->SatErrCountGetSupHeatDensityRefrig <= df->RefrigErrorLimitTest) {
ShowWarningMessage(
state,
format("{}: Refrigerant [{}] is saturated at the given conditions, saturated density at given temperature returned. **",
Expand Down

4 comments on commit 54be7dc

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

fixVRFhighCOP (Unknown) - x86_64-Linux-Ubuntu-22.04-gcc-11.4: OK (2913 of 2913 tests passed, 0 test warnings)

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.

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

Build Badge Test 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.

fixVRFhighCOP (Unknown) - x86_64-Linux-Ubuntu-22.04-gcc-11.4-IntegrationCoverage-RelWithDebInfo: OK (799 of 799 tests passed, 0 test warnings)

Build Badge Test Badge Coverage Badge

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

fixVRFhighCOP (Unknown) - x86_64-Linux-Ubuntu-22.04-gcc-11.4-UnitTestsCoverage-RelWithDebInfo: OK (2097 of 2097 tests passed, 0 test warnings)

Build Badge Test Badge Coverage Badge

Please sign in to comment.