Skip to content
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

Merged
merged 9 commits into from
Aug 15, 2022

Conversation

jdolence
Copy link
Member

@jdolence jdolence commented Aug 15, 2022

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

  • Adds a test for any bugs fixed. Adds tests for new features.
  • Format your changes by using the make format command after configuring with cmake.
  • Document any new features, update documentation for changes made.
  • Make sure the copyright notice on any files you modified is up to date.
  • After creating a pull request, note it in the CHANGELOG.md file

@jdolence jdolence changed the title Draft: Provide a function to give initial temperature guesses for PTE Provide a function to give initial temperature guesses for PTE Aug 15, 2022
@jhp-lanl
Copy link
Collaborator

The changes look good to me, but can we add a dead simple unit test to cover the behavior?

Copy link
Collaborator

@Yurlungur Yurlungur left a 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) {
Copy link
Collaborator

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?

singularity-eos/closure/mixed_cell_models.hpp Show resolved Hide resolved
singularity-eos/closure/mixed_cell_models.hpp Show resolved Hide resolved
@jdolence
Copy link
Member Author

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?

@Yurlungur
Copy link
Collaborator

Yep, I'd say so. I'll trigger tests on Darwin and then let's get it merged in.

@Yurlungur
Copy link
Collaborator

Ah, actually Darwin CI currently in-repair. I'll just merge when github tests pass.

@jhp-lanl jhp-lanl merged commit 394bb13 into main Aug 15, 2022
@Yurlungur Yurlungur deleted the jdolence/temp_guess branch April 19, 2024 22:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants