www.mooseframework.org
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
TabulatedFluidProperties Class Reference

Class for fluid properties read from a file. More...

#include <TabulatedFluidProperties.h>

Inheritance diagram for TabulatedFluidProperties:
[legend]

Public Member Functions

 TabulatedFluidProperties (const InputParameters &parameters)
 
virtual ~TabulatedFluidProperties ()
 
virtual void initialSetup () override
 
virtual std::string fluidName () const override
 Fluid name. More...
 
virtual Real molarMass () const override
 Molar mass [kg/mol]. More...
 
virtual Real rho_from_p_T (Real pressure, Real temperature) const override
 Density from pressure and temperature. More...
 
virtual void rho_from_p_T (Real pressure, Real temperature, Real &rho, Real &drho_dp, Real &drho_dT) const override
 Density and its derivatives from pressure and temperature. More...
 
virtual Real e_from_p_T (Real pressure, Real temperature) const override
 Internal energy from pressure and temperature. More...
 
virtual void e_from_p_T (Real pressure, Real temperature, Real &e, Real &de_dp, Real &de_dT) const override
 Internal energy and its derivatives from pressure and temperature. More...
 
virtual Real h_from_p_T (Real p, Real T) const override
 Specific enthalpy from pressure and temperature. More...
 
virtual void h_from_p_T (Real pressure, Real temperature, Real &h, Real &dh_dp, Real &dh_dT) const override
 Specific enthalpy and its derivatives from pressure and temperature. More...
 
virtual Real mu_from_p_T (Real pressure, Real temperature) const override
 
virtual void mu_from_p_T (Real pressure, Real temperature, Real &mu, Real &dmu_dp, Real &dmu_dT) const override
 
virtual Real cp_from_p_T (Real pressure, Real temperature) const override
 Isobaric specific heat capacity. More...
 
virtual Real cv_from_p_T (Real pressure, Real temperature) const override
 Isochoric specific heat. More...
 
virtual Real c_from_p_T (Real pressure, Real temperature) const override
 Speed of sound. More...
 
virtual Real k_from_p_T (Real pressure, Real temperature) const override
 Thermal conductivity. More...
 
virtual void k_from_p_T (Real pressure, Real temperature, Real &k, Real &dk_dp, Real &dk_dT) const override
 Thermal conductivity and its derivatives wrt pressure and temperature. More...
 
virtual Real s_from_p_T (Real pressure, Real temperature) const override
 Specific entropy from pressure and temperature. More...
 
virtual void s_from_p_T (Real p, Real T, Real &s, Real &ds_dp, Real &ds_dT) const override
 Specific entropy and its derivatives from pressure and temperature. More...
 
virtual Real henryConstant (Real temperature) const override
 Henry's law constant for dissolution in water. More...
 
virtual void henryConstant (Real temperature, Real &Kh, Real &dKh_dT) const override
 Henry's law constant for dissolution in water and derivative wrt temperature. More...
 
virtual Real vaporPressure (Real temperature) const override
 Vapor pressure. More...
 
virtual void vaporPressure (Real temperature, Real &psat, Real &dpsat_dT) const override
 Vapor pressure. More...
 
virtual Real cp_from_p_T (Real pressure, Real temperature) const
 Isobaric specific heat capacity. More...
 
virtual void cp_from_p_T (Real pressure, Real temperature, Real &cp, Real &dcp_dp, Real &dcp_dT) const
 Isobaric specific heat capacity from pressure and temperature. More...
 
virtual Real p_from_v_e (Real v, Real e) const
 Pressure from specific volume and specific internal energy. More...
 
virtual void p_from_v_e (Real v, Real e, Real &p, Real &dp_dv, Real &dp_de) const
 Pressure and its derivatives from specific volume and specific internal energy. More...
 
virtual Real T_from_v_e (Real v, Real e) const
 Temperature from specific volume and specific internal energy. More...
 
virtual void T_from_v_e (Real v, Real e, Real &T, Real &dT_dv, Real &dT_de) const
 Temperature and its derivatives from specific volume and specific internal energy. More...
 
virtual Real c_from_v_e (Real v, Real e) const
 Sound speed from specific volume and specific internal energy. More...
 
virtual void c_from_v_e (Real v, Real e, Real &c, Real &dc_dv, Real &dc_de) const
 Sound speed and its derivatives from specific volume and specific internal energy. More...
 
virtual Real cp_from_v_e (Real v, Real e) const
 Isobaric (constant-pressure) specific heat from specific volume and specific internal energy. More...
 
virtual void cp_from_v_e (Real v, Real e, Real &cp, Real &dcp_dv, Real &dcp_de) const
 Isobaric (constant pressure) specific heat from specific volume and specific internal energy. More...
 
virtual Real cv_from_v_e (Real v, Real e) const
 Isochoric (constant-volume) specific heat from specific volume and specific internal energy. More...
 
virtual Real mu_from_v_e (Real v, Real e) const
 Dynamic viscosity from specific volume and specific internal energy. More...
 
virtual Real k_from_v_e (Real v, Real e) const
 Thermal conductivity from specific volume and specific internal energy. More...
 
virtual Real s_from_v_e (Real v, Real e) const
 Specific entropy from specific volume and specific internal energy. More...
 
virtual void s_from_v_e (Real v, Real e, Real &s, Real &ds_dv, Real &ds_de) const
 Specific entropy and its derivatives from specific volume and specific internal energy. More...
 
virtual Real s (Real pressure, Real temperature) const
 
virtual Real s_from_h_p (Real h, Real p) const
 Specific entropy from specific enthalpy and pressure. More...
 
virtual void s_from_h_p (Real h, Real p, Real &s, Real &ds_dh, Real &ds_dp) const
 Specific entropy and its derivatives from specific enthalpy and pressure. More...
 
virtual Real rho_from_p_s (Real p, Real s) const
 Density from pressure and specific entropy. More...
 
virtual void rho_from_p_s (Real p, Real s, Real &rho, Real &drho_dp, Real &drho_ds) const
 Density and its derivatives from pressure and specific entropy. More...
 
virtual Real e_from_v_h (Real v, Real h) const
 Specific internal energy as a function of specific volume and specific enthalpy. More...
 
virtual void e_from_v_h (Real v, Real h, Real &e, Real &de_dv, Real &de_dh) const
 Specific internal energy and derivatives as a function of specific volume and specific enthalpy. More...
 
virtual Real rho (Real p, Real T) const
 
virtual void rho_dpT (Real pressure, Real temperature, Real &rho, Real &drho_dp, Real &drho_dT) const
 
virtual Real v_from_p_T (Real p, Real T) const
 Specific volume from pressure and temperature. More...
 
virtual void v_from_p_T (Real p, Real T, Real &v, Real &dv_dp, Real &dv_dT) const
 Specific volume and its derivatives from pressure and temperature. More...
 
virtual Real e_from_p_rho (Real p, Real rho) const
 Specific internal energy from pressure and density. More...
 
virtual void e_from_p_rho (Real p, Real rho, Real &e, Real &de_dp, Real &de_drho) const
 Specific internal energy and its derivatives from pressure and density. More...
 
virtual Real e_spndl_from_v (Real v) const
 Specific internal energy from temperature and specific volume. More...
 
virtual void v_e_spndl_from_T (Real T, Real &v, Real &e) const
 Specific internal energy from temperature and specific volume. More...
 
virtual Real e_from_T_v (Real T, Real v) const
 Specific volume and specific internal energy from temerature at the vapor spinodal. More...
 
virtual void e_from_T_v (Real T, Real v, Real &e, Real &de_dT, Real &de_dv) const
 Specific internal energy and its derivatives from temperature and specific volume. More...
 
virtual Real p_from_T_v (Real T, Real v) const
 Pressure from temperature and specific volume. More...
 
virtual void p_from_T_v (Real T, Real v, Real &p, Real &dp_dT, Real &dp_dv) const
 Pressure and its derivatives from temperature and specific volume. More...
 
virtual Real h_from_T_v (Real T, Real v) const
 Specific enthalpy from temperature and specific volume. More...
 
virtual void h_from_T_v (Real T, Real v, Real &h, Real &dh_dT, Real &dh_dv) const
 Specific enthalpy and its derivatives from temperature and specific volume. More...
 
virtual Real s_from_T_v (Real T, Real v) const
 Specific entropy from temperature and specific volume. More...
 
virtual void s_from_T_v (Real T, Real v, Real &s, Real &ds_dT, Real &ds_dv) const
 Specific entropy and its derivatives from temperature and specific volume. More...
 
virtual Real cv_from_T_v (Real T, Real v) const
 Specific isochoric heat capacity from temperature and specific volume. More...
 
virtual Real h (Real p, Real T) const
 
virtual void h_dpT (Real pressure, Real temperature, Real &h, Real &dh_dp, Real &dh_dT) const
 
virtual Real e (Real pressure, Real temperature) const
 
virtual void e_dpT (Real pressure, Real temperature, Real &e, Real &de_dp, Real &de_dT) const
 
virtual Real p_from_h_s (Real h, Real s) const
 Pressure from specific enthalpy and specific entropy. More...
 
virtual void p_from_h_s (Real h, Real s, Real &p, Real &dp_dh, Real &dp_ds) const
 Pressure and its derivatives from specific enthalpy and specific entropy. More...
 
virtual Real g_from_v_e (Real v, Real e) const
 Gibbs free energy from specific volume and specific internal energy. More...
 
virtual Real beta_from_p_T (Real p, Real T) const
 Thermal expansion coefficient from pressure and temperature. More...
 
virtual void beta_from_p_T (Real p, Real T, Real &beta, Real &dbeta_dp, Real &dbeta_dT) const
 Thermal expansion coefficient and its derivatives from pressure and temperature. More...
 
virtual Real beta (Real pressure, Real temperature) const
 
virtual Real pp_sat_from_p_T (Real p, Real T) const
 Partial pressure at saturation in a gas mixture. More...
 
virtual Real T_from_p_h (Real pressure, Real enthalpy) const
 Temperature from pressure and specific enthalpy. More...
 
virtual Real criticalPressure () const
 Critical pressure. More...
 
virtual Real criticalTemperature () const
 Critical temperature. More...
 
virtual Real criticalDensity () const
 Critical density. More...
 
virtual Real criticalInternalEnergy () const
 Critical specific internal energy. More...
 
virtual Real triplePointPressure () const
 Triple point pressure. More...
 
virtual Real triplePointTemperature () const
 Triple point temperature. More...
 
virtual void rho_e_from_p_T (Real pressure, Real temperature, Real &rho, Real &drho_dp, Real &drho_dT, Real &e, Real &de_dp, Real &de_dT) const
 Density and internal energy and their derivatives wrt pressure and temperature. More...
 
virtual void rho_e_dpT (Real pressure, Real temperature, Real &rho, Real &drho_dp, Real &drho_dT, Real &e, Real &de_dp, Real &de_dT) const
 
virtual Real c (Real pressure, Real temperature) const
 
virtual void cp_from_p_T (Real pressure, Real temperature, Real &cp, Real &dcp_dp, Real &dcp_dT) const
 Isobaric specific heat capacity from pressure and temperature. More...
 
virtual Real gamma_from_p_T (Real pressure, Real temperature) const
 Adiabatic index - ratio of specific heats. More...
 
virtual Real mu (Real pressure, Real temperature) const
 Dynamic viscosity. More...
 
virtual void mu_dpT (Real pressure, Real temperature, Real &mu, Real &dmu_dp, Real &dmu_dT) const
 Dynamic viscosity and its derivatives wrt pressure and temperature. More...
 
virtual Real mu_from_rho_T (Real density, Real temperature) const
 Dynamic viscosity as a function of density and temperature. More...
 
virtual void mu_from_rho_T (Real density, Real temperature, Real ddensity_dT, Real &mu, Real &dmu_drho, Real &dmu_dT) const
 Dynamic viscosity and its derivatives wrt density and temperature. More...
 
virtual void mu_drhoT_from_rho_T (Real density, Real temperature, Real ddensity_dT, Real &mu, Real &dmu_drho, Real &dmu_dT) const
 
virtual void rho_mu (Real pressure, Real temperature, Real &rho, Real &mu) const
 Density and viscosity. More...
 
virtual void rho_mu_from_p_T (Real pressure, Real temperature, Real &rho, Real &mu) const
 
virtual void rho_mu_from_p_T (Real pressure, Real temperature, Real &rho, Real &drho_dp, Real &drho_dT, Real &mu, Real &dmu_dp, Real &dmu_dT) const
 Density and viscosity and their derivatives wrt pressure and temperature. More...
 
virtual void rho_mu_dpT (Real pressure, Real temperature, Real &rho, Real &drho_dp, Real &drho_dT, Real &mu, Real &dmu_dp, Real &dmu_dT) const
 
virtual Real k (Real pressure, Real temperature) const
 
virtual void k_dpT (Real pressure, Real temperature, Real &k, Real &dk_dp, Real &dk_dT) const
 
virtual Real k_from_rho_T (Real density, Real temperature) const
 Thermal conductivity as a function of density and temperature. More...
 
virtual void henryConstant_dT (Real temperature, Real &Kh, Real &dKh_dT) const
 
virtual void vaporPressure_dT (Real temperature, Real &psat, Real &dpsat_dT) const
 
virtual void execute () final
 
virtual void initialize () final
 
virtual void finalize () final
 
virtual void threadJoin (const UserObject &) final
 
virtual void subdomainSetup () final
 

Protected Member Functions

void writeTabulatedData (std::string file_name)
 Writes tabulated data to a file. More...
 
virtual void checkInputVariables (Real &pressure, Real &temperature) const
 Checks that the inputs are within the range of the tabulated data, and throws an error if they are not. More...
 
virtual void generateTabulatedData ()
 Generates a table of fluid properties by looping over pressure and temperature and calculating properties using the FluidProperties UserObject _fp. More...
 
void reshapeData2D (unsigned int nrow, unsigned int ncol, const std::vector< Real > &vec, std::vector< std::vector< Real >> &mat)
 Forms a 2D matrix from a single std::vector. More...
 
virtual Real henryConstantIAPWS (Real temperature, Real A, Real B, Real C) const
 IAPWS formulation of Henry's law constant for dissolution in water From Guidelines on the Henry's constant and vapour liquid distribution constant for gases in H20 and D20 at high temperatures, IAPWS (2004) More...
 
virtual void henryConstantIAPWS (Real temperature, Real &Kh, Real &dKh_dT, Real A, Real B, Real C) const
 
virtual void henryConstantIAPWS_dT (Real temperature, Real &Kh, Real &dKh_dT, Real A, Real B, Real C) const
 

Protected Attributes

FileName _file_name
 File name of tabulated data file. More...
 
std::vector< Real > _pressure
 Pressure vector. More...
 
std::vector< Real > _temperature
 Temperature vector. More...
 
std::vector< std::vector< Real > > _properties
 Tabulated fluid properties. More...
 
std::vector< std::unique_ptr< BicubicInterpolation > > _property_ipol
 Interpolated fluid property. More...
 
Real _temperature_min
 Minimum temperature in tabulated data. More...
 
Real _temperature_max
 Maximum temperature in tabulated data. More...
 
Real _pressure_min
 Minimum pressure in tabulated data. More...
 
Real _pressure_max
 Maximum pressure in tabulated data. More...
 
unsigned int _num_T
 Number of temperature points in the tabulated data. More...
 
unsigned int _num_p
 Number of pressure points in the tabulated data. More...
 
const bool _save_file
 Whether to save a generated fluid properties file to disk. More...
 
const SinglePhaseFluidProperties_fp
 SinglePhaseFluidPropertiesPT UserObject. More...
 
const std::vector< std::string > _required_columns {"pressure", "temperature"}
 List of required column names to be read. More...
 
const std::vector< std::string > _property_columns
 List of possible property column names to be read. More...
 
MultiMooseEnum _interpolated_properties_enum
 Properties to be interpolated entered in the input file. More...
 
std::vector< std::string > _interpolated_properties
 List of properties to be interpolated. More...
 
bool _interpolate_density
 Set of flags to note whether a property is to be interpolated. More...
 
bool _interpolate_enthalpy
 
bool _interpolate_internal_energy
 
bool _interpolate_viscosity
 
bool _interpolate_k
 
bool _interpolate_cp
 
bool _interpolate_cv
 
bool _interpolate_entropy
 
unsigned int _density_idx
 Index of each property. More...
 
unsigned int _enthalpy_idx
 
unsigned int _internal_energy_idx
 
unsigned int _viscosity_idx
 
unsigned int _k_idx
 
unsigned int _cp_idx
 
unsigned int _cv_idx
 
unsigned int _entropy_idx
 
MooseUtils::DelimitedFileReader _csv_reader
 The MOOSE delimited file reader. More...
 
const Real _R
 Universal gas constant (J/mol/K) More...
 
const Real _T_c2k
 Conversion of temperature from Celsius to Kelvin. More...
 

Detailed Description

Class for fluid properties read from a file.

