Skip to content

Commit

Permalink
is it because rho is uninitialized?
Browse files Browse the repository at this point in the history
  • Loading branch information
jonahm-LANL committed Jan 3, 2025
1 parent 5f8e8e0 commit 74ee377
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 0 additions & 3 deletions singularity-eos/eos/eos_base.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -874,14 +874,11 @@ 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
3 changes: 2 additions & 1 deletion test/eos_unit_test_helpers.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,8 @@ CheckRhoSieFromPT(EOS eos, Real rho, Real T,
Indexer_t &&lambda = static_cast<Real *>(nullptr)) {
const Real P = eos.PressureFromDensityTemperature(rho, T, lambda);
const Real sie = eos.InternalEnergyFromDensityTemperature(rho, T, lambda);
Real rtest, etest;
Real rtest = 12; // set these to something
Real etest = 1;
eos.DensityEnergyFromPressureTemperature(P, T, lambda, rtest, etest);
Real P_test = eos.PressureFromDensityTemperature(rtest, T, lambda);
Real residual = P_test - P;
Expand Down

0 comments on commit 74ee377

Please sign in to comment.