Open aikubo opened 1 week ago
Thanks for opening your first issue @aikubo (at least I believe it's the first) :smile:
Did you want to have a go at this @aikubo?
I was just checking, and TabulatedFluidProperties
passes through some things like
Real
TabulatedFluidProperties::molarMass() const
{
if (_fp)
return _fp->molarMass();
else
mooseError("Molar Mass not specified.");
}
but not critical properties or triple point properties. Adding the equivalent methods like above like you suggested in #27159 would fix this.
Yes I’ll have a go at it !
On Tue, Apr 23, 2024 at 6:15 PM Chris Green @.***> wrote:
Did you want to have a go at this @aikubo https://github.com/aikubo?
I was just checking, and TabulatedFluidProperties passes through some things like
Real TabulatedFluidProperties::molarMass() const { if (_fp) return _fp->molarMass(); else mooseError("Molar Mass not specified."); }
but not critical properties or triple point properties. Adding the equivalent methods like above like you suggested in #27159 https://github.com/idaholab/moose/discussions/27159 would fix this.
— Reply to this email directly, view it on GitHub https://github.com/idaholab/moose/issues/27457#issuecomment-2073795139, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMI4VWDI5XL5YNYXYU7JESDY64BSNAVCNFSM6AAAAABGVZNJYWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANZTG44TKMJTHE . You are receiving this because you were mentioned.Message ID: @.***>
So I've added the necessary functions to tabulated fluid properties based off the pointer _fp
. But I was still getting errors from the MWE above like this:
The following error occurred in the FluidProperties 'water' of type TabulatedFluidProperties.
Temperature 1.07419e+19 is outside the range of tabulated temperature (300, 500).
I traced this to the h_from_p_T
function in TabulatedFluidProperties
. Additionally, it would also output the wrong values for viscosity and density.When it does the interpolation it gets the wrong phase field (liquid instead of twophase) because the dT is 0 while dh is + at the phase change.
So I added a flag in TabulatedFluidProperties called p_h_variables
which will call the _fp->h_from_p_T
instead of interpolating. This does negate some of the useful features of using tabulated properties. You might be able to add something like construct_pT_from_ph
or modify construct_pT_from_vh
which would help speed it up.
I also wrote a test for this in /modules/porousflow/tests/test/fluidstate.
Branch is here: https://github.com/aikubo/moose/tree/tabulatedfluidproperties_watervapor
Bug Description
Currently, TabulatedFluidProperties and TabulatedBicubicFluidProperties don't work with certain other classes which call functions like TriplePointPressure() which are implemented in other fluid properties such as Water97FluidProperties.
Noted in https://github.com/idaholab/moose/discussions/27159#discussioncomment-9205632
Steps to Reproduce
Which produces
Impact
Currently this means you can't use TFP with PorousFlowWaterVapor and potentially other classes which call functions associated with multiphase behavior.
It can be useful to use TFP to save time on calculations and for convergence issues.
[Optional] Diagnostics
No response