Property values are read from a CSV file containing property data. Monotonically increasing values of pressure and temperature must be included in the data file, specifying the phase space where tabulated fluid properties will be defined. An error is thrown if either temperature or pressure data is not included or not monotonic, and an error is also thrown if this UserObject is requested to provide a fluid property outside this phase space.

This class is intended to be used when complicated formulations for fluid properties (for example, density or enthalpy) are required, which can be computationally expensive. This is particularly the case where the fluid equation of state is based on a Helmholtz free energy that is a function of density and temperature, like that used in CO2FluidProperties. In this case, density must be solved iteratively using pressure and temperature, which increases the computational burden.

Using interpolation to calculate these fluid properties can significantly reduce the computational time for these cases.

The expected file format for the tabulated fluid properties is now described. The first line must be the header containing the required column names "pressure" and "temperature", and the names of the fluid properties to be read. Available fluid property names are: "density", "enthalpy", "internal_energy", "viscosity", "k" (thermal conductivity), "cp" (isobaric specific heat capacity), "cv" (isochoric specific heat capacity), and "entropy". Note: the order is not important, although having pressure and temperature first makes the data easier for a human to read).

The data in the pressure and temperature columns must be monotonically increasing. This file format does require duplication of the pressure and temperature data - each pressure value must be included num_T times, while each temperature value is repeated num_p times, where num_T and num_p are the number of temperature and pressure points, respectively. This class will check that the required number of data points have been entered (num_T * num_p).

An example of a valid fluid properties file is provided below:

pressure, temperature, density, enthalpy, internal_energy 200000, 275, 3.90056, -21487, -72761.7 200000, 277, 3.86573, -19495.4, -71232.0 200000, 280, 3.83155, -17499.1, -69697.3 300000, 275, 6.07273, -22728.3, -73626.5 300000, 277, 6.01721, -20711.5, -72079.3 300000, 280, 5.96277, -18691.0, -70527.7

and so on.

If no tabulated fluid property data file exists, then data for the fluid supplied by the required FluidProperties UserObject will be generated using the pressure and temperature ranges specified in the input file at the beginning of the simulation. The properties to be tabulated are provided in the "interpolated_properties" input parameter (the properties that can be tabulated are listed above).

This tabulated data will be written to file in the correct format, enabling suitable data files to be created for future use. There is an upfront computational expense required for this initial data generation, depending on the required number of pressure and temperature points. However, provided that the number of data points required to generate the tabulated data is smaller than the number of times the property members in the FluidProperties UserObject are used, the initial time to generate the data and the subsequent interpolation time can be much less than using the original FluidProperties UserObject.

Properties specified in the data file or listed in the input file (and their derivatives wrt pressure and temperature) will be calculated using bicubic interpolation, while all remaining fluid properties are calculated using the supplied FluidProperties UserObject.

Definition at line 90 of file TabulatedFluidProperties.h.

Constructor & Destructor Documentation

◆ TabulatedFluidProperties()

TabulatedFluidProperties::TabulatedFluidProperties ( const InputParameters &  parameters)

Definition at line 60 of file TabulatedFluidProperties.C.

61  : SinglePhaseFluidProperties(parameters),
62  _file_name(getParam<FileName>("fluid_property_file")),
63  _temperature_min(getParam<Real>("temperature_min")),
64  _temperature_max(getParam<Real>("temperature_max")),
65  _pressure_min(getParam<Real>("pressure_min")),
66  _pressure_max(getParam<Real>("pressure_max")),
67  _num_T(getParam<unsigned int>("num_T")),
68  _num_p(getParam<unsigned int>("num_p")),
69  _save_file(getParam<bool>("save_file")),
70  _fp(getUserObject<SinglePhaseFluidProperties>("fp")),
71  _interpolated_properties_enum(getParam<MultiMooseEnum>("interpolated_properties")),
73  _interpolate_density(false),
74  _interpolate_enthalpy(false),
77  _interpolate_k(false),
78  _interpolate_cp(false),
79  _interpolate_cv(false),
80  _interpolate_entropy(false),
81  _density_idx(0),
82  _enthalpy_idx(0),
84  _viscosity_idx(0),
85  _k_idx(0),
86  _cp_idx(0),
87  _cv_idx(0),
88  _entropy_idx(0),
89  _csv_reader(_file_name, &_communicator)
90 {
91  // Sanity check on minimum and maximum temperatures and pressures
93  mooseError(name(), ": temperature_max must be greater than temperature_min");
95  mooseError(name(), ": pressure_max must be greater than pressure_min");
96 
97  // Lines starting with # in the data file are treated as comments
98  _csv_reader.setComment("#");
99 }
Real _temperature_max
Maximum temperature in tabulated data.
Real _pressure_max
Maximum pressure in tabulated data.
MooseUtils::DelimitedFileReader _csv_reader
The MOOSE delimited file reader.
SinglePhaseFluidProperties(const InputParameters &parameters)
MultiMooseEnum _interpolated_properties_enum
Properties to be interpolated entered in the input file.
Real _temperature_min
Minimum temperature in tabulated data.
const std::string name
Definition: Setup.h:22
std::vector< std::string > _interpolated_properties
List of properties to be interpolated.
unsigned int _num_T
Number of temperature points in the tabulated data.
Real _pressure_min
Minimum pressure in tabulated data.
unsigned int _num_p
Number of pressure points in the tabulated data.
unsigned int _density_idx
Index of each property.
bool _interpolate_density
Set of flags to note whether a property is to be interpolated.
const bool _save_file
Whether to save a generated fluid properties file to disk.
const SinglePhaseFluidProperties & _fp
SinglePhaseFluidPropertiesPT UserObject.
FileName _file_name
File name of tabulated data file.

◆ ~TabulatedFluidProperties()

TabulatedFluidProperties::~TabulatedFluidProperties ( )
virtual

Definition at line 101 of file TabulatedFluidProperties.C.

101 {}

Member Function Documentation

◆ beta()

Real SinglePhaseFluidProperties::beta ( Real  pressure,
Real  temperature 
) const
virtualinherited

Definition at line 268 of file SinglePhaseFluidProperties.C.

Referenced by SimpleFluidProperties::beta_from_p_T(), and Water97FluidProperties::vaporTemperature().

269 {
270  return beta_from_p_T(p, T);
271 }
virtual Real beta_from_p_T(Real p, Real T) const
Thermal expansion coefficient from pressure and temperature.

◆ beta_from_p_T() [1/2]

Real SinglePhaseFluidProperties::beta_from_p_T ( Real  p,
Real  T 
) const
virtualinherited

Thermal expansion coefficient from pressure and temperature.

Parameters
[in]ppressure (Pa)
[in]Ttemperature (K)
Returns
beta (1/K)

Reimplemented in SimpleFluidProperties.

Definition at line 177 of file SinglePhaseFluidProperties.C.

Referenced by SinglePhaseFluidProperties::beta().

178 {
179  // The volumetric thermal expansion coefficient is defined as
180  // 1/v dv/dT)_p
181  // It is the fractional change rate of volume with respect to temperature change
182  // at constant pressure. Here it is coded as
183  // - 1/rho drho/dT)_p
184  // using chain rule with v = v(rho)
185 
186  Real rho, drho_dp, drho_dT;
187  rho_from_p_T(p, T, rho, drho_dp, drho_dT);
188  return -drho_dT / rho;
189 }
virtual Real rho(Real p, Real T) const
virtual Real rho_from_p_T(Real p, Real T) const
Density from pressure and temperature.

◆ beta_from_p_T() [2/2]

void SinglePhaseFluidProperties::beta_from_p_T ( Real  p,
Real  T,
Real &  beta,
Real &  dbeta_dp,
Real &  dbeta_dT 
) const
virtualinherited

Thermal expansion coefficient and its derivatives from pressure and temperature.

Parameters
[in]ppressure (Pa)
[in]Ttemperature (K)
[out]betabeta (1/K)
[out]dbeta_dpderivative of the thermal expansion coefficient w.r.t. pressure
[out]dbeta_dTderivative of the thermal expansion coefficient w.r.t. temperature

Reimplemented in SimpleFluidProperties.

Definition at line 192 of file SinglePhaseFluidProperties.C.

193 {
194  mooseError(name(), ": ", __PRETTY_FUNCTION__, " not implemented.");
195 }
const std::string name
Definition: Setup.h:22

◆ c()

Real SinglePhaseFluidProperties::c ( Real  pressure,
Real  temperature 
) const
virtualinherited

Definition at line 465 of file SinglePhaseFluidProperties.C.

Referenced by IdealGasFluidProperties::c_from_v_e(), StiffenedGasFluidProperties::c_from_v_e(), Water97FluidProperties::densityRegion3(), Water97FluidProperties::subregionVolume(), and Water97FluidProperties::vaporPressure().

466 {
467  mooseDeprecated(name(), ": c() is deprecated. Use c_from_p_T() instead");
468 
469  return c_from_p_T(p, T);
470 }
virtual Real c_from_p_T(Real pressure, Real temperature) const
Speed of sound.
const std::string name
Definition: Setup.h:22

◆ c_from_p_T()

Real TabulatedFluidProperties::c_from_p_T ( Real  pressure,
Real  temperature 
) const
overridevirtual

Speed of sound.

Parameters
pressurefluid pressure (Pa)
temperaturefluid temperature (K)
Returns
speed of sound (m/s)

Reimplemented from SinglePhaseFluidProperties.

Definition at line 420 of file TabulatedFluidProperties.C.

421 {
423 }
virtual Real c_from_p_T(Real pressure, Real temperature) const
Speed of sound.
const std::string temperature
Definition: NS.h:27
const std::string pressure
Definition: NS.h:26
const SinglePhaseFluidProperties & _fp
SinglePhaseFluidPropertiesPT UserObject.

◆ c_from_v_e() [1/2]

Real SinglePhaseFluidProperties::c_from_v_e ( Real  v,
Real  e 
) const
virtualinherited

Sound speed from specific volume and specific internal energy.

Parameters
[in]vspecific volume
[in]especific internal energy

Reimplemented in IdealGasFluidProperties, and StiffenedGasFluidProperties.

Definition at line 50 of file SinglePhaseFluidProperties.C.

Referenced by FluidPropertiesMaterial::computeQpProperties(), and NSMachAux::computeValue().

51 {
52  mooseError(name(), ": ", __PRETTY_FUNCTION__, " not implemented.");
53 }
const std::string name
Definition: Setup.h:22

◆ c_from_v_e() [2/2]

void SinglePhaseFluidProperties::c_from_v_e ( Real  v,
Real  e,
Real &  c,
Real &  dc_dv,
Real &  dc_de 
) const
virtualinherited

Sound speed and its derivatives from specific volume and specific internal energy.

Parameters
[in]vspecific volume
[in]especific internal energy
[out]dc_dvderivative of sound speed w.r.t. specific volume
[out]dc_dederivative of sound speed w.r.t. specific internal energy

Reimplemented in IdealGasFluidProperties, and StiffenedGasFluidProperties.

Definition at line 56 of file SinglePhaseFluidProperties.C.

57 {
58  mooseError(name(), ": ", __PRETTY_FUNCTION__, " not implemented.");
59 }
const std::string name
Definition: Setup.h:22

◆ checkInputVariables()

void TabulatedFluidProperties::checkInputVariables ( Real &  pressure,
Real &  temperature 
) const
protectedvirtual

Checks that the inputs are within the range of the tabulated data, and throws an error if they are not.

Parameters
pressureinput pressure (Pa)
temperatureinput temperature (K)

Definition at line 641 of file TabulatedFluidProperties.C.

Referenced by cp_from_p_T(), cv_from_p_T(), e_from_p_T(), h_from_p_T(), k_from_p_T(), mu_from_p_T(), rho_from_p_T(), and s_from_p_T().

642 {
643  if (pressure < _pressure_min || pressure > _pressure_max)
644  throw MooseException(
645  "Pressure " + Moose::stringify(pressure) + " is outside the range of tabulated pressure (" +
646  Moose::stringify(_pressure_min) + ", " + Moose::stringify(_pressure_max) + ").");
647 
648  if (temperature < _temperature_min || temperature > _temperature_max)
649  throw MooseException("Temperature " + Moose::stringify(temperature) +
650  " is outside the range of tabulated temperature (" +
651  Moose::stringify(_temperature_min) + ", " +
652  Moose::stringify(_temperature_max) + ").");
653 }
Real _temperature_max
Maximum temperature in tabulated data.
Real _pressure_max
Maximum pressure in tabulated data.
const std::string temperature
Definition: NS.h:27
Real _temperature_min
Minimum temperature in tabulated data.
Real _pressure_min
Minimum pressure in tabulated data.
const std::string pressure
Definition: NS.h:26

◆ cp_from_p_T() [1/4]

Real TabulatedFluidProperties::cp_from_p_T ( Real  pressure,
Real  temperature 
) const
overridevirtual

Isobaric specific heat capacity.

Parameters
pressurefluid pressure (Pa)
temperaturefluid temperature (K)
Returns
cp (J/kg/K)

Reimplemented from SinglePhaseFluidProperties.

Definition at line 426 of file TabulatedFluidProperties.C.

427 {
428  if (_interpolate_cp)
429  {
431  return _property_ipol[_cp_idx]->sample(pressure, temperature);
432  }
433  else
435 }
const std::string temperature
Definition: NS.h:27
virtual void checkInputVariables(Real &pressure, Real &temperature) const
Checks that the inputs are within the range of the tabulated data, and throws an error if they are no...
virtual Real cp_from_p_T(Real pressure, Real temperature) const
Isobaric specific heat capacity.
const std::string pressure
Definition: NS.h:26
std::vector< std::unique_ptr< BicubicInterpolation > > _property_ipol
Interpolated fluid property.
const SinglePhaseFluidProperties & _fp
SinglePhaseFluidPropertiesPT UserObject.

◆ cp_from_p_T() [2/4]

Real SinglePhaseFluidProperties::cp_from_p_T

Isobaric specific heat capacity.

Parameters
pressurefluid pressure (Pa)
temperaturefluid temperature (K)
Returns
cp (J/kg/K)

Definition at line 472 of file SinglePhaseFluidProperties.C.

473 {
474  mooseError(name(), ": ", __PRETTY_FUNCTION__, " not implemented.");
475 }
const std::string name
Definition: Setup.h:22

◆ cp_from_p_T() [3/4]

void SinglePhaseFluidProperties::cp_from_p_T

Isobaric specific heat capacity from pressure and temperature.

Parameters
[in]pressurefluid pressure (Pa)
[in]temperaturefluid temperature (K)
[out]cpisobaric specific heat (J/kg/K)
[out]dcp_dpderivative of isobaric specific heat w.r.t. pressure (J/kg/K/Pa)
[out]dcp_dTderivative of isobaric specific heat w.r.t. temperature (J/kg/K/K)

Definition at line 478 of file SinglePhaseFluidProperties.C.

479 {
480  mooseError(name(), ": ", __PRETTY_FUNCTION__, " not implemented.");
481 }
const std::string name
Definition: Setup.h:22

◆ cp_from_p_T() [4/4]

void SinglePhaseFluidProperties::cp_from_p_T ( Real  pressure,
Real  temperature,
Real &  cp,
Real &  dcp_dp,
Real &  dcp_dT 
) const
virtualinherited

Isobaric specific heat capacity from pressure and temperature.

Parameters
[in]pressurefluid pressure (Pa)
[in]temperaturefluid temperature (K)
[out]cpisobaric specific heat (J/kg/K)
[out]dcp_dpderivative of isobaric specific heat w.r.t. pressure (J/kg/K/Pa)
[out]dcp_dTderivative of isobaric specific heat w.r.t. temperature (J/kg/K/K)

Reimplemented in StiffenedGasFluidProperties, IdealGasFluidProperties, and SimpleFluidProperties.

Definition at line 478 of file SinglePhaseFluidProperties.C.

479 {
480  mooseError(name(), ": ", __PRETTY_FUNCTION__, " not implemented.");
481 }
const std::string name
Definition: Setup.h:22

◆ cp_from_v_e() [1/2]

Real SinglePhaseFluidProperties::cp_from_v_e ( Real  v,
Real  e 
) const
virtualinherited

Isobaric (constant-pressure) specific heat from specific volume and specific internal energy.

Parameters
[in]vspecific volume
[in]especific internal energy

Reimplemented in IdealGasFluidProperties, and StiffenedGasFluidProperties.

Definition at line 61 of file SinglePhaseFluidProperties.C.

Referenced by FluidPropertiesMaterial::computeQpProperties(), and GeneralVaporMixtureFluidProperties::cp_from_p_T().

62 {
63  mooseError(name(), ": ", __PRETTY_FUNCTION__, " not implemented.");
64 }
const std::string name
Definition: Setup.h:22

◆ cp_from_v_e() [2/2]

void SinglePhaseFluidProperties::cp_from_v_e ( Real  v,
Real  e,
Real &  cp,
Real &  dcp_dv,
Real &  dcp_de 
) const
virtualinherited

Isobaric (constant pressure) specific heat from specific volume and specific internal energy.

