Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/extendedHIspeedFix' into extende…
Browse files Browse the repository at this point in the history
…dHIspeedFix
  • Loading branch information
Yujie Xu committed Sep 13, 2024
2 parents 6600069 + 4f4809f commit aa7352d
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 @@ -487,7 +487,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

0 comments on commit aa7352d

Please sign in to comment.