Add StiffenedGas EOS implementation#2979
Conversation
Review checklistThis checklist is meant to assist creators of PRs (to let them know what reviewers will typically look for) and reviewers (to guide them in a structured review process). Items do not need to be checked explicitly for a PR to be eligible for merging. Purpose and scope
Code quality
Documentation
Testing
Performance
Verification
Created with ❤️ by the Trixi.jl community. |
|
Note. I forgot to remove tester.jl file that I copied accidentally. |
jlchan
left a comment
There was a problem hiding this comment.
Thanks @Raymond0622! Here are some comments. Once these are addressed, you can mark it ready for review
| # run the simulation | ||
| solver = CarpenterKennedy2N54(williamson_condition = false) | ||
| sol = solve(ode, solver; | ||
| dt = stepsize_callback(ode), saveat = LinRange(tspan..., 100),# solve needs some value here but it will be overwritten by the stepsize_callback |
There was a problem hiding this comment.
Lets remove saveat for CI-run elixirs
| boundary_conditions = (x_neg = boundary_condition_periodic, | ||
| x_pos = boundary_condition_periodic); |
There was a problem hiding this comment.
These are defined but not used
| pInf = 1e9 | ||
| q = -1167 * 1e3 | ||
| R = 0.08314 / 0.01802 | ||
| gamma = 2.35 | ||
| cv0 = 1816.0 |
There was a problem hiding this comment.
Could we convert all constants via convert(RealT, ...) so StiffenedGas(RealT=Float32) is type-stable and consistent with Trixi conventions? Adding a unit test would b great too
| """ | ||
| function calc_pressure_derivatives(V, T, eos::StiffenedGas) | ||
| (; cv0, gamma) = eos | ||
| dpdT_V = (gamma - 1) * cv0 * T / V |
There was a problem hiding this comment.
Should there be a factor of T here?
| end | ||
|
|
||
| #struct to match | ||
| # https://www.sciencedirect.com/science/article/pii/S0045793015001887 |
There was a problem hiding this comment.
It might be good in this comment (possibly bulk it out to a docstring) to point to the equation of state in the reference. I think it is equation (38) but I am not 100% sure because the notation used below is slightly different.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2979 +/- ##
==========================================
- Coverage 97.11% 97.05% -0.06%
==========================================
Files 625 627 +2
Lines 48544 48584 +40
==========================================
+ Hits 47139 47150 +11
- Misses 1405 1434 +29
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Using equation_of_state framework introduced by Jesse Chan, I added a Stiffened Gas EOS implementation using state functions defined in the following reference: https://www.sciencedirect.com/science/article/pii/S0029549310005157