Parameters
[in]vspecific volume (m$^3$/kg)
[in]especific internal energy (J/kg)
[out]cpisobaric specific heat (J/kg/K)
[out]dcp_dvderivative of isobaric specific heat w.r.t. specific volume (J/K/m$^3$)
[out]dcp_dederivative of isobaric specific heat w.r.t. specific inernal energy (1/K)

Reimplemented in IdealGasFluidProperties, and StiffenedGasFluidProperties.

Definition at line 67 of file SinglePhaseFluidProperties.C.

68 {
69  mooseError(name(), ": ", __PRETTY_FUNCTION__, " not implemented.");
70 }
const std::string name
Definition: Setup.h:22

◆ criticalDensity()

Real SinglePhaseFluidProperties::criticalDensity ( ) const
virtualinherited

◆ criticalInternalEnergy()

Real SinglePhaseFluidProperties::criticalInternalEnergy ( ) const
virtualinherited

Critical specific internal energy.

Returns
specific internal energy (J/kg)

Reimplemented in StiffenedGasFluidProperties.

Definition at line 244 of file SinglePhaseFluidProperties.C.

Referenced by IdealRealGasMixtureFluidProperties::p_T_from_v_e().

245 {
246  mooseError(name(), ": criticalInternalEnergy() is not implemented");
247 }
const std::string name
Definition: Setup.h:22

◆ criticalPressure()

Real SinglePhaseFluidProperties::criticalPressure ( ) const
virtualinherited

Critical pressure.

Returns
critical pressure (Pa)

Reimplemented in HydrogenFluidProperties, CO2FluidProperties, NitrogenFluidProperties, MethaneFluidProperties, NaClFluidProperties, and Water97FluidProperties.

Definition at line 226 of file SinglePhaseFluidProperties.C.

227 {
228  mooseError(name(), ": criticalPressure() is not implemented");
229 }
const std::string name
Definition: Setup.h:22

◆ criticalTemperature()

Real SinglePhaseFluidProperties::criticalTemperature ( ) const
virtualinherited

◆ cv_from_p_T()

Real TabulatedFluidProperties::cv_from_p_T ( Real  pressure,
Real  temperature 
) const
overridevirtual

Isochoric specific heat.

Parameters
pressurefluid pressure (Pa)
temperaturefluid temperature (K)
Returns
cv (J/kg/K)

Reimplemented from SinglePhaseFluidProperties.

Definition at line 438 of file TabulatedFluidProperties.C.

439 {
440  if (_interpolate_cv)
441  {
443  return _property_ipol[_cv_idx]->sample(pressure, temperature);
444  }
445  else
447 }
virtual Real cv_from_p_T(Real pressure, Real temperature) const
Isochoric specific heat.
const std::string temperature
Definition: NS.h:27
virtual void checkInputVariables(Real &pressure, Real &temperature) const
Checks that the inputs are within the range of the tabulated data, and throws an error if they are no...
const std::string pressure
Definition: NS.h:26
std::vector< std::unique_ptr< BicubicInterpolation > > _property_ipol
Interpolated fluid property.
const SinglePhaseFluidProperties & _fp
SinglePhaseFluidPropertiesPT UserObject.

◆ cv_from_T_v()

Real SinglePhaseFluidProperties::cv_from_T_v ( Real  T,
Real  v 
) const
virtualinherited

Specific isochoric heat capacity from temperature and specific volume.

Parameters
[in]Ttemperature
[in]vspecific volume

Reimplemented in IdealGasFluidProperties, and StiffenedGasFluidProperties.

Definition at line 695 of file SinglePhaseFluidProperties.C.

Referenced by IdealRealGasMixtureFluidProperties::cv_from_p_T(), and IdealRealGasMixtureFluidProperties::cv_from_T_v().

696 {
697  mooseError(name(), ": ", __PRETTY_FUNCTION__, " not implemented.");
698 }
const std::string name
Definition: Setup.h:22

◆ cv_from_v_e()

Real SinglePhaseFluidProperties::cv_from_v_e ( Real  v,
Real  e 
) const
virtualinherited

Isochoric (constant-volume) specific heat from specific volume and specific internal energy.

Parameters
[in]vspecific volume
[in]especific internal energy

Reimplemented in IdealGasFluidProperties, and StiffenedGasFluidProperties.

Definition at line 72 of file SinglePhaseFluidProperties.C.

Referenced by FluidPropertiesMaterial::computeQpProperties(), and GeneralVaporMixtureFluidProperties::cv_from_p_T().

73 {
74  mooseError(name(), ": ", __PRETTY_FUNCTION__, " not implemented.");
75 }
const std::string name
Definition: Setup.h:22

◆ e()

Real SinglePhaseFluidProperties::e ( Real  pressure,
Real  temperature 
) const
virtualinherited

Definition at line 415 of file SinglePhaseFluidProperties.C.

Referenced by Water97FluidProperties::b2bc(), IdealGasFluidProperties::c_from_v_e(), StiffenedGasFluidProperties::c_from_v_e(), NaClFluidProperties::cp_from_p_T(), IdealGasFluidProperties::cp_from_v_e(), StiffenedGasFluidProperties::cp_from_v_e(), Water97FluidProperties::densityRegion3(), SinglePhaseFluidProperties::e_dpT(), StiffenedGasFluidProperties::e_from_p_rho(), IdealGasFluidProperties::e_from_p_rho(), HelmholtzFluidProperties::e_from_p_T(), IdealGasFluidPropertiesPT::e_from_p_T(), Water97FluidProperties::e_from_p_T(), NaClFluidProperties::e_from_p_T(), IdealGasFluidProperties::e_from_p_T(), StiffenedGasFluidProperties::e_from_p_T(), SimpleFluidProperties::e_from_p_T(), e_from_p_T(), SinglePhaseFluidProperties::e_from_p_T(), StiffenedGasFluidProperties::e_from_T_v(), IdealGasFluidProperties::e_from_T_v(), IdealGasFluidProperties::e_from_v_h(), StiffenedGasFluidProperties::e_from_v_h(), IdealGasFluidProperties::g_from_v_e(), StiffenedGasFluidProperties::g_from_v_e(), IdealGasFluidProperties::h_from_p_T(), NaClFluidProperties::h_from_p_T(), NitrogenFluidProperties::mu_from_rho_T(), HydrogenFluidProperties::mu_from_rho_T(), CO2FluidProperties::mu_from_rho_T(), StiffenedGasFluidProperties::p_from_T_v(), IdealGasFluidProperties::p_from_v_e(), StiffenedGasFluidProperties::p_from_v_e(), IdealGasFluidPropertiesPT::rho_e_dpT(), SinglePhaseFluidProperties::rho_e_dpT(), SinglePhaseFluidProperties::rho_e_from_p_T(), StiffenedGasFluidProperties::s_from_T_v(), IdealGasFluidProperties::s_from_v_e(), StiffenedGasFluidProperties::s_from_v_e(), Water97FluidProperties::subregion3(), Water97FluidProperties::subregionVolume(), SinglePhaseFluidProperties::T_from_p_h(), IdealGasFluidProperties::T_from_v_e(), StiffenedGasFluidProperties::T_from_v_e(), StiffenedGasFluidProperties::v_e_spndl_from_T(), and Water97FluidProperties::vaporTemperature().

416 {
417  mooseDeprecated(name(), ": e() is deprecated. Use e_from_p_T() instead");
418 
419  return e_from_p_T(p, T);
420 }
virtual Real e_from_p_T(Real p, Real T) const
Internal energy from pressure and temperature.
const std::string name
Definition: Setup.h:22

◆ e_dpT()

void SinglePhaseFluidProperties::e_dpT ( Real  pressure,
Real  temperature,
Real &  e,
Real &  de_dp,
Real &  de_dT 
) const
virtualinherited

Definition at line 423 of file SinglePhaseFluidProperties.C.

424 {
425  mooseDeprecated(name(), ": e_dpT() is deprecated. Use e_from_p_T() instead");
426 
427  e_from_p_T(p, T, e, de_dp, de_dT);
428 }
virtual Real e_from_p_T(Real p, Real T) const
Internal energy from pressure and temperature.
const std::string name
Definition: Setup.h:22
virtual Real e(Real pressure, Real temperature) const

◆ e_from_p_rho() [1/2]

Real SinglePhaseFluidProperties::e_from_p_rho ( Real  p,
Real  rho 
) const
virtualinherited

Specific internal energy from pressure and density.

Parameters
[in]ppressure
[in]rhodensity

Reimplemented in IdealGasFluidProperties, and StiffenedGasFluidProperties.

Definition at line 629 of file SinglePhaseFluidProperties.C.

Referenced by StagnationTemperatureAux::computeValue(), InternalEnergyAux::computeValue(), and SinglePhaseFluidProperties::e_from_p_T().

630 {
631  mooseError(name(), ": ", __PRETTY_FUNCTION__, " not implemented.");
632 }
const std::string name
Definition: Setup.h:22

◆ e_from_p_rho() [2/2]

void SinglePhaseFluidProperties::e_from_p_rho ( Real  p,
Real  rho,
Real &  e,
Real &  de_dp,
Real &  de_drho 
) const
virtualinherited

Specific internal energy and its derivatives from pressure and density.

Parameters
[in]ppressure
[in]rhodensity
[out]especific internal energy
[out]de_dpderivative of specific internal energy w.r.t. pressure
[out]de_drhoderivative of specific internal energy w.r.t. density

Reimplemented in IdealGasFluidProperties, and StiffenedGasFluidProperties.

Definition at line 635 of file SinglePhaseFluidProperties.C.

636 {
637  mooseError(name(), ": ", __PRETTY_FUNCTION__, " not implemented.");
638 }
const std::string name
Definition: Setup.h:22

◆ e_from_p_T() [1/2]

Real TabulatedFluidProperties::e_from_p_T ( Real  p,
Real  T 
) const
overridevirtual

Internal energy from pressure and temperature.

Parameters
[in]ppressure (Pa)
[in]Ttemperature (K)
Returns
internal energy (J/kg)

Reimplemented from SinglePhaseFluidProperties.

Definition at line 342 of file TabulatedFluidProperties.C.

343 {
345  {
348  }
349  else
351 }
const std::string temperature
Definition: NS.h:27
virtual Real e_from_p_T(Real p, Real T) const
Internal energy from pressure and temperature.
virtual void checkInputVariables(Real &pressure, Real &temperature) const
Checks that the inputs are within the range of the tabulated data, and throws an error if they are no...
const std::string pressure
Definition: NS.h:26
std::vector< std::unique_ptr< BicubicInterpolation > > _property_ipol
Interpolated fluid property.
const SinglePhaseFluidProperties & _fp
SinglePhaseFluidPropertiesPT UserObject.

◆ e_from_p_T() [2/2]

void TabulatedFluidProperties::e_from_p_T ( Real  p,
Real  T,
Real &  e,
Real &  de_dp,
Real &  de_dT 
) const
overridevirtual

Internal energy and its derivatives from pressure and temperature.

Parameters
[in]ppressure (Pa)
[in]Ttemperature (K)
[out]einternal energy (J/kg)
[out]de_dpderivative of internal energy w.r.t. pressure
[out]de_dTderivative of internal energy w.r.t. temperature

Reimplemented from SinglePhaseFluidProperties.

Definition at line 354 of file TabulatedFluidProperties.C.

356 {
358  {
360  _property_ipol[_internal_energy_idx]->sampleValueAndDerivatives(
361  pressure, temperature, e, de_dp, de_dT);
362  }
363  else
364  _fp.e_from_p_T(pressure, temperature, e, de_dp, de_dT);
365 }
const std::string temperature
Definition: NS.h:27
virtual Real e_from_p_T(Real p, Real T) const
Internal energy from pressure and temperature.
virtual void checkInputVariables(Real &pressure, Real &temperature) const
Checks that the inputs are within the range of the tabulated data, and throws an error if they are no...
const std::string pressure
Definition: NS.h:26
std::vector< std::unique_ptr< BicubicInterpolation > > _property_ipol
Interpolated fluid property.
virtual Real e(Real pressure, Real temperature) const
const SinglePhaseFluidProperties & _fp
SinglePhaseFluidPropertiesPT UserObject.

◆ e_from_T_v() [1/2]

Real SinglePhaseFluidProperties::e_from_T_v ( Real  T,
Real  v 
) const
virtualinherited

Specific volume and specific internal energy from temerature at the vapor spinodal.

Parameters
[in]Ttemerature

Reimplemented in IdealGasFluidProperties, and StiffenedGasFluidProperties.

Definition at line 640 of file SinglePhaseFluidProperties.C.

Referenced by IdealRealGasMixtureFluidProperties::e_from_T_v(), IdealRealGasMixtureFluidProperties::k_from_p_T(), IdealRealGasMixtureFluidProperties::k_from_T_v(), IdealRealGasMixtureFluidProperties::mu_from_p_T(), and IdealRealGasMixtureFluidProperties::mu_from_T_v().

641 {
642  mooseError(name(), ": ", __PRETTY_FUNCTION__, " not implemented.");
643 }
const std::string name
Definition: Setup.h:22

◆ e_from_T_v() [2/2]

void SinglePhaseFluidProperties::e_from_T_v ( Real  T,
Real  v,
Real &  e,
Real &  de_dT,
Real &  de_dv 
) const
virtualinherited

Specific internal energy and its derivatives from temperature and specific volume.

Parameters
[in]Ttemperature
[in]vspecific volume
[out]especific internal energy (J/kg)
[out]de_dTderivative of specific internal energy w.r.t. temperature
[out]de_dvderivative of specific internal energy w.r.t. specific volume

Reimplemented in IdealGasFluidProperties, and StiffenedGasFluidProperties.

Definition at line 657 of file SinglePhaseFluidProperties.C.

658 {
659  mooseError(name(), ": ", __PRETTY_FUNCTION__, " not implemented.");
660 }
const std::string name
Definition: Setup.h:22

◆ e_from_v_h() [1/2]

Real SinglePhaseFluidProperties::e_from_v_h ( Real  v,
Real  h 
) const
virtualinherited

Specific internal energy as a function of specific volume and specific enthalpy.

Parameters
[in]vspecific volume
[in]hspecific enthalpy

Reimplemented in StiffenedGasFluidProperties, and IdealGasFluidProperties.

Definition at line 120 of file SinglePhaseFluidProperties.C.

Referenced by SinglePhaseFluidProperties::T_from_p_h().

121 {
122  mooseError(name(), ": ", __PRETTY_FUNCTION__, " not implemented.");
123 }
const std::string name
Definition: Setup.h:22

◆ e_from_v_h() [2/2]

void SinglePhaseFluidProperties::e_from_v_h ( Real  v,
Real  h,
Real &  e,
Real &  de_dv,
Real &  de_dh 
) const
virtualinherited

Specific internal energy and derivatives as a function of specific volume and specific enthalpy.

Parameters
[in]vspecific volume
[in]hspecific enthalpy
[out]de_dvderivative of specific internal energy w.r.t. specific volume
[out]de_dhderivative of specific internal energy w.r.t. specific enthalpy

Reimplemented in StiffenedGasFluidProperties, and IdealGasFluidProperties.

Definition at line 126 of file SinglePhaseFluidProperties.C.

127 {
128  mooseError(name(), ": ", __PRETTY_FUNCTION__, " not implemented.");
129 }
const std::string name
Definition: Setup.h:22

◆ e_spndl_from_v()

Real SinglePhaseFluidProperties::e_spndl_from_v ( Real  v) const
virtualinherited

Specific internal energy from temperature and specific volume.

Parameters
[in]Ttemperature
[in]vspecific volume

Reimplemented in StiffenedGasFluidProperties.

Definition at line 645 of file SinglePhaseFluidProperties.C.

Referenced by IdealRealGasMixtureFluidProperties::p_T_from_v_e().

646 {
647  mooseError(name(), ": ", __PRETTY_FUNCTION__, " not implemented.");
648 }
const std::string name
Definition: Setup.h:22

◆ execute()

virtual void FluidProperties::execute ( )
inlinefinalvirtualinherited

Definition at line 27 of file FluidProperties.h.

27 {}

◆ finalize()

virtual void FluidProperties::finalize ( )
inlinefinalvirtualinherited

Definition at line 29 of file FluidProperties.h.

29 {}

◆ fluidName()

std::string TabulatedFluidProperties::fluidName ( ) const
overridevirtual

Fluid name.

Returns
string representing fluid name

Reimplemented from SinglePhaseFluidProperties.

Definition at line 304 of file TabulatedFluidProperties.C.

305 {
306  return _fp.fluidName();
307 }
virtual std::string fluidName() const
Fluid name.
const SinglePhaseFluidProperties & _fp
SinglePhaseFluidPropertiesPT UserObject.

◆ g_from_v_e()

Real SinglePhaseFluidProperties::g_from_v_e ( Real  v,
Real  e 
) const
virtualinherited

Gibbs free energy from specific volume and specific internal energy.

Parameters
[in]vspecific volume
[in]especific internal energy

Reimplemented in StiffenedGasFluidProperties, and IdealGasFluidProperties.

