-
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
Respect known inputs, constrained P and T solvers #156
Conversation
…0/eap_integration
…arate kernel for each possible input condition and respects those conditions. In addition, 2 new PTE solvers have been added to support this re-write. Finding a PTE solution where either P or T is known and constrained. This will respect that constraint and find the appropriate internal energy. This is still being tested.
@jhp-lanl, please take a look at the new kernels and make sure the inputs are treated as inputs and the outputs are treated as outputs. @Yurlungur, @jdolence, @chadmeyer, @jhp-lanl I gave the solvers my best shot. For now I have just commented out initbase and replaced them with different init bases that I think should work. I think there is still an issue in initialization at how to get good initial volume fraction / component density guesses yet still conserve mass. |
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.
Great work, @dholladay00 ! A few comments:
- Looks like you mostly copy-pasted into the new solver definitions. I think there's room to abstract some of that functionality out so there's less repeat code.
- I didn't carefully cross check the equations against @jhp-lanl 's doc, but that should be done.
- I am not 100% confident about the initial guesses you're setting up for the solvers. I think that's worth thinking carefully about.
- We need some tests of these solvers. It should be pretty easy to set up a cross check We can use one of the full
PTESolverDependsRhoT
orPTESolverDependsRhoSie
solvers to set up a system we know has an equilibrium solution, then pass in data toPTESolverFixed*
to see if it can recover the same equilibrium. - Nice cleanup of the
singularity_eos*
file but I think it could still use some refactoring to clarify flow control and reduce repeated code.
Yeah let's all take a look at this at some point. I agree I think there's an issue as currently written. |
Are we talking about a correctness issue? |
I'm not sure, actually. I think just a little bit more communal staring/cross checking would be useful. |
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'll have to finish reviewing singularity_eos.cpp
next week unfortunately
rho_total = 0.0; | ||
for (int m = 0; m < nmat; ++m) { | ||
rhobar[m] = rho[m] * vfrac[m]; | ||
rho_total += rhobar[m]; | ||
} |
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.
My thinking (which could of course be incorrect) was that the only difference between the base class Init()
and what's needed here is that the initialization of the pressure array isn't required.
…nd matrix element indexing issue in the rho-P solver. Remove debugging print statements and clean up the test.
… gets created if kokkos in enabled.
…the name to reflect this. Alter the pte test to reflect these changes as well.
… made. These functions were folded into the base class and used as necessary.
Are you asking about your Your stuff is mainly for initialization where we wouldn't expect the material volumes or volume fractions to be known before the PTE solve, so your volume fraction guess is probably as good as any. I think your functions need to assume that only the bare minimum is known about a state. You still allow a temperature guess to be passed through right? I think that should be sufficient. But I haven't thought about this code in a while so I could be forgetting key details. |
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.
This looks good! I think you addressed all of my issues
@Yurlungur I think this is ready, give this another look when you get a chance. Hoping to get this merged soon. |
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.
You've addressed all my comments and this looks good. But before we merge, I asked @jdolence to run this branch in riot to make sure the changes to PTE didn't break anything.
Oh also @dholladay00 and/or @jhp-lanl if we could add documentation regarding the two new PTE solvers, that would be helpful. Jeff's pdf should be enough, just dump it into sphinx in the right file. |
@Yurlungur, in terms of using the cache, I do the offset calculation to figure out the cache location within the solver and create an accessor to it outside of the solve. It's not ideal but it doesn't mess with the current implementation of caching in the solvers and it allows me to take advantage of it when doing lookups after the PTE solve. |
I can do this @dholladay00 since you've been slogging through debugging and writing this code. It will come in a separate MR and I'll create an issue |
…nge when needed. Addresses Jonahs comments
👍 I think this good enough for now. With the issue we can resolve later.
Thanks, @jhp-lanl ! That works for me. As soon as @jdolence confirms nothing breaks downstream in riot, I'm ready to merge. |
@Yurlungur @jdolence is there a timeline for the downstream testing? I'd like to get this merged ASAP. |
@Yurlungur and @jdolence I reiterate that this should be merged ASAP. |
Just spoke to @jdolence let's just merge it. Wil lmerge as soon as tests pass. |
PR Summary
The get_sg_eos function did not properly take into account the knowns and unknowns for all possible input conditions, nor could it initialize mixed material regions with P-T, rho-T, or rho-P, inputs. There is now a different kernel for each different input condition and 2 new PTE solvers that can take into account when P or T are known but the internal energy is not known.
PR Checklist
make format
command after configuring withcmake
.