-
Notifications
You must be signed in to change notification settings - Fork 8
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
Bjm/stiffgas #274
Bjm/stiffgas #274
Conversation
eos_singularity.cpp eos_singularity.f90 to add the Stiffened Gas EoS
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.
Overall looks pretty good! Thanks for adding this. A few minor nitpicks below. In addition, some bigger picture things:
- We should test this on GPUs. the Darwin CI pipeline will do that for us, but if you have access to a GPU machine it's worth trying to run the tests there yourself too.
- We try to add the PR to the
CHANGELOG.md
file - It would be good to add documentation about this EOS to the
models.rst
file indoc/sphinx/src
. You can see how the others there are done. It doesn't have to be very extensive. - Looks like your code isn't formatted. We use
clang-format
to automatically format our code. If you haveclang-format
installed, you can run it onsingularity-eos
automatically in one of two ways: first, you can typemake format_singularity-eos
in your build directory. Alternatively, if that isn't working for you, there's a script inutils/scripts
calledformat.sh
. You can run it to format your code. I recommend running it as:
FMT=path/to/clang-format VERBOSE=1 utils/scripts/format.sh
where FMT
points to the path of your clang-format
executable.
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.
Good start Ben!
We should decide how to do entropy. I'd prefer this to match the ideal gas case, but I'm open to arguments as to why this is better. Numerically, I think the ideal gas case is simpler though.
I'd like to see a few sanity tests like:
- Can you create an ideal gas EOS and a stiffened gas EOS with appropriate parameters and have them return the same result?
- Are the asymptotic limits correct? You'll need to address some of the numerical issues above (divide by zero, etc.), but for example
$P(\rho, 0)$ or$P(0, T)$ should return$-P_\infty$ . - Check the bulk modulus against a finite difference of the pressure (see the Gruneisen EOS for an example)
- Use a finite difference to approximate
$T\left(\frac{\partial S}{\partial T}\right)_V$ and see if that's equal to the constant heat capacity.
EDIT - And of course add documentation for the new model.
and adds robust::SMALL() to logorithms to prevent potential numerical issues Not fixed/touched: Appropriate floor for entropy, energy, pressure Entropy formulation Bulk modulus formulation Daniel's optimizations
version 1 inputs : gm1, Cv, Pinf, q version 2 inputs : gm1, Cv, Pinf, q, q', T0, P0
@c0sm0-kramer after you add documentation I think this is good to go. EDIT - Actually can you add a couple more tests. I'll make a new review |
…jm/stiffgas Need changes from LANL team
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.
Looks like it's just about there. A few more changes and it should be good to go.
Ping me on mattermost when you make the changes and I'll run the CI on gitlab and get this merged when that passes
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.
Looks good to me! I'll run the CI on gitlab and then if that passes we just need @Yurlungur to approve and this is good to go. Thanks a lot @c0sm0-kramer !
CI failed on GPUs because of missing @c0sm0-kramer all we need is documentation and this is good to go. Please add the EOS to the |
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.
Small nitpick: can you move the stiff gas EOS model up just after the ideal gas model in the documentation rather than at the end? Otherwise this looks good!
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 very good! Thanks for all your effort in pulling this through.
PR Summary
Added Stiffened Gas EoS according to reference Élaboration des lois d'état d'un liquide et de sa vapeur pour les modèles d'écoulements diphasiques, International Journal of Thermal Sciences, O Le Métayer and J Massoni and R Saurel, https://doi.org/10.1016/j.ijthermalsci.2003.09.002. Built with cmake 3.26.4 and make 3.82, compiled and tested with gcc 10.3.0.
This allows for the use of a stiffened gas EoS.
PR Checklist
make format
command after configuring withcmake
.