Definition at line 722 of file SinglePhaseFluidProperties.C.

Referenced by FluidPropertiesMaterial::computeQpProperties().

723 {
724  mooseError(name(), ": ", __PRETTY_FUNCTION__, " not implemented.");
725 }
const std::string name
Definition: Setup.h:22

◆ gamma_from_p_T()

Real SinglePhaseFluidProperties::gamma_from_p_T ( Real  pressure,
Real  temperature 
) const
virtualinherited

Adiabatic index - ratio of specific heats.

Parameters
pressurefluid pressure (Pa)
temperaturefluid temperature (K)
Returns
gamma (-)

Definition at line 262 of file SinglePhaseFluidProperties.C.

263 {
264  return cp_from_p_T(p, T) / cv_from_p_T(p, T);
265 }
virtual Real cv_from_p_T(Real pressure, Real temperature) const
Isochoric specific heat.
virtual Real cp_from_p_T(Real pressure, Real temperature) const
Isobaric specific heat capacity.

◆ generateTabulatedData()

void TabulatedFluidProperties::generateTabulatedData ( )
protectedvirtual

Generates a table of fluid properties by looping over pressure and temperature and calculating properties using the FluidProperties UserObject _fp.

Definition at line 550 of file TabulatedFluidProperties.C.

Referenced by initialSetup().

551 {
552  _pressure.resize(_num_p);
553  _temperature.resize(_num_T);
554 
555  // Generate data for all properties entered in input file
558 
559  for (std::size_t i = 0; i < _interpolated_properties_enum.size(); ++i)
561 
562  for (std::size_t i = 0; i < _properties.size(); ++i)
563  _properties[i].resize(_num_p * _num_T);
564 
565  // Temperature is divided equally into _num_T segments
566  Real delta_T = (_temperature_max - _temperature_min) / static_cast<Real>(_num_T - 1);
567 
568  for (unsigned int j = 0; j < _num_T; ++j)
569  _temperature[j] = _temperature_min + j * delta_T;
570 
571  // Divide the pressure into _num_p equal segments
572  Real delta_p = (_pressure_max - _pressure_min) / static_cast<Real>(_num_p - 1);
573 
574  for (unsigned int i = 0; i < _num_p; ++i)
575  _pressure[i] = _pressure_min + i * delta_p;
576 
577  // Generate the tabulated data at the pressure and temperature points
578  for (std::size_t i = 0; i < _properties.size(); ++i)
579  {
580  if (_interpolated_properties[i] == "density")
581  for (unsigned int p = 0; p < _num_p; ++p)
582  for (unsigned int t = 0; t < _num_T; ++t)
584 
585  if (_interpolated_properties[i] == "enthalpy")
586  for (unsigned int p = 0; p < _num_p; ++p)
587  for (unsigned int t = 0; t < _num_T; ++t)
588  _properties[i][p * _num_T + t] = _fp.h_from_p_T(_pressure[p], _temperature[t]);
589 
590  if (_interpolated_properties[i] == "internal_energy")
591  for (unsigned int p = 0; p < _num_p; ++p)
592  for (unsigned int t = 0; t < _num_T; ++t)
593  _properties[i][p * _num_T + t] = _fp.e_from_p_T(_pressure[p], _temperature[t]);
594 
595  if (_interpolated_properties[i] == "viscosity")
596  for (unsigned int p = 0; p < _num_p; ++p)
597  for (unsigned int t = 0; t < _num_T; ++t)
598  _properties[i][p * _num_T + t] = _fp.mu_from_p_T(_pressure[p], _temperature[t]);
599 
600  if (_interpolated_properties[i] == "k")
601  for (unsigned int p = 0; p < _num_p; ++p)
602  for (unsigned int t = 0; t < _num_T; ++t)
603  _properties[i][p * _num_T + t] = _fp.k_from_p_T(_pressure[p], _temperature[t]);
604 
605  if (_interpolated_properties[i] == "cv")
606  for (unsigned int p = 0; p < _num_p; ++p)
607  for (unsigned int t = 0; t < _num_T; ++t)
608  _properties[i][p * _num_T + t] = _fp.cv_from_p_T(_pressure[p], _temperature[t]);
609 
610  if (_interpolated_properties[i] == "cp")
611  for (unsigned int p = 0; p < _num_p; ++p)
612  for (unsigned int t = 0; t < _num_T; ++t)
613  _properties[i][p * _num_T + t] = _fp.cp_from_p_T(_pressure[p], _temperature[t]);
614 
615  if (_interpolated_properties[i] == "entropy")
616  for (unsigned int p = 0; p < _num_p; ++p)
617  for (unsigned int t = 0; t < _num_T; ++t)
618  _properties[i][p * _num_T + t] = _fp.s_from_p_T(_pressure[p], _temperature[t]);
619  }
620 }
virtual Real cv_from_p_T(Real pressure, Real temperature) const
Isochoric specific heat.
Real _temperature_max
Maximum temperature in tabulated data.
virtual Real mu_from_p_T(Real pressure, Real temperature) const
Real _pressure_max
Maximum pressure in tabulated data.
MultiMooseEnum _interpolated_properties_enum
Properties to be interpolated entered in the input file.
virtual Real e_from_p_T(Real p, Real T) const
Internal energy from pressure and temperature.
virtual Real rho_from_p_T(Real p, Real T) const
Density from pressure and temperature.
Real _temperature_min
Minimum temperature in tabulated data.
std::vector< std::string > _interpolated_properties
List of properties to be interpolated.
virtual Real k_from_p_T(Real pressure, Real temperature) const
Thermal conductivity.
std::vector< Real > _pressure
Pressure vector.
std::vector< Real > _temperature
Temperature vector.
unsigned int _num_T
Number of temperature points in the tabulated data.
Real _pressure_min
Minimum pressure in tabulated data.
std::vector< std::vector< Real > > _properties
Tabulated fluid properties.
virtual Real s_from_p_T(Real p, Real T) const
Specific entropy from pressure and temperature.
unsigned int _num_p
Number of pressure points in the tabulated data.
virtual Real cp_from_p_T(Real pressure, Real temperature) const
Isobaric specific heat capacity.
virtual Real h_from_p_T(Real p, Real T) const
Specific enthalpy from pressure and temperature.
const SinglePhaseFluidProperties & _fp
SinglePhaseFluidPropertiesPT UserObject.

◆ h()

Real SinglePhaseFluidProperties::h ( Real  p,
Real  T 
) const
virtualinherited

◆ h_dpT()

void SinglePhaseFluidProperties::h_dpT ( Real  pressure,
Real  temperature,
Real &  h,
Real &  dh_dp,
Real &  dh_dT 
) const
virtualinherited

Definition at line 603 of file SinglePhaseFluidProperties.C.

604 {
605  mooseDeprecated(name(), ": h_dpT() is deprecated. Use h_from_p_T() instead");
606 
607  h_from_p_T(p, T, h, dh_dp, dh_dT);
608 }
virtual Real h(Real p, Real T) const
const std::string name
Definition: Setup.h:22
virtual Real h_from_p_T(Real p, Real T) const
Specific enthalpy from pressure and temperature.

◆ h_from_p_T() [1/2]

Real TabulatedFluidProperties::h_from_p_T ( Real  p,
Real  T 
) const
overridevirtual

Specific enthalpy from pressure and temperature.

Parameters
[in]ppressure (Pa)
[in]Ttemperature (K)
Returns
h (J/kg)

Reimplemented from SinglePhaseFluidProperties.

Definition at line 368 of file TabulatedFluidProperties.C.

369 {
371  {
374  }
375  else
377 }
const std::string temperature
Definition: NS.h:27
virtual void checkInputVariables(Real &pressure, Real &temperature) const
Checks that the inputs are within the range of the tabulated data, and throws an error if they are no...
const std::string pressure
Definition: NS.h:26
virtual Real h_from_p_T(Real p, Real T) const
Specific enthalpy from pressure and temperature.
std::vector< std::unique_ptr< BicubicInterpolation > > _property_ipol
Interpolated fluid property.
const SinglePhaseFluidProperties & _fp
SinglePhaseFluidPropertiesPT UserObject.

◆ h_from_p_T() [2/2]

void TabulatedFluidProperties::h_from_p_T ( Real  p,
Real  T,
Real &  h,
Real &  dh_dp,
Real &  dh_dT 
) const
overridevirtual

Specific enthalpy and its derivatives from pressure and temperature.

Parameters
[in]ppressure (Pa)
[in]Ttemperature (K)
[out]hspecific enthalpy (J/kg)
[out]dh_dpderivative of specific enthalpy w.r.t. pressure
[out]dh_dTderivative of specific enthalpy w.r.t. temperature

Reimplemented from SinglePhaseFluidProperties.

Definition at line 380 of file TabulatedFluidProperties.C.

382 {
384  {
386  _property_ipol[_enthalpy_idx]->sampleValueAndDerivatives(
387  pressure, temperature, h, dh_dp, dh_dT);
388  }
389  else
390  _fp.h_from_p_T(pressure, temperature, h, dh_dp, dh_dT);
391 }
virtual Real h(Real p, Real T) const
const std::string temperature
Definition: NS.h:27
virtual void checkInputVariables(Real &pressure, Real &temperature) const
Checks that the inputs are within the range of the tabulated data, and throws an error if they are no...
const std::string pressure
Definition: NS.h:26
virtual Real h_from_p_T(Real p, Real T) const
Specific enthalpy from pressure and temperature.
std::vector< std::unique_ptr< BicubicInterpolation > > _property_ipol
Interpolated fluid property.
const SinglePhaseFluidProperties & _fp
SinglePhaseFluidPropertiesPT UserObject.

◆ h_from_T_v() [1/2]

Real SinglePhaseFluidProperties::h_from_T_v ( Real  T,
Real  v 
) const
virtualinherited

Specific enthalpy from temperature and specific volume.

Parameters
[in]Ttemperature
[in]vspecific volume

Reimplemented in IdealGasFluidProperties, and StiffenedGasFluidProperties.

Definition at line 673 of file SinglePhaseFluidProperties.C.

Referenced by IdealRealGasMixtureFluidProperties::cp_from_p_T(), and IdealRealGasMixtureFluidProperties::cp_from_T_v().

674 {
675  mooseError(name(), ": ", __PRETTY_FUNCTION__, " not implemented.");
676 }
const std::string name
Definition: Setup.h:22

◆ h_from_T_v() [2/2]

void SinglePhaseFluidProperties::h_from_T_v ( Real  T,
Real  v,
Real &  h,
Real &  dh_dT,
Real &  dh_dv 
) const
virtualinherited

Specific enthalpy and its derivatives from temperature and specific volume.

Parameters
[in]Ttemperature
[in]vspecific volume
[out]hspecific enthalpy (J/kg)
[out]dh_dTderivative of specific enthalpy w.r.t. temperature
[out]dh_dvderivative of specific enthalpy w.r.t. specific volume

Reimplemented in IdealGasFluidProperties, and StiffenedGasFluidProperties.

Definition at line 679 of file SinglePhaseFluidProperties.C.

680 {
681  mooseError(name(), ": ", __PRETTY_FUNCTION__, " not implemented.");
682 }
const std::string name
Definition: Setup.h:22

◆ henryConstant() [1/2]

Real TabulatedFluidProperties::henryConstant ( Real  temperature) const
overridevirtual

Henry's law constant for dissolution in water.

Parameters
temperaturefluid temperature (K)
Returns
Henry's constant

Reimplemented from SinglePhaseFluidProperties.

Definition at line 494 of file TabulatedFluidProperties.C.

495 {
496  return _fp.henryConstant(temperature);
497 }
const std::string temperature
Definition: NS.h:27
virtual Real henryConstant(Real temperature) const
Henry&#39;s law constant for dissolution in water.
const SinglePhaseFluidProperties & _fp
SinglePhaseFluidPropertiesPT UserObject.

◆ henryConstant() [2/2]

void TabulatedFluidProperties::henryConstant ( Real  temperature,
Real &  Kh,
Real &  dKh_dT 
) const
overridevirtual

Henry's law constant for dissolution in water and derivative wrt temperature.

Parameters
temperaturefluid temperature (K)
[out]KhHenry's constant
[out]dKh_dTderivative of Kh wrt temperature

Reimplemented from SinglePhaseFluidProperties.

Definition at line 500 of file TabulatedFluidProperties.C.

501 {
502  _fp.henryConstant(temperature, Kh, dKh_dT);
503 }
const std::string temperature
Definition: NS.h:27
virtual Real henryConstant(Real temperature) const
Henry&#39;s law constant for dissolution in water.
const SinglePhaseFluidProperties & _fp
SinglePhaseFluidPropertiesPT UserObject.

◆ henryConstant_dT()

void SinglePhaseFluidProperties::henryConstant_dT ( Real  temperature,
Real &  Kh,
Real &  dKh_dT 
) const
virtualinherited

Definition at line 379 of file SinglePhaseFluidProperties.C.

380 {
381  mooseDeprecated(name(), ": henryConstant_dT() is deprecated. Use henryConstant() instead");
382 
383  henryConstant(T, Kh, dKh_dT);
384 }
const std::string name
Definition: Setup.h:22
virtual Real henryConstant(Real temperature) const
Henry&#39;s law constant for dissolution in water.

◆ henryConstantIAPWS() [1/2]

Real SinglePhaseFluidProperties::henryConstantIAPWS ( Real  temperature,
Real  A,
Real  B,
Real  C 
) const
protectedvirtualinherited

IAPWS formulation of Henry's law constant for dissolution in water From Guidelines on the Henry's constant and vapour liquid distribution constant for gases in H20 and D20 at high temperatures, IAPWS (2004)

Definition at line 274 of file SinglePhaseFluidProperties.C.

Referenced by MethaneFluidProperties::henryConstant(), NitrogenFluidProperties::henryConstant(), HydrogenFluidProperties::henryConstant(), CO2FluidProperties::henryConstant(), and SinglePhaseFluidProperties::henryConstantIAPWS_dT().

275 {
276  const Real Tr = T / 647.096;
277  const Real tau = 1.0 - Tr;
278 
279  const Real lnkh =
280  A / Tr + B * std::pow(tau, 0.355) / Tr + C * std::pow(Tr, -0.41) * std::exp(tau);
281 
282  // The vapor pressure used in this formulation
283  const std::vector<Real> a{
284  -7.85951783, 1.84408259, -11.7866497, 22.6807411, -15.9618719, 1.80122502};
285  const std::vector<Real> b{1.0, 1.5, 3.0, 3.5, 4.0, 7.5};
286  Real sum = 0.0;
287 
288  for (std::size_t i = 0; i < a.size(); ++i)
289  sum += a[i] * std::pow(tau, b[i]);
290 
291  return 22.064e6 * std::exp(sum / Tr) * std::exp(lnkh);
292 }
ExpressionBuilder::EBTerm pow(const ExpressionBuilder::EBTerm &left, T exponent)

◆ henryConstantIAPWS() [2/2]

void SinglePhaseFluidProperties::henryConstantIAPWS ( Real  temperature,
Real &  Kh,
Real &  dKh_dT,
Real  A,
Real  B,
Real  C 
) const
protectedvirtualinherited

Definition at line 295 of file SinglePhaseFluidProperties.C.

297 {
298  const Real pc = 22.064e6;
299  const Real Tc = 647.096;
300 
301  const Real Tr = T / Tc;
302  const Real tau = 1.0 - Tr;
303 
304  const Real lnkh =
305  A / Tr + B * std::pow(tau, 0.355) / Tr + C * std::pow(Tr, -0.41) * std::exp(tau);
306  const Real dlnkh_dT =
307  (-A / Tr / Tr - B * std::pow(tau, 0.355) / Tr / Tr - 0.355 * B * std::pow(tau, -0.645) / Tr -
308  0.41 * C * std::pow(Tr, -1.41) * std::exp(tau) - C * std::pow(Tr, -0.41) * std::exp(tau)) /
309  Tc;
310 
311  // The vapor pressure used in this formulation
312  const std::vector<Real> a{
313  -7.85951783, 1.84408259, -11.7866497, 22.6807411, -15.9618719, 1.80122502};
314  const std::vector<Real> b{1.0, 1.5, 3.0, 3.5, 4.0, 7.5};
315  Real sum = 0.0;
316  Real dsum = 0.0;
317 
318  for (std::size_t i = 0; i < a.size(); ++i)
319  {
320  sum += a[i] * std::pow(tau, b[i]);
321  dsum += a[i] * b[i] * std::pow(tau, b[i] - 1.0);
322  }
323 
324  const Real p = pc * std::exp(sum / Tr);
325  const Real dp_dT = -p / Tc / Tr * (sum / Tr + dsum);
326 
327  // Henry's constant and its derivative wrt temperature
328  Kh = p * std::exp(lnkh);
329  dKh_dT = (p * dlnkh_dT + dp_dT) * std::exp(lnkh);
330 }
ExpressionBuilder::EBTerm pow(const ExpressionBuilder::EBTerm &left, T exponent)

◆ henryConstantIAPWS_dT()

