Skip to content

Feature/enthalpy refactoring

Yue Wang requested to merge feature/enthalpy-refactoring into master

What this MR does / why does DuMux need it:

This is a first draft for refactoring the enthalpy computation. We would like to use a common database (NIST) for all of our components if possible (for most there is data in NIST). The only "problem" is that the provided temperature ranges as in this table can be constraining as they only start from T=298K for certain components. People probably would also like to use lower temperatures. Therefore, we compared the plots for the enthalpy difference compared to the the state of T=298K for three approaches. 1) Shomate equation for enthalpy, as suggested by NIST, 2) integrated shomate equation for heat capacity, which should also result in enthalpy, 3) take discrete value for heat capacity and integrate those, these should probably be the reference values, although the discrete values are quite sparse. heatEnt

As can be seen, method 1) and 2) match very well as expected. But what can also be seen: for temperature lower than 298K, these lines also match quite well with the integrated experimental values for the heat capacity. As for lower temperatures all methods align well, in the current implementation we also allow temperatures lower than 298K but print a warning once, that we are operating on extrapolated values, if that is the case. We would like to extend this approach to all components to have a unified interface for the enthalpy.

In the lower graph we compared the values for the computed enthalpies in Dumux with the values provided by the Shomate equations. enthalpyComp The dashed line represents the current values in Dumux (orange, dashed line), however they do not use the reference temperature of 298K, which we would like to unify. If we correct the Dumux values to the desired reference temperature we obtain the red line which matches very well with the values provided by the Shomate equation. For methane, the relative RMSE (compared to the corrected Dumux values) is around 0.08%.

Connected to #1255

Before you request a review from someone, make sure to revise the following points:

  • does the new code follow the style guide?
  • do the test pipelines pass? (see guide on how to run pipelines for a merge request)
  • is the code you changed and/or the new code you wrote covered in the test suite? (if not, extend the existing tests or write new ones)
  • is the list of the header includes complete? ("include what you use")
  • all files have to end with a \n character. Make sure there is no \ No newline at end of file comment in "Changes" of this MR.
  • (if not applicable remove) are newly introduced or modified physical values/functions backed up with a scientific reference (including doi) in the docs?
Edited by Ivan Buntic

Merge request reports