SinglePhaseFluidProperties

SinglePhaseFluidProperties is a base class for all single-phase fluid properties objects. Its main function is to provide interfaces for computing various properties from different combinations of other properties.

Properties

The following properties are considered in this class, where the "Name" column gives the identifier for the property used in the available interfaces:

NameSymbolDescription
betaVolumetric expansion coefficient
cSpeed of sound
cpIsobaric specific heat capacity
cvIsochoric specific heat capacity
eSpecific internal energy
gGibbs free energy
gammaRatio of specific heats,
hSpecific enthalpy
kThermal conductivity
muDynamic viscosity
pPressure
rhoDensity
sSpecific entropy
TTemperature
vSpecific volume

Because two independent, intensive thermodynamic properties define a thermodynamic state of a pure fluid, interfaces in these objects are of the form where is the desired thermodynamic property and and are independent, intensive thermodynamic properties that define the thermodynamic state. The corresponding function name is fname_from_aname_bname, where fname, aname, and bname are the names in the table above, corresponding to , , and , respectively. The following table lists which properties are available from various combinations of properties (e.g., "Yes" in the column for the row denotes that the interface fname_from_aname_bname is available):

Name
Yes
YesYes
YesYes
YesYesYes
YesYesYesYes
Yes
YesYes
YesYes
YesYesYes
YesYesYes
YesYesYes
YesYes
YesYesYesYes
YesYes
Yes

Interfaces are also provided for getting derivatives of fluid properties with respect to the input arguments. These interfaces are named the same as their non-derivative counterparts, but have no return value but 3 additional (output) arguments, corresponding to the property value and then the derivatives of each of the two input arguments. For example, has the interface rho_from_p_T(p, T, rho, drho_dp, drho_dT), where drho_dp and drho_dT correspond to and , respectively.

commentnote:Automatic Differentiation

Fluid properties objects have interfaces for taking advantage of MOOSE's Automatic Differentiation capability. See the example in the next section.

Additionally, the following interfaces are available:

  • fluidName(): The fluid name.

  • molarMass(): The fluid's molar mass (kg/mol).

The full list of available methods can be found in either the source code or the Modules Doxygen page for each FluidProperties class.

Default Analytical Fluid Properties Relations

SinglePhaseFluidProperties provides a number of default implementations for some fluid properties where analytical relations hold for all single phase fluid properties. Some of these fluid properties are also implemented along with their derivatives with regards to the input variables, when these derivatives can also be analytically described. Relevant automatic differentiation (AD) implementations are also provided through a macro to avoid duplicated code.

The full list of available methods can be found in either the source code or the Doxygen page.

Variable Set Conversions

Different fluid applications may require different variable sets, such as (pressure, temperature) or (specific volume, specific internal energy), depending on the flow regimes of interest and relatedly the numerical discretization. Fluid properties are not necessarily implemented or known for all variable sets, so conversions from one variable set to another can be helpful.

For many fluids, analytical closures for these conversions are not known, so SinglePhaseFluidProperties defines several routines for iteratively converting from one variable set to another. This leverages the numerical inversion methods utilities. Notably, the following routines are provided:

  void p_T_from_v_e(const CppType & v,
                    const CppType & e,
                    Real p0,
                    Real T0,
                    CppType & p,
                    CppType & T,
                    bool & conversion_succeeded) const;
(moose/modules/fluid_properties/include/fluidproperties/SinglePhaseFluidProperties.h)
  void p_T_from_v_h(const T & v,
                    const T & h,
                    Real p0,
                    Real T0,
                    T & pressure,
                    T & temperature,
                    bool & conversion_succeeded) const;
(moose/modules/fluid_properties/include/fluidproperties/SinglePhaseFluidProperties.h)
  void p_T_from_h_s(const T & h,
                    const T & s,
                    Real p0,
                    Real T0,
                    T & pressure,
                    T & temperature,
                    bool & conversion_succeeded) const;
(moose/modules/fluid_properties/include/fluidproperties/SinglePhaseFluidProperties.h)

These routines may then be used to convert from one variable set to another before obtaining the desired fluid property. For example, this routine converts (pressure, temperature) to (specific volume, specific energy) to compute entropy.

SinglePhaseFluidProperties::s_from_p_T(const Real pressure, const Real temperature) const
{
  Real v, e;
  v_e_from_p_T(pressure, temperature, v, e);
  return s_from_v_e(v, e);
}
(moose/modules/fluid_properties/src/fluidproperties/SinglePhaseFluidProperties.C)