void SinglePhaseFluidProperties::henryConstantIAPWS_dT ( Real  temperature,
Real &  Kh,
Real &  dKh_dT,
Real  A,
Real  B,
Real  C 
) const
protectedvirtualinherited

Definition at line 333 of file SinglePhaseFluidProperties.C.

335 {
336  mooseDeprecated(name(),
337  ":henryConstantIAPWS_dT() is deprecated. Use henryConstantIAPWS() instead");
338 
339  henryConstantIAPWS(T, Kh, dKh_dT, A, B, C);
340 }
const std::string name
Definition: Setup.h:22
virtual Real henryConstantIAPWS(Real temperature, Real A, Real B, Real C) const
IAPWS formulation of Henry&#39;s law constant for dissolution in water From Guidelines on the Henry&#39;s con...

◆ initialize()

virtual void FluidProperties::initialize ( )
inlinefinalvirtualinherited

Definition at line 28 of file FluidProperties.h.

28 {}

◆ initialSetup()

void TabulatedFluidProperties::initialSetup ( )
overridevirtual

Definition at line 104 of file TabulatedFluidProperties.C.

105 {
106  // Check to see if _file_name supplied exists. If it does, that data
107  // will be used. If it does not exist, data will be generated and then
108  // written to _file_name.
109  std::ifstream file(_file_name.c_str());
110  if (file.good())
111  {
112  _console << name() + ": Reading tabulated properties from " << _file_name << "\n";
113  _csv_reader.read();
114 
115  const std::vector<std::string> & column_names = _csv_reader.getNames();
116 
117  // Check that all required columns are present
118  for (std::size_t i = 0; i < _required_columns.size(); ++i)
119  {
120  if (std::find(column_names.begin(), column_names.end(), _required_columns[i]) ==
121  column_names.end())
122  mooseError(name(),
123  ": no ",
125  " data read in ",
126  _file_name,
127  ". A column named ",
129  " must be present");
130  }
131 
132  // Check that any property names read from the file are present in the list of possible
133  // properties, and if they are, add them to the list of read properties
134  for (std::size_t i = 0; i < column_names.size(); ++i)
135  {
136  // Only check properties not in _required_columns
137  if (std::find(_required_columns.begin(), _required_columns.end(), column_names[i]) ==
138  _required_columns.end())
139  {
140  if (std::find(_property_columns.begin(), _property_columns.end(), column_names[i]) ==
141  _property_columns.end())
142  mooseError(name(),
143  ": ",
144  column_names[i],
145  " read in ",
146  _file_name,
147  " is not one of the properties that TabulatedFluidProperties understands");
148  else
149  _interpolated_properties.push_back(column_names[i]);
150  }
151  }
152 
153  std::map<std::string, unsigned int> data_index;
154  for (std::size_t i = 0; i < column_names.size(); ++i)
155  {
156  auto it = std::find(column_names.begin(), column_names.end(), column_names[i]);
157  data_index[column_names[i]] = std::distance(column_names.begin(), it);
158  }
159 
160  const std::vector<std::vector<Real>> & column_data = _csv_reader.getData();
161 
162  // Extract the pressure and temperature data vectors
163  _pressure = column_data[data_index.find("pressure")->second];
164  _temperature = column_data[data_index.find("temperature")->second];
165 
166  // Pressure and temperature data contains duplicates due to the csv format.
167  // First, check that pressure is monotonically increasing
168  if (!std::is_sorted(_pressure.begin(), _pressure.end()))
169  mooseError(
170  name(), ": the column data for pressure is not monotonically increasing in ", _file_name);
171 
172  // The first pressure value is repeated for each temperature value. Counting the
173  // number of repeats provides the number of temperature values
174  auto num_T = std::count(_pressure.begin(), _pressure.end(), _pressure.front());
175 
176  // Now remove the duplicates in the pressure vector
177  auto last_unique = std::unique(_pressure.begin(), _pressure.end());
178  _pressure.erase(last_unique, _pressure.end());
179  _num_p = _pressure.size();
180 
181  // Check that the number of rows in the csv file is equal to _num_p * _num_T
182  if (column_data[0].size() != _num_p * static_cast<unsigned int>(num_T))
183  mooseError(name(),
184  ": the number of rows in ",
185  _file_name,
186  " is not equal to the number of unique pressure values ",
187  _num_p,
188  " multiplied by the number of unique temperature values ",
189  num_T);
190 
191  // Need to make sure that the temperature values are provided in ascending order
192  // as well as duplicated for each pressure value
193  std::vector<Real> temp0(_temperature.begin(), _temperature.begin() + num_T);
194  if (!std::is_sorted(temp0.begin(), temp0.end()))
195  mooseError(name(),
196  ": the column data for temperature is not monotonically increasing in ",
197  _file_name);
198 
199  auto it_temp = _temperature.begin() + num_T;
200  for (std::size_t i = 1; i < _pressure.size(); ++i)
201  {
202  std::vector<Real> temp(it_temp, it_temp + num_T);
203  if (temp != temp0)
204  mooseError(name(),
205  ": temperature values for pressure ",
206  _pressure[i],
207  " are not identical to values for ",
208  _pressure[0]);
209 
210  std::advance(it_temp, num_T);
211  }
212 
213  // At this point, all temperature data has been provided in ascending order
214  // identically for each pressure value, so we can just keep the first range
215  _temperature.erase(_temperature.begin() + num_T, _temperature.end());
216  _num_T = _temperature.size();
217 
218  // Minimum and maximum pressure and temperature. Note that _pressure and
219  // _temperature are sorted
220  _pressure_min = _pressure.front();
221  _pressure_max = _pressure.back();
222  _temperature_min = _temperature.front();
224 
225  // Extract the fluid property data from the file
226  for (std::size_t i = 0; i < _interpolated_properties.size(); ++i)
227  _properties.push_back(column_data[data_index.find(_interpolated_properties[i])->second]);
228  }
229  else
230  {
231  _console << name() + ": No tabulated properties file named " << _file_name << " exists.\n";
232  _console << name() + ": Generating tabulated data ";
233 
234  if (_save_file)
235  _console << name() + ": Writing tabulated data to " << _file_name << "\n";
236 
238 
239  // Write tabulated data to file
240  if (_save_file)
242  }
243 
244  // At this point, all properties read or generated are able to be used by
245  // TabulatedFluidProperties. Now set flags and indexes for each property in
246  //_interpolated_properties to use in property calculations
247  for (std::size_t i = 0; i < _interpolated_properties.size(); ++i)
248  {
249  if (_interpolated_properties[i] == "density")
250  {
251  _interpolate_density = true;
252  _density_idx = i;
253  }
254  if (_interpolated_properties[i] == "enthalpy")
255  {
256  _interpolate_enthalpy = true;
257  _enthalpy_idx = i;
258  }
259  if (_interpolated_properties[i] == "internal_energy")
260  {
263  }
264  if (_interpolated_properties[i] == "viscosity")
265  {
266  _interpolate_viscosity = true;
267  _viscosity_idx = i;
268  }
269  if (_interpolated_properties[i] == "k")
270  {
271  _interpolate_k = true;
272  _k_idx = i;
273  }
274  if (_interpolated_properties[i] == "cp")
275  {
276  _interpolate_cp = true;
277  _cp_idx = i;
278  }
279  if (_interpolated_properties[i] == "cv")
280  {
281  _interpolate_cv = true;
282  _cv_idx = i;
283  }
284  if (_interpolated_properties[i] == "entropy")
285  {
286  _interpolate_entropy = true;
287  _entropy_idx = i;
288  }
289  }
290 
291  // Construct bicubic interpolants from tabulated data
292  std::vector<std::vector<Real>> data_matrix;
293  _property_ipol.resize(_properties.size());
294 
295  for (std::size_t i = 0; i < _property_ipol.size(); ++i)
296  {
297  reshapeData2D(_num_p, _num_T, _properties[i], data_matrix);
298  _property_ipol[i] =
299  libmesh_make_unique<BicubicInterpolation>(_pressure, _temperature, data_matrix);
300  }
301 }
Real _temperature_max
Maximum temperature in tabulated data.
const std::vector< std::string > _required_columns
List of required column names to be read.
Real _pressure_max
Maximum pressure in tabulated data.
MooseUtils::DelimitedFileReader _csv_reader
The MOOSE delimited file reader.
Real _temperature_min
Minimum temperature in tabulated data.
const std::string name
Definition: Setup.h:22
std::vector< std::string > _interpolated_properties
List of properties to be interpolated.
std::vector< Real > _pressure
Pressure vector.
std::vector< Real > _temperature
Temperature vector.
unsigned int _num_T
Number of temperature points in the tabulated data.
Real _pressure_min
Minimum pressure in tabulated data.
std::vector< std::vector< Real > > _properties
Tabulated fluid properties.
unsigned int _num_p
Number of pressure points in the tabulated data.
const std::vector< std::string > _property_columns
List of possible property column names to be read.
unsigned int _density_idx
Index of each property.
bool _interpolate_density
Set of flags to note whether a property is to be interpolated.
void reshapeData2D(unsigned int nrow, unsigned int ncol, const std::vector< Real > &vec, std::vector< std::vector< Real >> &mat)
Forms a 2D matrix from a single std::vector.
const bool _save_file
Whether to save a generated fluid properties file to disk.
std::vector< std::unique_ptr< BicubicInterpolation > > _property_ipol
Interpolated fluid property.
virtual void generateTabulatedData()
Generates a table of fluid properties by looping over pressure and temperature and calculating proper...
void writeTabulatedData(std::string file_name)
Writes tabulated data to a file.
FileName _file_name
File name of tabulated data file.

◆ k()

Real SinglePhaseFluidProperties::k ( Real  pressure,
Real  temperature 
) const
virtualinherited

◆ k_dpT()

void SinglePhaseFluidProperties::k_dpT ( Real  pressure,
Real  temperature,
Real &  k,
Real &  dk_dp,
Real &  dk_dT 
) const
virtualinherited

Definition at line 579 of file SinglePhaseFluidProperties.C.

580 {
581  mooseDeprecated(name(), ": k_dpT() is deprecated. Use k_from_p_T() instead");
582 
583  k_from_p_T(p, T, k, dk_dp, dk_dT);
584 }
virtual Real k(Real pressure, Real temperature) const
const std::string name
Definition: Setup.h:22
virtual Real k_from_p_T(Real pressure, Real temperature) const
Thermal conductivity.

◆ k_from_p_T() [1/2]

Real TabulatedFluidProperties::k_from_p_T ( Real  pressure,
Real  temperature 
) const
overridevirtual

Thermal conductivity.

Parameters
pressurefluid pressure (Pa)
temperaturefluid temperature (K)
Returns
thermal conductivity (W/m/K)

Reimplemented from SinglePhaseFluidProperties.

Definition at line 450 of file TabulatedFluidProperties.C.

451 {
452  if (_interpolate_k)
453  {
455  return _property_ipol[_k_idx]->sample(pressure, temperature);
456  }
457  else
459 }
const std::string temperature
Definition: NS.h:27
virtual void checkInputVariables(Real &pressure, Real &temperature) const
Checks that the inputs are within the range of the tabulated data, and throws an error if they are no...
virtual Real k_from_p_T(Real pressure, Real temperature) const
Thermal conductivity.
const std::string pressure
Definition: NS.h:26
std::vector< std::unique_ptr< BicubicInterpolation > > _property_ipol
Interpolated fluid property.
const SinglePhaseFluidProperties & _fp
SinglePhaseFluidPropertiesPT UserObject.

◆ k_from_p_T() [2/2]

void TabulatedFluidProperties::k_from_p_T ( Real  pressure,
Real  temperature,
Real &  k,
Real &  dk_dp,
Real &  dk_dT 
) const
overridevirtual

Thermal conductivity and its derivatives wrt pressure and temperature.

Parameters
pressurefluid pressure (Pa)
temperaturefluid temperature (K)
[out]thermalconductivity (W/m/K)
[out]derivativeof thermal conductivity wrt pressure
[out]derivativeof thermal conductivity wrt temperature

Reimplemented from SinglePhaseFluidProperties.

Definition at line 462 of file TabulatedFluidProperties.C.

464 {
465  if (_interpolate_k)
466  {
468  return _property_ipol[_k_idx]->sampleValueAndDerivatives(
469  pressure, temperature, k, dk_dp, dk_dT);
470  }
471  else
472  return _fp.k_from_p_T(pressure, temperature, k, dk_dp, dk_dT);
473 }
const std::string temperature
Definition: NS.h:27
virtual Real k(Real pressure, Real temperature) const
virtual void checkInputVariables(Real &pressure, Real &temperature) const
Checks that the inputs are within the range of the tabulated data, and throws an error if they are no...
virtual Real k_from_p_T(Real pressure, Real temperature) const
Thermal conductivity.
const std::string pressure
Definition: NS.h:26
std::vector< std::unique_ptr< BicubicInterpolation > > _property_ipol
Interpolated fluid property.
const SinglePhaseFluidProperties & _fp
SinglePhaseFluidPropertiesPT UserObject.

◆ k_from_rho_T()

Real SinglePhaseFluidProperties::k_from_rho_T ( Real  density,
Real  temperature 
) const
virtualinherited

Thermal conductivity as a function of density and temperature.

Parameters
densityfluid density (kg/m^3)
temperaturefluid temperature (K)
Returns
thermal conductivity (W/m/K)

Reimplemented in CO2FluidProperties, Water97FluidProperties, HydrogenFluidProperties, and NitrogenFluidProperties.

Definition at line 362 of file SinglePhaseFluidProperties.C.

363 {
364  mooseError(name(), ": k_from_rho_T is not implemented.");
365 }
const std::string name
Definition: Setup.h:22

◆ k_from_v_e()

Real SinglePhaseFluidProperties::k_from_v_e ( Real  v,
Real  e 
) const
virtualinherited

Thermal conductivity from specific volume and specific internal energy.

Parameters
[in]vspecific volume
[in]especific internal energy

Reimplemented in IdealGasFluidProperties, and StiffenedGasFluidProperties.

Definition at line 82 of file SinglePhaseFluidProperties.C.

Referenced by FluidPropertiesMaterial::computeQpProperties(), GeneralVaporMixtureFluidProperties::k_from_p_T(), IdealRealGasMixtureFluidProperties::k_from_p_T(), and IdealRealGasMixtureFluidProperties::k_from_T_v().

83 {
84  mooseError(name(), ": ", __PRETTY_FUNCTION__, " not implemented.");
85 }
const std::string name
Definition: Setup.h:22

◆ molarMass()

Real TabulatedFluidProperties::molarMass ( ) const
overridevirtual

Molar mass [kg/mol].

Returns
molar mass

Reimplemented from SinglePhaseFluidProperties.

Definition at line 310 of file TabulatedFluidProperties.C.

311 {
312  return _fp.molarMass();
313 }
virtual Real molarMass() const
Molar mass [kg/mol].
const SinglePhaseFluidProperties & _fp
SinglePhaseFluidPropertiesPT UserObject.

◆ mu()

Real SinglePhaseFluidProperties::mu ( Real  pressure,
Real  temperature 
) const
virtualinherited

◆ mu_dpT()

void SinglePhaseFluidProperties::mu_dpT ( Real  pressure,
Real  temperature,
Real &  mu,
Real &  dmu_dp,
Real &  dmu_dT 
) const
virtualinherited

Dynamic viscosity and its derivatives wrt pressure and temperature.

Parameters
pressurefluid pressure (Pa)
temperaturefluid temperature (K)
[out]muviscosity (Pa.s)
[out]dmu_dpderivative of viscosity wrt pressure
[out]dmu_dTderivative of viscosity wrt temperature

Definition at line 502 of file SinglePhaseFluidProperties.C.

503 {
504  mooseDeprecated(name(), ": mu_dpT() is deprecated. Use mu_from_p_T() instead");
505 
506  mu_from_p_T(p, T, mu, dmu_dp, dmu_dT);
507 }
virtual Real mu_from_p_T(Real pressure, Real temperature) const
virtual Real mu(Real pressure, Real temperature) const
Dynamic viscosity.
const std::string name
Definition: Setup.h:22

◆ mu_drhoT_from_rho_T()

void SinglePhaseFluidProperties::mu_drhoT_from_rho_T ( Real  density,
Real  temperature,
Real  ddensity_dT,
Real &  mu,
Real &  dmu_drho,
Real &  dmu_dT 
) const
virtualinherited

Definition at line 354 of file SinglePhaseFluidProperties.C.

356 {
357  mooseDeprecated(name(), ":mu_drhoT_from_rho_T() is deprecated. Use mu_from_rho_T() instead");
358 
359  mu_from_rho_T(rho, T, drho_dT, mu, dmu_drho, dmu_dT);
360 }
virtual Real mu_from_rho_T(Real density, Real temperature) const
Dynamic viscosity as a function of density and temperature.
virtual Real mu(Real pressure, Real temperature) const
Dynamic viscosity.
virtual Real rho(Real p, Real T) const
const std::string name
Definition: Setup.h:22

◆ mu_from_p_T() [1/2]

