-
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
Helmholtz EOS #264
Helmholtz EOS #264
Conversation
I'm sure with a paper and some time I could decipher much of this, but as it stands I'm a bit concerned by all the short variable names flying around without context. Is there any way the variable names can be more descriptive? |
… threading in root finding. Almost there. Of course no guarantee it compiles.
👍 I blindly copied this out of the reference implementation---I will add some documentation in sphinx as well as some comments pointing to the reference implementation an the paper. Would that be sufficient to clarify? |
I think that will be helpful, but I just don't feel that reading the paper should be needed for the code review. Some basic comments to explain the general structure of the code and explanations for what blocks of variables are doing (or more descriptive variable names) will probably aid the review process. |
I can do that. The variable names are, for the most part, meaningfully self consistent. I think some comments explaining the convention will clarify. |
I added a Fortran interface, but I could not test it. Compiling (more precisely linking) my test program lead to quite a few error messages. I'm not sure if is because I forgot something in the interface or due to the issue described in #284 (given that the error message mentions several EOS is suspect the latter). I would need someone else to have a look at the interface to be sure. |
(This part is for archival purposes, i.e. that there is a reference somewhere that we thoroughly tested the implementation against a reference implementation) TestingTable interpolation
Root findingThe root finding is checked rather through a self-consistency check than a comparison against a reference implementation. We did compare it against the reference implementation, however, due to the different root finding algorithms and slightly different bounding mechanisms this comparison is rather difficult to interpret. Here we test self-consistency by going 'full circle', i.e. we calculate the internal energy through the table interpolation Fig 3. shows the difference between the original value and the value obtained from the root find without an initial guess for the temperature. It can be seen that the root find struggles in the low temperature - low density region. But once a sensible initial guess is provided (which it realistically will be in a production scenario) the root find works much better (see Fig 4). (Both Figures also show |
@@ -427,6 +443,21 @@ integer function init_sg_NobleAbel_f(matindex, eos, gm1, Cv, & | |||
err = init_sg_NobleAbel(matindex-1, eos%ptr, gm1, Cv, bb, qq, & | |||
c_loc(sg_mods_enabled), c_loc(sg_mods_values)) | |||
end function init_sg_NobleAbel_f | |||
|
|||
integer function init_sg_Helmholtz_f(matindex, eos, filename, rad, gas, coul, ion, ele, & |
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.
The fortran + C++ backend looks correct. It's also not necessarily needed for the astrophysical EOS's unless desired.
@dholladay00 does this look right to you?
using Catch::Matchers::WithinRel; | ||
using singularity::Helmholtz; | ||
const std::string filename = "../test/helmholtz/helm_table.dat"; | ||
SCENARIO("Helmholtz equation of state - Table interpolation (tgiven)", "[HelmholtzEOS]") { |
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'm not sure why either test would work---you weren't testing on device, because you had normal for loops for the test code, not portableFor
loops. I've fixed it, and tests now run on device.
From my perspective, this is ready to go. @mauneyc-LANL are you happy with the current cmake? |
I requested changes but I'll just approve for now since I don't want to hold anything up if I'm not around |
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.
Only one issue to address, everything else looks ok.
Misread the code, changes not needed
Triggered tests on re-git. Merging after they pass. |
PR Summary
Preliminary work on implementing a Helmholtz EOS in singularity-eos
PR Checklist
make format
command after configuring withcmake
.