Skip to content

Commit 4f4809f

Browse files
committed
try using a shorter termination for bisection solver
1 parent 16faa31 commit 4f4809f

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

src/EnergyPlus/ExtendedHI.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -485,7 +485,7 @@ namespace ExtendedHI {
485485
// The function computes the extended heat index, in Kelvinn
486486

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

src/EnergyPlus/General.cc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,14 @@ void SolveRoot(const EnergyPlusData &state,
241241
}
242242
break;
243243
}
244+
case HVACSystemRootSolverAlgorithm::ShortBisectionThenRegulaFalsi: {
245+
if (NIte < 3) {
246+
XTemp = (X1 + X0) / 2.0;
247+
} else {
248+
XTemp = (Y0 * X1 - Y1 * X0) / DY;
249+
}
250+
break;
251+
}
244252
default: {
245253
XTemp = (Y0 * X1 - Y1 * X0) / DY;
246254
}

src/EnergyPlus/HVACSystemRootFindingAlgorithm.hh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ enum class HVACSystemRootSolverAlgorithm : int
5959
RegulaFalsiThenBisection,
6060
BisectionThenRegulaFalsi,
6161
Alternation,
62+
ShortBisectionThenRegulaFalsi,
6263
Num
6364
};
6465
struct HVACSystemRootFindingAlgorithm

0 commit comments

Comments
 (0)