-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Provide a function to give initial temperature guesses for PTE #164
Conversation
The changes look good to me, but can we add a dead simple unit test to cover the behavior? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like this. Also nice use of not-quite-transcendental functions. :D
I do think we should have some kind of test. What about just using this initial guess machinery in test_pte.cpp
to generate initial guesses for the solver?
Tguess = std::max(Tguess, temp[m]); | ||
// If a guess was passed in, it's saved in Tnorm | ||
Real Tguess; | ||
if (Tnorm > 0.0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we allow zero temperature? I assume not?
thanks for the quick review @jhp-lanl and @Yurlungur. I've added a call to this function in the test_pte code, as @Yurlungur suggested. If the tests pass, is this good to go? |
Yep, I'd say so. I'll trigger tests on Darwin and then let's get it merged in. |
Ah, actually Darwin CI currently in-repair. I'll just merge when github tests pass. |
PR Summary
This PR introduces a function that solves$u_0 = \sum_m \rho_m \alpha_m \epsilon_m(\rho_m, T)$ for the temperature $T$ , for fixed input $u_0$ (total material energy density, i.e. $erg/cm^{3}$ ), $\alpha_m$ (material volume fractions), and $\rho_m$ (material physical densities). The intent of the function is to be used to provide an initial guess for the PTE solver, so the hard coded tolerance of the solver is quite loose. Bisection is used because it's better behaved for EOSs that have only a weak dependence of $\epsilon$ on $T$ at cold temperatures.
To go along with this, the PTE solvers have been augmented to allow an initial temperature guess to be (optionally) provided. If a guess is not provided, or the guess is zero, the solver tries to guess a temperature as before.
PR Checklist
make format
command after configuring withcmake
.