Fluid equations of state
PorousFlow uses formulations contained in the Fluid Properties module to calculate fluid properties such as density or viscosity.
Using the Fluid Properties module
Implementation
PorousFlow can use any of the UserObjects in the Fluid Properties module. A specific fluid can be included in the input file by adding the following block
[FluidProperties<<<{"href": "../../syntax/FluidProperties/index.html"}>>>]
[water]
type = Water97FluidProperties<<<{"description": "Fluid properties for water and steam (H2O) using IAPWS-IF97", "href": "../../source/fluidproperties/Water97FluidProperties.html"}>>>
[]
[]
(modules/porous_flow/test/tests/fluids/h2o.i)To calculate fluid properties, a PorousFlowSingleComponentFluid
Material
can be used by adding
[Materials<<<{"href": "../../syntax/Materials/index.html"}>>>]
[temperature]
type = PorousFlowTemperature<<<{"description": "Material to provide temperature at the quadpoints or nodes and derivatives of it with respect to the PorousFlow variables", "href": "../../source/materials/PorousFlowTemperature.html"}>>>
temperature<<<{"description": "Fluid temperature variable. Note, the default is suitable if your simulation is using Kelvin units, but probably not for Celsius"}>>> = temp
[]
[ppss]
type = PorousFlow1PhaseFullySaturated<<<{"description": "This Material is used for the fully saturated single-phase situation where porepressure is the primary variable", "href": "../../source/materials/PorousFlow1PhaseFullySaturated.html"}>>>
porepressure<<<{"description": "Variable that represents the porepressure of the single phase"}>>> = pp
[]
[water]
type = PorousFlowSingleComponentFluid<<<{"description": "This Material calculates fluid properties at the quadpoints or nodes for a single component fluid", "href": "../../source/materials/PorousFlowSingleComponentFluid.html"}>>>
temperature_unit<<<{"description": "The unit of the temperature variable"}>>> = Kelvin
fp<<<{"description": "The name of the user object for fluid properties"}>>> = water
phase<<<{"description": "The phase number"}>>> = 0
[]
[]
(modules/porous_flow/test/tests/fluids/h2o.i)Fluid density, viscosity, internal energy and enthalpy are calculated by this material (depending on the options chosen, see PorousFlowSingleComponentFluid
for details).
Multiple fluids can be included by simply adding additional fluids to the Modules
block and corresponding PorousFlowSingleComponentFluid
entries in the Materials
block.
Due to this design, it is trivial to change the fluid in any simulation by simply swapping out the Fluid Properties UserObjects.
The fluid properties UserObjects expect temperature in Kelvin.
If the input file uses temperature in Celsius, the temperature_unit
option in PorousFlowSingleComponentFluid
must be set to Celsius
.
Performance
Computing fluid properties such as density and viscosity can be expensive when using detailed fluid equations of state (such as Water97FluidProperties or CO2FluidProperties). In some cases, these computations can be a significant proportion of the overall time taken.
In order to reduce the computational expense of using high-precision fluid formulations, the Fluid Properties module provides a general UserObject that uses bicubic interpolation to calculate fluid properties, see TabulatedFluidProperties for details. Using interpolation to calculate fluid properties can significantly reduce the computational expense (particularly for CO2FluidProperties, where the density is calculated iteratively from pressure and temperature).
In the PorousFlow module, fluid density and viscosity are typically calculated at the same time. To achieve the maximum benefit from TabulatedFluidProperties, users should ensure that both density and viscosity are calculated by interpolation, by either providing them in the supplied properties file, or making sure that both are specified in the interpolated_properties
input parameter if no data file exists.
Available fluids
The full list of available fluids is provided in the Fluid Properties module.