15#include "libmesh/utility.h"
20#pragma GCC diagnostic push
21#pragma GCC diagnostic ignored "-Woverloaded-virtual"
36 virtual std::string
fluidName()
const override;
40 virtual Real
rho_from_p_T(Real pressure, Real temperature)
const override;
45 Real pressure, Real temperature, Real &
rho, Real & drho_dp, Real & drho_dT)
const override;
47 const ADReal & temperature,
50 ADReal & drho_dT)
const override;
54 rho_from_p_s(Real
p, Real s, Real &
rho, Real & drho_dp, Real & drho_ds)
const override;
56 virtual Real
v_from_p_T(Real pressure, Real temperature)
const override;
61 v_from_p_T(Real pressure, Real temperature, Real &
v, Real & dv_dp, Real & dv_dT)
const override;
63 virtual Real
e_from_p_T(Real pressure, Real temperature)
const override;
68 e_from_p_T(Real pressure, Real temperature, Real & e, Real & de_dp, Real & de_dT)
const override;
75 e_from_p_rho(Real pressure, Real
rho, Real & e, Real & de_dp, Real & de_drho)
const override;
81 virtual void T_from_p_rho(Real pressure, Real
rho, Real &
T, Real & dT_dp, Real & dT_drho)
const;
88 h_from_p_T(Real pressure, Real temperature, Real &
h, Real & dh_dp, Real & dh_dT)
const override;
90 virtual Real
mu_from_p_T(Real pressure, Real temperature)
const override;
93 Real pressure, Real temperature, Real &
mu, Real & dmu_dp, Real & dmu_dT)
const override;
95 virtual Real
cp_from_p_T(Real pressure, Real temperature)
const override;
98 Real pressure, Real temperature, Real & cp, Real & dcp_dp, Real & dcp_dT)
const override;
100 using SinglePhaseFluidProperties::cp_from_p_T;
102 virtual Real
cv_from_p_T(Real pressure, Real temperature)
const override;
104 Real pressure, Real temperature, Real & cv, Real & dcv_dp, Real & dcv_dT)
const override;
106 virtual Real
c_from_p_T(Real pressure, Real temperature)
const override;
108 c_from_p_T(Real pressure, Real temperature, Real &
c, Real & dc_dp, Real & dc_dT)
const override;
110 virtual Real
k_from_p_T(Real pressure, Real temperature)
const override;
113 k_from_p_T(Real pressure, Real temperature, Real & k, Real & dk_dp, Real & dk_dT)
const override;
115 virtual Real
s_from_p_T(Real pressure, Real temperature)
const override;
117 virtual void s_from_p_T(Real
p, Real
T, Real & s, Real & ds_dp, Real & ds_dT)
const override;
127 virtual void vaporPressure(Real temperature, Real & psat, Real & dpsat_dT)
const override;
130 virtual void vaporTemperature(Real pressure, Real & Tsat, Real & dTsat_dp)
const override;
132 virtual Real
T_from_p_h(Real pressure, Real enthalpy)
const override;
146 virtual Real
p_from_v_e(Real
v, Real e)
const override;
147 virtual void p_from_v_e(Real
v, Real e, Real &
p, Real & dp_dv, Real & dp_de)
const override;
152 ADReal & dp_de)
const override;
153 virtual Real
T_from_v_e(Real
v, Real e)
const override;
154 virtual void T_from_v_e(Real
v, Real e, Real &
T, Real & dT_dv, Real & dT_de)
const override;
159 ADReal & dp_de)
const override;
160 virtual Real
c_from_v_e(Real
v, Real e)
const override;
161 virtual void c_from_v_e(Real
v, Real e, Real &
c, Real & dc_dv, Real & dc_de)
const override;
162 virtual Real
cp_from_v_e(Real
v, Real e)
const override;
163 virtual void cp_from_v_e(Real
v, Real e, Real & cp, Real & dcp_dv, Real & dcp_de)
const override;
164 virtual Real
cv_from_v_e(Real
v, Real e)
const override;
165 virtual void cv_from_v_e(Real
v, Real e, Real & cv, Real & dcv_dv, Real & dcv_de)
const override;
166 virtual Real
mu_from_v_e(Real
v, Real e)
const override;
167 virtual void mu_from_v_e(Real
v, Real e, Real &
mu, Real & dmu_dv, Real & dmu_de)
const override;
168 virtual Real
k_from_v_e(Real
v, Real e)
const override;
169 virtual void k_from_v_e(Real
v, Real e, Real & k, Real & dk_dv, Real & dk_de)
const override;
170 virtual Real
g_from_v_e(Real
v, Real e)
const override;
172 virtual void e_from_v_h(Real
v, Real
h, Real & e, Real & de_dv, Real & de_dh)
const override;
175 virtual void T_from_p_s(Real
p, Real s, Real &
T, Real & dT_dp, Real & dT_ds)
const;
176 virtual Real
s_from_v_e(Real
v, Real e)
const override;
177 virtual void s_from_v_e(Real
v, Real e, Real & s, Real & ds_dv, Real & ds_de)
const override;
178 virtual Real
s_from_h_p(Real
h, Real pressure)
const override;
180 s_from_h_p(Real
h, Real pressure, Real & s, Real & ds_dh, Real & ds_dp)
const override;
183 using SinglePhaseFluidProperties::c_from_v_e;
184 using SinglePhaseFluidProperties::p_from_v_e;
185 using SinglePhaseFluidProperties::T_from_v_e;
200 template <
typename T>
209 template <
typename T>
227 std::vector<Real> & v2,
228 const std::string & file_name,
229 const std::string & v1_name,
230 const std::string & v2_name);
270 const std::string & needed_property)
const;
422#pragma GCC diagnostic pop
DualNumber< Real, DNDerivativeType, true > ADReal
const InputParameters & parameters() const
Common class for single phase fluid properties.
e e e e s T T T T T rho T
e e e e s T T T T T rho v v T e h
Class for fluid properties read from a tabulation in a file.
FileName _file_name_out
File name of output tabulated data file.
std::unique_ptr< BidimensionalInterpolation > _T_from_v_e_ipol
Bi-dimensional interpolation of temperature from (v,e)
virtual Real v_from_p_T(Real pressure, Real temperature) const override
unsigned int _num_T
Number of temperature points in the tabulated data.
const bool _save_file
Whether to save a generated fluid properties file to disk.
bool _initial_setup_done
keeps track of whether initialSetup has been performed
const SinglePhaseFluidProperties *const _fp
SinglePhaseFluidPropertiesPT UserObject.
FileName _file_name_ve_out
File name of output (v,e) tabulated data file.
std::vector< std::string > _interpolated_properties
List of properties to be interpolated.
void checkInputVariables(T &pressure, T &temperature) const
Checks that the inputs are within the range of the tabulated data, and throws an error if they are no...
std::vector< Real > _internal_energy
Specific internal energy vector.
void readFileTabulationData(bool use_pT)
Read tabulation data from file.
unsigned int _enthalpy_idx
Real _v_min
Minimum specific volume in tabulated data (can be user-specified)
virtual Real s_from_v_e(Real v, Real e) const override
unsigned int _viscosity_idx
virtual Real triplePointTemperature() const override
Triple point temperature.
std::vector< std::vector< Real > > _properties_ve
Tabulated fluid properties in (v,e) (read from file OR computed from _fp)
void computePropertyIndicesInInterpolationVectors()
Retrieves the index for each property in the vector of interpolations.
virtual Real e_from_v_h(Real v, Real h) const override
unsigned int _num_v
Number of specific volume points in the tabulated data.
Real _v_max
Maximum specific volume in tabulated data (can be user-specified)
Real _h_min
Minimum specific enthalpy in tabulated data.
FileName _file_name_ve_in
File name of input (v,e) tabulated data file.
virtual Real T_from_p_h(Real pressure, Real enthalpy) const override
void missingVEInterpolationError(const std::string &function_name) const
Standardized error message for missing interpolation.
virtual void constructInterpolation()=0
virtual Real rho_from_p_s(Real p, Real s) const override
std::vector< Real > _temperature
Temperature vector.
const bool _create_direct_ve_interpolations
Whether the object has direct (v,e) interpolations (whether created from file or from _fp)
virtual Real g_from_v_e(Real v, Real e) const override
bool _interpolate_entropy
void writeTabulatedData(std::string file_name)
Writes tabulated data to a file.
void NeedTabulationError(const std::string &needed_property) const
Utility to forward errors related to properties being requested for tabulation, but no tabulation is ...
virtual void generateTabulatedData()
Generates a table of fluid properties by looping over pressure and temperature and calculating proper...
virtual Real cp_from_p_T(Real pressure, Real temperature) const override
std::unique_ptr< BidimensionalInterpolation > _p_from_v_h_ipol
Bidimensional interpolation of pressure from (v,h)
virtual void generateVETabulatedData()
Generates a table of fluid properties by looping over specific volume and internal energy and calcula...
unsigned int _entropy_idx
Real _temperature_max
Maximum temperature in tabulated data.
static InputParameters validParams()
Real _e_min
Minimum internal energy in tabulated data (can be user-specified)
virtual Real T_from_p_rho(Real pressure, Real rho) const
const bool _create_direct_pT_interpolations
Whether the object has direct (p,T) interpolations (whether created from file or from _fp)
Real _e_max
Maximum internal energy in tabulated data (can be user-specified)
virtual Real triplePointPressure() const override
Triple point pressure.
void checkFileTabulationGrids(std::vector< Real > &v1, std::vector< Real > &v2, const std::string &file_name, const std::string &v1_name, const std::string &v2_name)
Check that the tabulation grids in the file are correct (no repeats etc)
bool _interpolate_temperature
std::vector< Real > _enthalpy
Specific enthalpy vector.
virtual Real cp_from_v_e(Real v, Real e) const override
void TabulationNotImplementedError(const std::string &desired_routine) const
Utility to forward errors related to fluid properties methods not implemented.
virtual Real cv_from_v_e(Real v, Real e) const override
void createVHGridVectors()
Create (or reset) the grid vectors for the specific volume and enthalpy interpolation The order of pr...
virtual Real T_from_h_s(Real h, Real s) const
bool _log_space_v
log-space the specific volume interpolation grid axis instead of linear
unsigned int _num_p
Number of pressure points in the tabulated data.
OOBBehavior
Enum specifying all the behavior on out of bounds data options.
MooseUtils::DelimitedFileReader _csv_reader
The MOOSE delimited file reader.
FileName _file_name_in
File name of input tabulated data file.
bool _v_bounds_specified
Whether the specific volume bounds were set by the user.
std::vector< std::unique_ptr< BidimensionalInterpolation > > _property_ve_ipol
Vector of bi-dimensional interpolation of fluid properties directly in (v,e)
bool _construct_pT_from_vh
if the lookup table p(v, h) and T(v, h) should be constructed
bool _interpolate_viscosity
virtual void checkInitialGuess(bool post_reading_tabulation) const
Checks initial guess for Newton Method.
MultiMooseEnum _interpolated_properties_enum
Properties to be interpolated entered in the input file.
std::unique_ptr< BidimensionalInterpolation > _p_from_v_e_ipol
Bi-dimensional interpolation of pressure from (v,e)
void createVGridVector()
Create (or reset) the grid vectors for the specific volume and internal energy interpolations The ord...
virtual Real criticalTemperature() const override
Critical temperature.
virtual Real h_from_p_T(Real p, Real T) const override
unsigned int _num_e
Number of internal energy points in tabulated data.
void NeedTabulationOrFPError(const std::string &desired_routine, const std::string &needed_property) const
Utility to forward errors related to fluid properties needing more data for their computation This sh...
bool _interpolate_internal_energy
std::vector< Real > _specific_volume
Specific volume vector.
virtual Real rho_from_p_T(Real pressure, Real temperature) const override
virtual void initialSetup() override
virtual Real e_from_p_rho(Real pressure, Real rho) const override
virtual Real cv_from_p_T(Real pressure, Real temperature) const override
MooseEnum _OOBBehavior
User-selected out-of-bounds behavior.
virtual Real p_from_v_e(Real v, Real e) const override
Derivatives like dc_dv & dc_de are computed using the chain rule dy/dx(p,T) = dy/dp * dp/dx + dy/dT *...
bool _log_space_e
log-space the internal energy interpolation grid axis instead of linear
void checkInputVariablesVE(T &v, T &e) const
Checks that the inputs are within the range of the tabulated data, and throws an error if they are no...
virtual Real mu_from_p_T(Real pressure, Real temperature) const override
virtual Real mu_from_v_e(Real v, Real e) const override
virtual Real k_from_p_T(Real pressure, Real temperature) const override
virtual std::vector< Real > henryCoefficients() const override
The following routines are simply forwarded to the 'fp' companion FluidProperties as they are not inc...
unsigned int _internal_energy_idx
bool _interpolate_pressure
virtual Real T_from_p_s(Real p, Real s) const
virtual Real s_from_h_p(Real h, Real pressure) const override
virtual Real vaporTemperature(Real pressure) const override
Vapor temperature.
Real _pressure_max
Maximum pressure in tabulated data.
virtual Real vaporPressure(Real temperature) const override
Vapor pressure.
Real _h_max
Maximum specific enthalpy in tabulated data.
std::vector< std::unique_ptr< BidimensionalInterpolation > > _property_ipol
Vector of bi-dimensional interpolation of fluid properties.
virtual Real criticalDensity() const override
Critical density.
virtual Real molarMass() const override
Molar mass [kg/mol].
virtual Real T_from_v_e(Real v, Real e) const override
void createVEGridVectors()
unsigned int _density_idx
Index of each property.
virtual Real k_from_v_e(Real v, Real e) const override
std::unique_ptr< BidimensionalInterpolation > _T_from_v_h_ipol
Bi-dimensional interpolation of temperature from (v,h)
virtual Real s_from_p_T(Real pressure, Real temperature) const override
Real _temperature_min
Minimum temperature in tabulated data.
virtual std::string fluidName() const override
Fluid name.
Real _pressure_min
Minimum pressure in tabulated data.
const bool _allow_fp_and_tabulation
Whether to allow a fp object when a tabulation is in use.
virtual Real c_from_v_e(Real v, Real e) const override
std::vector< std::vector< Real > > _properties
Tabulated fluid properties (read from file OR computed from _fp)
bool _construct_pT_from_ve
if the lookup table p(v, e) and T(v, e) should be constructed
std::vector< Real > _pressure
Pressure vector.
bool _log_space_h
log-space the enthalpy interpolation grid axis instead of linear
bool _e_bounds_specified
Whether the specific internal energy bounds were set by the user.
virtual Real e_from_p_T(Real pressure, Real temperature) const override
bool _interpolate_enthalpy
virtual Real c_from_p_T(Real pressure, Real temperature) const override
bool _interpolate_density
Set of flags to note whether a property is to be interpolated.
virtual Real criticalPressure() const override
Critical pressure.