# 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:

[Modules]
[./FluidProperties]
[./the_simple_fluid]
type = Water97FluidProperties
[../]
[../]
[]

(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]
[./porepressure]
initial_condition = 1E6
[../]
[./temperature]
initial_condition = 313
scaling = 1E-8
[../]
[]

(modules/porous_flow/examples/tutorial/05.i)

and

[BCs]
[./constant_injection_porepressure]
type = PresetBC
variable = porepressure
value = 2E6
boundary = injection_area
[../]
[./constant_injection_temperature]
type = PresetBC
variable = temperature
value = 333
boundary = 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:

[Modules]
[./FluidProperties]
[./true_water]
type = Water97FluidProperties
[../]
[./tabulated_water]
type = TabulatedFluidProperties
fp = true_water
temperature_min = 275
interpolated_properties = 'density viscosity enthalpy internal_energy'
fluid_property_file = water97_tabulated.csv
[../]
[../]
[]

(modules/porous_flow/examples/tutorial/05_tabulated.i)

and

[PorousFlowBasicTHM]
porepressure = porepressure
temperature = temperature
coupling_type = ThermoHydro
gravity = '0 0 0'
fp = 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!