Skip to content

Commit

Permalink
try using a shorter termination for bisection solver
Browse files Browse the repository at this point in the history
  • Loading branch information
yujiex committed Sep 13, 2024
1 parent 16faa31 commit 4f4809f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/EnergyPlus/ExtendedHI.cc
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,7 @@ namespace ExtendedHI {
// The function computes the extended heat index, in Kelvinn

auto const HVACSystemRootSolverBackup = state.dataRootFinder->HVACSystemRootFinding.HVACSystemRootSolver;
state.dataRootFinder->HVACSystemRootFinding.HVACSystemRootSolver = HVACSystemRootSolverAlgorithm::BisectionThenRegulaFalsi;
state.dataRootFinder->HVACSystemRootFinding.HVACSystemRootSolver = HVACSystemRootSolverAlgorithm::ShortBisectionThenRegulaFalsi;
int eqvar_name = 0;
Real64 eqvar_value = find_eqvar_name_and_value(state, Ta, RH, eqvar_name);

Expand Down
8 changes: 8 additions & 0 deletions src/EnergyPlus/General.cc
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,14 @@ void SolveRoot(const EnergyPlusData &state,
}
break;
}
case HVACSystemRootSolverAlgorithm::ShortBisectionThenRegulaFalsi: {
if (NIte < 3) {
XTemp = (X1 + X0) / 2.0;
} else {
XTemp = (Y0 * X1 - Y1 * X0) / DY;
}
break;
}
default: {
XTemp = (Y0 * X1 - Y1 * X0) / DY;
}
Expand Down
1 change: 1 addition & 0 deletions src/EnergyPlus/HVACSystemRootFindingAlgorithm.hh
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ enum class HVACSystemRootSolverAlgorithm : int
RegulaFalsiThenBisection,
BisectionThenRegulaFalsi,
Alternation,
ShortBisectionThenRegulaFalsi,
Num
};
struct HVACSystemRootFindingAlgorithm
Expand Down

4 comments on commit 4f4809f

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

extendedHIspeedFix (yujiex) - x86_64-Linux-Ubuntu-22.04-gcc-11.4: OK (2923 of 2923 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.

extendedHIspeedFix (yujiex) - Win64-Windows-10-VisualStudio-16: OK (2901 of 2901 tests passed, 0 test warnings)

Build Badge Test Badge

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

extendedHIspeedFix (yujiex) - x86_64-Linux-Ubuntu-22.04-gcc-11.4-UnitTestsCoverage-RelWithDebInfo: OK (2107 of 2107 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.

extendedHIspeedFix (yujiex) - 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

Please sign in to comment.