Skip to content

Commit

Permalink
choose worse, but more generic guess... does that help?
Browse files Browse the repository at this point in the history
  • Loading branch information
jonahm-LANL committed Jan 3, 2025
1 parent a74bd26 commit 5f8e8e0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion singularity-eos/eos/eos_base.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -854,7 +854,6 @@ class EosBase {
DensityEnergyFromPressureTemperature(const Real press, const Real temp,
Indexer_t &&lambda, Real &rho, Real &sie) const {
using RootFinding1D::findRoot; // more robust but slower. Better default.
using RootFinding1D::regula_falsi;
using RootFinding1D::Status;

// Pressure is not monotone in density at low densities, which can
Expand All @@ -875,11 +874,14 @@ class EosBase {
};
Real rhoguess = rho; // use input density
if ((rhoguess <= rhomin) || (rhoguess >= rhomax)) { // avoid edge effects
/*
if ((rhomin < DEFAULT_RHO_GUESS) && (DEFAULT_RHO_GUESS < rhomax)) {
rhoguess = DEFAULT_RHO_GUESS;
} else {
rhoguess = 0.5 * (rhomin + rhomax);
}
*/
rhoguess = 0.5 * (rhomin + rhomax);
}
auto status = findRoot(PofRT, press, rhoguess, rhomin, rhomax, robust::EPS(),
robust::EPS(), rho);
Expand Down

0 comments on commit 5f8e8e0

Please sign in to comment.