Real TabulatedFluidProperties::mu_from_p_T ( Real  pressure,
Real  temperature 
) const
overridevirtual

Reimplemented from SinglePhaseFluidProperties.

Definition at line 394 of file TabulatedFluidProperties.C.

395 {
397  {
400  }
401  else
403 }
virtual Real mu_from_p_T(Real pressure, Real temperature) const
const std::string temperature
Definition: NS.h:27
virtual void checkInputVariables(Real &pressure, Real &temperature) const
Checks that the inputs are within the range of the tabulated data, and throws an error if they are no...
const std::string pressure
Definition: NS.h:26
std::vector< std::unique_ptr< BicubicInterpolation > > _property_ipol
Interpolated fluid property.
const SinglePhaseFluidProperties & _fp
SinglePhaseFluidPropertiesPT UserObject.

◆ mu_from_p_T() [2/2]

void TabulatedFluidProperties::mu_from_p_T ( Real  pressure,
Real  temperature,
Real &  mu,
Real &  dmu_dp,
Real &  dmu_dT 
) const
overridevirtual

Reimplemented from SinglePhaseFluidProperties.

Definition at line 406 of file TabulatedFluidProperties.C.

408 {
410  {
412  _property_ipol[_viscosity_idx]->sampleValueAndDerivatives(
413  pressure, temperature, mu, dmu_dp, dmu_dT);
414  }
415  else
416  return _fp.mu_from_p_T(pressure, temperature, mu, dmu_dp, dmu_dT);
417 }
virtual Real mu_from_p_T(Real pressure, Real temperature) const
virtual Real mu(Real pressure, Real temperature) const
Dynamic viscosity.
const std::string temperature
Definition: NS.h:27
virtual void checkInputVariables(Real &pressure, Real &temperature) const
Checks that the inputs are within the range of the tabulated data, and throws an error if they are no...
const std::string pressure
Definition: NS.h:26
std::vector< std::unique_ptr< BicubicInterpolation > > _property_ipol
Interpolated fluid property.
const SinglePhaseFluidProperties & _fp
SinglePhaseFluidPropertiesPT UserObject.

◆ mu_from_rho_T() [1/2]

Real SinglePhaseFluidProperties::mu_from_rho_T ( Real  density,
Real  temperature 
) const
virtualinherited

Dynamic viscosity as a function of density and temperature.

Parameters
densityfluid density (kg/m^3)
temperaturefluid temperature (K)
Returns
viscosity (Pa.s)

Reimplemented in Water97FluidProperties, CO2FluidProperties, HydrogenFluidProperties, and NitrogenFluidProperties.

Definition at line 342 of file SinglePhaseFluidProperties.C.

Referenced by SinglePhaseFluidProperties::mu_drhoT_from_rho_T().

343 {
344  mooseError(name(), ": mu_from_rho_T is not implemented.");
345 }
const std::string name
Definition: Setup.h:22

◆ mu_from_rho_T() [2/2]

void SinglePhaseFluidProperties::mu_from_rho_T ( Real  density,
Real  temperature,
Real  ddensity_dT,
Real &  mu,
Real &  dmu_drho,
Real &  dmu_dT 
) const
virtualinherited

Dynamic viscosity and its derivatives wrt density and temperature.

Parameters
densityfluid density (kg/m^3)
temperaturefluid temperature (K)
ddensity_dTderivative of density wrt temperature
[out]muviscosity (Pa.s)
[out]dmu_drhoderivative of viscosity wrt density
[out]dmu_dTderivative of viscosity wrt temperature

Reimplemented in Water97FluidProperties, CO2FluidProperties, HydrogenFluidProperties, and NitrogenFluidProperties.

Definition at line 348 of file SinglePhaseFluidProperties.C.

349 {
350  mooseError(name(), ": mu_from_rho_T is not implemented.");
351 }
const std::string name
Definition: Setup.h:22

◆ mu_from_v_e()

Real SinglePhaseFluidProperties::mu_from_v_e ( Real  v,
Real  e 
) const
virtualinherited

Dynamic viscosity from specific volume and specific internal energy.

Parameters
[in]vspecific volume
[in]especific internal energy

Reimplemented in IdealGasFluidProperties, and StiffenedGasFluidProperties.

Definition at line 77 of file SinglePhaseFluidProperties.C.

Referenced by FluidPropertiesMaterial::computeQpProperties(), GeneralVaporMixtureFluidProperties::mu_from_p_T(), IdealRealGasMixtureFluidProperties::mu_from_p_T(), and IdealRealGasMixtureFluidProperties::mu_from_T_v().

78 {
79  mooseError(name(), ": ", __PRETTY_FUNCTION__, " not implemented.");
80 }
const std::string name
Definition: Setup.h:22

◆ p_from_h_s() [1/2]

Real SinglePhaseFluidProperties::p_from_h_s ( Real  h,
Real  s 
) const
virtualinherited

Pressure from specific enthalpy and specific entropy.

Parameters
[in]hspecific enthalpy
[in]sspecific entropy

Reimplemented in StiffenedGasFluidProperties, and IdealGasFluidProperties.

Definition at line 711 of file SinglePhaseFluidProperties.C.

Referenced by StagnationPressureAux::computeValue(), and StagnationTemperatureAux::computeValue().

712 {
713  mooseError(name(), ": ", __PRETTY_FUNCTION__, " not implemented.");
714 }
const std::string name
Definition: Setup.h:22

◆ p_from_h_s() [2/2]

void SinglePhaseFluidProperties::p_from_h_s ( Real  h,
Real  s,
Real &  p,
Real &  dp_dh,
Real &  dp_ds 
) const
virtualinherited

Pressure and its derivatives from specific enthalpy and specific entropy.

Parameters
[in]hspecific enthalpy
[in]sspecific entropy

Reimplemented in StiffenedGasFluidProperties, and IdealGasFluidProperties.

Definition at line 717 of file SinglePhaseFluidProperties.C.

718 {
719  mooseError(name(), ": ", __PRETTY_FUNCTION__, " not implemented.");
720 }
const std::string name
Definition: Setup.h:22

◆ p_from_T_v() [1/2]

Real SinglePhaseFluidProperties::p_from_T_v ( Real  T,
Real  v 
) const
virtualinherited

Pressure from temperature and specific volume.

Parameters
[in]Ttemperature
[in]vspecific volume

Reimplemented in IdealGasFluidProperties, and StiffenedGasFluidProperties.

Definition at line 662 of file SinglePhaseFluidProperties.C.

Referenced by IdealRealGasMixtureFluidProperties::p_from_T_v().

663 {
664  mooseError(name(), ": ", __PRETTY_FUNCTION__, " not implemented.");
665 }
const std::string name
Definition: Setup.h:22

◆ p_from_T_v() [2/2]

void SinglePhaseFluidProperties::p_from_T_v ( Real  T,
Real  v,
Real &  p,
Real &  dp_dT,
Real &  dp_dv 
) const
virtualinherited

Pressure and its derivatives from temperature and specific volume.

Parameters
[in]Ttemperature
[in]vspecific volume
[out]ppressure (Pa)
[out]dp_dTderivative of pressure w.r.t. temperature
[out]dp_dvderivative of pressure w.r.t. specific volume

Reimplemented in IdealGasFluidProperties, and StiffenedGasFluidProperties.

Definition at line 668 of file SinglePhaseFluidProperties.C.

669 {
670  mooseError(name(), ": ", __PRETTY_FUNCTION__, " not implemented.");
671 }
const std::string name
Definition: Setup.h:22

◆ p_from_v_e() [1/2]

Real SinglePhaseFluidProperties::p_from_v_e ( Real  v,
Real  e 
) const
virtualinherited

Pressure from specific volume and specific internal energy.

Parameters
[in]vspecific volume
[in]especific internal energy

Reimplemented in IdealGasFluidProperties, StiffenedGasFluidProperties, and NaNInterfaceTestFluidProperties.

Definition at line 28 of file SinglePhaseFluidProperties.C.

Referenced by FluidPropertiesMaterial::computeQpProperties(), PressureAux::computeValue(), StagnationPressureAux::computeValue(), and StagnationTemperatureAux::computeValue().

29 {
30  mooseError(name(), ": ", __PRETTY_FUNCTION__, " not implemented.");
31 }
const std::string name
Definition: Setup.h:22

◆ p_from_v_e() [2/2]

void SinglePhaseFluidProperties::p_from_v_e ( Real  v,
Real  e,
Real &  p,
Real &  dp_dv,
Real &  dp_de 
) const
virtualinherited

Pressure and its derivatives from specific volume and specific internal energy.

Parameters
[in]vspecific volume
[in]especific internal energy
[out]ppressure
[out]dp_dvderivative of pressure w.r.t. specific volume
[out]dp_dederivative of pressure w.r.t. specific internal energy

Reimplemented in IdealGasFluidProperties, StiffenedGasFluidProperties, and NaNInterfaceTestFluidProperties.

Definition at line 34 of file SinglePhaseFluidProperties.C.

35 {
36  mooseError(name(), ": ", __PRETTY_FUNCTION__, " not implemented.");
37 }
const std::string name
Definition: Setup.h:22

◆ pp_sat_from_p_T()

Real SinglePhaseFluidProperties::pp_sat_from_p_T ( Real  p,
Real  T 
) const
virtualinherited

Partial pressure at saturation in a gas mixture.

Parameters
[in]ppressure (Pa)
[in]Ttemperature (K)
Returns
pp_sat (Pa)

Reimplemented in StiffenedGasFluidProperties.

Definition at line 208 of file SinglePhaseFluidProperties.C.

Referenced by IdealRealGasMixtureFluidProperties::xs_prim_from_p_T().

209 {
210  mooseError(name(), ": pp_sat_from_p_T is not implemented");
211 }
const std::string name
Definition: Setup.h:22

◆ reshapeData2D()

void TabulatedFluidProperties::reshapeData2D ( unsigned int  nrow,
unsigned int  ncol,
const std::vector< Real > &  vec,
std::vector< std::vector< Real >> &  mat 
)
protected

Forms a 2D matrix from a single std::vector.

Parameters
nrownumber of rows in the matrix
ncolnumber of columns in the matrix
vec1D vector to reshape into a 2D matrix
[out]2Dmatrix formed by reshaping vec

Definition at line 623 of file TabulatedFluidProperties.C.

Referenced by initialSetup().

627 {
628  if (!vec.empty())
629  {
630  mat.resize(nrow);
631  for (unsigned int i = 0; i < nrow; ++i)
632  mat[i].resize(ncol);
633 
634  for (unsigned int i = 0; i < nrow; ++i)
635  for (unsigned int j = 0; j < ncol; ++j)
636  mat[i][j] = vec[i * ncol + j];
637  }
638 }

◆ rho()

Real SinglePhaseFluidProperties::rho ( Real  p,
Real  T 
) const
virtualinherited

Definition at line 616 of file SinglePhaseFluidProperties.C.

Referenced by SinglePhaseFluidProperties::beta_from_p_T(), StiffenedGasFluidProperties::c2_from_p_rho(), StiffenedGasFluidProperties::e_from_p_rho(), IdealGasFluidProperties::e_from_p_rho(), NaClFluidProperties::e_from_p_T(), SinglePhaseFluidProperties::e_from_p_T(), IdealGasFluidProperties::h_from_p_T(), Water97FluidProperties::k_from_p_T(), SinglePhaseFluidProperties::mu_drhoT_from_rho_T(), CO2FluidProperties::mu_from_p_T(), NitrogenFluidProperties::mu_from_p_T(), HydrogenFluidProperties::mu_from_p_T(), Water97FluidProperties::mu_from_p_T(), SinglePhaseFluidProperties::rho_dpT(), IdealGasFluidPropertiesPT::rho_e_dpT(), SinglePhaseFluidProperties::rho_e_dpT(), SinglePhaseFluidProperties::rho_e_from_p_T(), IdealGasFluidProperties::rho_from_p_s(), StiffenedGasFluidProperties::rho_from_p_s(), HelmholtzFluidProperties::rho_from_p_T(), CO2FluidProperties::rho_from_p_T(), StiffenedGasFluidProperties::rho_from_p_T(), IdealGasFluidPropertiesPT::rho_from_p_T(), IdealGasFluidProperties::rho_from_p_T(), Water97FluidProperties::rho_from_p_T(), NaClFluidProperties::rho_from_p_T(), SimpleFluidProperties::rho_from_p_T(), rho_from_p_T(), SinglePhaseFluidProperties::rho_mu(), SinglePhaseFluidProperties::rho_mu_dpT(), NitrogenFluidProperties::rho_mu_from_p_T(), HydrogenFluidProperties::rho_mu_from_p_T(), CO2FluidProperties::rho_mu_from_p_T(), IdealGasFluidPropertiesPT::rho_mu_from_p_T(), Water97FluidProperties::rho_mu_from_p_T(), SinglePhaseFluidProperties::rho_mu_from_p_T(), SinglePhaseFluidProperties::T_from_p_h(), and SinglePhaseFluidProperties::v_from_p_T().

617 {
618  mooseDeprecated(name(), ": rho() is deprecated. Use rho_from_p_T() instead");
619 
620  return rho_from_p_T(p, T);
621 }
virtual Real rho_from_p_T(Real p, Real T) const
Density from pressure and temperature.
const std::string name
Definition: Setup.h:22

◆ rho_dpT()

void SinglePhaseFluidProperties::rho_dpT ( Real  pressure,
Real  temperature,
Real &  rho,
Real &  drho_dp,
Real &  drho_dT 
) const
virtualinherited

Definition at line 406 of file SinglePhaseFluidProperties.C.

408 {
409  mooseDeprecated(name(), ": rho_dpT() is deprecated. Use rho_from_p_T() instead");
410 
411  rho_from_p_T(p, T, rho, drho_dp, drho_dT);
412 }
virtual Real rho(Real p, Real T) const
virtual Real rho_from_p_T(Real p, Real T) const
Density from pressure and temperature.
const std::string name
Definition: Setup.h:22

◆ rho_e_dpT()

void SinglePhaseFluidProperties::rho_e_dpT ( Real  pressure,
Real  temperature,
Real &  rho,
Real &  drho_dp,
Real &  drho_dT,
Real &  e,
Real &  de_dp,
Real &  de_dT 
) const
virtualinherited

Reimplemented in IdealGasFluidPropertiesPT.

Definition at line 445 of file SinglePhaseFluidProperties.C.

453 {
454  mooseDeprecated(name(), ": rho_e_dpT() is deprecated. Use rho_e_from_p_T() instead");
455 
456  rho_e_from_p_T(p, T, rho, drho_dp, drho_dT, e, de_dp, de_dT);
457 }
virtual Real rho(Real p, Real T) const
virtual void rho_e_from_p_T(Real pressure, Real temperature, Real &rho, Real &drho_dp, Real &drho_dT, Real &e, Real &de_dp, Real &de_dT) const
Density and internal energy and their derivatives wrt pressure and temperature.
const std::string name
Definition: Setup.h:22
virtual Real e(Real pressure, Real temperature) const

◆ rho_e_from_p_T()

void SinglePhaseFluidProperties::rho_e_from_p_T ( Real  pressure,
Real  temperature,
Real &  rho,
Real &  drho_dp,
Real &  drho_dT,
Real &  e,
Real &  de_dp,
Real &  de_dT 
) const
virtualinherited

Density and internal energy and their derivatives wrt pressure and temperature.

Parameters
pressurefluid pressure (Pa)
temperaturefluid temperature (K)
[out]rhodensity (kg/m^3)
[out]drho_dpderivative of density wrt pressure
[out]drho_dTderivative of density wrt temperature
[out]einternal energy (J/kg)
[out]de_dpderivative of internal energy wrt pressure
[out]de_dTderivative of internal energy wrt temperature

Definition at line 431 of file SinglePhaseFluidProperties.C.

Referenced by SinglePhaseFluidProperties::rho_e_dpT().

439 {
440  rho_from_p_T(p, T, rho, drho_dp, drho_dT);
441  e_from_p_T(p, T, e, de_dp, de_dT);
442 }
virtual Real e_from_p_T(Real p, Real T) const
Internal energy from pressure and temperature.
virtual Real rho(Real p, Real T) const
virtual Real rho_from_p_T(Real p, Real T) const
Density from pressure and temperature.
virtual Real e(Real pressure, Real temperature) const

◆ rho_from_p_s() [1/2]

Real SinglePhaseFluidProperties::rho_from_p_s ( Real  p,
Real  s 
) const
virtualinherited

Density from pressure and specific entropy.

Parameters
[in]ppressure
[in]sspecific entropy

Reimplemented in IdealGasFluidProperties, and StiffenedGasFluidProperties.

Definition at line 109 of file SinglePhaseFluidProperties.C.

Referenced by StagnationTemperatureAux::computeValue(), and SinglePhaseFluidProperties::T_from_p_h().

110 {
111  mooseError(name(), ": ", __PRETTY_FUNCTION__, " not implemented.");
112 }
const std::string name
Definition: Setup.h:22

◆ rho_from_p_s() [2/2]

