lanl / singularity-eos

Performance portable equations of state and mixed cell closures
https://lanl.github.io/singularity-eos/
BSD 3-Clause "New" or "Revised" License
27 stars 8 forks source link

Tentative plan for thermodynamic consistency and for potentials as needed for kinetic phase transitions #210

Open Yurlungur opened 1 year ago

Yurlungur commented 1 year ago

This is a follow up and summary of a discussion had between myself, @chadmeyer @aematts @jhp-lanl . This is the path forward for potentials as needed for @aematts 's kinetic phase transition treatment:

  1. We will expose two new functions: EntropyFromDensityEnergy and EntropyFromDensityTemperature. Not all non-tabulated equations of state have an entropy in closed form. For now we will provide a stub in the base class that simply raises an error for those equations of state.
  2. We will provide an introspection mechanism so a downstream code can ask an EOS if it (a) has an entropy, (b) if that entropy is thermodynamically consistent, or (c) none of the above. A function with no inputs and an enum class output probably works.
  3. For tabulated EOS's we can pass through to the underlying tabulated information, e.g., through EOSPAC.
  4. In the medium term we will also look into providing a tool that can plot "distance from thermodynamic consistency" for a given EOS, perhaps as a python script, so users can decide for themselves if they want to trust a given EOS or table for a given problem/application. @aematts mentioned that PEM-EOS may already have such a tool they may be willing to share.
  5. In the longish term, we will consider the possibility of computing an entropy by integration and tabulating it, even for analytic EOS's with no closed form. This could perhaps be a modifier.

Thanks everyone for a productive discussion today. Please let me know if this summarizes the team's thoughts and whether or not it still makes sense.

jhp-lanl commented 1 year ago

I think this issue is a better representation of the path forward than our previous discussion in https://github.com/lanl/singularity-eos/issues/196. Closing that issue.