idaholab / moose

Multiphysics Object Oriented Simulation Environment
https://www.mooseframework.org
GNU Lesser General Public License v2.1
1.72k stars 1.04k forks source link

Allow TabulatedFluidProperties to be used with (v,e) & (v,h) arguments #20101

Closed snschune closed 1 year ago

snschune commented 2 years ago

Reason

TabulatedFluidProperties is a flexible class to provide custom fluid properties. However, it does not work with THM because it only implements (p, T) lookups.

Design

Implement a reverse interpolation p(v,e), T(v,e), p(v,h),T(v,h) and then reuse (p,T) implementation.

Impact

new capability

veeshy commented 2 years ago

Any update on this issue? I saw https://github.com/idaholab/moose/pull/20102 had problems which is a bummer. Any way a community member could help here if there is a vision for this that's not represented in the issue / pr?

snschune commented 2 years ago

If you can guarantee that v(p,T) and e(p,t) are both monotonic, then you can invert them and for any p,T get v,e. The current implementation uses splines which I don't think guarantee monotonicity of the interpolation. You could replace the splines with linear interpolation which is monotonic if the interpolation points are monotonic. You can make linear interpolation be quite efficient even with a lot of x,y pairs if you resample x onto a uniform grid. Then you have to find a good way to invert v,e(p,T) and you're essentially done.

All in all, it seems like difficult task for limited benefit to me. If we really want to support tabulated material properties from v,e, then it might be better to implement a bespoke fluid properties to do that.

veeshy commented 2 years ago

Yup, I think this line of thinking eventually leads you to something like https://inldigitallibrary.inl.gov/sites/sti/sti/Sort_1213.pdf which have inversion built into the spline, but looks like a lot of work ha.

tabular v,e does sound nicer, though it's harder to get a nice rectangular grid with it, for example CO2 PT and rhou show in http://www.coolprop.org/fluid_properties/fluids/CarbonDioxide.html#consistency-plots

GiudGiud commented 1 year ago

Closed by #22060