void SinglePhaseFluidProperties::rho_from_p_s ( Real  p,
Real  s,
Real &  rho,
Real &  drho_dp,
Real &  drho_ds 
) const
virtualinherited

Density and its derivatives from pressure and specific entropy.

Parameters
[in]ppressure
[in]sspecific entropy
[out]rhodensity
[out]drho_dpderivative of density w.r.t. pressure
[out]drho_dsderivative of density w.r.t. specific entropy

Reimplemented in IdealGasFluidProperties, and StiffenedGasFluidProperties.

Definition at line 115 of file SinglePhaseFluidProperties.C.

116 {
117  mooseError(name(), ": ", __PRETTY_FUNCTION__, " not implemented.");
118 }
const std::string name
Definition: Setup.h:22

◆ rho_from_p_T() [1/2]

Real TabulatedFluidProperties::rho_from_p_T ( Real  p,
Real  T 
) const
overridevirtual

Density from pressure and temperature.

Parameters
[in]ppressure (Pa)
[in]Ttemperature (K)
Returns
density (kg/m^3)

Reimplemented from SinglePhaseFluidProperties.

Definition at line 316 of file TabulatedFluidProperties.C.

317 {
319  {
322  }
323  else
325 }
const std::string temperature
Definition: NS.h:27
virtual Real rho_from_p_T(Real p, Real T) const
Density from pressure and temperature.
virtual void checkInputVariables(Real &pressure, Real &temperature) const
Checks that the inputs are within the range of the tabulated data, and throws an error if they are no...
const std::string pressure
Definition: NS.h:26
unsigned int _density_idx
Index of each property.
bool _interpolate_density
Set of flags to note whether a property is to be interpolated.
std::vector< std::unique_ptr< BicubicInterpolation > > _property_ipol
Interpolated fluid property.
const SinglePhaseFluidProperties & _fp
SinglePhaseFluidPropertiesPT UserObject.

◆ rho_from_p_T() [2/2]

void TabulatedFluidProperties::rho_from_p_T ( Real  p,
Real  T,
Real &  rho,
Real &  drho_dp,
Real &  drho_dT 
) const
overridevirtual

Density and its derivatives from pressure and temperature.

Parameters
[in]ppressure (Pa)
[in]Ttemperature (K)
[out]rhodensity (kg/m^3)
[out]drho_dpderivative of density w.r.t. pressure
[out]drho_dTderivative of density w.r.t. temperature

Reimplemented from SinglePhaseFluidProperties.

Definition at line 328 of file TabulatedFluidProperties.C.

330 {
332  {
334  _property_ipol[_density_idx]->sampleValueAndDerivatives(
335  pressure, temperature, rho, drho_dp, drho_dT);
336  }
337  else
338  _fp.rho_from_p_T(pressure, temperature, rho, drho_dp, drho_dT);
339 }
const std::string temperature
Definition: NS.h:27
virtual Real rho(Real p, Real T) const
virtual Real rho_from_p_T(Real p, Real T) const
Density from pressure and temperature.
virtual void checkInputVariables(Real &pressure, Real &temperature) const
Checks that the inputs are within the range of the tabulated data, and throws an error if they are no...
const std::string pressure
Definition: NS.h:26
unsigned int _density_idx
Index of each property.
bool _interpolate_density
Set of flags to note whether a property is to be interpolated.
std::vector< std::unique_ptr< BicubicInterpolation > > _property_ipol
Interpolated fluid property.
const SinglePhaseFluidProperties & _fp
SinglePhaseFluidPropertiesPT UserObject.

◆ rho_mu()

void SinglePhaseFluidProperties::rho_mu ( Real  pressure,
Real  temperature,
Real &  rho,
Real &  mu 
) const
virtualinherited

Density and viscosity.

Parameters
pressurefluid pressure (Pa)
temperaturefluid temperature (K)
[out]rhodensity (kg/m^3)
[out]muviscosity (Pa.s)

Definition at line 516 of file SinglePhaseFluidProperties.C.

517 {
518  mooseDeprecated(name(), ": rho_mu() is deprecated. Use rho_mu_from_p_T() instead");
519 
520  rho_mu_from_p_T(p, T, rho, mu);
521 }
virtual Real mu(Real pressure, Real temperature) const
Dynamic viscosity.
virtual Real rho(Real p, Real T) const
const std::string name
Definition: Setup.h:22
virtual void rho_mu_from_p_T(Real pressure, Real temperature, Real &rho, Real &mu) const

◆ rho_mu_dpT()

void SinglePhaseFluidProperties::rho_mu_dpT ( Real  pressure,
Real  temperature,
Real &  rho,
Real &  drho_dp,
Real &  drho_dT,
Real &  mu,
Real &  dmu_dp,
Real &  dmu_dT 
) const
virtualinherited

Definition at line 531 of file SinglePhaseFluidProperties.C.

539 {
540  mooseDeprecated(name(), ": rho_mu_dpT() is deprecated. Use rho_mu_from_p_T() instead");
541 
542  rho_mu_from_p_T(p, T, rho, drho_dp, drho_dT, mu, dmu_dp, dmu_dT);
543 }
virtual Real mu(Real pressure, Real temperature) const
Dynamic viscosity.
virtual Real rho(Real p, Real T) const
const std::string name
Definition: Setup.h:22
virtual void rho_mu_from_p_T(Real pressure, Real temperature, Real &rho, Real &mu) const

◆ rho_mu_from_p_T() [1/2]

void SinglePhaseFluidProperties::rho_mu_from_p_T ( Real  pressure,
Real  temperature,
Real &  rho,
Real &  mu 
) const
virtualinherited

Reimplemented in Water97FluidProperties, IdealGasFluidPropertiesPT, CO2FluidProperties, HydrogenFluidProperties, and NitrogenFluidProperties.

Definition at line 524 of file SinglePhaseFluidProperties.C.

Referenced by PorousFlowSingleComponentFluid::computeQpProperties(), PorousFlowWaterNCG::gasProperties(), PorousFlowBrineCO2::gasProperties(), PorousFlowWaterNCG::liquidProperties(), SinglePhaseFluidProperties::rho_mu(), and SinglePhaseFluidProperties::rho_mu_dpT().

525 {
526  rho = rho_from_p_T(p, T);
527  mu = mu_from_p_T(p, T);
528 }
virtual Real mu_from_p_T(Real pressure, Real temperature) const
virtual Real mu(Real pressure, Real temperature) const
Dynamic viscosity.
virtual Real rho(Real p, Real T) const
virtual Real rho_from_p_T(Real p, Real T) const
Density from pressure and temperature.

◆ rho_mu_from_p_T() [2/2]

void SinglePhaseFluidProperties::rho_mu_from_p_T ( Real  pressure,
Real  temperature,
Real &  rho,
Real &  drho_dp,
Real &  drho_dT,
Real &  mu,
Real &  dmu_dp,
Real &  dmu_dT 
) const
virtualinherited

Density and viscosity and their derivatives wrt pressure and temperature.

Parameters
pressurefluid pressure (Pa)
temperaturefluid temperature (K)
[out]rhodensity (kg/m^3)
[out]drho_dpderivative of density wrt pressure
[out]drho_dTderivative of density wrt temperature
[out]muviscosity (Pa.s)
[out]dmu_dpderivative of viscosity wrt pressure
[out]dmu_dTderivative of viscosity wrt temperature

Reimplemented in Water97FluidProperties, IdealGasFluidPropertiesPT, CO2FluidProperties, HydrogenFluidProperties, and NitrogenFluidProperties.

Definition at line 546 of file SinglePhaseFluidProperties.C.

554 {
555  rho_from_p_T(p, T, rho, drho_dp, drho_dT);
556  mu_from_p_T(p, T, mu, dmu_dp, dmu_dT);
557 }
virtual Real mu_from_p_T(Real pressure, Real temperature) const
virtual Real mu(Real pressure, Real temperature) const
Dynamic viscosity.
virtual Real rho(Real p, Real T) const
virtual Real rho_from_p_T(Real p, Real T) const
Density from pressure and temperature.

◆ s()

Real SinglePhaseFluidProperties::s ( Real  pressure,
Real  temperature 
) const
virtualinherited

◆ s_from_h_p() [1/2]

Real SinglePhaseFluidProperties::s_from_h_p ( Real  h,
Real  p 
) const
virtualinherited

Specific entropy from specific enthalpy and pressure.

Parameters
[in]hspecific enthalpy
[in]ppressure

Reimplemented in IdealGasFluidProperties, and StiffenedGasFluidProperties.

Definition at line 98 of file SinglePhaseFluidProperties.C.

Referenced by SinglePhaseFluidProperties::T_from_p_h().

99 {
100  mooseError(name(), ": ", __PRETTY_FUNCTION__, " not implemented.");
101 }
const std::string name
Definition: Setup.h:22

◆ s_from_h_p() [2/2]

void SinglePhaseFluidProperties::s_from_h_p ( Real  h,
Real  p,
Real &  s,
Real &  ds_dh,
Real &  ds_dp 
) const
virtualinherited

Specific entropy and its derivatives from specific enthalpy and pressure.

Parameters
[in]hspecific enthalpy
[in]ppressure
[out]sspecific entropy
[out]ds_dhderivative of specific entropy w.r.t. specific enthalpy
[out]ds_dpderivative of specific entropy w.r.t. pressure

Reimplemented in IdealGasFluidProperties, and StiffenedGasFluidProperties.

Definition at line 104 of file SinglePhaseFluidProperties.C.

105 {
106  mooseError(name(), ": ", __PRETTY_FUNCTION__, " not implemented.");
107 }
const std::string name
Definition: Setup.h:22

◆ s_from_p_T() [1/2]

Real TabulatedFluidProperties::s_from_p_T ( Real  p,
Real  T 
) const
overridevirtual

Specific entropy from pressure and temperature.

Parameters
[in]ppressure
[in]Ttemperature

Reimplemented from SinglePhaseFluidProperties.

Definition at line 476 of file TabulatedFluidProperties.C.

477 {
479  {
482  }
483  else
485 }
const std::string temperature
Definition: NS.h:27
virtual void checkInputVariables(Real &pressure, Real &temperature) const
Checks that the inputs are within the range of the tabulated data, and throws an error if they are no...
virtual Real s_from_p_T(Real p, Real T) const
Specific entropy from pressure and temperature.
const std::string pressure
Definition: NS.h:26
std::vector< std::unique_ptr< BicubicInterpolation > > _property_ipol
Interpolated fluid property.
const SinglePhaseFluidProperties & _fp
SinglePhaseFluidPropertiesPT UserObject.

◆ s_from_p_T() [2/2]

void TabulatedFluidProperties::s_from_p_T ( Real  p,
Real  T,
Real &  s,
Real &  ds_dp,
Real &  ds_dT 
) const
overridevirtual

Specific entropy and its derivatives from pressure and temperature.

Parameters
[in]ppressure
[in]Ttemperature
[out]sspecific entropy
[out]ds_dpderivative of specific entropy w.r.t. pressure
[out]ds_dTderivative of specific entropy w.r.t. temperature

Reimplemented from SinglePhaseFluidProperties.

Definition at line 488 of file TabulatedFluidProperties.C.

489 {
490  SinglePhaseFluidProperties::s_from_p_T(p, T, s, ds_dp, ds_dT);
491 }
virtual Real s(Real pressure, Real temperature) const
virtual Real s_from_p_T(Real p, Real T) const
Specific entropy from pressure and temperature.

◆ s_from_T_v() [1/2]

Real SinglePhaseFluidProperties::s_from_T_v ( Real  T,
Real  v 
) const
virtualinherited

Specific entropy from temperature and specific volume.

Parameters
[in]Ttemperature
[in]vspecific volume

Reimplemented in IdealGasFluidProperties, and StiffenedGasFluidProperties.

Definition at line 684 of file SinglePhaseFluidProperties.C.

Referenced by IdealRealGasMixtureFluidProperties::s_from_T_v().

685 {
686  mooseError(name(), ": ", __PRETTY_FUNCTION__, " not implemented.");
687 }
const std::string name
Definition: Setup.h:22

◆ s_from_T_v() [2/2]

void SinglePhaseFluidProperties::s_from_T_v ( Real  T,
Real  v,
Real &  s,
Real &  ds_dT,
Real &  ds_dv 
) const
virtualinherited

Specific entropy and its derivatives from temperature and specific volume.

Parameters
[in]Ttemperature
[in]vspecific volume
[out]sspecific entropy (J/kg)
[out]ds_dTderivative of specific entropy w.r.t. temperature
[out]ds_dvderivative of specific entropy w.r.t. specific volume

Reimplemented in IdealGasFluidProperties, and StiffenedGasFluidProperties.

Definition at line 690 of file SinglePhaseFluidProperties.C.

691 {
692  mooseError(name(), ": ", __PRETTY_FUNCTION__, " not implemented.");
693 }
const std::string name
Definition: Setup.h:22

◆ s_from_v_e() [1/2]

Real SinglePhaseFluidProperties::s_from_v_e ( Real  v,
Real  e 
) const
virtualinherited

Specific entropy from specific volume and specific internal energy.

Parameters
[in]vspecific volume
[in]especific internal energy

Reimplemented in IdealGasFluidProperties, and StiffenedGasFluidProperties.

Definition at line 87 of file SinglePhaseFluidProperties.C.

Referenced by StagnationPressureAux::computeValue(), and StagnationTemperatureAux::computeValue().

88 {
89  mooseError(name(), ": ", __PRETTY_FUNCTION__, " not implemented.");
90 }
const std::string name
Definition: Setup.h:22

◆ s_from_v_e() [2/2]

void SinglePhaseFluidProperties::s_from_v_e ( Real  v,
Real  e,
Real &  s,
Real &  ds_dv,
Real &  ds_de 
) const
virtualinherited

Specific entropy and its derivatives from specific volume and specific internal energy.

Parameters
[in]vspecific volume
[in]especific internal energy
[out]sspecific entropy
[out]ds_dvderivative of specific entropy w.r.t. specific volume
[out]ds_dederivative of specific entropy w.r.t. specific internal energy

Reimplemented in IdealGasFluidProperties, and StiffenedGasFluidProperties.

Definition at line 93 of file SinglePhaseFluidProperties.C.

94 {
95  mooseError(name(), ": ", __PRETTY_FUNCTION__, " not implemented.");
96 }
const std::string name
Definition: Setup.h:22

◆ subdomainSetup()

virtual void FluidProperties::subdomainSetup ( )
inlinefinalvirtualinherited

Definition at line 32 of file FluidProperties.h.

32 {}

◆ T_from_p_h()

Real SinglePhaseFluidProperties::T_from_p_h ( Real  pressure,
Real  enthalpy 
) const
virtualinherited

Temperature from pressure and specific enthalpy.

Parameters
[in]pressurepressure (Pa)
[in]enthalpyenthalpy (J/kg)
Returns
Temperature (K)

Reimplemented in IdealGasFluidProperties.

Definition at line 728 of file SinglePhaseFluidProperties.C.

729 {
730  const Real s = s_from_h_p(h, p);
731  const Real rho = rho_from_p_s(p, s);
732  const Real v = 1. / rho;
733  const Real e = e_from_v_h(v, h);
734  return T_from_v_e(v, e);
735 }
virtual Real T_from_v_e(Real v, Real e) const
Temperature from specific volume and specific internal energy.
virtual Real s(Real pressure, Real temperature) const
virtual Real h(Real p, Real T) const
virtual Real s_from_h_p(Real h, Real p) const
Specific entropy from specific enthalpy and pressure.
virtual Real rho(Real p, Real T) const
virtual Real e_from_v_h(Real v, Real h) const
Specific internal energy as a function of specific volume and specific enthalpy.
virtual Real rho_from_p_s(Real p, Real s) const
Density from pressure and specific entropy.
virtual Real e(Real pressure, Real temperature) const

◆ T_from_v_e() [1/2]

Real SinglePhaseFluidProperties::T_from_v_e ( Real  v,
Real  e 
) const
virtualinherited

Temperature from specific volume and specific internal energy.

Parameters
[in]vspecific volume
[in]especific internal energy
Returns
sound speed

Reimplemented in IdealGasFluidProperties, and StiffenedGasFluidProperties.

Definition at line 39 of file SinglePhaseFluidProperties.C.

Referenced by FluidPropertiesMaterial::computeQpProperties(), StagnationTemperatureAux::computeValue(), TemperatureAux::computeValue(), IdealRealGasMixtureFluidProperties::p_T_from_v_e(), and SinglePhaseFluidProperties::T_from_p_h().

40 {
41  mooseError(name(), ": ", __PRETTY_FUNCTION__, " not implemented.");
42 }
const std::string name
Definition: Setup.h:22

◆ T_from_v_e() [2/2]

void SinglePhaseFluidProperties::T_from_v_e ( Real  v,
Real  e,
Real &  T,
Real &  dT_dv,
Real &  dT_de 
) const
virtualinherited

Temperature and its derivatives from specific volume and specific internal energy.

