-
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
Fix bulk modulus calculation in spiner EOS #370
Conversation
Thanks for catching this @pdmullen ! I'm going to trigger tests on Darwin. |
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 want to hear from @jhp-lanl @dholladay00 and/or @chadmeyer just to confirm. But I think this fix is correct. And tests pass on Darwin.
Looking at this now. I think this might be OK, but I want to make sure (and perhaps also ensure that this is what we want). Let's agree that Is that what it is? I'm thinking so, but I might need to dig into |
I had the same confusion. I thought |
I think the another issue is that This would be advantageous for two reasons: 1) it avoids roundoff due to unnecessary multiplications and additions and 2) it can leverages the effort that the EOSPAC folks put into making sure that EOSPAC returns the most accurate bulk modulus possible. |
I'd add that it feels a bit weird for SpinerEOS to demand a bulk modulus field in tables when it actually just recomputes them from thermodynamic derivatives. Maybe a future MR could optionally enroll "bulk modulus correction/fixing". That way if a user wants to use bulk moduli as directly computed from EOSPAC, they could set |
I think this looks ready for merging |
Fixes a (potential) bug in Spiner EOS bulk modulus calculation.
PR Summary
Despite the bulk modulus being a required table in a SpinerDependsRhoT or SpinerDependsRhoSie EOS file, it is overwritten by functions$\partial P / \partial \rho \; \vert_{T}$ . However, I believe (please check me) that spiner expects that the tables provided correspond to $\partial P / \partial \rho \; \vert_{e}$ . This PR changes the bulk modulus formula to reflect this. There is this trick that $\partial P / \partial e \; \vert_{\rho} < 0$ , it modifies the bulk modulus calculation. I tried to preserve this behavior by defining $\partial P / \partial \rho \; \vert_{T}$ in terms of thermodynamic derivatives (please double check me...).
fixBulkModulus_
andcalcBMod_
, respectively. Inside these functions, the bulk modulus formulae assumedpdrho
to beeos_spiner
plays wherein ifPR Checklist
make format
command after configuring withcmake
.If preparing for a new release, in addition please check the following: