Skip to content

Commit

Permalink
expm1
Browse files Browse the repository at this point in the history
  • Loading branch information
rraustad committed Dec 25, 2024
1 parent 40ef0a7 commit 62fd1a4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/EnergyPlus/WaterToAirHeatPumpSimple.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3768,7 +3768,7 @@ namespace WaterToAirHeatPumpSimple {
To1 = aa + LatentCapacityTimeConstant;
Error = 1.0;
while (Error > 0.001) {
To2 = aa - LatentCapacityTimeConstant * (std::exp(-To1 / LatentCapacityTimeConstant) - 1.0);
To2 = aa - LatentCapacityTimeConstant * std::expm1(-To1 / LatentCapacityTimeConstant);
Error = std::abs((To2 - To1) / To1);
To1 = To2;
}
Expand Down
2 changes: 1 addition & 1 deletion src/EnergyPlus/WaterUse.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1497,7 +1497,7 @@ namespace WaterUse {
case HeatRecovHX::CrossFlow: { // Unmixed
Real64 CapacityRatio = MinCapacityRate / max(DrainCapacityRate, HXCapacityRate);
Real64 NTU = this->HXUA / MinCapacityRate;
this->Effectiveness = 1.0 - std::exp((std::pow(NTU, 0.22) / CapacityRatio) * (std::exp(-CapacityRatio * std::pow(NTU, 0.78)) - 1.0));
this->Effectiveness = 1.0 - std::exp((std::pow(NTU, 0.22) / CapacityRatio) * std::expm1(-CapacityRatio * std::pow(NTU, 0.78)));
} break;
default:
break;
Expand Down

3 comments on commit 62fd1a4

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

CppCheck-exp (rraustad) - x86_64-Linux-Ubuntu-24.04-gcc-13.3: OK (2916 of 2918 tests passed, 0 test warnings)

Failures:\n

integration Test Summary

  • Passed: 799
  • Failed: 2

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

CppCheck-exp (rraustad) - x86_64-Linux-Ubuntu-24.04-gcc-13.3-UnitTestsCoverage-RelWithDebInfo: OK (2100 of 2100 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.

CppCheck-exp (rraustad) - x86_64-Linux-Ubuntu-24.04-gcc-13.3-IntegrationCoverage-RelWithDebInfo: OK (799 of 801 tests passed, 0 test warnings)

Failures:\n

integration Test Summary

  • Passed: 799
  • Failed: 2

Build Badge Test Badge Coverage Badge

Please sign in to comment.