Parameters
[in]vspecific volume
[in]especific internal energy
[out]Ttemperature
[out]dT_dvderivative of temperature w.r.t. specific volume
[out]dT_dederivative of temperature w.r.t. specific internal energy

Reimplemented in IdealGasFluidProperties, and StiffenedGasFluidProperties.

Definition at line 45 of file SinglePhaseFluidProperties.C.

46 {
47  mooseError(name(), ": ", __PRETTY_FUNCTION__, " not implemented.");
48 }
const std::string name
Definition: Setup.h:22

◆ threadJoin()

virtual void FluidProperties::threadJoin ( const UserObject &  )
inlinefinalvirtualinherited

Definition at line 31 of file FluidProperties.h.

31 {}

◆ triplePointPressure()

Real SinglePhaseFluidProperties::triplePointPressure ( ) const
virtualinherited

Triple point pressure.

Returns
triple point pressure (Pa)

Reimplemented in HydrogenFluidProperties, CO2FluidProperties, NitrogenFluidProperties, MethaneFluidProperties, NaClFluidProperties, and Water97FluidProperties.

Definition at line 250 of file SinglePhaseFluidProperties.C.

251 {
252  mooseError(name(), ": triplePointPressure() is not implemented");
253 }
const std::string name
Definition: Setup.h:22

◆ triplePointTemperature()

Real SinglePhaseFluidProperties::triplePointTemperature ( ) const
virtualinherited

Triple point temperature.

Returns
triple point temperature (K)

Reimplemented in HydrogenFluidProperties, CO2FluidProperties, NitrogenFluidProperties, MethaneFluidProperties, NaClFluidProperties, and Water97FluidProperties.

Definition at line 256 of file SinglePhaseFluidProperties.C.

257 {
258  mooseError(name(), ": triplePointTemperature() is not implemented");
259 }
const std::string name
Definition: Setup.h:22

◆ v_e_spndl_from_T()

void SinglePhaseFluidProperties::v_e_spndl_from_T ( Real  T,
Real &  v,
Real &  e 
) const
virtualinherited

Specific internal energy from temperature and specific volume.

Parameters
[in]Ttemperature
[in]vspecific volume

Reimplemented in StiffenedGasFluidProperties.

Definition at line 651 of file SinglePhaseFluidProperties.C.

Referenced by IdealRealGasMixtureFluidProperties::v_from_p_T().

652 {
653  mooseError(name(), ": ", __PRETTY_FUNCTION__, " not implemented.");
654 }
const std::string name
Definition: Setup.h:22

◆ v_from_p_T() [1/2]

Real SinglePhaseFluidProperties::v_from_p_T ( Real  p,
Real  T 
) const
virtualinherited

Specific volume from pressure and temperature.

Parameters
[in]ppressure
[in]Ttemperature

Definition at line 157 of file SinglePhaseFluidProperties.C.

Referenced by GeneralVaporMixtureFluidProperties::c_from_p_T(), GeneralVaporMixtureFluidProperties::cp_from_p_T(), GeneralVaporMixtureFluidProperties::cv_from_p_T(), GeneralVaporMixtureFluidProperties::k_from_p_T(), GeneralVaporMixtureFluidProperties::mu_from_p_T(), GeneralVaporMixtureFluidProperties::v_from_p_T(), and IdealRealGasMixtureFluidProperties::xs_prim_from_p_T().

158 {
159  const Real rho = rho_from_p_T(p, T);
160  return 1.0 / rho;
161 }
virtual Real rho(Real p, Real T) const
virtual Real rho_from_p_T(Real p, Real T) const
Density from pressure and temperature.

◆ v_from_p_T() [2/2]

void SinglePhaseFluidProperties::v_from_p_T ( Real  p,
Real  T,
Real &  v,
Real &  dv_dp,
Real &  dv_dT 
) const
virtualinherited

Specific volume and its derivatives from pressure and temperature.

Parameters
[in]ppressure
[in]Ttemperature
[out]vspecific volume
[out]dv_dpderivative of specific volume w.r.t. pressure
[out]dv_dTderivative of specific volume w.r.t. temperature

Definition at line 164 of file SinglePhaseFluidProperties.C.

165 {
166  Real rho, drho_dp, drho_dT;
167  rho_from_p_T(p, T, rho, drho_dp, drho_dT);
168 
169  v = 1.0 / rho;
170  const Real dv_drho = -1.0 / (rho * rho);
171 
172  dv_dp = dv_drho * drho_dp;
173  dv_dT = dv_drho * drho_dT;
174 }
virtual Real rho(Real p, Real T) const
virtual Real rho_from_p_T(Real p, Real T) const
Density from pressure and temperature.

◆ vaporPressure() [1/2]

Real TabulatedFluidProperties::vaporPressure ( Real  temperature) const
overridevirtual

Vapor pressure.

Used to delineate liquid and gas phases. Valid for temperatures between the triple point temperature and the critical temperature

Parameters
temperaturewater temperature (K)
Returns
saturation pressure (Pa)

Reimplemented from SinglePhaseFluidProperties.

Definition at line 506 of file TabulatedFluidProperties.C.

507 {
508  return _fp.vaporPressure(temperature);
509 }
virtual Real vaporPressure(Real temperature) const
Vapor pressure.
const std::string temperature
Definition: NS.h:27
const SinglePhaseFluidProperties & _fp
SinglePhaseFluidPropertiesPT UserObject.

◆ vaporPressure() [2/2]

void TabulatedFluidProperties::vaporPressure ( Real  temperature,
Real &  psat,
Real &  dpsat_dT 
) const
overridevirtual

Vapor pressure.

Used to delineate liquid and gas phases. Valid for temperatures between the triple point temperature and the critical temperature

Parameters
temperaturewater temperature (K)
[out]saturationpressure (Pa)
[out]derivativeof saturation pressure wrt temperature (Pa/K)

Reimplemented from SinglePhaseFluidProperties.

Definition at line 512 of file TabulatedFluidProperties.C.

513 {
514  _fp.vaporPressure(temperature, psat, dpsat_dT);
515 }
virtual Real vaporPressure(Real temperature) const
Vapor pressure.
const std::string temperature
Definition: NS.h:27
const SinglePhaseFluidProperties & _fp
SinglePhaseFluidPropertiesPT UserObject.

◆ vaporPressure_dT()

void SinglePhaseFluidProperties::vaporPressure_dT ( Real  temperature,
Real &  psat,
Real &  dpsat_dT 
) const
virtualinherited

Definition at line 398 of file SinglePhaseFluidProperties.C.

399 {
400  mooseDeprecated(name(), ": vaporPressure_dT() is deprecated. Use vaporPressure() instead");
401 
402  vaporPressure(T, psat, dpsat_dT);
403 }
virtual Real vaporPressure(Real temperature) const
Vapor pressure.
const std::string name
Definition: Setup.h:22

◆ writeTabulatedData()

void TabulatedFluidProperties::writeTabulatedData ( std::string  file_name)
protected

Writes tabulated data to a file.

Parameters
file_namename of the file to be written

Definition at line 518 of file TabulatedFluidProperties.C.

Referenced by initialSetup().

519 {
520  if (processor_id() == 0)
521  {
522  MooseUtils::checkFileWriteable(file_name);
523 
524  std::ofstream file_out(file_name.c_str());
525 
526  // Write out date and fluid type
527  time_t now = time(&now);
528  file_out << "# " << _fp.fluidName() << " properties created by TabulatedFluidProperties on "
529  << ctime(&now) << "\n";
530 
531  // Write out column names
532  file_out << "pressure, temperature";
533  for (std::size_t i = 0; i < _interpolated_properties.size(); ++i)
534  file_out << ", " << _interpolated_properties[i];
535  file_out << "\n";
536 
537  // Write out the fluid property data
538  for (unsigned int p = 0; p < _num_p; ++p)
539  for (unsigned int t = 0; t < _num_T; ++t)
540  {
541  file_out << _pressure[p] << ", " << _temperature[t];
542  for (std::size_t i = 0; i < _properties.size(); ++i)
543  file_out << ", " << _properties[i][p * _num_T + t];
544  file_out << "\n";
545  }
546  }
547 }
std::vector< std::string > _interpolated_properties
List of properties to be interpolated.
std::vector< Real > _pressure
Pressure vector.
std::vector< Real > _temperature
Temperature vector.
unsigned int _num_T
Number of temperature points in the tabulated data.
std::vector< std::vector< Real > > _properties
Tabulated fluid properties.
unsigned int _num_p
Number of pressure points in the tabulated data.
virtual std::string fluidName() const
Fluid name.
const SinglePhaseFluidProperties & _fp
SinglePhaseFluidPropertiesPT UserObject.

Member Data Documentation

◆ _cp_idx

unsigned int TabulatedFluidProperties::_cp_idx
protected

Definition at line 235 of file TabulatedFluidProperties.h.

Referenced by cp_from_p_T(), and initialSetup().

◆ _csv_reader

MooseUtils::DelimitedFileReader TabulatedFluidProperties::_csv_reader
protected

The MOOSE delimited file reader.

Definition at line 240 of file TabulatedFluidProperties.h.

Referenced by initialSetup(), and TabulatedFluidProperties().

◆ _cv_idx

unsigned int TabulatedFluidProperties::_cv_idx
protected

Definition at line 236 of file TabulatedFluidProperties.h.

Referenced by cv_from_p_T(), and initialSetup().

◆ _density_idx

unsigned int TabulatedFluidProperties::_density_idx
protected

Index of each property.

Definition at line 230 of file TabulatedFluidProperties.h.

Referenced by initialSetup(), and rho_from_p_T().

◆ _enthalpy_idx

unsigned int TabulatedFluidProperties::_enthalpy_idx
protected

Definition at line 231 of file TabulatedFluidProperties.h.

Referenced by h_from_p_T(), and initialSetup().

◆ _entropy_idx

unsigned int TabulatedFluidProperties::_entropy_idx
protected

Definition at line 237 of file TabulatedFluidProperties.h.

Referenced by initialSetup(), and s_from_p_T().

◆ _file_name

FileName TabulatedFluidProperties::_file_name
protected

File name of tabulated data file.

Definition at line 181 of file TabulatedFluidProperties.h.

Referenced by initialSetup().

◆ _fp

const SinglePhaseFluidProperties& TabulatedFluidProperties::_fp
protected

◆ _internal_energy_idx

unsigned int TabulatedFluidProperties::_internal_energy_idx
protected

Definition at line 232 of file TabulatedFluidProperties.h.

Referenced by e_from_p_T(), and initialSetup().

◆ _interpolate_cp

bool TabulatedFluidProperties::_interpolate_cp
protected

Definition at line 225 of file TabulatedFluidProperties.h.

Referenced by cp_from_p_T(), and initialSetup().

◆ _interpolate_cv

bool TabulatedFluidProperties::_interpolate_cv
protected

Definition at line 226 of file TabulatedFluidProperties.h.

Referenced by cv_from_p_T(), and initialSetup().

◆ _interpolate_density

bool TabulatedFluidProperties::_interpolate_density
protected

Set of flags to note whether a property is to be interpolated.

Definition at line 220 of file TabulatedFluidProperties.h.

Referenced by initialSetup(), and rho_from_p_T().

◆ _interpolate_enthalpy

bool TabulatedFluidProperties::_interpolate_enthalpy
protected

Definition at line 221 of file TabulatedFluidProperties.h.

Referenced by h_from_p_T(), and initialSetup().

◆ _interpolate_entropy

bool TabulatedFluidProperties::_interpolate_entropy
protected

Definition at line 227 of file TabulatedFluidProperties.h.

Referenced by initialSetup(), and s_from_p_T().

◆ _interpolate_internal_energy

bool TabulatedFluidProperties::_interpolate_internal_energy
protected

Definition at line 222 of file TabulatedFluidProperties.h.

Referenced by e_from_p_T(), and initialSetup().

◆ _interpolate_k

bool TabulatedFluidProperties::_interpolate_k
protected

Definition at line 224 of file TabulatedFluidProperties.h.

Referenced by initialSetup(), and k_from_p_T().

◆ _interpolate_viscosity

bool TabulatedFluidProperties::_interpolate_viscosity
protected

Definition at line 223 of file TabulatedFluidProperties.h.

Referenced by initialSetup(), and mu_from_p_T().

◆ _interpolated_properties

std::vector<std::string> TabulatedFluidProperties::_interpolated_properties
protected

List of properties to be interpolated.

Definition at line 218 of file TabulatedFluidProperties.h.

Referenced by generateTabulatedData(), initialSetup(), and writeTabulatedData().

◆ _interpolated_properties_enum

MultiMooseEnum TabulatedFluidProperties::_interpolated_properties_enum
protected

Properties to be interpolated entered in the input file.

Definition at line 216 of file TabulatedFluidProperties.h.

Referenced by generateTabulatedData().

◆ _k_idx

unsigned int TabulatedFluidProperties::_k_idx
protected

Definition at line 234 of file TabulatedFluidProperties.h.

Referenced by initialSetup(), and k_from_p_T().

◆ _num_p

unsigned int TabulatedFluidProperties::_num_p
protected

Number of pressure points in the tabulated data.

Definition at line 203 of file TabulatedFluidProperties.h.

Referenced by generateTabulatedData(), initialSetup(), and writeTabulatedData().

◆ _num_T

unsigned int TabulatedFluidProperties::_num_T
protected

Number of temperature points in the tabulated data.

Definition at line 201 of file TabulatedFluidProperties.h.

Referenced by generateTabulatedData(), initialSetup(), and writeTabulatedData().

◆ _pressure

std::vector<Real> TabulatedFluidProperties::_pressure
protected

Pressure vector.

Definition at line 183 of file TabulatedFluidProperties.h.

Referenced by generateTabulatedData(), initialSetup(), and writeTabulatedData().

◆ _pressure_max

Real TabulatedFluidProperties::_pressure_max
protected

Maximum pressure in tabulated data.

Definition at line 199 of file TabulatedFluidProperties.h.

Referenced by checkInputVariables(), generateTabulatedData(), initialSetup(), and TabulatedFluidProperties().

◆ _pressure_min

Real TabulatedFluidProperties::_pressure_min
protected

Minimum pressure in tabulated data.

Definition at line 197 of file TabulatedFluidProperties.h.

Referenced by checkInputVariables(), generateTabulatedData(), initialSetup(), and TabulatedFluidProperties().

◆ _properties

std::vector<std::vector<Real> > TabulatedFluidProperties::_properties
protected

Tabulated fluid properties.

Definition at line 187 of file TabulatedFluidProperties.h.

Referenced by generateTabulatedData(), initialSetup(), and writeTabulatedData().

◆ _property_columns

const std::vector<std::string> TabulatedFluidProperties::_property_columns
protected
Initial value:
{
"density", "enthalpy", "internal_energy", "viscosity", "k", "cv", "cp", "entropy"}

List of possible property column names to be read.

Definition at line 213 of file TabulatedFluidProperties.h.

Referenced by initialSetup().

◆ _property_ipol

std::vector<std::unique_ptr<BicubicInterpolation> > TabulatedFluidProperties::_property_ipol
protected

Interpolated fluid property.

Definition at line 190 of file TabulatedFluidProperties.h.

Referenced by cp_from_p_T(), cv_from_p_T(), e_from_p_T(), h_from_p_T(), initialSetup(), k_from_p_T(), mu_from_p_T(), rho_from_p_T(), and s_from_p_T().

◆ _R

const Real SinglePhaseFluidProperties::_R
protectedinherited

◆ _required_columns

const std::vector<std::string> TabulatedFluidProperties::_required_columns {"pressure", "temperature"}
protected

List of required column names to be read.

Definition at line 211 of file TabulatedFluidProperties.h.

Referenced by initialSetup().

◆ _save_file

const bool TabulatedFluidProperties::_save_file
protected

Whether to save a generated fluid properties file to disk.

Definition at line 205 of file TabulatedFluidProperties.h.

Referenced by initialSetup().

◆ _T_c2k

const Real SinglePhaseFluidProperties::_T_c2k
protectedinherited

◆ _temperature

std::vector<Real> TabulatedFluidProperties::_temperature
protected

Temperature vector.

Definition at line 185 of file TabulatedFluidProperties.h.

Referenced by generateTabulatedData(), initialSetup(), and writeTabulatedData().

◆ _temperature_max

Real TabulatedFluidProperties::_temperature_max
protected

Maximum temperature in tabulated data.

Definition at line 195 of file TabulatedFluidProperties.h.

Referenced by checkInputVariables(), generateTabulatedData(), initialSetup(), and TabulatedFluidProperties().

◆ _temperature_min

Real TabulatedFluidProperties::_temperature_min
protected

Minimum temperature in tabulated data.

Definition at line 193 of file TabulatedFluidProperties.h.

Referenced by checkInputVariables(), generateTabulatedData(), initialSetup(), and TabulatedFluidProperties().

◆ _viscosity_idx

unsigned int TabulatedFluidProperties::_viscosity_idx
protected

Definition at line 233 of file TabulatedFluidProperties.h.

Referenced by initialSetup(), and mu_from_p_T().


The documentation for this class was generated from the following files: