Porous Flow Tutorial Page 05. Using a realistic equation of state for the fluid
It is trivial to add a realistic equation of state to any PorousFlow simulation. For instance, the high-precision Water97 equation of state may be used:
[FluidProperties<<<{"href": "../../syntax/FluidProperties/index.html"}>>>]
[the_simple_fluid]
type = Water97FluidProperties<<<{"description": "Fluid properties for water and steam (H2O) using IAPWS-IF97", "href": "../../source/fluidproperties/Water97FluidProperties.html"}>>>
[]
[](modules/porous_flow/examples/tutorial/05.i)(The name "the_simple_fluid" could also be changed to something more appropriate.)
In this case, the initial and boundary conditions must also be changed because the Water97 equation of state is not defined for (an absolute vacuum). For example:
[Variables<<<{"href": "../../syntax/Variables/index.html"}>>>]
[porepressure]
initial_condition<<<{"description": "Specifies a constant initial condition for this variable"}>>> = 1E6
[]
[temperature]
initial_condition<<<{"description": "Specifies a constant initial condition for this variable"}>>> = 313
scaling<<<{"description": "Specifies a scaling factor to apply to this variable"}>>> = 1E-8
[]
[](modules/porous_flow/examples/tutorial/05.i)and
[BCs<<<{"href": "../../syntax/BCs/index.html"}>>>]
[constant_injection_porepressure]
type = DirichletBC<<<{"description": "Imposes the essential boundary condition $u=g$, where $g$ is a constant, controllable value.", "href": "../../source/bcs/DirichletBC.html"}>>>
variable<<<{"description": "The name of the variable that this residual object operates on"}>>> = porepressure
value<<<{"description": "Value of the BC"}>>> = 2E6
boundary<<<{"description": "The list of boundary IDs from the mesh where this object applies"}>>> = injection_area
[]
[constant_injection_temperature]
type = DirichletBC<<<{"description": "Imposes the essential boundary condition $u=g$, where $g$ is a constant, controllable value.", "href": "../../source/bcs/DirichletBC.html"}>>>
variable<<<{"description": "The name of the variable that this residual object operates on"}>>> = temperature
value<<<{"description": "Value of the BC"}>>> = 333
boundary<<<{"description": "The list of boundary IDs from the mesh where this object applies"}>>> = injection_area
[]
[](modules/porous_flow/examples/tutorial/05.i)Using realistic high-precision equations of state can cause PorousFlow to run quite slowly, because the equations of state are so complicated to evaluate. It is always recommended to use TabulatedFluidProperties in the following way:
[FluidProperties<<<{"href": "../../syntax/FluidProperties/index.html"}>>>]
[true_water]
type = Water97FluidProperties<<<{"description": "Fluid properties for water and steam (H2O) using IAPWS-IF97", "href": "../../source/fluidproperties/Water97FluidProperties.html"}>>>
[]
[tabulated_water]
type = TabulatedBicubicFluidProperties<<<{"description": "Fluid properties using bicubic interpolation on tabulated values provided", "href": "../../source/fluidproperties/TabulatedBicubicFluidProperties.html"}>>>
input_fp<<<{"description": "The name of the FluidProperties UserObject"}>>> = true_water
temperature_min<<<{"description": "Minimum temperature for tabulated data."}>>> = 275
interpolated_properties<<<{"description": "Properties to interpolate. If unspecified and a data file is provided, the properties from the data file will be used. If specified, some properties from the data file can be ignored."}>>> = 'density viscosity enthalpy internal_energy'
fluid_property_output_file<<<{"description": "Name of the CSV file which can be output with the tabulation. This file can then be read as a 'fluid_property_file'"}>>> = water97_tabulated.csv
# Comment out the input_fp parameter and uncomment the fluid_property_file to use the newly generated tabulation
# fluid_property_file = water97_tabulated.csv
[]
[](modules/porous_flow/examples/tutorial/05_tabulated.i)and
[PorousFlowBasicTHM<<<{"href": "../../syntax/PorousFlowBasicTHM/index.html"}>>>]
porepressure<<<{"description": "The name of the porepressure variable"}>>> = porepressure
temperature<<<{"description": "For isothermal simulations, this is the temperature at which fluid properties (and stress-free strains) are evaluated at. Otherwise, this is the name of the temperature variable. Units = Kelvin"}>>> = temperature
coupling_type<<<{"description": "The type of simulation. For simulations involving Mechanical deformations, you will need to supply the correct Biot coefficient. For simulations involving Thermal flows, you will need an associated ConstantThermalExpansionCoefficient Material"}>>> = ThermoHydro
gravity<<<{"description": "Gravitational acceleration vector downwards (m/s^2)"}>>> = '0 0 0'
fp<<<{"description": "The name of the user object for fluid properties. Only needed if fluid_properties_type = PorousFlowSingleComponentFluid"}>>> = tabulated_water
[](modules/porous_flow/examples/tutorial/05_tabulated.i)Another advantage of using TabulatedfluidProperties is that the bounds on pressure and temperature imposed by the original "true" equation of state can be extrapolated past, which can help to remove problems of MOOSE trying to sample outside the original's region of validity (and thus causing the timestep to be cut).
Finally, in the case at hand, it is worth reminding the reader that PorousFlowBasicTHM is based on the assumptions of a constant, large fluid bulk modulus, and a constant fluid thermal expansion coefficient, which are incorrect for some fluids. User beware!