https://mooseframework.inl.gov
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Protected Types | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
TabulatedFluidProperties Class Referenceabstract

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

#include <TabulatedFluidProperties.h>

Inheritance diagram for TabulatedFluidProperties:
[legend]

Public Types

typedef DataFileName DataFileParameterType
 

Public Member Functions

 TabulatedFluidProperties (const InputParameters &parameters)
 
virtual void initialSetup () override
 
virtual void constructInterpolation ()=0
 
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
 
virtual ADReal rho_from_p_T (const ADReal &pressure, const ADReal &temperature) const override
 
virtual void rho_from_p_T (Real pressure, Real temperature, Real &rho, Real &drho_dp, Real &drho_dT) const override
 
virtual void rho_from_p_T (const ADReal &pressure, const ADReal &temperature, ADReal &rho, ADReal &drho_dp, ADReal &drho_dT) const override
 
virtual Real rho_from_p_s (Real p, Real s) const override
 
virtual void rho_from_p_s (Real p, Real s, Real &rho, Real &drho_dp, Real &drho_ds) const override
 
virtual Real v_from_p_T (Real pressure, Real temperature) const override
 
virtual ADReal v_from_p_T (const ADReal &pressure, const ADReal &temperature) const override
 
virtual void v_from_p_T (Real pressure, Real temperature, Real &v, Real &dv_dp, Real &dv_dT) const override
 
virtual Real e_from_p_T (Real pressure, Real temperature) const override
 
virtual ADReal e_from_p_T (const ADReal &pressure, const ADReal &temperature) const override
 
virtual void e_from_p_T (Real pressure, Real temperature, Real &e, Real &de_dp, Real &de_dT) const override
 
virtual Real e_from_p_rho (Real pressure, Real rho) const override
 
virtual ADReal e_from_p_rho (const ADReal &pressure, const ADReal &rho) const override
 
virtual void e_from_p_rho (Real pressure, Real rho, Real &e, Real &de_dp, Real &de_drho) const override
 
virtual Real T_from_p_rho (Real pressure, Real rho) const
 
virtual ADReal T_from_p_rho (const ADReal &pressure, const ADReal &rho) const
 
virtual void T_from_p_rho (Real pressure, Real rho, Real &T, Real &dT_dp, Real &dT_drho) const
 
virtual Real h_from_p_T (Real p, Real T) const override
 
virtual ADReal h_from_p_T (const ADReal &pressure, const ADReal &temperature) const override
 
virtual void h_from_p_T (Real pressure, Real temperature, Real &h, Real &dh_dp, Real &dh_dT) const override
 
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
 
virtual void cp_from_p_T (Real pressure, Real temperature, Real &cp, Real &dcp_dp, Real &dcp_dT) const override
 
virtual Real cv_from_p_T (Real pressure, Real temperature) const override
 
virtual void cv_from_p_T (Real pressure, Real temperature, Real &cv, Real &dcv_dp, Real &dcv_dT) const override
 
virtual Real c_from_p_T (Real pressure, Real temperature) const override
 
virtual void c_from_p_T (Real pressure, Real temperature, Real &c, Real &dc_dp, Real &dc_dT) const override
 
virtual Real k_from_p_T (Real pressure, Real temperature) const override
 
virtual void k_from_p_T (Real pressure, Real temperature, Real &k, Real &dk_dp, Real &dk_dT) const override
 
virtual Real s_from_p_T (Real pressure, Real temperature) const override
 
virtual void s_from_p_T (Real p, Real T, Real &s, Real &ds_dp, Real &ds_dT) const override
 
virtual std::vector< RealhenryCoefficients () const override
 The following routines are simply forwarded to the 'fp' companion FluidProperties as they are not included in the tabulations presently. More...
 
virtual Real vaporPressure (Real temperature) const override
 Vapor pressure. More...
 
virtual void vaporPressure (Real temperature, Real &psat, Real &dpsat_dT) const override
 
virtual Real vaporTemperature (Real pressure) const override
 Vapor temperature. More...
 
virtual void vaporTemperature (Real pressure, Real &Tsat, Real &dTsat_dp) const override
 
virtual Real T_from_p_h (Real pressure, Real enthalpy) const override
 
virtual ADReal T_from_p_h (const ADReal &pressure, const ADReal &enthalpy) const override
 
virtual Real triplePointPressure () const override
 Triple point pressure. More...
 
virtual Real triplePointTemperature () const override
 Triple point temperature. More...
 
virtual Real criticalPressure () const override
 Critical pressure. More...
 
virtual Real criticalTemperature () const override
 Critical temperature. More...
 
virtual Real criticalDensity () const override
 Critical density. More...
 
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 * dT/dx where y = c, cp, cv... More...
 
virtual void p_from_v_e (Real v, Real e, Real &p, Real &dp_dv, Real &dp_de) const override
 
virtual void p_from_v_e (const ADReal &v, const ADReal &e, ADReal &p, ADReal &dp_dv, ADReal &dp_de) const override
 
virtual Real T_from_v_e (Real v, Real e) const override
 
virtual void T_from_v_e (Real v, Real e, Real &T, Real &dT_dv, Real &dT_de) const override
 
virtual void T_from_v_e (const ADReal &v, const ADReal &e, ADReal &p, ADReal &dp_dv, ADReal &dp_de) const override
 
virtual Real c_from_v_e (Real v, Real e) const override
 
virtual void c_from_v_e (Real v, Real e, Real &c, Real &dc_dv, Real &dc_de) const override
 
virtual Real cp_from_v_e (Real v, Real e) const override
 
virtual void cp_from_v_e (Real v, Real e, Real &cp, Real &dcp_dv, Real &dcp_de) const override
 
virtual Real cv_from_v_e (Real v, Real e) const override
 
virtual void cv_from_v_e (Real v, Real e, Real &cv, Real &dcv_dv, Real &dcv_de) const override
 
virtual Real mu_from_v_e (Real v, Real e) const override
 
virtual void mu_from_v_e (Real v, Real e, Real &mu, Real &dmu_dv, Real &dmu_de) const override
 
virtual Real k_from_v_e (Real v, Real e) const override
 
virtual void k_from_v_e (Real v, Real e, Real &k, Real &dk_dv, Real &dk_de) const override
 
virtual Real g_from_v_e (Real v, Real e) const override
 
virtual Real e_from_v_h (Real v, Real h) const override
 
virtual void e_from_v_h (Real v, Real h, Real &e, Real &de_dv, Real &de_dh) const override
 
virtual Real T_from_h_s (Real h, Real s) const
 
virtual Real T_from_p_s (Real p, Real s) const
 
virtual void T_from_p_s (Real p, Real s, Real &T, Real &dT_dp, Real &dT_ds) const
 
virtual Real s_from_v_e (Real v, Real e) const override
 
virtual void s_from_v_e (Real v, Real e, Real &s, Real &ds_dv, Real &ds_de) const override
 
virtual Real s_from_h_p (Real h, Real pressure) const override
 
virtual void s_from_h_p (Real h, Real pressure, Real &s, Real &ds_dh, Real &ds_dp) const override
 
virtual Real criticalInternalEnergy () const
 Critical specific internal energy. 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 ADReal vaporPressure (const ADReal &T) const
 
virtual ADReal vaporTemperature (const ADReal &p) const
 
template<typename CppType >
void v_e_from_p_T (const CppType &p, const CppType &T, CppType &v, CppType &e) const
 
template<typename CppType >
void v_e_from_p_T (const CppType &p, const CppType &T, CppType &v, CppType &dv_dp, CppType &dv_dT, CppType &e, CppType &de_dp, CppType &de_dT) const
 
virtual void rho_mu_from_p_T (Real p, Real T, Real &rho, Real &mu) const
 Combined methods. More...
 
virtual void rho_mu_from_p_T (Real p, Real T, Real &rho, Real &drho_dp, Real &drho_dT, Real &mu, Real &dmu_dp, Real &dmu_dT) const
 
virtual void rho_mu_from_p_T (const ADReal &p, const ADReal &T, ADReal &rho, ADReal &mu) const
 
virtual void rho_e_from_p_T (Real p, Real T, Real &rho, Real &drho_dp, Real &drho_dT, Real &e, Real &de_dp, Real &de_dT) const
 
template<typename CppType >
void p_T_from_v_e (const CppType &v, const CppType &e, Real p0, Real T0, CppType &p, CppType &T, bool &conversion_succeeded) const
 Determines (p,T) from (v,e) using Newton Solve in 2D Useful for conversion between different sets of state variables. More...
 
template<typename T >
void p_T_from_v_h (const T &v, const T &h, Real p0, Real T0, T &pressure, T &temperature, bool &conversion_succeeded) const
 Determines (p,T) from (v,h) using Newton Solve in 2D Useful for conversion between different sets of state variables. More...
 
template<typename T >
void p_T_from_h_s (const T &h, const T &s, Real p0, Real T0, T &pressure, T &temperature, bool &conversion_succeeded) const
 Determines (p,T) from (h,s) using Newton Solve in 2D Useful for conversion between different sets of state variables. More...
 
template<>
std::pair< Real, RealmakeZeroAndOne (const Real &)
 
virtual void execute () final
 
virtual void initialize () final
 
virtual void finalize () final
 
virtual void threadJoin (const UserObject &) final
 
virtual void subdomainSetup () final
 
bool needThreadedCopy () const override final
 
virtual Real spatialValue (const Point &) const
 
virtual const std::vector< Point > spatialPoints () const
 
void setPrimaryThreadCopy (UserObject *primary)
 
UserObjectprimaryThreadCopy ()
 
SubProblemgetSubProblem () const
 
bool shouldDuplicateInitialExecution () const
 
void gatherSum (T &value)
 
void gatherMax (T &value)
 
void gatherMin (T &value)
 
void gatherProxyValueMax (T1 &proxy, T2 &value)
 
void gatherProxyValueMin (T1 &proxy, T2 &value)
 
std::set< UserObjectName > getDependObjects () const
 
const std::set< std::string > & getRequestedItems () override
 
const std::set< std::string > & getSuppliedItems () override
 
unsigned int systemNumber () const
 
virtual bool enabled () const
 
std::shared_ptr< MooseObjectgetSharedPtr ()
 
std::shared_ptr< const MooseObjectgetSharedPtr () const
 
bool isKokkosObject () const
 
MooseAppgetMooseApp () const
 
const std::string & type () const
 
const std::string & name () const
 
std::string typeAndName () const
 
MooseObjectParameterName uniqueParameterName (const std::string &parameter_name) const
 
MooseObjectName uniqueName () const
 
const InputParametersparameters () const
 
const hit::Node * getHitNode () const
 
bool hasBase () const
 
const std::string & getBase () const
 
const TgetParam (const std::string &name) const
 
std::vector< std::pair< T1, T2 > > getParam (const std::string &param1, const std::string &param2) const
 
const TqueryParam (const std::string &name) const
 
const TgetRenamedParam (const std::string &old_name, const std::string &new_name) const
 
T getCheckedPointerParam (const std::string &name, const std::string &error_string="") const
 
bool haveParameter (const std::string &name) const
 
bool isParamValid (const std::string &name) const
 
bool isParamSetByUser (const std::string &name) const
 
void connectControllableParams (const std::string &parameter, const std::string &object_type, const std::string &object_name, const std::string &object_parameter) const
 
void paramError (const std::string &param, Args... args) const
 
void paramWarning (const std::string &param, Args... args) const
 
void paramWarning (const std::string &param, Args... args) const
 
void paramInfo (const std::string &param, Args... args) const
 
std::string messagePrefix (const bool hit_prefix=true) const
 
std::string errorPrefix (const std::string &) const
 
void mooseError (Args &&... args) const
 
void mooseDocumentedError (const std::string &repo_name, const unsigned int issue_num, Args &&... args) const
 
void mooseErrorNonPrefixed (Args &&... args) const
 
void mooseWarning (Args &&... args) const
 
void mooseWarning (Args &&... args) const
 
void mooseWarningNonPrefixed (Args &&... args) const
 
void mooseWarningNonPrefixed (Args &&... args) const
 
void mooseDeprecated (Args &&... args) const
 
void mooseDeprecated (Args &&... args) const
 
void mooseDeprecatedNoTrace (Args &&... args) const
 
void mooseInfo (Args &&... args) const
 
void callMooseError (std::string msg, const bool with_prefix, const hit::Node *node=nullptr, const bool show_trace=true) const
 
std::string getDataFileName (const std::string &param) const
 
std::string getDataFileNameByName (const std::string &relative_path) const
 
std::string getDataFilePath (const std::string &relative_path) const
 
virtual void timestepSetup ()
 
virtual void jacobianSetup ()
 
virtual void residualSetup ()
 
virtual void customSetup (const ExecFlagType &)
 
const ExecFlagEnumgetExecuteOnEnum () const
 
UserObjectName getUserObjectName (const std::string &param_name) const
 
const TgetUserObject (const std::string &param_name, bool is_dependency=true) const
 
const TgetUserObjectByName (const UserObjectName &object_name, bool is_dependency=true) const
 
const UserObjectBasegetUserObjectBase (const std::string &param_name, bool is_dependency=true) const
 
const UserObjectBasegetUserObjectBaseByName (const UserObjectName &object_name, bool is_dependency=true) const
 
const std::vector< MooseVariableScalar *> & getCoupledMooseScalarVars ()
 
const std::set< TagID > & getScalarVariableCoupleableVectorTags () const
 
const std::set< TagID > & getScalarVariableCoupleableMatrixTags () const
 
const GenericMaterialProperty< T, is_ad > & getGenericMaterialProperty (const std::string &name, MaterialData &material_data, const unsigned int state=0)
 
const GenericMaterialProperty< T, is_ad > & getGenericMaterialProperty (const std::string &name, const unsigned int state=0)
 
const GenericMaterialProperty< T, is_ad > & getGenericMaterialProperty (const std::string &name, const unsigned int state=0)
 
const MaterialProperty< T > & getMaterialProperty (const std::string &name, MaterialData &material_data, const unsigned int state=0)
 
const MaterialProperty< T > & getMaterialProperty (const std::string &name, const unsigned int state=0)
 
const MaterialProperty< T > & getMaterialProperty (const std::string &name, const unsigned int state=0)
 
const ADMaterialProperty< T > & getADMaterialProperty (const std::string &name, MaterialData &material_data)
 
const ADMaterialProperty< T > & getADMaterialProperty (const std::string &name)
 
const ADMaterialProperty< T > & getADMaterialProperty (const std::string &name)
 
const MaterialProperty< T > & getMaterialPropertyOld (const std::string &name, MaterialData &material_data)
 
const MaterialProperty< T > & getMaterialPropertyOld (const std::string &name)
 
const MaterialProperty< T > & getMaterialPropertyOld (const std::string &name)
 
const MaterialProperty< T > & getMaterialPropertyOlder (const std::string &name, MaterialData &material_data)
 
const MaterialProperty< T > & getMaterialPropertyOlder (const std::string &name)
 
const MaterialProperty< T > & getMaterialPropertyOlder (const std::string &name)
 
const GenericMaterialProperty< T, is_ad > & getGenericMaterialPropertyByName (const MaterialPropertyName &name, MaterialData &material_data, const unsigned int state)
 
const GenericMaterialProperty< T, is_ad > & getGenericMaterialPropertyByName (const MaterialPropertyName &name, const unsigned int state=0)
 
const GenericMaterialProperty< T, is_ad > & getGenericMaterialPropertyByName (const MaterialPropertyName &name, const unsigned int state=0)
 
const MaterialProperty< T > & getMaterialPropertyByName (const MaterialPropertyName &name, MaterialData &material_data, const unsigned int state=0)
 
const MaterialProperty< T > & getMaterialPropertyByName (const MaterialPropertyName &name, const unsigned int state=0)
 
const MaterialProperty< T > & getMaterialPropertyByName (const MaterialPropertyName &name, const unsigned int state=0)
 
const ADMaterialProperty< T > & getADMaterialPropertyByName (const MaterialPropertyName &name, MaterialData &material_data)
 
const ADMaterialProperty< T > & getADMaterialPropertyByName (const MaterialPropertyName &name)
 
const ADMaterialProperty< T > & getADMaterialPropertyByName (const MaterialPropertyName &name)
 
const MaterialProperty< T > & getMaterialPropertyOldByName (const MaterialPropertyName &name, MaterialData &material_data)
 
const MaterialProperty< T > & getMaterialPropertyOldByName (const MaterialPropertyName &name)
 
const MaterialProperty< T > & getMaterialPropertyOldByName (const MaterialPropertyName &name)
 
const MaterialProperty< T > & getMaterialPropertyOlderByName (const MaterialPropertyName &name, MaterialData &material_data)
 
const MaterialProperty< T > & getMaterialPropertyOlderByName (const MaterialPropertyName &name)
 
const MaterialProperty< T > & getMaterialPropertyOlderByName (const MaterialPropertyName &name)
 
Moose::Kokkos::MaterialProperty< T, dimension > getKokkosMaterialPropertyByName (const std::string &prop_name_in)
 
Moose::Kokkos::MaterialProperty< T, dimension > getKokkosMaterialPropertyOldByName (const std::string &prop_name)
 
Moose::Kokkos::MaterialProperty< T, dimension > getKokkosMaterialPropertyOlderByName (const std::string &prop_name)
 
Moose::Kokkos::MaterialProperty< T, dimension > getKokkosMaterialProperty (const std::string &name)
 
Moose::Kokkos::MaterialProperty< T, dimension > getKokkosMaterialPropertyOld (const std::string &name)
 
Moose::Kokkos::MaterialProperty< T, dimension > getKokkosMaterialPropertyOlder (const std::string &name)
 
std::pair< const MaterialProperty< T > *, std::set< SubdomainID > > getBlockMaterialProperty (const MaterialPropertyName &name)
 
std::pair< Moose::Kokkos::MaterialProperty< T, dimension >, std::set< SubdomainID > > getKokkosBlockMaterialProperty (const MaterialPropertyName &name)
 
const GenericMaterialProperty< T, is_ad > & getGenericZeroMaterialProperty (const std::string &name)
 
const GenericMaterialProperty< T, is_ad > & getGenericZeroMaterialProperty ()
 
const GenericMaterialProperty< T, is_ad > & getGenericZeroMaterialPropertyByName (const std::string &prop_name)
 
const MaterialProperty< T > & getZeroMaterialProperty (Ts... args)
 
std::set< SubdomainIDgetMaterialPropertyBlocks (const std::string &name)
 
std::vector< SubdomainName > getMaterialPropertyBlockNames (const std::string &name)
 
std::set< BoundaryIDgetMaterialPropertyBoundaryIDs (const std::string &name)
 
std::vector< BoundaryName > getMaterialPropertyBoundaryNames (const std::string &name)
 
void checkBlockAndBoundaryCompatibility (std::shared_ptr< MaterialBase > discrete)
 
std::unordered_map< SubdomainID, std::vector< MaterialBase *> > buildRequiredMaterials (bool allow_stateful=true)
 
void statefulPropertiesAllowed (bool)
 
virtual bool getMaterialPropertyCalled () const
 
virtual const std::unordered_set< unsigned int > & getMatPropDependencies () const
 
virtual void resolveOptionalProperties ()
 
const GenericMaterialProperty< T, is_ad > & getPossiblyConstantGenericMaterialPropertyByName (const MaterialPropertyName &prop_name, MaterialData &material_data, const unsigned int state)
 
bool isImplicit ()
 
Moose::StateArg determineState () const
 
bool hasUserObject (const std::string &param_name) const
 
bool hasUserObject (const std::string &param_name) const
 
bool hasUserObject (const std::string &param_name) const
 
bool hasUserObject (const std::string &param_name) const
 
bool hasUserObjectByName (const UserObjectName &object_name) const
 
bool hasUserObjectByName (const UserObjectName &object_name) const
 
bool hasUserObjectByName (const UserObjectName &object_name) const
 
bool hasUserObjectByName (const UserObjectName &object_name) const
 
const GenericOptionalMaterialProperty< T, is_ad > & getGenericOptionalMaterialProperty (const std::string &name, const unsigned int state=0)
 
const GenericOptionalMaterialProperty< T, is_ad > & getGenericOptionalMaterialProperty (const std::string &name, const unsigned int state=0)
 
const OptionalMaterialProperty< T > & getOptionalMaterialProperty (const std::string &name, const unsigned int state=0)
 
const OptionalMaterialProperty< T > & getOptionalMaterialProperty (const std::string &name, const unsigned int state=0)
 
const OptionalADMaterialProperty< T > & getOptionalADMaterialProperty (const std::string &name)
 
const OptionalADMaterialProperty< T > & getOptionalADMaterialProperty (const std::string &name)
 
const OptionalMaterialProperty< T > & getOptionalMaterialPropertyOld (const std::string &name)
 
const OptionalMaterialProperty< T > & getOptionalMaterialPropertyOld (const std::string &name)
 
const OptionalMaterialProperty< T > & getOptionalMaterialPropertyOlder (const std::string &name)
 
const OptionalMaterialProperty< T > & getOptionalMaterialPropertyOlder (const std::string &name)
 
MaterialBasegetMaterial (const std::string &name)
 
MaterialBasegetMaterial (const std::string &name)
 
MaterialBasegetMaterialByName (const std::string &name, bool no_warn=false)
 
MaterialBasegetMaterialByName (const std::string &name, bool no_warn=false)
 
bool hasMaterialProperty (const std::string &name)
 
bool hasMaterialProperty (const std::string &name)
 
bool hasMaterialPropertyByName (const std::string &name)
 
bool hasMaterialPropertyByName (const std::string &name)
 
bool hasADMaterialProperty (const std::string &name)
 
bool hasADMaterialProperty (const std::string &name)
 
bool hasADMaterialPropertyByName (const std::string &name)
 
bool hasADMaterialPropertyByName (const std::string &name)
 
bool hasKokkosMaterialProperty (const std::string &name)
 
bool hasKokkosMaterialProperty (const std::string &name)
 
bool hasKokkosMaterialPropertyByName (const std::string &name)
 
bool hasKokkosMaterialPropertyByName (const std::string &name)
 
bool hasGenericMaterialProperty (const std::string &name)
 
bool hasGenericMaterialProperty (const std::string &name)
 
bool hasGenericMaterialPropertyByName (const std::string &name)
 
bool hasGenericMaterialPropertyByName (const std::string &name)
 
const FunctiongetFunction (const std::string &name) const
 
const FunctiongetFunctionByName (const FunctionName &name) const
 
bool hasFunction (const std::string &param_name) const
 
bool hasFunctionByName (const FunctionName &name) const
 
Moose::Kokkos::Function getKokkosFunction (const std::string &name) const
 
const TgetKokkosFunction (const std::string &name) const
 
Moose::Kokkos::Function getKokkosFunctionByName (const FunctionName &name) const
 
const TgetKokkosFunctionByName (const FunctionName &name) const
 
bool hasKokkosFunction (const std::string &param_name) const
 
bool hasKokkosFunctionByName (const FunctionName &name) const
 
bool isDefaultPostprocessorValue (const std::string &param_name, const unsigned int index=0) const
 
bool hasPostprocessor (const std::string &param_name, const unsigned int index=0) const
 
bool hasPostprocessorByName (const PostprocessorName &name) const
 
std::size_t coupledPostprocessors (const std::string &param_name) const
 
const PostprocessorName & getPostprocessorName (const std::string &param_name, const unsigned int index=0) const
 
const VectorPostprocessorValuegetVectorPostprocessorValue (const std::string &param_name, const std::string &vector_name) const
 
const VectorPostprocessorValuegetVectorPostprocessorValue (const std::string &param_name, const std::string &vector_name, bool needs_broadcast) const
 
const VectorPostprocessorValuegetVectorPostprocessorValueByName (const VectorPostprocessorName &name, const std::string &vector_name) const
 
const VectorPostprocessorValuegetVectorPostprocessorValueByName (const VectorPostprocessorName &name, const std::string &vector_name, bool needs_broadcast) const
 
const VectorPostprocessorValuegetVectorPostprocessorValueOld (const std::string &param_name, const std::string &vector_name) const
 
const VectorPostprocessorValuegetVectorPostprocessorValueOld (const std::string &param_name, const std::string &vector_name, bool needs_broadcast) const
 
const VectorPostprocessorValuegetVectorPostprocessorValueOldByName (const VectorPostprocessorName &name, const std::string &vector_name) const
 
const VectorPostprocessorValuegetVectorPostprocessorValueOldByName (const VectorPostprocessorName &name, const std::string &vector_name, bool needs_broadcast) const
 
const ScatterVectorPostprocessorValuegetScatterVectorPostprocessorValue (const std::string &param_name, const std::string &vector_name) const
 
const ScatterVectorPostprocessorValuegetScatterVectorPostprocessorValueByName (const VectorPostprocessorName &name, const std::string &vector_name) const
 
const ScatterVectorPostprocessorValuegetScatterVectorPostprocessorValueOld (const std::string &param_name, const std::string &vector_name) const
 
const ScatterVectorPostprocessorValuegetScatterVectorPostprocessorValueOldByName (const VectorPostprocessorName &name, const std::string &vector_name) const
 
bool hasVectorPostprocessor (const std::string &param_name, const std::string &vector_name) const
 
bool hasVectorPostprocessor (const std::string &param_name) const
 
bool hasVectorPostprocessorByName (const VectorPostprocessorName &name, const std::string &vector_name) const
 
bool hasVectorPostprocessorByName (const VectorPostprocessorName &name) const
 
const VectorPostprocessorName & getVectorPostprocessorName (const std::string &param_name) const
 
TgetSampler (const std::string &name)
 
SamplergetSampler (const std::string &name)
 
TgetSamplerByName (const SamplerName &name)
 
SamplergetSamplerByName (const SamplerName &name)
 
virtual void meshChanged ()
 
virtual void meshDisplaced ()
 
PerfGraphperfGraph ()
 
const PostprocessorValuegetPostprocessorValue (const std::string &param_name, const unsigned int index=0) const
 
const PostprocessorValuegetPostprocessorValue (const std::string &param_name, const unsigned int index=0) const
 
const PostprocessorValuegetPostprocessorValueOld (const std::string &param_name, const unsigned int index=0) const
 
const PostprocessorValuegetPostprocessorValueOld (const std::string &param_name, const unsigned int index=0) const
 
const PostprocessorValuegetPostprocessorValueOlder (const std::string &param_name, const unsigned int index=0) const
 
const PostprocessorValuegetPostprocessorValueOlder (const std::string &param_name, const unsigned int index=0) const
 
virtual const PostprocessorValuegetPostprocessorValueByName (const PostprocessorName &name) const
 
virtual const PostprocessorValuegetPostprocessorValueByName (const PostprocessorName &name) const
 
const PostprocessorValuegetPostprocessorValueOldByName (const PostprocessorName &name) const
 
const PostprocessorValuegetPostprocessorValueOldByName (const PostprocessorName &name) const
 
const PostprocessorValuegetPostprocessorValueOlderByName (const PostprocessorName &name) const
 
const PostprocessorValuegetPostprocessorValueOlderByName (const PostprocessorName &name) const
 
bool isVectorPostprocessorDistributed (const std::string &param_name) const
 
bool isVectorPostprocessorDistributed (const std::string &param_name) const
 
bool isVectorPostprocessorDistributedByName (const VectorPostprocessorName &name) const
 
bool isVectorPostprocessorDistributedByName (const VectorPostprocessorName &name) const
 
const DistributiongetDistribution (const std::string &name) const
 
const TgetDistribution (const std::string &name) const
 
const DistributiongetDistribution (const std::string &name) const
 
const TgetDistribution (const std::string &name) const
 
const DistributiongetDistributionByName (const DistributionName &name) const
 
const TgetDistributionByName (const std::string &name) const
 
const DistributiongetDistributionByName (const DistributionName &name) const
 
const TgetDistributionByName (const std::string &name) const
 
const Parallel::Communicator & comm () const
 
processor_id_type n_processors () const
 
processor_id_type processor_id () const
 

Static Public Member Functions

static InputParameters validParams ()
 
static void callMooseError (MooseApp *const app, const InputParameters &params, std::string msg, const bool with_prefix, const hit::Node *node, const bool show_trace=true)
 
static void sort (typename std::vector< T > &vector)
 
static void sortDFS (typename std::vector< T > &vector)
 
static void cyclicDependencyError (CyclicDependencyException< T2 > &e, const std::string &header, NameFunc &&name_func)
 
static void cyclicDependencyError (CyclicDependencyException< T2 > &e, const std::string &header)
 

Public Attributes

 usingCombinedWarningSolutionWarnings
 
const ConsoleStream _console
 

Static Public Attributes

static const Real _R = 8.3144598
 Universal gas constant (J/mol/K) More...
 
static const std::string type_param
 
static const std::string name_param
 
static const std::string unique_name_param
 
static const std::string app_param
 
static const std::string moose_base_param
 
static const std::string kokkos_object_param
 
static constexpr PropertyValue::id_type default_property_id
 
static constexpr PropertyValue::id_type zero_property_id
 
static constexpr auto SYSTEM
 
static constexpr auto NAME
 

Protected Types

enum  OOBBehavior {
  Ignore, Throw, DeclareInvalid, WarnInvalid,
  SetToClosestBound
}
 Enum specifying all the behavior on out of bounds data options. More...
 

Protected Member Functions

void writeTabulatedData (std::string file_name)
 Writes tabulated data to a file. More...
 
template<typename T >
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 not. More...
 
template<typename T >
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 not. More...
 
virtual void checkInitialGuess (bool post_reading_tabulation) const
 Checks initial guess for Newton Method. More...
 
void readFileTabulationData (bool use_pT)
 Read tabulation data from file. More...
 
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) 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...
 
virtual void generateVETabulatedData ()
 Generates a table of fluid properties by looping over specific volume and internal energy and calculating properties using the FluidProperties UserObject _fp. More...
 
void computePropertyIndicesInInterpolationVectors ()
 Retrieves the index for each property in the vector of interpolations. More...
 
void createVGridVector ()
 Create (or reset) the grid vectors for the specific volume and internal energy interpolations The order of priority for determining the range boundaries in v and e: More...
 
void createVEGridVectors ()
 
void createVHGridVectors ()
 Create (or reset) the grid vectors for the specific volume and enthalpy interpolation The order of priority for determining the range boundaries in v and h: More...
 
void missingVEInterpolationError (const std::string &function_name) const
 Standardized error message for missing interpolation. More...
 
void TabulationNotImplementedError (const std::string &desired_routine) const
 Utility to forward errors related to fluid properties methods not implemented. More...
 
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 should generally be used as an 'else' condition to if (_interpolate_property) / else if (_fp) More...
 
void NeedTabulationError (const std::string &needed_property) const
 Utility to forward errors related to properties being requested for tabulation, but no tabulation is present This should generally be used as an 'else' condition to if (_interpolate_needed_property) More...
 
virtual void addPostprocessorDependencyHelper (const PostprocessorName &name) const override
 
virtual void addVectorPostprocessorDependencyHelper (const VectorPostprocessorName &name) const override
 
virtual void addUserObjectDependencyHelper (const UserObjectBase &uo) const override
 
void addReporterDependencyHelper (const ReporterName &reporter_name) override
 
void flagInvalidSolutionInternal (const InvalidSolutionID invalid_solution_id) const
 
InvalidSolutionID registerInvalidSolutionInternal (const std::string &message, const bool warning) const
 
const ReporterContextBasegetReporterContextBaseByName (const ReporterName &reporter_name) const
 
const ReporterNamegetReporterName (const std::string &param_name) const
 
TdeclareRestartableData (const std::string &data_name, Args &&... args)
 
ManagedValue< TdeclareManagedRestartableDataWithContext (const std::string &data_name, void *context, Args &&... args)
 
const TgetRestartableData (const std::string &data_name) const
 
TdeclareRestartableDataWithContext (const std::string &data_name, void *context, Args &&... args)
 
TdeclareRecoverableData (const std::string &data_name, Args &&... args)
 
TdeclareRestartableDataWithObjectName (const std::string &data_name, const std::string &object_name, Args &&... args)
 
TdeclareRestartableDataWithObjectNameWithContext (const std::string &data_name, const std::string &object_name, void *context, Args &&... args)
 
std::string restartableName (const std::string &data_name) const
 
const TgetMeshProperty (const std::string &data_name, const std::string &prefix)
 
const TgetMeshProperty (const std::string &data_name)
 
bool hasMeshProperty (const std::string &data_name, const std::string &prefix) const
 
bool hasMeshProperty (const std::string &data_name, const std::string &prefix) const
 
bool hasMeshProperty (const std::string &data_name) const
 
bool hasMeshProperty (const std::string &data_name) const
 
std::string meshPropertyName (const std::string &data_name) const
 
PerfID registerTimedSection (const std::string &section_name, const unsigned int level) const
 
PerfID registerTimedSection (const std::string &section_name, const unsigned int level, const std::string &live_message, const bool print_dots=true) const
 
std::string timedSectionName (const std::string &section_name) const
 
bool isCoupledScalar (const std::string &var_name, unsigned int i=0) const
 
unsigned int coupledScalarComponents (const std::string &var_name) const
 
unsigned int coupledScalar (const std::string &var_name, unsigned int comp=0) const
 
libMesh::Order coupledScalarOrder (const std::string &var_name, unsigned int comp=0) const
 
const VariableValuecoupledScalarValue (const std::string &var_name, unsigned int comp=0) const
 
const ADVariableValueadCoupledScalarValue (const std::string &var_name, unsigned int comp=0) const
 
const GenericVariableValue< is_ad > & coupledGenericScalarValue (const std::string &var_name, unsigned int comp=0) const
 
const GenericVariableValue< false > & coupledGenericScalarValue (const std::string &var_name, const unsigned int comp) const
 
const GenericVariableValue< true > & coupledGenericScalarValue (const std::string &var_name, const unsigned int comp) const
 
const VariableValuecoupledVectorTagScalarValue (const std::string &var_name, TagID tag, unsigned int comp=0) const
 
const VariableValuecoupledMatrixTagScalarValue (const std::string &var_name, TagID tag, unsigned int comp=0) const
 
const VariableValuecoupledScalarValueOld (const std::string &var_name, unsigned int comp=0) const
 
const VariableValuecoupledScalarValueOlder (const std::string &var_name, unsigned int comp=0) const
 
const VariableValuecoupledScalarDot (const std::string &var_name, unsigned int comp=0) const
 
const ADVariableValueadCoupledScalarDot (const std::string &var_name, unsigned int comp=0) const
 
const VariableValuecoupledScalarDotDot (const std::string &var_name, unsigned int comp=0) const
 
const VariableValuecoupledScalarDotOld (const std::string &var_name, unsigned int comp=0) const
 
const VariableValuecoupledScalarDotDotOld (const std::string &var_name, unsigned int comp=0) const
 
const VariableValuecoupledScalarDotDu (const std::string &var_name, unsigned int comp=0) const
 
const VariableValuecoupledScalarDotDotDu (const std::string &var_name, unsigned int comp=0) const
 
const MooseVariableScalargetScalarVar (const std::string &var_name, unsigned int comp) const
 
virtual void checkMaterialProperty (const std::string &name, const unsigned int state)
 
virtual void getKokkosMaterialPropertyHook (const std::string &, const unsigned int)
 
void markMatPropRequested (const std::string &)
 
MaterialPropertyName getMaterialPropertyName (const std::string &name) const
 
void checkExecutionStage ()
 
const TgetReporterValue (const std::string &param_name, const std::size_t time_index=0)
 
const TgetReporterValue (const std::string &param_name, ReporterMode mode, const std::size_t time_index=0)
 
const TgetReporterValue (const std::string &param_name, const std::size_t time_index=0)
 
const TgetReporterValue (const std::string &param_name, ReporterMode mode, const std::size_t time_index=0)
 
const TgetReporterValueByName (const ReporterName &reporter_name, const std::size_t time_index=0)
 
const TgetReporterValueByName (const ReporterName &reporter_name, ReporterMode mode, const std::size_t time_index=0)
 
const TgetReporterValueByName (const ReporterName &reporter_name, const std::size_t time_index=0)
 
const TgetReporterValueByName (const ReporterName &reporter_name, ReporterMode mode, const std::size_t time_index=0)
 
bool hasReporterValue (const std::string &param_name) const
 
bool hasReporterValue (const std::string &param_name) const
 
bool hasReporterValue (const std::string &param_name) const
 
bool hasReporterValue (const std::string &param_name) const
 
bool hasReporterValueByName (const ReporterName &reporter_name) const
 
bool hasReporterValueByName (const ReporterName &reporter_name) const
 
bool hasReporterValueByName (const ReporterName &reporter_name) const
 
bool hasReporterValueByName (const ReporterName &reporter_name) const
 
const GenericMaterialProperty< T, is_ad > * defaultGenericMaterialProperty (const std::string &name)
 
const GenericMaterialProperty< T, is_ad > * defaultGenericMaterialProperty (const std::string &name)
 
const MaterialProperty< T > * defaultMaterialProperty (const std::string &name)
 
const MaterialProperty< T > * defaultMaterialProperty (const std::string &name)
 
const ADMaterialProperty< T > * defaultADMaterialProperty (const std::string &name)
 
const ADMaterialProperty< T > * defaultADMaterialProperty (const std::string &name)
 

Static Protected Member Functions

template<typename T , typename Functor >
static void xyDerivatives (const T x, const T &y, T &z, T &dz_dx, T &dz_dy, const Functor &z_from_x_y)
 Computes the dependent variable z and its derivatives with respect to the independent variables x and y using the simple two parameter z_from_x_y functor. More...
 
template<typename T >
static std::pair< T, TmakeZeroAndOne (const T &)
 Given a type example, this method returns zero and unity representations of that type (first and second members of returned pair respectively) More...
 
static std::string meshPropertyName (const std::string &data_name, const std::string &prefix)
 

Protected Attributes

FileName _file_name_in
 File name of input tabulated data file. More...
 
FileName _file_name_ve_in
 File name of input (v,e) tabulated data file. More...
 
FileName _file_name_out
 File name of output tabulated data file. More...
 
FileName _file_name_ve_out
 File name of output (v,e) tabulated data file. More...
 
const bool _save_file
 Whether to save a generated fluid properties file to disk. More...
 
std::vector< Real_pressure
 Pressure vector. More...
 
std::vector< Real_temperature
 Temperature vector. More...
 
std::vector< Real_specific_volume
 Specific volume vector. More...
 
std::vector< Real_internal_energy
 Specific internal energy vector. More...
 
std::vector< Real_enthalpy
 Specific enthalpy vector. More...
 
const bool _create_direct_pT_interpolations
 Whether the object has direct (p,T) interpolations (whether created from file or from _fp) More...
 
const bool _create_direct_ve_interpolations
 Whether the object has direct (v,e) interpolations (whether created from file or from _fp) More...
 
std::vector< std::vector< Real > > _properties
 Tabulated fluid properties (read from file OR computed from _fp) More...
 
std::vector< std::vector< Real > > _properties_ve
 Tabulated fluid properties in (v,e) (read from file OR computed from _fp) More...
 
std::vector< std::unique_ptr< BidimensionalInterpolation > > _property_ipol
 Vector of bi-dimensional interpolation of fluid properties. More...
 
std::vector< std::unique_ptr< BidimensionalInterpolation > > _property_ve_ipol
 Vector of bi-dimensional interpolation of fluid properties directly in (v,e) 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 SinglePhaseFluidProperties *const _fp
 SinglePhaseFluidPropertiesPT UserObject. More...
 
const bool _allow_fp_and_tabulation
 Whether to allow a fp object when a tabulation is in use. 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_c
 
bool _interpolate_cp
 
bool _interpolate_cv
 
bool _interpolate_entropy
 
bool _interpolate_pressure
 
bool _interpolate_temperature
 
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 _c_idx
 
unsigned int _cp_idx
 
unsigned int _cv_idx
 
unsigned int _entropy_idx
 
unsigned int _p_idx
 
unsigned int _T_idx
 
MooseUtils::DelimitedFileReader _csv_reader
 The MOOSE delimited file reader. More...
 
bool _construct_pT_from_ve
 if the lookup table p(v, e) and T(v, e) should be constructed More...
 
bool _construct_pT_from_vh
 if the lookup table p(v, h) and T(v, h) should be constructed More...
 
bool _initial_setup_done
 keeps track of whether initialSetup has been performed More...
 
unsigned int _num_v
 Number of specific volume points in the tabulated data. More...
 
unsigned int _num_e
 Number of internal energy points in tabulated data. More...
 
bool _log_space_v
 log-space the specific volume interpolation grid axis instead of linear More...
 
bool _log_space_e
 log-space the internal energy interpolation grid axis instead of linear More...
 
bool _log_space_h
 log-space the enthalpy interpolation grid axis instead of linear More...
 
MooseEnum _OOBBehavior
 User-selected out-of-bounds behavior. More...
 
std::unique_ptr< BidimensionalInterpolation_T_from_v_e_ipol
 Bi-dimensional interpolation of temperature from (v,e) More...
 
std::unique_ptr< BidimensionalInterpolation_p_from_v_e_ipol
 Bi-dimensional interpolation of pressure from (v,e) More...
 
std::unique_ptr< BidimensionalInterpolation_T_from_v_h_ipol
 Bi-dimensional interpolation of temperature from (v,h) More...
 
std::unique_ptr< BidimensionalInterpolation_p_from_v_h_ipol
 Bidimensional interpolation of pressure from (v,h) More...
 
bool _e_bounds_specified
 Whether the specific internal energy bounds were set by the user. More...
 
bool _v_bounds_specified
 Whether the specific volume bounds were set by the user. More...
 
Real _e_min
 Minimum internal energy in tabulated data (can be user-specified) More...
 
Real _e_max
 Maximum internal energy in tabulated data (can be user-specified) More...
 
Real _v_min
 Minimum specific volume in tabulated data (can be user-specified) More...
 
Real _v_max
 Maximum specific volume in tabulated data (can be user-specified) More...
 
Real _h_min
 Minimum specific enthalpy in tabulated data. More...
 
Real _h_max
 Maximum specific enthalpy in tabulated data. More...
 
const Real _tolerance
 Newton's method may be used to convert between variable sets. More...
 
const Real _T_initial_guess
 Initial guess for temperature (or temperature used to compute the initial guess) More...
 
const Real _p_initial_guess
 Initial guess for pressure (or pressure used to compute the initial guess) More...
 
const unsigned int _max_newton_its
 Maximum number of iterations for the variable conversion newton solves. More...
 
const bool _verbose_newton
 Whether to output information about newton solves to console. More...
 
const Real _T_c2k
 Conversion of temperature from Celsius to Kelvin. More...
 
const bool _allow_imperfect_jacobians
 Flag to set unimplemented Jacobian entries to zero. More...
 
const Moose::CoordinateSystemType_coord_sys
 
const THREAD_ID _tid
 
SubProblem_subproblem
 
FEProblemBase_fe_problem
 
SystemBase_sys
 
Assembly_assembly
 
const bool _duplicate_initial_execution
 
std::set< std::string > _depend_uo
 
const bool & _enabled
 
MooseApp_app
 
Factory_factory
 
ActionFactory_action_factory
 
const std::string & _type
 
const std::string & _name
 
const InputParameters_pars
 
const ExecFlagEnum_execute_enum
 
const ExecFlagType_current_execute_flag
 
MooseApp_restartable_app
 
const std::string _restartable_system_name
 
const THREAD_ID _restartable_tid
 
const bool _restartable_read_only
 
FEProblemBase_mci_feproblem
 
FEProblemBase_mdi_feproblem
 
MooseApp_pg_moose_app
 
const std::string _prefix
 
FEProblemBase_sc_fe_problem
 
const THREAD_ID _sc_tid
 
const Real_real_zero
 
const VariableValue_scalar_zero
 
const Point & _point_zero
 
const InputParameters_mi_params
 
const std::string _mi_name
 
const MooseObjectName _mi_moose_object_name
 
FEProblemBase_mi_feproblem
 
SubProblem_mi_subproblem
 
const THREAD_ID _mi_tid
 
const bool _is_kokkos_object
 
const Moose::MaterialDataType _material_data_type
 
MaterialData_material_data
 
bool _stateful_allowed
 
bool _get_material_property_called
 
std::vector< std::unique_ptr< PropertyValue > > _default_properties
 
std::unordered_set< unsigned int_material_property_dependencies
 
const MaterialPropertyName _get_suffix
 
const bool _use_interpolated_state
 
const InputParameters_ti_params
 
FEProblemBase_ti_feproblem
 
bool _is_implicit
 
Real_t
 
const Real_t_old
 
int_t_step
 
Real_dt
 
Real_dt_old
 
bool _is_transient
 
const Parallel::Communicator & _communicator
 

Static Protected Attributes

static const std::string _interpolated_old
 
static const std::string _interpolated_older
 
 propfunc (p, v, e) propfunc(T
 Compute a fluid property given for the state defined by two given properties. More...
 
propfunc (c, v, e) propfunc(cp
 
e e propfunc (cv, v, e) propfunc(mu
 
e e e propfunc (k, v, e) propfuncWithDefault(s
 
e e e e propfunc (s, h, p) propfunc(rho
 
e e e e s propfunc (e, v, h) propfuncWithDefault(s
 
e e e e s T propfunc (pp_sat, p, T) propfunc(mu
 
e e e e s T T propfunc (k, rho, T) propfuncWithDefault(c
 
e e e e s T T T T T propfunc (rho, p, T) propfunc(e
 
e e e e s T T T T T rho propfunc (e, T, v) propfunc(p
 
e e e e s T T T T T rho v propfunc (h, T, v) propfunc(s
 
e e e e s T T T T T rho v v propfunc (cv, T, v) propfunc(h
 
e e e e s T T T propfuncWithDefault (cp, p, T) propfuncWithDefault(cv
 
e e e e s T T T T propfuncWithDefault (mu, p, T) propfuncWithDefault(k
 
e e e e s T T T T T rho v v T propfuncWithDefault (h, v, e) propfunc(g
 
e e e e s T T T T T rho v v TpropfuncWithDefault (p, h, s) propfunc(T
 
e e e e s T T T T T rho v v T e p propfuncWithDefault (T, p, h) propfuncWithDefault(beta
 
e e e e s T T T T T rho v v T e p T propfuncWithDefault (v, p, T) propfuncWithDefault(e
 
e e e e s T T T T T rho v v T e p T T propfuncWithDefault (gamma, v, e) propfuncWithDefault(gamma
 
 v
 
v
 
e e v
 
e e e v
 
e e e e s T T T T T rho v v T v
 
e e e e p
 
e e e e s p
 
e e e e s T T p
 
e e e e s T T T p
 
e e e e s T T T T p
 
e e e e s T T T T T p
 
e e e e s T T T T T rho v v p
 
e e e e s T T T T T rho v v T e p p
 
e e e e s T T T T T rho v v T e p T p
 
e e e e s T T T T T rho v v T e p T T p
 
e e e e s T rho
 
e e e e s T T T T T rho T
 
e e e e s T T T T T rho v T
 
e e e e s T T T T T rho v v Th
 

Detailed Description

Class for fluid properties read from a tabulation in a file.

Definition at line 26 of file TabulatedFluidProperties.h.

Member Enumeration Documentation

◆ OOBBehavior

Enum specifying all the behavior on out of bounds data options.

Enumerator
Ignore 
Throw 
DeclareInvalid 
WarnInvalid 
SetToClosestBound 

Definition at line 383 of file TabulatedFluidProperties.h.

Constructor & Destructor Documentation

◆ TabulatedFluidProperties()

TabulatedFluidProperties::TabulatedFluidProperties ( const InputParameters parameters)

Definition at line 163 of file TabulatedFluidProperties.C.

165  _file_name_in(isParamValid("fluid_property_file") ? getParam<FileName>("fluid_property_file")
166  : ""),
168  isParamValid("fluid_property_ve_file") ? getParam<FileName>("fluid_property_ve_file") : ""),
169  _file_name_out(isParamValid("fluid_property_output_file")
170  ? getParam<FileName>("fluid_property_output_file")
171  : ""),
172  _file_name_ve_out(isParamValid("fluid_property_ve_output_file")
173  ? getParam<FileName>("fluid_property_ve_output_file")
174  : ""),
175  _save_file(isParamValid("save_file") ? getParam<bool>("save_file")
176  : (isParamValid("fluid_property_output_file") ||
177  isParamValid("fluid_property_ve_output_file"))),
178  _create_direct_pT_interpolations(getParam<bool>("create_pT_interpolations")),
179  _create_direct_ve_interpolations(getParam<bool>("create_ve_interpolations")),
180  _temperature_min(getParam<Real>("temperature_min")),
181  _temperature_max(getParam<Real>("temperature_max")),
182  _pressure_min(getParam<Real>("pressure_min")),
183  _pressure_max(getParam<Real>("pressure_max")),
184  _num_T(getParam<unsigned int>("num_T")),
185  _num_p(getParam<unsigned int>("num_p")),
186  // work-around to allow use of 'fp' in GlobalParams
187  _fp(isParamValid("input_fp") ? ((getParam<UserObjectName>("input_fp") != name())
188  ? &getUserObject<SinglePhaseFluidProperties>("input_fp")
189  : nullptr)
190  : nullptr),
191  _allow_fp_and_tabulation(getParam<bool>("allow_fp_and_tabulation")),
192  _interpolated_properties_enum(getParam<MultiMooseEnum>("interpolated_properties")),
194  _interpolate_density(false),
195  _interpolate_enthalpy(false),
197  _interpolate_viscosity(false),
198  _interpolate_k(false),
199  _interpolate_c(false),
200  _interpolate_cp(false),
201  _interpolate_cv(false),
202  _interpolate_entropy(false),
203  _interpolate_pressure(false),
217  _construct_pT_from_ve(getParam<bool>("construct_pT_from_ve")),
218  _construct_pT_from_vh(getParam<bool>("construct_pT_from_vh")),
219  _initial_setup_done(false),
220  _num_v(getParam<unsigned int>("num_v")),
221  _num_e(getParam<unsigned int>("num_e")),
222  _log_space_v(getParam<bool>("use_log_grid_v")),
223  _log_space_e(getParam<bool>("use_log_grid_e")),
224  _log_space_h(getParam<bool>("use_log_grid_h")),
225  _OOBBehavior(getParam<MooseEnum>("out_of_bounds_behavior")),
226  _e_min(0),
227  _e_max(0),
228  _v_min(0),
229  _v_max(0)
230 {
231  // Check that initial guess (used in Newton Method) is within min and max values
232  checkInitialGuess(false);
233  // Sanity check on minimum and maximum temperatures and pressures
235  mooseError("temperature_max must be greater than temperature_min");
237  mooseError("pressure_max must be greater than pressure_min");
238 
239  // Set (v,e) bounds if specified by the user
240  if (isParamValid("e_min") && isParamValid("e_max"))
241  {
242  _e_min = getParam<Real>("e_min");
243  _e_max = getParam<Real>("e_max");
244  _e_bounds_specified = true;
245  }
246  else if (isParamValid("e_min") || isParamValid("e_max"))
247  paramError("e_min",
248  "Either both or none of the min and max values of the specific internal energy "
249  "should be specified");
250  else
251  _e_bounds_specified = false;
252  if (isParamValid("v_min") && isParamValid("v_max"))
253  {
254  _v_min = getParam<Real>("v_min");
255  _v_max = getParam<Real>("v_max");
256  _v_bounds_specified = true;
257  }
258  else if (isParamValid("v_min") || isParamValid("v_max"))
259  paramError("v_min",
260  "Either both or none of the min and max values of the specific volume "
261  "should be specified");
262  else
263  _v_bounds_specified = false;
264 
265  // Handle out of bounds behavior parameters and deprecation
266  if (isParamValid("error_on_out_of_bounds") && getParam<bool>("error_on_out_of_bounds") &&
267  _OOBBehavior != Throw)
268  paramError("out_of_bounds_behavior", "Inconsistent selection of out of bounds behavior.");
269  else if (isParamValid("error_on_out_of_bounds") && !getParam<bool>("error_on_out_of_bounds"))
271 
272  // Lines starting with # in the data file are treated as comments
273  _csv_reader.setComment("#");
274 
275  // Can only and must receive one source of data between fp and tabulations
276  if (_fp && (!_file_name_in.empty() || !_file_name_ve_in.empty()) && !_allow_fp_and_tabulation)
277  paramError(
278  "fluid_property_file",
279  "Cannot supply both a fluid properties object with 'input_fp' and a source tabulation "
280  "file with 'fluid_property_file', unless 'allow_fp_and_tabulation' is set to true");
281  if (!_fp && _file_name_in.empty() && _file_name_ve_in.empty())
282  paramError(
283  "fluid_property_file",
284  "Either a fluid properties object with the parameter 'input_fp' and a source tabulation "
285  "file with the parameter 'fluid_property_file' or 'fluid_property_ve_file' should "
286  "be provided.");
288  paramError("create_pT_interpolations", "Must create either (p,T) or (v,e) interpolations");
289 
290  // Some parameters are not used when reading a tabulation
291  if (!_fp && !_file_name_in.empty() &&
292  (isParamSetByUser("pressure_min") || isParamSetByUser("pressure_max") ||
293  isParamSetByUser("temperature_min") || isParamSetByUser("temperature_max")))
294  mooseWarning("User-specified bounds in pressure and temperature are ignored when reading a "
295  "'fluid_property_file'. The tabulation bounds are selected "
296  "from the bounds of the input tabulation.");
297  if (!_fp && !_file_name_in.empty() && (isParamSetByUser("num_p") || isParamSetByUser("num_T")))
298  mooseWarning("User-specified grid sizes in pressure and temperature are ignored when reading a "
299  "'fluid_property_file'. The tabulation bounds are selected "
300  "from the bounds of the input tabulation.");
301  if (!_fp && !_file_name_ve_in.empty() &&
302  (isParamSetByUser("v_min") || isParamSetByUser("v_max") || isParamSetByUser("e_min") ||
303  isParamSetByUser("e_max")))
304  mooseWarning(
305  "User-specified bounds in specific volume and internal energy are ignored when reading a "
306  "'fluid_property_ve_file'. The tabulation bounds are selected "
307  "from the bounds of the input tabulation.");
308  if (!_fp && !_file_name_ve_in.empty() && (isParamSetByUser("num_e") || isParamSetByUser("num_v")))
309  mooseWarning("User-specified grid sizes in specific volume and internal energy are ignored "
310  "when reading a 'fluid_property_ve_file'. The tabulation widths are read "
311  "from the input tabulation.");
312  if (!_file_name_ve_in.empty() && (_log_space_v || _log_space_e))
313  mooseWarning(
314  "User specfied logarithmic grids in specific volume and energy are ignored when reading a "
315  "'fluid_properties_ve_file'. The tabulation grid is read from the input tabulation");
316 }
bool _log_space_v
log-space the specific volume interpolation grid axis instead of linear
FileName _file_name_ve_in
File name of input (v,e) tabulated data file.
const bool _create_direct_ve_interpolations
Whether the object has direct (v,e) interpolations (whether created from file or from _fp) ...
const unsigned int invalid_uint
void paramError(const std::string &param, Args... args) const
const bool _create_direct_pT_interpolations
Whether the object has direct (p,T) interpolations (whether created from file or from _fp) ...
void setComment(const std::string &value)
Real _temperature_max
Maximum temperature in tabulated data.
Real _e_max
Maximum internal energy in tabulated data (can be user-specified)
const InputParameters & parameters() const
Real _e_min
Minimum internal energy in tabulated data (can be user-specified)
Real _pressure_max
Maximum pressure in tabulated data.
bool _e_bounds_specified
Whether the specific internal energy bounds were set by the user.
MooseUtils::DelimitedFileReader _csv_reader
The MOOSE delimited file reader.
SinglePhaseFluidProperties(const InputParameters &parameters)
const Parallel::Communicator & _communicator
bool _log_space_e
log-space the internal energy interpolation grid axis instead of linear
MooseEnum _OOBBehavior
User-selected out-of-bounds behavior.
MultiMooseEnum _interpolated_properties_enum
Properties to be interpolated entered in the input file.
bool _v_bounds_specified
Whether the specific volume bounds were set by the user.
FileName _file_name_ve_out
File name of output (v,e) tabulated data file.
unsigned int _num_v
Number of specific volume points in the tabulated data.
bool _construct_pT_from_ve
if the lookup table p(v, e) and T(v, e) should be constructed
Real _temperature_min
Minimum temperature in tabulated data.
const std::string & name() const
bool _construct_pT_from_vh
if the lookup table p(v, h) and T(v, h) should be constructed
FileName _file_name_out
File name of output tabulated data file.
bool _log_space_h
log-space the enthalpy interpolation grid axis instead of linear
Real _v_min
Minimum specific volume in tabulated data (can be user-specified)
std::vector< std::string > _interpolated_properties
List of properties to be interpolated.
unsigned int _num_T
Number of temperature points in the tabulated data.
bool _initial_setup_done
keeps track of whether initialSetup has been performed
const SinglePhaseFluidProperties *const _fp
SinglePhaseFluidPropertiesPT UserObject.
Real _pressure_min
Minimum pressure in tabulated data.
unsigned int _num_p
Number of pressure points in the tabulated data.
const bool _allow_fp_and_tabulation
Whether to allow a fp object when a tabulation is in use.
Real _v_max
Maximum specific volume in tabulated data (can be user-specified)
void mooseWarning(Args &&... args) const
void mooseError(Args &&... args) const
virtual void checkInitialGuess(bool post_reading_tabulation) const
Checks initial guess for Newton Method.
unsigned int _density_idx
Index of each property.
bool _interpolate_density
Set of flags to note whether a property is to be interpolated.
bool isParamValid(const std::string &name) const
const bool _save_file
Whether to save a generated fluid properties file to disk.
bool isParamSetByUser(const std::string &name) const
FileName _file_name_in
File name of input tabulated data file.
unsigned int _num_e
Number of internal energy points in tabulated data.

Member Function Documentation

◆ c_from_p_T() [1/2]

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

Definition at line 1022 of file TabulatedFluidProperties.C.

Referenced by c_from_v_e().

1023 {
1025  {
1027  return _property_ipol[_c_idx]->sample(pressure, temperature);
1028  }
1029  else
1030  {
1031  if (_fp)
1032  return _fp->c_from_p_T(pressure, temperature);
1033  else
1034  NeedTabulationOrFPError("c_from_p_T", "c");
1035  }
1036 }
const bool _create_direct_pT_interpolations
Whether the object has direct (p,T) interpolations (whether created from file or from _fp) ...
static const std::string temperature
Definition: NS.h:60
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...
const SinglePhaseFluidProperties *const _fp
SinglePhaseFluidPropertiesPT UserObject.
static const std::string pressure
Definition: NS.h:57
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...
std::vector< std::unique_ptr< BidimensionalInterpolation > > _property_ipol
Vector of bi-dimensional interpolation of fluid properties.

◆ c_from_p_T() [2/2]

void TabulatedFluidProperties::c_from_p_T ( Real  pressure,
Real  temperature,
Real c,
Real dc_dp,
Real dc_dT 
) const
overridevirtual

Definition at line 1039 of file TabulatedFluidProperties.C.

1041 {
1043  {
1045  _property_ipol[_c_idx]->sampleValueAndDerivatives(pressure, temperature, c, dc_dp, dc_dT);
1046  }
1047  else
1048  {
1049  if (_fp)
1050  _fp->c_from_p_T(pressure, temperature, c, dc_dp, dc_dT);
1051  else
1052  NeedTabulationOrFPError("c_from_p_T with derivatives", "c");
1053  }
1054 }
const bool _create_direct_pT_interpolations
Whether the object has direct (p,T) interpolations (whether created from file or from _fp) ...
static const std::string temperature
Definition: NS.h:60
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...
const SinglePhaseFluidProperties *const _fp
SinglePhaseFluidPropertiesPT UserObject.
static const std::string pressure
Definition: NS.h:57
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...
std::vector< std::unique_ptr< BidimensionalInterpolation > > _property_ipol
Vector of bi-dimensional interpolation of fluid properties.

◆ c_from_v_e() [1/2]

Real TabulatedFluidProperties::c_from_v_e ( Real  v,
Real  e 
) const
overridevirtual

Definition at line 1481 of file TabulatedFluidProperties.C.

Referenced by writeTabulatedData().

1482 {
1484  missingVEInterpolationError(__PRETTY_FUNCTION__);
1486 
1488  return _property_ve_ipol[_c_idx]->sample(v, e);
1489  else if (_construct_pT_from_ve)
1490  {
1491  Real p = _p_from_v_e_ipol->sample(v, e);
1492  Real T = _T_from_v_e_ipol->sample(v, e);
1493  return c_from_p_T(p, T);
1494  }
1495  else if (_fp)
1496  return _fp->c_from_v_e(v, e);
1497  else
1498  NeedTabulationOrFPError("c_from_v_e", "c");
1499 }
const bool _create_direct_ve_interpolations
Whether the object has direct (v,e) interpolations (whether created from file or from _fp) ...
std::vector< std::unique_ptr< BidimensionalInterpolation > > _property_ve_ipol
Vector of bi-dimensional interpolation of fluid properties directly in (v,e)
std::unique_ptr< BidimensionalInterpolation > _p_from_v_e_ipol
Bi-dimensional interpolation of pressure from (v,e)
std::unique_ptr< BidimensionalInterpolation > _T_from_v_e_ipol
Bi-dimensional interpolation of temperature from (v,e)
bool _construct_pT_from_ve
if the lookup table p(v, e) and T(v, e) should be constructed
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 c_from_p_T(Real pressure, Real temperature) const override
const SinglePhaseFluidProperties *const _fp
SinglePhaseFluidPropertiesPT UserObject.
void missingVEInterpolationError(const std::string &function_name) const
Standardized error message for missing interpolation.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
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...

◆ c_from_v_e() [2/2]

void TabulatedFluidProperties::c_from_v_e ( Real  v,
Real  e,
Real c,
Real dc_dv,
Real dc_de 
) const
overridevirtual

Definition at line 1502 of file TabulatedFluidProperties.C.

1503 {
1505  missingVEInterpolationError(__PRETTY_FUNCTION__);
1507 
1509  _property_ve_ipol[_c_idx]->sampleValueAndDerivatives(v, e, c, dc_dv, dc_de);
1510  else if (_construct_pT_from_ve)
1511  {
1512  Real p, dp_dv, dp_de;
1513  _p_from_v_e_ipol->sampleValueAndDerivatives(v, e, p, dp_dv, dp_de);
1514  Real T, dT_dv, dT_de;
1515  _T_from_v_e_ipol->sampleValueAndDerivatives(v, e, T, dT_dv, dT_de);
1516  Real dc_dp, dc_dT;
1517  c_from_p_T(p, T, c, dc_dp, dc_dT);
1518  dc_dv = dc_dp * dp_dv + dc_dT * dT_dv;
1519  dc_de = dc_dp * dp_de + dc_dT * dT_de;
1520  }
1521  else if (_fp)
1522  _fp->c_from_v_e(v, e, c, dc_dv, dc_de);
1523  else
1524  NeedTabulationOrFPError("c_from_v_e with derivatives", "c");
1525 }
const bool _create_direct_ve_interpolations
Whether the object has direct (v,e) interpolations (whether created from file or from _fp) ...
std::vector< std::unique_ptr< BidimensionalInterpolation > > _property_ve_ipol
Vector of bi-dimensional interpolation of fluid properties directly in (v,e)
std::unique_ptr< BidimensionalInterpolation > _p_from_v_e_ipol
Bi-dimensional interpolation of pressure from (v,e)
std::unique_ptr< BidimensionalInterpolation > _T_from_v_e_ipol
Bi-dimensional interpolation of temperature from (v,e)
bool _construct_pT_from_ve
if the lookup table p(v, e) and T(v, e) should be constructed
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 c_from_p_T(Real pressure, Real temperature) const override
const SinglePhaseFluidProperties *const _fp
SinglePhaseFluidPropertiesPT UserObject.
void missingVEInterpolationError(const std::string &function_name) const
Standardized error message for missing interpolation.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
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...

◆ checkFileTabulationGrids()

void TabulatedFluidProperties::checkFileTabulationGrids ( std::vector< Real > &  v1,
std::vector< Real > &  v2,
const std::string &  file_name,
const std::string &  v1_name,
const std::string &  v2_name 
)
protected

Check that the tabulation grids in the file are correct (no repeats etc)

Parameters
v1the first grid axis (pressure for pT grid)
v2the second grid axis (temperature for pT grid)
file_namethe name of the tabulation file

Definition at line 2499 of file TabulatedFluidProperties.C.

Referenced by readFileTabulationData().

2504 {
2505  // NOTE: We kept the comments in terms of pressure & temperature for clarity
2506  // Pressure (v1) and temperature (v2) data contains duplicates due to the csv format.
2507  // First, check that pressure (v1) is monotonically increasing
2508  if (!std::is_sorted(v1.begin(), v1.end()))
2509  mooseError("The column data for ", v1_name, " is not monotonically increasing in ", file_name);
2510 
2511  // The first pressure (v1) value is repeated for each temperature (v2) value. Counting the
2512  // number of repeats provides the number of temperature (v2) values
2513  auto num_v2 = std::count(v1.begin(), v1.end(), v1.front());
2514 
2515  // Now remove the duplicates in the pressure (v1) vector
2516  auto last_unique = std::unique(v1.begin(), v1.end());
2517  v1.erase(last_unique, v1.end());
2518 
2519  // Check that the number of rows in the csv file is equal to _num_v1 * _num_v2
2520  // v2 is currently the same size as the column_data (will get trimmed at the end)
2521  if (v2.size() != v1.size() * libMesh::cast_int<unsigned int>(num_v2))
2522  mooseError("The number of rows in ",
2523  file_name,
2524  " is not equal to the number of unique ",
2525  v1_name,
2526  " values ",
2527  v1.size(),
2528  " multiplied by the number of unique ",
2529  v2_name,
2530  " values ",
2531  num_v2);
2532 
2533  // Need to make sure that the temperature (v2) values are provided in ascending order
2534  std::vector<Real> base_v2(v2.begin(), v2.begin() + num_v2);
2535  if (!std::is_sorted(base_v2.begin(), base_v2.end()))
2536  mooseError("The column data for ", v2_name, " is not monotonically increasing in ", file_name);
2537 
2538  // Need to make sure that the temperature (v2) are repeated for each pressure (v1) grid point
2539  auto it_v2 = v2.begin() + num_v2;
2540  for (const auto i : make_range(v1.size() - 1))
2541  {
2542  std::vector<Real> repeated_v2(it_v2, it_v2 + num_v2);
2543  if (repeated_v2 != base_v2)
2544  mooseError(v2_name,
2545  " values for ",
2546  v1_name,
2547  " ",
2548  v1[i + 1],
2549  " are not identical to values for ",
2550  v1[0]);
2551 
2552  std::advance(it_v2, num_v2);
2553  }
2554 
2555  // At this point, all temperature (v2) data has been provided in ascending order
2556  // identically for each pressure (v1) value, so we can just keep the first range
2557  v2.erase(v2.begin() + num_v2, v2.end());
2558 }
IntRange< T > make_range(T beg, T end)
void mooseError(Args &&... args) const

◆ checkInitialGuess()

void TabulatedFluidProperties::checkInitialGuess ( bool  post_reading_tabulation) const
protectedvirtual

Checks initial guess for Newton Method.

Parameters
post_reading_tabulationwhether the check is performed at construction (false) or after reading a file tabulation (true)

Definition at line 2308 of file TabulatedFluidProperties.C.

Referenced by readFileTabulationData(), and TabulatedFluidProperties().

2309 {
2310  // First condition applies when generating a tabulation
2311  // Second condition applies when using a pre-generated loaded tabulation
2312  if ((!post_reading_tabulation && _fp && (_construct_pT_from_ve || _construct_pT_from_vh)) ||
2313  (post_reading_tabulation && (_file_name_in != "" || _file_name_ve_in != "") &&
2314  (_create_direct_ve_interpolations || isParamSetByUser("T_initial_guess") ||
2315  isParamSetByUser("p_initial_guess"))))
2316  {
2317  if (_p_initial_guess < _pressure_min || _p_initial_guess > _pressure_max)
2318  mooseWarning("Pressure initial guess for (p,T), (v,e) conversions " +
2320  " is outside the range of tabulated "
2321  "pressure (" +
2323 
2324  if (_T_initial_guess < _temperature_min || _T_initial_guess > _temperature_max)
2325  mooseWarning("Temperature initial guess for (p,T), (v,e) conversions " +
2327  " is outside the range of tabulated "
2328  "temperature (" +
2330  ").");
2331  }
2332 }
FileName _file_name_ve_in
File name of input (v,e) tabulated data file.
const bool _create_direct_ve_interpolations
Whether the object has direct (v,e) interpolations (whether created from file or from _fp) ...
Real _temperature_max
Maximum temperature in tabulated data.
Real _pressure_max
Maximum pressure in tabulated data.
bool _construct_pT_from_ve
if the lookup table p(v, e) and T(v, e) should be constructed
Real _temperature_min
Minimum temperature in tabulated data.
bool _construct_pT_from_vh
if the lookup table p(v, h) and T(v, h) should be constructed
std::string stringify(const T &t)
const SinglePhaseFluidProperties *const _fp
SinglePhaseFluidPropertiesPT UserObject.
Real _pressure_min
Minimum pressure in tabulated data.
const Real _p_initial_guess
Initial guess for pressure (or pressure used to compute the initial guess)
void mooseWarning(Args &&... args) const
const Real _T_initial_guess
Initial guess for temperature (or temperature used to compute the initial guess)
bool isParamSetByUser(const std::string &name) const
FileName _file_name_in
File name of input tabulated data file.

◆ checkInputVariables()

template<typename T >
template void TabulatedFluidProperties::checkInputVariables ( T pressure,
T temperature 
) const
protected

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 2222 of file TabulatedFluidProperties.C.

Referenced by c_from_p_T(), cp_from_p_T(), cv_from_p_T(), e_from_p_rho(), e_from_p_T(), h_from_p_T(), k_from_p_T(), mu_from_p_T(), rho_from_p_T(), s_from_p_T(), T_from_p_rho(), and v_from_p_T().

2223 {
2224  using std::max, std::min;
2225 
2226  if (_OOBBehavior == Ignore)
2227  return;
2228  else if (MooseUtils::absoluteFuzzyGreaterThan(_pressure_min, pressure, libMesh::TOLERANCE) ||
2229  MooseUtils::absoluteFuzzyGreaterThan(pressure, _pressure_max, libMesh::TOLERANCE))
2230  {
2231  if (_OOBBehavior == Throw)
2232  throw MooseException("Pressure " + Moose::stringify(pressure) +
2233  " is outside the range of tabulated pressure (" +
2236 
2237  else
2238  {
2241  flagInvalidSolution("Pressure out of bounds");
2242  else if (_OOBBehavior == WarnInvalid)
2243  flagSolutionWarning("Pressure out of bounds");
2244  }
2245  }
2246 
2247  if (MooseUtils::absoluteFuzzyGreaterThan(_temperature_min, temperature, libMesh::TOLERANCE) ||
2248  MooseUtils::absoluteFuzzyGreaterThan(temperature, _temperature_max, libMesh::TOLERANCE))
2249  {
2250  if (_OOBBehavior == Throw)
2251  throw MooseException("Temperature " + Moose::stringify(temperature) +
2252  " is outside the range of tabulated temperature (" +
2255  else
2256  {
2259  flagInvalidSolution("Temperature out of bounds");
2260  else if (_OOBBehavior == WarnInvalid)
2261  flagSolutionWarning("Temperature out of bounds");
2262  }
2263  }
2264 }
static constexpr Real TOLERANCE
Real _temperature_max
Maximum temperature in tabulated data.
Real _pressure_max
Maximum pressure in tabulated data.
static const std::string temperature
Definition: NS.h:60
MooseEnum _OOBBehavior
User-selected out-of-bounds behavior.
auto max(const L &left, const R &right)
Real _temperature_min
Minimum temperature in tabulated data.
std::string stringify(const T &t)
Real _pressure_min
Minimum pressure in tabulated data.
static const std::string pressure
Definition: NS.h:57
auto min(const L &left, const R &right)

◆ checkInputVariablesVE()

template<typename T >
template void TabulatedFluidProperties::checkInputVariablesVE ( T v,
T e 
) const
protected

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

Parameters
vspecific volume (m3/kg)
especific internal energy (J/kg)

Definition at line 2268 of file TabulatedFluidProperties.C.

Referenced by c_from_v_e(), cp_from_v_e(), cv_from_v_e(), g_from_v_e(), k_from_v_e(), mu_from_v_e(), p_from_v_e(), s_from_v_e(), and T_from_v_e().

2269 {
2270  using std::max, std::min;
2271 
2272  if (_OOBBehavior == Ignore)
2273  return;
2274  else if (e < _e_min || e > _e_max)
2275  {
2276  if (_OOBBehavior == Throw)
2277  throw MooseException("Specific internal energy " + Moose::stringify(e) +
2278  " is outside the range of tabulated specific internal energies (" +
2279  Moose::stringify(_e_min) + ", " + Moose::stringify(_e_max) + ").");
2280  else
2281  {
2282  e = max(_e_min, min(e, _e_max));
2284  flagInvalidSolution("Specific internal energy out of bounds");
2285  else if (_OOBBehavior == WarnInvalid)
2286  flagSolutionWarning("Specific internal energy out of bounds");
2287  }
2288  }
2289 
2290  if (v < _v_min || v > _v_max)
2291  {
2292  if (_OOBBehavior == Throw)
2293  throw MooseException("Specific volume " + Moose::stringify(v) +
2294  " is outside the range of tabulated specific volumes (" +
2295  Moose::stringify(_v_min) + ", " + Moose::stringify(_v_max) + ").");
2296  else
2297  {
2298  v = max(T(_v_min), min(v, T(_v_max)));
2300  flagInvalidSolution("Specific volume out of bounds");
2301  else if (_OOBBehavior == WarnInvalid)
2302  flagSolutionWarning("Specific volume out of bounds");
2303  }
2304  }
2305 }
Real _e_max
Maximum internal energy in tabulated data (can be user-specified)
Real _e_min
Minimum internal energy in tabulated data (can be user-specified)
MooseEnum _OOBBehavior
User-selected out-of-bounds behavior.
auto max(const L &left, const R &right)
Real _v_min
Minimum specific volume in tabulated data (can be user-specified)
std::string stringify(const T &t)
Real _v_max
Maximum specific volume in tabulated data (can be user-specified)
auto min(const L &left, const R &right)

◆ computePropertyIndicesInInterpolationVectors()

void TabulatedFluidProperties::computePropertyIndicesInInterpolationVectors ( )
protected

Retrieves the index for each property in the vector of interpolations.

Definition at line 2561 of file TabulatedFluidProperties.C.

Referenced by initialSetup().

2562 {
2563  // At this point, all properties read or generated are able to be used by
2564  // TabulatedFluidProperties. Now set flags and indexes for each property in
2565  //_interpolated_properties to use in property calculations
2566  for (std::size_t i = 0; i < _interpolated_properties.size(); ++i)
2567  {
2568  if (_interpolated_properties[i] == "density")
2569  {
2570  _interpolate_density = true;
2571  _density_idx = i;
2572  }
2573  else if (_interpolated_properties[i] == "enthalpy")
2574  {
2575  _interpolate_enthalpy = true;
2576  _enthalpy_idx = i;
2577  }
2578  else if (_interpolated_properties[i] == "internal_energy")
2579  {
2582  }
2583  else if (_interpolated_properties[i] == "viscosity")
2584  {
2585  _interpolate_viscosity = true;
2586  _viscosity_idx = i;
2587  }
2588  else if (_interpolated_properties[i] == "k")
2589  {
2590  _interpolate_k = true;
2591  _k_idx = i;
2592  }
2593  else if (_interpolated_properties[i] == "c")
2594  {
2595  _interpolate_c = true;
2596  _c_idx = i;
2597  }
2598  else if (_interpolated_properties[i] == "cp")
2599  {
2600  _interpolate_cp = true;
2601  _cp_idx = i;
2602  }
2603  else if (_interpolated_properties[i] == "cv")
2604  {
2605  _interpolate_cv = true;
2606  _cv_idx = i;
2607  }
2608  else if (_interpolated_properties[i] == "entropy")
2609  {
2610  _interpolate_entropy = true;
2611  _entropy_idx = i;
2612  }
2613  else if (_interpolated_properties[i] == "pressure")
2614  {
2615  _interpolate_pressure = true;
2616  _p_idx = i;
2617  }
2618  else if (_interpolated_properties[i] == "temperature")
2619  {
2620  _interpolate_temperature = true;
2621  _T_idx = i;
2622  }
2623  else
2624  mooseError("Specified property '" + _interpolated_properties[i] +
2625  "' is present in the tabulation but is not currently leveraged by the code in the "
2626  "TabulatedFluidProperties. If it is spelled correctly, then please contact a "
2627  "MOOSE or fluid properties module developer.");
2628  }
2629 }
std::vector< std::string > _interpolated_properties
List of properties to be interpolated.
void mooseError(Args &&... args) const
unsigned int _density_idx
Index of each property.
bool _interpolate_density
Set of flags to note whether a property is to be interpolated.

◆ constructInterpolation()

virtual void TabulatedFluidProperties::constructInterpolation ( )
pure virtual

Implemented in TabulatedBicubicFluidProperties.

Referenced by initialSetup().

◆ cp_from_p_T() [1/2]

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

Definition at line 1057 of file TabulatedFluidProperties.C.

Referenced by cp_from_v_e().

1058 {
1060  {
1062  return _property_ipol[_cp_idx]->sample(pressure, temperature);
1063  }
1064  else
1065  {
1066  if (_fp)
1067  return _fp->cp_from_p_T(pressure, temperature);
1068  else
1069  NeedTabulationOrFPError("cp_from_p_T", "c");
1070  }
1071 }
const bool _create_direct_pT_interpolations
Whether the object has direct (p,T) interpolations (whether created from file or from _fp) ...
static const std::string temperature
Definition: NS.h:60
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...
const SinglePhaseFluidProperties *const _fp
SinglePhaseFluidPropertiesPT UserObject.
static const std::string pressure
Definition: NS.h:57
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...
std::vector< std::unique_ptr< BidimensionalInterpolation > > _property_ipol
Vector of bi-dimensional interpolation of fluid properties.

◆ cp_from_p_T() [2/2]

void TabulatedFluidProperties::cp_from_p_T ( Real  pressure,
Real  temperature,
Real cp,
Real dcp_dp,
Real dcp_dT 
) const
overridevirtual

Definition at line 1074 of file TabulatedFluidProperties.C.

1076 {
1078  {
1080  _property_ipol[_cp_idx]->sampleValueAndDerivatives(pressure, temperature, cp, dcp_dp, dcp_dT);
1081  }
1082  else
1083  {
1084  if (_fp)
1085  _fp->cp_from_p_T(pressure, temperature, cp, dcp_dp, dcp_dT);
1086  else
1087  NeedTabulationOrFPError("cp_from_p_T with derivatives", "cp");
1088  }
1089 }
const bool _create_direct_pT_interpolations
Whether the object has direct (p,T) interpolations (whether created from file or from _fp) ...
static const std::string temperature
Definition: NS.h:60
static const std::string cp
Definition: NS.h:125
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...
const SinglePhaseFluidProperties *const _fp
SinglePhaseFluidPropertiesPT UserObject.
static const std::string pressure
Definition: NS.h:57
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...
std::vector< std::unique_ptr< BidimensionalInterpolation > > _property_ipol
Vector of bi-dimensional interpolation of fluid properties.

◆ cp_from_v_e() [1/2]

Real TabulatedFluidProperties::cp_from_v_e ( Real  v,
Real  e 
) const
overridevirtual

Definition at line 1528 of file TabulatedFluidProperties.C.

Referenced by writeTabulatedData().

1529 {
1531  missingVEInterpolationError(__PRETTY_FUNCTION__);
1533 
1535  return _property_ve_ipol[_cp_idx]->sample(v, e);
1536  else if (_construct_pT_from_ve)
1537  {
1538  Real p = _p_from_v_e_ipol->sample(v, e);
1539  Real T = _T_from_v_e_ipol->sample(v, e);
1540  return cp_from_p_T(p, T);
1541  }
1542  else if (_fp)
1543  return _fp->cp_from_v_e(v, e);
1544  else
1545  NeedTabulationOrFPError("cp_from_v_e", "cp");
1546 }
const bool _create_direct_ve_interpolations
Whether the object has direct (v,e) interpolations (whether created from file or from _fp) ...
std::vector< std::unique_ptr< BidimensionalInterpolation > > _property_ve_ipol
Vector of bi-dimensional interpolation of fluid properties directly in (v,e)
std::unique_ptr< BidimensionalInterpolation > _p_from_v_e_ipol
Bi-dimensional interpolation of pressure from (v,e)
std::unique_ptr< BidimensionalInterpolation > _T_from_v_e_ipol
Bi-dimensional interpolation of temperature from (v,e)
bool _construct_pT_from_ve
if the lookup table p(v, e) and T(v, e) should be constructed
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...
const SinglePhaseFluidProperties *const _fp
SinglePhaseFluidPropertiesPT UserObject.
void missingVEInterpolationError(const std::string &function_name) const
Standardized error message for missing interpolation.
virtual Real cp_from_p_T(Real pressure, Real temperature) const override
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
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...

◆ cp_from_v_e() [2/2]

void TabulatedFluidProperties::cp_from_v_e ( Real  v,
Real  e,
Real cp,
Real dcp_dv,
Real dcp_de 
) const
overridevirtual

Definition at line 1549 of file TabulatedFluidProperties.C.

1550 {
1552  missingVEInterpolationError(__PRETTY_FUNCTION__);
1554 
1556  _property_ve_ipol[_cp_idx]->sampleValueAndDerivatives(v, e, cp, dcp_dv, dcp_de);
1557  else if (_construct_pT_from_ve)
1558  {
1559  Real p, dp_dv, dp_de;
1560  _p_from_v_e_ipol->sampleValueAndDerivatives(v, e, p, dp_dv, dp_de);
1561  Real T, dT_dv, dT_de;
1562  _T_from_v_e_ipol->sampleValueAndDerivatives(v, e, T, dT_dv, dT_de);
1563  Real dcp_dp, dcp_dT;
1564  cp_from_p_T(p, T, cp, dcp_dp, dcp_dT);
1565  dcp_dv = dcp_dp * dp_dv + dcp_dT * dT_dv;
1566  dcp_de = dcp_dp * dp_de + dcp_dT * dT_de;
1567  }
1568  else if (_fp)
1569  _fp->cp_from_v_e(v, e, cp, dcp_dv, dcp_de);
1570  else
1571  NeedTabulationOrFPError("cp_from_v_e with derivatives", "cp");
1572 }
const bool _create_direct_ve_interpolations
Whether the object has direct (v,e) interpolations (whether created from file or from _fp) ...
std::vector< std::unique_ptr< BidimensionalInterpolation > > _property_ve_ipol
Vector of bi-dimensional interpolation of fluid properties directly in (v,e)
std::unique_ptr< BidimensionalInterpolation > _p_from_v_e_ipol
Bi-dimensional interpolation of pressure from (v,e)
std::unique_ptr< BidimensionalInterpolation > _T_from_v_e_ipol
Bi-dimensional interpolation of temperature from (v,e)
static const std::string cp
Definition: NS.h:125
bool _construct_pT_from_ve
if the lookup table p(v, e) and T(v, e) should be constructed
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...
const SinglePhaseFluidProperties *const _fp
SinglePhaseFluidPropertiesPT UserObject.
void missingVEInterpolationError(const std::string &function_name) const
Standardized error message for missing interpolation.
virtual Real cp_from_p_T(Real pressure, Real temperature) const override
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
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...

◆ createVEGridVectors()

void TabulatedFluidProperties::createVEGridVectors ( )
protected

Definition at line 2685 of file TabulatedFluidProperties.C.

Referenced by TabulatedBicubicFluidProperties::constructInterpolation(), generateVETabulatedData(), and initialSetup().

2686 {
2688  if (!_e_bounds_specified)
2689  {
2690  // if csv exists, get max and min values from csv file
2692  {
2693  _e_min = *std::min_element(_properties[_internal_energy_idx].begin(),
2695  _e_max = *std::max_element(_properties[_internal_energy_idx].begin(),
2697  }
2698  else if (_fp)
2699  {
2700  // extreme values of internal energy for the grid bounds
2701  Real e1 = _fp->e_from_p_T(_pressure_min, _temperature_min);
2702  Real e2 = _fp->e_from_p_T(_pressure_max, _temperature_min);
2703  Real e3 = _fp->e_from_p_T(_pressure_min, _temperature_max);
2704  Real e4 = _fp->e_from_p_T(_pressure_max, _temperature_max);
2705  _e_min = std::min({e1, e2, e3, e4});
2706  _e_max = std::max({e1, e2, e3, e4});
2707  }
2708  else
2709  mooseWarning("Unable to compute grid bounds in internal energy. Please specify the e_min/max "
2710  "parameters");
2711  }
2712 
2713  // Create e grid for interpolation
2714  _internal_energy.resize(_num_e);
2715  if (_log_space_e)
2716  {
2717  // incrementing the exponent linearly will yield a log-spaced grid after taking the value to
2718  // the power of 10
2719  if (_e_min < 0)
2720  mooseError("Logarithmic grid in specific energy can only be used with a positive specific "
2721  "energy. Current minimum: " +
2722  std::to_string(_e_min));
2723  Real de = (std::log10(_e_max) - std::log10(_e_min)) / ((Real)_num_e - 1);
2724  Real log_e_min = std::log10(_e_min);
2725  for (const auto j : make_range(_num_e))
2726  _internal_energy[j] = std::pow(10, log_e_min + j * de);
2727  }
2728  else
2729  {
2730  Real de = (_e_max - _e_min) / ((Real)_num_e - 1);
2731  for (const auto j : make_range(_num_e))
2732  _internal_energy[j] = _e_min + j * de;
2733  }
2734 }
Real _temperature_max
Maximum temperature in tabulated data.
Real _e_max
Maximum internal energy in tabulated data (can be user-specified)
Real _e_min
Minimum internal energy in tabulated data (can be user-specified)
Real _pressure_max
Maximum pressure in tabulated data.
bool _e_bounds_specified
Whether the specific internal energy bounds were set by the user.
bool _log_space_e
log-space the internal energy interpolation grid axis instead of linear
Real _temperature_min
Minimum temperature in tabulated data.
const SinglePhaseFluidProperties *const _fp
SinglePhaseFluidPropertiesPT UserObject.
Real _pressure_min
Minimum pressure in tabulated data.
std::vector< std::vector< Real > > _properties
Tabulated fluid properties (read from file OR computed from _fp)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
void mooseWarning(Args &&... args) const
IntRange< T > make_range(T beg, T end)
void mooseError(Args &&... args) const
std::vector< Real > _internal_energy
Specific internal energy vector.
static const std::complex< double > j(0, 1)
Complex number "j" (also known as "i")
void createVGridVector()
Create (or reset) the grid vectors for the specific volume and internal energy interpolations The ord...
MooseUnits pow(const MooseUnits &, int)
unsigned int _num_e
Number of internal energy points in tabulated data.

◆ createVGridVector()

void TabulatedFluidProperties::createVGridVector ( )
protected

Create (or reset) the grid vectors for the specific volume and internal energy interpolations The order of priority for determining the range boundaries in v and e:

  • if user-specified, use _v_min/max and _e_min/max
  • if reading a (v,e) interpolation, the bounds of that range
  • if a _fp exist find the min/max v/e from T_min/max and p_min/max

Definition at line 2632 of file TabulatedFluidProperties.C.

Referenced by createVEGridVectors(), and createVHGridVectors().

2633 {
2634  mooseAssert(_file_name_ve_in.empty(), "We should be reading the specific volume grid from file");
2635  if (!_v_bounds_specified)
2636  {
2637  // if csv exists, get max and min values from csv file
2639  {
2640  Real rho_max =
2641  *std::max_element(_properties[_density_idx].begin(), _properties[_density_idx].end());
2642  Real rho_min =
2643  *std::min_element(_properties[_density_idx].begin(), _properties[_density_idx].end());
2644  _v_max = 1 / rho_min;
2645  _v_min = 1 / rho_max;
2646  }
2647  else if (_fp)
2648  {
2649  // extreme values of specific volume for the grid bounds
2650  Real v1 = _fp->v_from_p_T(_pressure_min, _temperature_min);
2651  Real v2 = _fp->v_from_p_T(_pressure_max, _temperature_min);
2652  Real v3 = _fp->v_from_p_T(_pressure_min, _temperature_max);
2653  Real v4 = _fp->v_from_p_T(_pressure_max, _temperature_max);
2654  _v_min = std::min({v1, v2, v3, v4});
2655  _v_max = std::max({v1, v2, v3, v4});
2656  }
2657  else
2658  mooseWarning("Unable to compute grid bounds in specific volume. Please specify the v_min/max "
2659  "parameters");
2660 
2661  // Prevent changing the bounds of the grid
2662  _v_bounds_specified = true;
2663  }
2664 
2665  // Create v grid for interpolation
2666  _specific_volume.resize(_num_v);
2667  if (_log_space_v)
2668  {
2669  // incrementing the exponent linearly will yield a log-spaced grid after taking the value to
2670  // the power of 10
2671  Real dv = (std::log10(_v_max) - std::log10(_v_min)) / ((Real)_num_v - 1);
2672  Real log_v_min = std::log10(_v_min);
2673  for (unsigned int j = 0; j < _num_v; ++j)
2674  _specific_volume[j] = std::pow(10, log_v_min + j * dv);
2675  }
2676  else
2677  {
2678  Real dv = (_v_max - _v_min) / ((Real)_num_v - 1);
2679  for (unsigned int j = 0; j < _num_v; ++j)
2680  _specific_volume[j] = _v_min + j * dv;
2681  }
2682 }
bool _log_space_v
log-space the specific volume interpolation grid axis instead of linear
FileName _file_name_ve_in
File name of input (v,e) tabulated data file.
Real _temperature_max
Maximum temperature in tabulated data.
Real _pressure_max
Maximum pressure in tabulated data.
bool _v_bounds_specified
Whether the specific volume bounds were set by the user.
unsigned int _num_v
Number of specific volume points in the tabulated data.
Real _temperature_min
Minimum temperature in tabulated data.
Real _v_min
Minimum specific volume in tabulated data (can be user-specified)
const SinglePhaseFluidProperties *const _fp
SinglePhaseFluidPropertiesPT UserObject.
Real _pressure_min
Minimum pressure in tabulated data.
std::vector< std::vector< Real > > _properties
Tabulated fluid properties (read from file OR computed from _fp)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
Real _v_max
Maximum specific volume in tabulated data (can be user-specified)
void mooseWarning(Args &&... args) const
std::vector< Real > _specific_volume
Specific volume vector.
unsigned int _density_idx
Index of each property.
bool _interpolate_density
Set of flags to note whether a property is to be interpolated.
static const std::complex< double > j(0, 1)
Complex number "j" (also known as "i")
MooseUnits pow(const MooseUnits &, int)

◆ createVHGridVectors()

void TabulatedFluidProperties::createVHGridVectors ( )
protected

Create (or reset) the grid vectors for the specific volume and enthalpy interpolation The order of priority for determining the range boundaries in v and h:

  • if user-specified, use _v_min/max and _e_min/max
  • if a _fp exist find the min/max v/e from T_min/max and p_min/max
  • if reading a (p,T) tabulation, the bounds of the enthalpy grid
  • if reading a (v,e) tabulation, the bounds of the enthalpy grid

Definition at line 2737 of file TabulatedFluidProperties.C.

Referenced by TabulatedBicubicFluidProperties::constructInterpolation().

2738 {
2739  if (_file_name_ve_in.empty())
2741  if (_fp)
2742  {
2743  // extreme values of enthalpy for the grid bounds
2744  Real h1 = _fp->h_from_p_T(_pressure_min, _temperature_min);
2745  Real h2 = _fp->h_from_p_T(_pressure_max, _temperature_min);
2746  Real h3 = _fp->h_from_p_T(_pressure_min, _temperature_max);
2747  Real h4 = _fp->h_from_p_T(_pressure_max, _temperature_max);
2748  _h_min = std::min({h1, h2, h3, h4});
2749  _h_max = std::max({h1, h2, h3, h4});
2750  }
2751  // if csv exists, get max and min values from csv file
2752  else if (_properties.size())
2753  {
2754  _h_max = *max_element(_properties[_enthalpy_idx].begin(), _properties[_enthalpy_idx].end());
2755  _h_min = *min_element(_properties[_enthalpy_idx].begin(), _properties[_enthalpy_idx].end());
2756  }
2757  else if (_properties_ve.size())
2758  {
2759  _h_max = *max_element(_properties[_enthalpy_idx].begin(), _properties[_enthalpy_idx].end());
2760  _h_min = *min_element(_properties[_enthalpy_idx].begin(), _properties[_enthalpy_idx].end());
2761  }
2762  else
2763  mooseError("Need a source to compute the enthalpy grid bounds: either a FP object, or a (p,T) "
2764  "tabulation file or a (v,e) tabulation file");
2765 
2766  // Create h grid for interpolation
2767  // enthalpy & internal energy use same # grid points
2768  _enthalpy.resize(_num_e);
2769  if (_log_space_h)
2770  {
2771  // incrementing the exponent linearly will yield a log-spaced grid after taking the value to
2772  // the power of 10
2773  if (_h_min < 0)
2774  mooseError("Logarithmic grid in specific energy can only be used with a positive enthalpy. "
2775  "Current minimum: " +
2776  std::to_string(_h_min));
2777  Real dh = (std::log10(_h_max) - std::log10(_h_min)) / ((Real)_num_e - 1);
2778  Real log_h_min = std::log10(_h_min);
2779  for (const auto j : make_range(_num_e))
2780  _enthalpy[j] = std::pow(10, log_h_min + j * dh);
2781  }
2782  else
2783  {
2784  Real dh = (_h_max - _h_min) / ((Real)_num_e - 1);
2785  for (const auto j : make_range(_num_e))
2786  _enthalpy[j] = _h_min + j * dh;
2787  }
2788 }
FileName _file_name_ve_in
File name of input (v,e) tabulated data file.
Real _temperature_max
Maximum temperature in tabulated data.
Real _h_max
Maximum specific enthalpy in tabulated data.
Real _pressure_max
Maximum pressure in tabulated data.
Real _h_min
Minimum specific enthalpy in tabulated data.
std::vector< Real > _enthalpy
Specific enthalpy vector.
Real _temperature_min
Minimum temperature in tabulated data.
bool _log_space_h
log-space the enthalpy interpolation grid axis instead of linear
const SinglePhaseFluidProperties *const _fp
SinglePhaseFluidPropertiesPT UserObject.
Real _pressure_min
Minimum pressure in tabulated data.
std::vector< std::vector< Real > > _properties
Tabulated fluid properties (read from file OR computed from _fp)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
std::vector< std::vector< Real > > _properties_ve
Tabulated fluid properties in (v,e) (read from file OR computed from _fp)
IntRange< T > make_range(T beg, T end)
void mooseError(Args &&... args) const
static const std::complex< double > j(0, 1)
Complex number "j" (also known as "i")
void createVGridVector()
Create (or reset) the grid vectors for the specific volume and internal energy interpolations The ord...
MooseUnits pow(const MooseUnits &, int)
unsigned int _num_e
Number of internal energy points in tabulated data.

◆ criticalDensity()

Real TabulatedFluidProperties::criticalDensity ( ) const
overridevirtual

Critical density.

Returns
critical density (kg/m^3)

Reimplemented from SinglePhaseFluidProperties.

Definition at line 1366 of file TabulatedFluidProperties.C.

1367 {
1368  if (_fp)
1369  return _fp->criticalDensity();
1370  else
1371  TabulationNotImplementedError("criticalDensity");
1372 }
const SinglePhaseFluidProperties *const _fp
SinglePhaseFluidPropertiesPT UserObject.
virtual Real criticalDensity() const
Critical density.
void TabulationNotImplementedError(const std::string &desired_routine) const
Utility to forward errors related to fluid properties methods not implemented.

◆ criticalInternalEnergy()

Real SinglePhaseFluidProperties::criticalInternalEnergy ( ) const
virtualinherited

Critical specific internal energy.

Returns
specific internal energy (J/kg)

Reimplemented in IdealGasFluidProperties, CaloricallyImperfectGas, and StiffenedGasFluidProperties.

Definition at line 320 of file SinglePhaseFluidProperties.C.

321 {
322  return e_from_p_rho(criticalPressure(), criticalDensity());
323 }
virtual Real criticalDensity() const
Critical density.
virtual Real criticalPressure() const
Critical pressure.

◆ criticalPressure()

Real TabulatedFluidProperties::criticalPressure ( ) const
overridevirtual

Critical pressure.

Returns
critical pressure (Pa)

Reimplemented from SinglePhaseFluidProperties.

Definition at line 1346 of file TabulatedFluidProperties.C.

1347 {
1348 
1349  if (_fp)
1350  return _fp->criticalPressure();
1351  else
1352  TabulationNotImplementedError("criticalPressure");
1353 }
const SinglePhaseFluidProperties *const _fp
SinglePhaseFluidPropertiesPT UserObject.
void TabulationNotImplementedError(const std::string &desired_routine) const
Utility to forward errors related to fluid properties methods not implemented.
virtual Real criticalPressure() const
Critical pressure.

◆ criticalTemperature()

Real TabulatedFluidProperties::criticalTemperature ( ) const
overridevirtual

Critical temperature.

Returns
critical temperature (K)

Reimplemented from SinglePhaseFluidProperties.

Definition at line 1356 of file TabulatedFluidProperties.C.

1357 {
1358 
1359  if (_fp)
1360  return _fp->criticalTemperature();
1361  else
1362  TabulationNotImplementedError("criticalTemperature");
1363 }
virtual Real criticalTemperature() const
Critical temperature.
const SinglePhaseFluidProperties *const _fp
SinglePhaseFluidPropertiesPT UserObject.
void TabulationNotImplementedError(const std::string &desired_routine) const
Utility to forward errors related to fluid properties methods not implemented.

◆ cv_from_p_T() [1/2]

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

Definition at line 1092 of file TabulatedFluidProperties.C.

Referenced by cv_from_v_e().

1093 {
1095  {
1097  return _property_ipol[_cv_idx]->sample(pressure, temperature);
1098  }
1099  else
1100  {
1101  if (_fp)
1102  return _fp->cv_from_p_T(pressure, temperature);
1103  else
1104  NeedTabulationOrFPError("cv_from_p_T", "cv");
1105  }
1106 }
const bool _create_direct_pT_interpolations
Whether the object has direct (p,T) interpolations (whether created from file or from _fp) ...
static const std::string temperature
Definition: NS.h:60
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...
const SinglePhaseFluidProperties *const _fp
SinglePhaseFluidPropertiesPT UserObject.
static const std::string pressure
Definition: NS.h:57
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...
std::vector< std::unique_ptr< BidimensionalInterpolation > > _property_ipol
Vector of bi-dimensional interpolation of fluid properties.

◆ cv_from_p_T() [2/2]

void TabulatedFluidProperties::cv_from_p_T ( Real  pressure,
Real  temperature,
Real cv,
Real dcv_dp,
Real dcv_dT 
) const
overridevirtual

Definition at line 1109 of file TabulatedFluidProperties.C.

1111 {
1112  if (_interpolate_cv)
1113  {
1115  _property_ipol[_cv_idx]->sampleValueAndDerivatives(pressure, temperature, cv, dcv_dp, dcv_dT);
1116  }
1117  else
1118  {
1119  if (_fp)
1120  _fp->cv_from_p_T(pressure, temperature, cv, dcv_dp, dcv_dT);
1121  else
1122  NeedTabulationOrFPError("cv_from_p_T with derivatives", "cv");
1123  }
1124 }
static const std::string cv
Definition: NS.h:126
static const std::string temperature
Definition: NS.h:60
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...
const SinglePhaseFluidProperties *const _fp
SinglePhaseFluidPropertiesPT UserObject.
static const std::string pressure
Definition: NS.h:57
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...
std::vector< std::unique_ptr< BidimensionalInterpolation > > _property_ipol
Vector of bi-dimensional interpolation of fluid properties.

◆ cv_from_v_e() [1/2]

Real TabulatedFluidProperties::cv_from_v_e ( Real  v,
Real  e 
) const
overridevirtual

Definition at line 1575 of file TabulatedFluidProperties.C.

Referenced by writeTabulatedData().

1576 {
1578  missingVEInterpolationError(__PRETTY_FUNCTION__);
1580 
1582  return _property_ve_ipol[_cv_idx]->sample(v, e);
1583  else if (_construct_pT_from_ve)
1584  {
1585  Real p = _p_from_v_e_ipol->sample(v, e);
1586  Real T = _T_from_v_e_ipol->sample(v, e);
1587  return cv_from_p_T(p, T);
1588  }
1589  else if (_fp)
1590  return _fp->cv_from_v_e(v, e);
1591  else
1592  NeedTabulationOrFPError("cv_from_v_e", "cv");
1593 }
const bool _create_direct_ve_interpolations
Whether the object has direct (v,e) interpolations (whether created from file or from _fp) ...
std::vector< std::unique_ptr< BidimensionalInterpolation > > _property_ve_ipol
Vector of bi-dimensional interpolation of fluid properties directly in (v,e)
std::unique_ptr< BidimensionalInterpolation > _p_from_v_e_ipol
Bi-dimensional interpolation of pressure from (v,e)
std::unique_ptr< BidimensionalInterpolation > _T_from_v_e_ipol
Bi-dimensional interpolation of temperature from (v,e)
bool _construct_pT_from_ve
if the lookup table p(v, e) and T(v, e) should be constructed
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...
const SinglePhaseFluidProperties *const _fp
SinglePhaseFluidPropertiesPT UserObject.
void missingVEInterpolationError(const std::string &function_name) const
Standardized error message for missing interpolation.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
virtual Real cv_from_p_T(Real pressure, Real temperature) const override
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...

◆ cv_from_v_e() [2/2]

void TabulatedFluidProperties::cv_from_v_e ( Real  v,
Real  e,
Real cv,
Real dcv_dv,
Real dcv_de 
) const
overridevirtual

Definition at line 1596 of file TabulatedFluidProperties.C.

1597 {
1599  missingVEInterpolationError(__PRETTY_FUNCTION__);
1601 
1603  _property_ve_ipol[_cv_idx]->sampleValueAndDerivatives(v, e, cv, dcv_dv, dcv_de);
1604  else if (_construct_pT_from_ve)
1605  {
1606  Real p, dp_dv, dp_de;
1607  _p_from_v_e_ipol->sampleValueAndDerivatives(v, e, p, dp_dv, dp_de);
1608  Real T, dT_dv, dT_de;
1609  _T_from_v_e_ipol->sampleValueAndDerivatives(v, e, T, dT_dv, dT_de);
1610  Real dcv_dp, dcv_dT;
1611  cv_from_p_T(p, T, cv, dcv_dp, dcv_dT);
1612  dcv_dv = dcv_dp * dp_dv + dcv_dT * dT_dv;
1613  dcv_de = dcv_dp * dp_de + dcv_dT * dT_de;
1614  }
1615  else if (_fp)
1616  _fp->cv_from_v_e(v, e, cv, dcv_dv, dcv_de);
1617  else
1618  NeedTabulationOrFPError("cv_from_v_e with derivatives", "cv");
1619 }
const bool _create_direct_ve_interpolations
Whether the object has direct (v,e) interpolations (whether created from file or from _fp) ...
static const std::string cv
Definition: NS.h:126
std::vector< std::unique_ptr< BidimensionalInterpolation > > _property_ve_ipol
Vector of bi-dimensional interpolation of fluid properties directly in (v,e)
std::unique_ptr< BidimensionalInterpolation > _p_from_v_e_ipol
Bi-dimensional interpolation of pressure from (v,e)
std::unique_ptr< BidimensionalInterpolation > _T_from_v_e_ipol
Bi-dimensional interpolation of temperature from (v,e)
bool _construct_pT_from_ve
if the lookup table p(v, e) and T(v, e) should be constructed
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...
const SinglePhaseFluidProperties *const _fp
SinglePhaseFluidPropertiesPT UserObject.
void missingVEInterpolationError(const std::string &function_name) const
Standardized error message for missing interpolation.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
virtual Real cv_from_p_T(Real pressure, Real temperature) const override
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...

◆ e_from_p_rho() [1/3]

Real TabulatedFluidProperties::e_from_p_rho ( Real  pressure,
Real  rho 
) const
overridevirtual

Definition at line 744 of file TabulatedFluidProperties.C.

Referenced by T_from_p_rho().

745 {
746  Real e;
747  // Use v,e data, we already have v from rho
749  {
750  Real T_dummy = _T_initial_guess;
751  checkInputVariables(pressure, T_dummy);
752  auto lambda = [&](Real v, Real current_e, Real & new_p, Real & dp_dv, Real & dp_de)
753  { p_from_v_e(v, current_e, new_p, dp_dv, dp_de); };
754  const auto pair = FluidPropertiesUtils::NewtonSolve(1. / rho,
755  pressure,
756  /*initial guess*/ (_e_min + _e_max) / 2,
757  _tolerance,
758  lambda,
759  name() + "::e_from_p_rho",
762  e = pair.first;
763  }
764  // May use rho_from_p_T with derivatives in a Newton solve
765  else
766  {
768  e = e_from_p_T(pressure, T);
769  }
770  return e;
771 }
const bool _create_direct_ve_interpolations
Whether the object has direct (v,e) interpolations (whether created from file or from _fp) ...
Real _e_max
Maximum internal energy in tabulated data (can be user-specified)
Real _e_min
Minimum internal energy in tabulated data (can be user-specified)
const Real _tolerance
Newton&#39;s method may be used to convert between variable sets.
const bool _verbose_newton
Whether to output information about newton solves to console.
const std::string & name() const
std::pair< T, T > NewtonSolve(const T &x, const T &y, const Real z_initial_guess, const Real tolerance, const Functor &y_from_x_z, const std::string &caller_name, const unsigned int max_its=100, const bool verbose=false)
NewtonSolve does a 1D Newton Solve to solve the equation y = f(x, z) for variable z...
virtual Real e_from_p_T(Real pressure, Real temperature) const override
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...
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const unsigned int _max_newton_its
Maximum number of iterations for the variable conversion newton solves.
static const std::string pressure
Definition: NS.h:57
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 *...
const Real _T_initial_guess
Initial guess for temperature (or temperature used to compute the initial guess)
virtual Real T_from_p_rho(Real pressure, Real rho) const

◆ e_from_p_rho() [2/3]

ADReal TabulatedFluidProperties::e_from_p_rho ( const ADReal pressure,
const ADReal rho 
) const
overridevirtual

Definition at line 716 of file TabulatedFluidProperties.C.

717 {
718  ADReal e;
719  // Use v,e data, we already have v from rho
721  {
722  auto lambda = [&](ADReal v, ADReal current_e, ADReal & new_p, ADReal & dp_dv, ADReal & dp_de)
723  { p_from_v_e(v, current_e, new_p, dp_dv, dp_de); };
724  const auto pair = FluidPropertiesUtils::NewtonSolve(1. / rho,
725  pressure,
726  /*initial guess*/ (_e_min + _e_max) / 2,
727  _tolerance,
728  lambda,
729  name() + "::e_from_p_rho",
732  e = pair.first;
733  }
734  // May use rho_from_p_T with derivatives in a Newton solve
735  else
736  {
737  const auto T = T_from_p_rho(pressure, rho);
738  e = e_from_p_T(pressure, T);
739  }
740  return e;
741 }
const bool _create_direct_ve_interpolations
Whether the object has direct (v,e) interpolations (whether created from file or from _fp) ...
Real _e_max
Maximum internal energy in tabulated data (can be user-specified)
Real _e_min
Minimum internal energy in tabulated data (can be user-specified)
DualNumber< Real, DNDerivativeType, false > ADReal
const Real _tolerance
Newton&#39;s method may be used to convert between variable sets.
const bool _verbose_newton
Whether to output information about newton solves to console.
const std::string & name() const
std::pair< T, T > NewtonSolve(const T &x, const T &y, const Real z_initial_guess, const Real tolerance, const Functor &y_from_x_z, const std::string &caller_name, const unsigned int max_its=100, const bool verbose=false)
NewtonSolve does a 1D Newton Solve to solve the equation y = f(x, z) for variable z...
virtual Real e_from_p_T(Real pressure, Real temperature) const override
const unsigned int _max_newton_its
Maximum number of iterations for the variable conversion newton solves.
static const std::string pressure
Definition: NS.h:57
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 *...
virtual Real T_from_p_rho(Real pressure, Real rho) const

◆ e_from_p_rho() [3/3]

void TabulatedFluidProperties::e_from_p_rho ( Real  pressure,
Real  rho,
Real e,
Real de_dp,
Real de_drho 
) const
overridevirtual

Definition at line 774 of file TabulatedFluidProperties.C.

776 {
777  // get derivatives of T wrt to pressure and density
778  Real T, dT_dp, dT_drho;
779  T_from_p_rho(pressure, rho, T, dT_dp, dT_drho);
780 
781  // Get e, then derivatives of e wrt pressure and temperature
782  Real de_dp_at_const_T, de_dT;
783  e_from_p_T(pressure, T, e, de_dp_at_const_T, de_dT);
784 
785  // Get the derivatives of density wrt pressure and temperature
786  Real rho_pT, drho_dp, drho_dT;
787  rho_from_p_T(pressure, T, rho_pT, drho_dp, drho_dT);
788 
789  // derivatives of e wrt pressure and rho (what we want from e_from_p_rho)
790  de_drho = de_dT * dT_drho;
791  de_dp = de_dp_at_const_T - (de_drho * drho_dp);
792 }
virtual Real e_from_p_T(Real pressure, Real temperature) const override
virtual Real rho_from_p_T(Real pressure, Real temperature) const override
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
static const std::string pressure
Definition: NS.h:57
virtual Real T_from_p_rho(Real pressure, Real rho) const

◆ e_from_p_T() [1/3]

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

Definition at line 611 of file TabulatedFluidProperties.C.

Referenced by e_from_p_rho(), e_from_p_T(), and e_from_v_h().

612 {
614  {
618  else
619  NeedTabulationError("internal_energy");
620  }
622  {
625  auto lambda = [&](Real v, Real current_e, Real & new_T, Real & dT_dv, Real & dT_de)
626  { T_from_v_e(v, current_e, new_T, dT_dv, dT_de); };
627  const auto pair = FluidPropertiesUtils::NewtonSolve(1. / rho,
628  temperature,
629  /*initial guess*/ (_e_min + _e_max) / 2,
630  _tolerance,
631  lambda,
632  name() + "::e_from_p_T",
635  return pair.first;
636  }
637  else
638  {
639  if (_fp)
640  return _fp->e_from_p_T(pressure, temperature);
641  else
642  NeedTabulationOrFPError("e_from_p_T", "internal_energy");
643  }
644 }
const bool _create_direct_ve_interpolations
Whether the object has direct (v,e) interpolations (whether created from file or from _fp) ...
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 T_from_v_e(Real v, Real e) const override
Real _e_min
Minimum internal energy in tabulated data (can be user-specified)
static const std::string temperature
Definition: NS.h:60
const Real _tolerance
Newton&#39;s method may be used to convert between variable sets.
const bool _verbose_newton
Whether to output information about newton solves to console.
const std::string & name() const
std::pair< T, T > NewtonSolve(const T &x, const T &y, const Real z_initial_guess, const Real tolerance, const Functor &y_from_x_z, const std::string &caller_name, const unsigned int max_its=100, const bool verbose=false)
NewtonSolve does a 1D Newton Solve to solve the equation y = f(x, z) for variable z...
virtual Real rho_from_p_T(Real pressure, Real temperature) const override
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...
const SinglePhaseFluidProperties *const _fp
SinglePhaseFluidPropertiesPT UserObject.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const unsigned int _max_newton_its
Maximum number of iterations for the variable conversion newton solves.
static const std::string pressure
Definition: NS.h:57
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...
std::vector< std::unique_ptr< BidimensionalInterpolation > > _property_ipol
Vector of bi-dimensional interpolation of fluid properties.
void NeedTabulationError(const std::string &needed_property) const
Utility to forward errors related to properties being requested for tabulation, but no tabulation is ...

◆ e_from_p_T() [2/3]

ADReal TabulatedFluidProperties::e_from_p_T ( const ADReal pressure,
const ADReal temperature 
) const
overridevirtual

Definition at line 647 of file TabulatedFluidProperties.C.

648 {
650  {
651  ADReal pressure_nc = pressure, temperature_nc = temperature;
652  checkInputVariables(pressure_nc, temperature_nc);
654  return _property_ipol[_internal_energy_idx]->sample(pressure_nc, temperature_nc);
655  else
656  NeedTabulationError("internal_energy");
657  }
659  {
660  ADReal pressure_nc = pressure, temperature_nc = temperature;
661  checkInputVariables(pressure_nc, temperature_nc);
662  const ADReal rho = rho_from_p_T(pressure_nc, temperature_nc);
663  auto lambda = [&](ADReal v, ADReal current_e, ADReal & new_T, ADReal & dT_dv, ADReal & dT_de)
664  { T_from_v_e(v, current_e, new_T, dT_dv, dT_de); };
665  const auto pair = FluidPropertiesUtils::NewtonSolve(1. / rho,
666  temperature_nc,
667  /*initial guess*/ (_e_min + _e_max) / 2,
668  _tolerance,
669  lambda,
670  name() + "::e_from_p_T",
673  return pair.first;
674  }
675  else
676  {
677  if (_fp)
678  return _fp->e_from_p_T(pressure, temperature);
679  else
680  NeedTabulationOrFPError("AD e_from_p_T", "internal_energy");
681  }
682 }
const bool _create_direct_ve_interpolations
Whether the object has direct (v,e) interpolations (whether created from file or from _fp) ...
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 T_from_v_e(Real v, Real e) const override
Real _e_min
Minimum internal energy in tabulated data (can be user-specified)
static const std::string temperature
Definition: NS.h:60
DualNumber< Real, DNDerivativeType, false > ADReal
const Real _tolerance
Newton&#39;s method may be used to convert between variable sets.
const bool _verbose_newton
Whether to output information about newton solves to console.
const std::string & name() const
std::pair< T, T > NewtonSolve(const T &x, const T &y, const Real z_initial_guess, const Real tolerance, const Functor &y_from_x_z, const std::string &caller_name, const unsigned int max_its=100, const bool verbose=false)
NewtonSolve does a 1D Newton Solve to solve the equation y = f(x, z) for variable z...
virtual Real rho_from_p_T(Real pressure, Real temperature) const override
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...
const SinglePhaseFluidProperties *const _fp
SinglePhaseFluidPropertiesPT UserObject.
const unsigned int _max_newton_its
Maximum number of iterations for the variable conversion newton solves.
static const std::string pressure
Definition: NS.h:57
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...
std::vector< std::unique_ptr< BidimensionalInterpolation > > _property_ipol
Vector of bi-dimensional interpolation of fluid properties.
void NeedTabulationError(const std::string &needed_property) const
Utility to forward errors related to properties being requested for tabulation, but no tabulation is ...

◆ e_from_p_T() [3/3]

void TabulatedFluidProperties::e_from_p_T ( Real  pressure,
Real  temperature,
Real e,
Real de_dp,
Real de_dT 
) const
overridevirtual

Definition at line 685 of file TabulatedFluidProperties.C.

687 {
689  {
692  _property_ipol[_internal_energy_idx]->sampleValueAndDerivatives(
693  pressure, temperature, e, de_dp, de_dT);
694  else
695  NeedTabulationError("internal_energy");
696  }
698  {
700  // use finite differencing stencil
702  Real eps = 1e-8;
703  de_dp = (e_from_p_T(pressure * (1 + eps), temperature) - e) / (eps * pressure);
704  de_dT = (e_from_p_T(pressure, temperature * (1 + eps)) - e) / (eps * temperature);
705  }
706  else
707  {
708  if (_fp)
709  _fp->e_from_p_T(pressure, temperature, e, de_dp, de_dT);
710  else
711  NeedTabulationOrFPError("e_from_p_T with derivatives", "internal_energy");
712  }
713 }
const bool _create_direct_ve_interpolations
Whether the object has direct (v,e) interpolations (whether created from file or from _fp) ...
const bool _create_direct_pT_interpolations
Whether the object has direct (p,T) interpolations (whether created from file or from _fp) ...
const Real eps
static const std::string temperature
Definition: NS.h:60
virtual Real e_from_p_T(Real pressure, Real temperature) const override
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...
const SinglePhaseFluidProperties *const _fp
SinglePhaseFluidPropertiesPT UserObject.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
static const std::string pressure
Definition: NS.h:57
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...
std::vector< std::unique_ptr< BidimensionalInterpolation > > _property_ipol
Vector of bi-dimensional interpolation of fluid properties.
void NeedTabulationError(const std::string &needed_property) const
Utility to forward errors related to properties being requested for tabulation, but no tabulation is ...

◆ e_from_v_h() [1/2]

Real TabulatedFluidProperties::e_from_v_h ( Real  v,
Real  h 
) const
overridevirtual

Definition at line 1209 of file TabulatedFluidProperties.C.

Referenced by e_from_v_h().

1210 {
1212  {
1213  const Real p = _p_from_v_h_ipol->sample(v, h);
1214  const Real T = _T_from_v_h_ipol->sample(v, h);
1215  return e_from_p_T(p, T);
1216  }
1218  {
1219  // Lambda computes h from v and the current_e
1220  auto lambda = [&](Real v, Real current_e, Real & new_h, Real & dh_dv, Real & dh_de)
1221  { h_from_v_e(v, current_e, new_h, dh_dv, dh_de); };
1223  h,
1224  /*e initial guess*/ h - _p_initial_guess * v,
1225  _tolerance,
1226  lambda,
1227  name() + "::e_from_v_h",
1230  .first;
1231  return e;
1232  }
1233  else if (_fp)
1234  return _fp->e_from_v_h(v, h);
1235  else
1236  NeedTabulationOrFPError("e_from_v_h", "internal_energy");
1237 }
const bool _create_direct_ve_interpolations
Whether the object has direct (v,e) interpolations (whether created from file or from _fp) ...
std::unique_ptr< BidimensionalInterpolation > _p_from_v_h_ipol
Bidimensional interpolation of pressure from (v,h)
const Real _tolerance
Newton&#39;s method may be used to convert between variable sets.
const bool _verbose_newton
Whether to output information about newton solves to console.
e e e e s T T T T T rho v v T e h
const std::string & name() const
bool _construct_pT_from_vh
if the lookup table p(v, h) and T(v, h) should be constructed
std::pair< T, T > NewtonSolve(const T &x, const T &y, const Real z_initial_guess, const Real tolerance, const Functor &y_from_x_z, const std::string &caller_name, const unsigned int max_its=100, const bool verbose=false)
NewtonSolve does a 1D Newton Solve to solve the equation y = f(x, z) for variable z...
virtual Real e_from_p_T(Real pressure, Real temperature) const override
const SinglePhaseFluidProperties *const _fp
SinglePhaseFluidPropertiesPT UserObject.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const unsigned int _max_newton_its
Maximum number of iterations for the variable conversion newton solves.
const Real _p_initial_guess
Initial guess for pressure (or pressure used to compute the initial guess)
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...
std::unique_ptr< BidimensionalInterpolation > _T_from_v_h_ipol
Bi-dimensional interpolation of temperature from (v,h)

◆ e_from_v_h() [2/2]

void TabulatedFluidProperties::e_from_v_h ( Real  v,
Real  h,
Real e,
Real de_dv,
Real de_dh 
) const
overridevirtual

Definition at line 1240 of file TabulatedFluidProperties.C.

1241 {
1243  {
1244  Real p = 0, dp_dv = 0, dp_dh = 0;
1245  _p_from_v_h_ipol->sampleValueAndDerivatives(v, h, p, dp_dv, dp_dh);
1246  Real T = 0, dT_dv = 0, dT_dh = 0;
1247  _T_from_v_h_ipol->sampleValueAndDerivatives(v, h, T, dT_dv, dT_dh);
1248  Real de_dp, de_dT;
1249  e_from_p_T(p, T, e, de_dp, de_dT);
1250  de_dv = de_dp * dp_dv + de_dT * dT_dv;
1251  de_dh = de_dp * dp_dh + de_dT * dT_dh;
1252  }
1254  {
1255  // Lambda computes h from v and the current_e
1256  auto lambda = [&](Real v, Real current_e, Real & new_h, Real & dh_dv, Real & dh_de)
1257  { h_from_v_e(v, current_e, new_h, dh_dv, dh_de); };
1258  const auto e_data =
1260  h,
1261  /*e initial guess*/ h - _p_initial_guess * v,
1262  _tolerance,
1263  lambda,
1264  name() + "::e_from_v_h",
1266  _verbose_newton);
1267  e = e_data.first;
1268  // Finite difference approximation
1269  const auto e2 = e_from_v_h(v * (1 + TOLERANCE), h);
1270  de_dv = (e2 - e) / (TOLERANCE * v);
1271  de_dh = 1. / e_data.second;
1272  }
1273  else if (_fp)
1274  _fp->e_from_v_h(v, h, e, de_dv, de_dh);
1275  else
1276  NeedTabulationOrFPError("e_from_v_h", "internal_energy");
1277 }
const bool _create_direct_ve_interpolations
Whether the object has direct (v,e) interpolations (whether created from file or from _fp) ...
std::unique_ptr< BidimensionalInterpolation > _p_from_v_h_ipol
Bidimensional interpolation of pressure from (v,h)
virtual Real e_from_v_h(Real v, Real h) const override
const Real _tolerance
Newton&#39;s method may be used to convert between variable sets.
const bool _verbose_newton
Whether to output information about newton solves to console.
e e e e s T T T T T rho v v T e h
const std::string & name() const
bool _construct_pT_from_vh
if the lookup table p(v, h) and T(v, h) should be constructed
std::pair< T, T > NewtonSolve(const T &x, const T &y, const Real z_initial_guess, const Real tolerance, const Functor &y_from_x_z, const std::string &caller_name, const unsigned int max_its=100, const bool verbose=false)
NewtonSolve does a 1D Newton Solve to solve the equation y = f(x, z) for variable z...
virtual Real e_from_p_T(Real pressure, Real temperature) const override
const SinglePhaseFluidProperties *const _fp
SinglePhaseFluidPropertiesPT UserObject.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const unsigned int _max_newton_its
Maximum number of iterations for the variable conversion newton solves.
const Real _p_initial_guess
Initial guess for pressure (or pressure used to compute the initial guess)
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...
std::unique_ptr< BidimensionalInterpolation > _T_from_v_h_ipol
Bi-dimensional interpolation of temperature from (v,h)

◆ 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 IdealGasFluidProperties, CaloricallyImperfectGas, and StiffenedGasFluidProperties.

Definition at line 483 of file SinglePhaseFluidProperties.C.

484 {
485  mooseError(__PRETTY_FUNCTION__, " not implemented.");
486 }
void mooseError(Args &&... args) const

◆ execute()

virtual void FluidProperties::execute ( )
inlinefinalvirtualinherited

Implements ThreadedGeneralUserObject.

Definition at line 33 of file FluidProperties.h.

33 {}

◆ finalize()

virtual void FluidProperties::finalize ( )
inlinefinalvirtualinherited

Implements ThreadedGeneralUserObject.

Definition at line 35 of file FluidProperties.h.

35 {}

◆ fluidName()

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

Fluid name.

Returns
string representing fluid name

Reimplemented from SinglePhaseFluidProperties.

Definition at line 379 of file TabulatedFluidProperties.C.

380 {
381  if (_fp)
382  return _fp->fluidName();
383  else
384  return "TabulationFromFile";
385 }
const SinglePhaseFluidProperties *const _fp
SinglePhaseFluidPropertiesPT UserObject.
e e e e s T T T T T rho v v T e p T T virtual T std::string fluidName() const
Fluid name.

◆ g_from_v_e()

Real TabulatedFluidProperties::g_from_v_e ( Real  v,
Real  e 
) const
overridevirtual

Definition at line 1762 of file TabulatedFluidProperties.C.

1763 {
1764  if (!_construct_pT_from_ve &&
1767  missingVEInterpolationError(__PRETTY_FUNCTION__);
1769 
1770  Real h, T = 0, s;
1772  {
1773  s = _property_ve_ipol[_entropy_idx]->sample(v, e);
1774  h = _property_ve_ipol[_enthalpy_idx]->sample(v, e);
1775  T = _property_ve_ipol[_T_idx]->sample(v, e);
1776  }
1778  {
1779  Real p0 = _p_initial_guess;
1780  Real T0 = _T_initial_guess;
1781  Real p = 0;
1782  bool conversion_succeeded;
1783  p_T_from_v_e(v, e, p0, T0, p, T, conversion_succeeded);
1784  s = s_from_p_T(p, T);
1785  h = h_from_p_T(p, T);
1786  }
1787  else
1788  mooseError(__PRETTY_FUNCTION__,
1789  "\nNo tabulation or fluid property 'input_fp' object to compute value");
1790  return h - T * s;
1791 }
const bool _create_direct_ve_interpolations
Whether the object has direct (v,e) interpolations (whether created from file or from _fp) ...
const unsigned int invalid_uint
const bool _create_direct_pT_interpolations
Whether the object has direct (p,T) interpolations (whether created from file or from _fp) ...
virtual Real s_from_p_T(Real pressure, Real temperature) const override
std::vector< std::unique_ptr< BidimensionalInterpolation > > _property_ve_ipol
Vector of bi-dimensional interpolation of fluid properties directly in (v,e)
void p_T_from_v_e(const CppType &v, const CppType &e, Real p0, Real T0, CppType &p, CppType &T, bool &conversion_succeeded) const
Determines (p,T) from (v,e) using Newton Solve in 2D Useful for conversion between different sets of ...
bool _construct_pT_from_ve
if the lookup table p(v, e) and T(v, e) should be constructed
e e e e s T T T T T rho v v T e h
virtual Real h_from_p_T(Real p, Real T) const override
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...
const SinglePhaseFluidProperties *const _fp
SinglePhaseFluidPropertiesPT UserObject.
void missingVEInterpolationError(const std::string &function_name) const
Standardized error message for missing interpolation.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const Real _p_initial_guess
Initial guess for pressure (or pressure used to compute the initial guess)
void mooseError(Args &&... args) const
const Real _T_initial_guess
Initial guess for temperature (or temperature used to compute the initial guess)

◆ 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 2051 of file TabulatedFluidProperties.C.

Referenced by initialSetup().

2052 {
2053  mooseAssert(_fp, "We should not try to generate (p,T) tabulated data without a _fp user object");
2054  _pressure.resize(_num_p);
2055  _temperature.resize(_num_T);
2056 
2057  // Generate data for all properties entered in input file
2060 
2061  for (std::size_t i = 0; i < _interpolated_properties_enum.size(); ++i)
2063 
2064  for (const auto i : index_range(_properties))
2065  _properties[i].resize(_num_p * _num_T);
2066 
2067  // Temperature is divided equally into _num_T segments
2068  Real delta_T = (_temperature_max - _temperature_min) / static_cast<Real>(_num_T - 1);
2069 
2070  for (unsigned int j = 0; j < _num_T; ++j)
2071  _temperature[j] = _temperature_min + j * delta_T;
2072 
2073  // Divide the pressure into _num_p equal segments
2074  Real delta_p = (_pressure_max - _pressure_min) / static_cast<Real>(_num_p - 1);
2075 
2076  for (unsigned int i = 0; i < _num_p; ++i)
2077  _pressure[i] = _pressure_min + i * delta_p;
2078 
2079  // Generate the tabulated data at the pressure and temperature points
2080  for (const auto i : index_range(_properties))
2081  {
2082  if (_interpolated_properties[i] == "density")
2083  for (unsigned int p = 0; p < _num_p; ++p)
2084  for (unsigned int t = 0; t < _num_T; ++t)
2085  _properties[i][p * _num_T + t] = _fp->rho_from_p_T(_pressure[p], _temperature[t]);
2086 
2087  if (_interpolated_properties[i] == "enthalpy")
2088  for (unsigned int p = 0; p < _num_p; ++p)
2089  for (unsigned int t = 0; t < _num_T; ++t)
2090  _properties[i][p * _num_T + t] = _fp->h_from_p_T(_pressure[p], _temperature[t]);
2091 
2092  if (_interpolated_properties[i] == "internal_energy")
2093  for (unsigned int p = 0; p < _num_p; ++p)
2094  for (unsigned int t = 0; t < _num_T; ++t)
2095  _properties[i][p * _num_T + t] = _fp->e_from_p_T(_pressure[p], _temperature[t]);
2096 
2097  if (_interpolated_properties[i] == "viscosity")
2098  for (unsigned int p = 0; p < _num_p; ++p)
2099  for (unsigned int t = 0; t < _num_T; ++t)
2100  _properties[i][p * _num_T + t] = _fp->mu_from_p_T(_pressure[p], _temperature[t]);
2101 
2102  if (_interpolated_properties[i] == "k")
2103  for (unsigned int p = 0; p < _num_p; ++p)
2104  for (unsigned int t = 0; t < _num_T; ++t)
2105  _properties[i][p * _num_T + t] = _fp->k_from_p_T(_pressure[p], _temperature[t]);
2106 
2107  if (_interpolated_properties[i] == "c")
2108  for (unsigned int p = 0; p < _num_p; ++p)
2109  for (unsigned int t = 0; t < _num_T; ++t)
2110  _properties[i][p * _num_T + t] = _fp->c_from_p_T(_pressure[p], _temperature[t]);
2111 
2112  if (_interpolated_properties[i] == "cv")
2113  for (unsigned int p = 0; p < _num_p; ++p)
2114  for (unsigned int t = 0; t < _num_T; ++t)
2115  _properties[i][p * _num_T + t] = _fp->cv_from_p_T(_pressure[p], _temperature[t]);
2116 
2117  if (_interpolated_properties[i] == "cp")
2118  for (unsigned int p = 0; p < _num_p; ++p)
2119  for (unsigned int t = 0; t < _num_T; ++t)
2120  _properties[i][p * _num_T + t] = _fp->cp_from_p_T(_pressure[p], _temperature[t]);
2121 
2122  if (_interpolated_properties[i] == "entropy")
2123  for (unsigned int p = 0; p < _num_p; ++p)
2124  for (unsigned int t = 0; t < _num_T; ++t)
2125  _properties[i][p * _num_T + t] = _fp->s_from_p_T(_pressure[p], _temperature[t]);
2126  }
2127 }
Real _temperature_max
Maximum temperature in tabulated data.
Real _pressure_max
Maximum pressure in tabulated data.
unsigned int size() const
MultiMooseEnum _interpolated_properties_enum
Properties to be interpolated entered in the input file.
Real _temperature_min
Minimum temperature in tabulated data.
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.
const SinglePhaseFluidProperties *const _fp
SinglePhaseFluidPropertiesPT UserObject.
Real _pressure_min
Minimum pressure in tabulated data.
std::vector< std::vector< Real > > _properties
Tabulated fluid properties (read from file OR computed from _fp)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
unsigned int _num_p
Number of pressure points in the tabulated data.
static const std::complex< double > j(0, 1)
Complex number "j" (also known as "i")
auto index_range(const T &sizable)

◆ generateVETabulatedData()

void TabulatedFluidProperties::generateVETabulatedData ( )
protectedvirtual

Generates a table of fluid properties by looping over specific volume and internal energy and calculating properties using the FluidProperties UserObject _fp.

Definition at line 2130 of file TabulatedFluidProperties.C.

Referenced by initialSetup().

2131 {
2132  mooseAssert(_fp, "We should not try to generate (v,e) tabulated data without a _fp user object");
2133  _specific_volume.resize(_num_v);
2134  _internal_energy.resize(_num_e);
2135 
2136  // Generate data for all properties entered in input file
2139 
2140  // This is filled from the user input, so it does not matter than this operation is performed
2141  // for both the (p,T) and (v,e) tabulated data generation
2142  for (std::size_t i = 0; i < _interpolated_properties_enum.size(); ++i)
2144 
2145  for (const auto i : index_range(_properties_ve))
2146  _properties_ve[i].resize(_num_v * _num_e);
2147 
2148  // Grids in (v,e) are not read, so we either use user input or rely on (p,T) data
2150 
2151  // Generate the tabulated data at the pressure and temperature points
2152  for (const auto i : index_range(_properties_ve))
2153  {
2154  if (_interpolated_properties[i] == "density")
2155  for (unsigned int v = 0; v < _num_v; ++v)
2156  for (unsigned int e = 0; e < _num_e; ++e)
2157  _properties_ve[i][v * _num_e + e] = 1. / _specific_volume[v];
2158 
2159  if (_interpolated_properties[i] == "enthalpy")
2160  for (unsigned int v = 0; v < _num_v; ++v)
2161  for (unsigned int e = 0; e < _num_e; ++e)
2162  _properties_ve[i][v * _num_e + e] =
2163  _fp->h_from_v_e(_specific_volume[v], _internal_energy[e]);
2164 
2165  if (_interpolated_properties[i] == "internal_energy")
2166  for (unsigned int v = 0; v < _num_v; ++v)
2167  for (unsigned int e = 0; e < _num_e; ++e)
2168  _properties_ve[i][v * _num_e + e] = _internal_energy[e];
2169 
2170  if (_interpolated_properties[i] == "viscosity")
2171  for (unsigned int v = 0; v < _num_v; ++v)
2172  for (unsigned int e = 0; e < _num_e; ++e)
2173  _properties_ve[i][v * _num_e + e] =
2174  _fp->mu_from_v_e(_specific_volume[v], _internal_energy[e]);
2175 
2176  if (_interpolated_properties[i] == "k")
2177  for (unsigned int v = 0; v < _num_v; ++v)
2178  for (unsigned int e = 0; e < _num_e; ++e)
2179  _properties_ve[i][v * _num_e + e] =
2180  _fp->k_from_v_e(_specific_volume[v], _internal_energy[e]);
2181 
2182  if (_interpolated_properties[i] == "c")
2183  for (unsigned int v = 0; v < _num_v; ++v)
2184  for (unsigned int e = 0; e < _num_e; ++e)
2185  _properties_ve[i][v * _num_e + e] =
2186  _fp->c_from_v_e(_specific_volume[v], _internal_energy[e]);
2187 
2188  if (_interpolated_properties[i] == "cv")
2189  for (unsigned int v = 0; v < _num_v; ++v)
2190  for (unsigned int e = 0; e < _num_e; ++e)
2191  _properties_ve[i][v * _num_e + e] =
2192  _fp->cv_from_v_e(_specific_volume[v], _internal_energy[e]);
2193 
2194  if (_interpolated_properties[i] == "cp")
2195  for (unsigned int v = 0; v < _num_v; ++v)
2196  for (unsigned int e = 0; e < _num_e; ++e)
2197  _properties_ve[i][v * _num_e + e] =
2198  _fp->cp_from_v_e(_specific_volume[v], _internal_energy[e]);
2199 
2200  if (_interpolated_properties[i] == "entropy")
2201  for (unsigned int v = 0; v < _num_v; ++v)
2202  for (unsigned int e = 0; e < _num_e; ++e)
2203  _properties_ve[i][v * _num_e + e] =
2204  _fp->s_from_v_e(_specific_volume[v], _internal_energy[e]);
2205 
2206  if (_interpolated_properties[i] == "pressure")
2207  for (unsigned int v = 0; v < _num_v; ++v)
2208  for (unsigned int e = 0; e < _num_e; ++e)
2209  _properties_ve[i][v * _num_e + e] =
2210  _fp->p_from_v_e(_specific_volume[v], _internal_energy[e]);
2211 
2212  if (_interpolated_properties[i] == "temperature")
2213  for (unsigned int v = 0; v < _num_v; ++v)
2214  for (unsigned int e = 0; e < _num_e; ++e)
2215  _properties_ve[i][v * _num_e + e] =
2216  _fp->T_from_v_e(_specific_volume[v], _internal_energy[e]);
2217  }
2218 }
unsigned int size() const
MultiMooseEnum _interpolated_properties_enum
Properties to be interpolated entered in the input file.
unsigned int _num_v
Number of specific volume points in the tabulated data.
std::vector< std::string > _interpolated_properties
List of properties to be interpolated.
const SinglePhaseFluidProperties *const _fp
SinglePhaseFluidPropertiesPT UserObject.
std::vector< std::vector< Real > > _properties_ve
Tabulated fluid properties in (v,e) (read from file OR computed from _fp)
std::vector< Real > _specific_volume
Specific volume vector.
std::vector< Real > _internal_energy
Specific internal energy vector.
auto index_range(const T &sizable)
unsigned int _num_e
Number of internal energy points in tabulated data.

◆ h_from_p_T() [1/3]

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

Definition at line 904 of file TabulatedFluidProperties.C.

Referenced by g_from_v_e(), and T_from_p_h().

905 {
907  {
912  {
913  Real v, e;
915  return _property_ve_ipol[_enthalpy_idx]->sample(v, e);
916  }
917  else
918  NeedTabulationError("enthalpy");
919  }
920  else
921  {
922  if (_fp)
923  return _fp->h_from_p_T(pressure, temperature);
924  else
925  NeedTabulationOrFPError("h_from_p_T", "enthalpy");
926  }
927 }
const bool _create_direct_ve_interpolations
Whether the object has direct (v,e) interpolations (whether created from file or from _fp) ...
const bool _create_direct_pT_interpolations
Whether the object has direct (p,T) interpolations (whether created from file or from _fp) ...
static const std::string temperature
Definition: NS.h:60
void v_e_from_p_T(const CppType &p, const CppType &T, CppType &v, CppType &e) const
std::vector< std::unique_ptr< BidimensionalInterpolation > > _property_ve_ipol
Vector of bi-dimensional interpolation of fluid properties directly in (v,e)
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...
const SinglePhaseFluidProperties *const _fp
SinglePhaseFluidPropertiesPT UserObject.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
static const std::string pressure
Definition: NS.h:57
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...
std::vector< std::unique_ptr< BidimensionalInterpolation > > _property_ipol
Vector of bi-dimensional interpolation of fluid properties.
void NeedTabulationError(const std::string &needed_property) const
Utility to forward errors related to properties being requested for tabulation, but no tabulation is ...

◆ h_from_p_T() [2/3]

ADReal TabulatedFluidProperties::h_from_p_T ( const ADReal pressure,
const ADReal temperature 
) const
overridevirtual

Definition at line 930 of file TabulatedFluidProperties.C.

931 {
933  {
934  ADReal pressure_nc = pressure, temperature_nc = temperature;
935  checkInputVariables(pressure_nc, temperature_nc);
937  return _property_ipol[_enthalpy_idx]->sample(pressure_nc, temperature_nc);
939  {
940  ADReal v, e;
941  SinglePhaseFluidProperties::v_e_from_p_T(pressure_nc, temperature_nc, v, e);
942  return _property_ve_ipol[_enthalpy_idx]->sample(v, e);
943  }
944  else
945  NeedTabulationError("enthalpy");
946  }
947  else if (_fp) // Assuming _fp can handle ADReal types
948  return _fp->h_from_p_T(pressure, temperature);
949  else
950  NeedTabulationOrFPError("AD h_from_p_T", "enthalpy");
951 }
const bool _create_direct_ve_interpolations
Whether the object has direct (v,e) interpolations (whether created from file or from _fp) ...
const bool _create_direct_pT_interpolations
Whether the object has direct (p,T) interpolations (whether created from file or from _fp) ...
static const std::string temperature
Definition: NS.h:60
void v_e_from_p_T(const CppType &p, const CppType &T, CppType &v, CppType &e) const
DualNumber< Real, DNDerivativeType, false > ADReal
std::vector< std::unique_ptr< BidimensionalInterpolation > > _property_ve_ipol
Vector of bi-dimensional interpolation of fluid properties directly in (v,e)
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...
const SinglePhaseFluidProperties *const _fp
SinglePhaseFluidPropertiesPT UserObject.
static const std::string pressure
Definition: NS.h:57
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...
std::vector< std::unique_ptr< BidimensionalInterpolation > > _property_ipol
Vector of bi-dimensional interpolation of fluid properties.
void NeedTabulationError(const std::string &needed_property) const
Utility to forward errors related to properties being requested for tabulation, but no tabulation is ...

◆ h_from_p_T() [3/3]

void TabulatedFluidProperties::h_from_p_T ( Real  pressure,
Real  temperature,
Real h,
Real dh_dp,
Real dh_dT 
) const
overridevirtual

Definition at line 954 of file TabulatedFluidProperties.C.

956 {
958  {
961  _property_ipol[_enthalpy_idx]->sampleValueAndDerivatives(
962  pressure, temperature, h, dh_dp, dh_dT);
964  {
965  Real v, e, dv_dp, dv_dT, de_dp, de_dT;
967  pressure, temperature, v, dv_dp, dv_dT, e, de_dp, de_dT);
968  Real dh_dv, dh_de;
969  _property_ve_ipol[_enthalpy_idx]->sampleValueAndDerivatives(v, e, h, dh_dv, dh_de);
970  dh_dp = dh_dv * dv_dp + dh_de * de_dp;
971  dh_dT = dh_dv * dv_dT + dh_de * de_dT;
972  }
973  else
974  NeedTabulationError("enthalpy");
975  }
976  else
977  {
978  if (_fp)
979  _fp->h_from_p_T(pressure, temperature, h, dh_dp, dh_dT);
980  else
981  NeedTabulationOrFPError("h_from_p_T with derivatives", "enthalpy");
982  }
983 }
const bool _create_direct_ve_interpolations
Whether the object has direct (v,e) interpolations (whether created from file or from _fp) ...
const bool _create_direct_pT_interpolations
Whether the object has direct (p,T) interpolations (whether created from file or from _fp) ...
static const std::string temperature
Definition: NS.h:60
void v_e_from_p_T(const CppType &p, const CppType &T, CppType &v, CppType &e) const
std::vector< std::unique_ptr< BidimensionalInterpolation > > _property_ve_ipol
Vector of bi-dimensional interpolation of fluid properties directly in (v,e)
e e e e s T T T T T rho v v T e h
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...
const SinglePhaseFluidProperties *const _fp
SinglePhaseFluidPropertiesPT UserObject.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
static const std::string pressure
Definition: NS.h:57
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...
std::vector< std::unique_ptr< BidimensionalInterpolation > > _property_ipol
Vector of bi-dimensional interpolation of fluid properties.
void NeedTabulationError(const std::string &needed_property) const
Utility to forward errors related to properties being requested for tabulation, but no tabulation is ...

◆ henryCoefficients()

std::vector< Real > TabulatedFluidProperties::henryCoefficients ( ) const
overridevirtual

The following routines are simply forwarded to the 'fp' companion FluidProperties as they are not included in the tabulations presently.

Reimplemented from SinglePhaseFluidProperties.

Definition at line 1280 of file TabulatedFluidProperties.C.

1281 {
1282  if (_fp)
1283  return _fp->henryCoefficients();
1284  else
1285  TabulationNotImplementedError("henryCoefficients");
1286 }
virtual std::vector< Real > henryCoefficients() const
Henry&#39;s law coefficients for dissolution in water.
const SinglePhaseFluidProperties *const _fp
SinglePhaseFluidPropertiesPT UserObject.
void TabulationNotImplementedError(const std::string &desired_routine) const
Utility to forward errors related to fluid properties methods not implemented.

◆ initialize()

virtual void FluidProperties::initialize ( )
inlinefinalvirtualinherited

Implements ThreadedGeneralUserObject.

Definition at line 34 of file FluidProperties.h.

34 {}

◆ initialSetup()

void TabulatedFluidProperties::initialSetup ( )
overridevirtual

Reimplemented from ThreadedGeneralUserObject.

Definition at line 319 of file TabulatedFluidProperties.C.

320 {
322  return;
323  _initial_setup_done = true;
324 
326  {
327  // If the user specified a (p, T) tabulation to read, use that
328  if (!_file_name_in.empty())
330  else
331  {
332  if (!_fp)
333  paramError("create_pT_interpolations",
334  "No FluidProperties (specified with 'input_fp' parameter) exists. Either "
335  "specify a 'input_fp' or "
336  "specify a (p, T) tabulation file with the 'fluid_property_file' parameter");
337  _console << name() + ": Generating (p, T) tabulated data\n";
338  _console << std::flush;
339 
341  }
342  }
343 
345  {
346  // If the user specified a (v, e) tabulation to read, use that
347  if (!_file_name_ve_in.empty())
348  readFileTabulationData(false);
349  else
350  {
351  if (!_fp)
352  paramError("create_ve_interpolations",
353  "No FluidProperties (specified with 'input_fp' parameter) exists. Either "
354  "specify a 'input_fp' or "
355  "specify a (v, e) tabulation file with the 'fluid_property_ve_file' parameter");
356  _console << name() + ": Generating (v, e) tabulated data\n";
357  _console << std::flush;
358 
360  }
361  }
362 
365 
366  // Could be needed to get bounds computed from (p, T) bounds
369 
370  // Write tabulated data to file
371  if (_save_file)
372  {
373  _console << name() + ": Writing tabulated data to " << _file_name_out << "\n";
375  }
376 }
FileName _file_name_ve_in
File name of input (v,e) tabulated data file.
void readFileTabulationData(bool use_pT)
Read tabulation data from file.
const bool _create_direct_ve_interpolations
Whether the object has direct (v,e) interpolations (whether created from file or from _fp) ...
void paramError(const std::string &param, Args... args) const
const bool _create_direct_pT_interpolations
Whether the object has direct (p,T) interpolations (whether created from file or from _fp) ...
void computePropertyIndicesInInterpolationVectors()
Retrieves the index for each property in the vector of interpolations.
const std::string & name() const
FileName _file_name_out
File name of output tabulated data file.
virtual void generateVETabulatedData()
Generates a table of fluid properties by looping over specific volume and internal energy and calcula...
bool _initial_setup_done
keeps track of whether initialSetup has been performed
const SinglePhaseFluidProperties *const _fp
SinglePhaseFluidPropertiesPT UserObject.
const ConsoleStream _console
const bool _save_file
Whether to save a generated fluid properties file to disk.
virtual void generateTabulatedData()
Generates a table of fluid properties by looping over pressure and temperature and calculating proper...
virtual void constructInterpolation()=0
void writeTabulatedData(std::string file_name)
Writes tabulated data to a file.
FileName _file_name_in
File name of input tabulated data file.

◆ k_from_p_T() [1/2]

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

Definition at line 1127 of file TabulatedFluidProperties.C.

Referenced by k_from_v_e().

1128 {
1130  {
1132  return _property_ipol[_k_idx]->sample(pressure, temperature);
1133  }
1134  else
1135  {
1136  if (_fp)
1137  return _fp->k_from_p_T(pressure, temperature);
1138  else
1139  NeedTabulationOrFPError("k_from_p_T", "k");
1140  }
1141 }
const bool _create_direct_pT_interpolations
Whether the object has direct (p,T) interpolations (whether created from file or from _fp) ...
static const std::string temperature
Definition: NS.h:60
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...
const SinglePhaseFluidProperties *const _fp
SinglePhaseFluidPropertiesPT UserObject.
static const std::string pressure
Definition: NS.h:57
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...
std::vector< std::unique_ptr< BidimensionalInterpolation > > _property_ipol
Vector of bi-dimensional interpolation of fluid properties.

◆ 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

Definition at line 1144 of file TabulatedFluidProperties.C.

1146 {
1148  {
1150  return _property_ipol[_k_idx]->sampleValueAndDerivatives(
1151  pressure, temperature, k, dk_dp, dk_dT);
1152  }
1153  else
1154  {
1155  if (_fp)
1156  return _fp->k_from_p_T(pressure, temperature, k, dk_dp, dk_dT);
1157  else
1158  NeedTabulationOrFPError("k_from_p_T with derivatives", "k");
1159  }
1160 }
const bool _create_direct_pT_interpolations
Whether the object has direct (p,T) interpolations (whether created from file or from _fp) ...
static const std::string temperature
Definition: NS.h:60
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...
const SinglePhaseFluidProperties *const _fp
SinglePhaseFluidPropertiesPT UserObject.
static const std::string pressure
Definition: NS.h:57
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...
std::vector< std::unique_ptr< BidimensionalInterpolation > > _property_ipol
Vector of bi-dimensional interpolation of fluid properties.
static const std::string k
Definition: NS.h:134

◆ k_from_v_e() [1/2]

Real TabulatedFluidProperties::k_from_v_e ( Real  v,
Real  e 
) const
overridevirtual

Definition at line 1669 of file TabulatedFluidProperties.C.

Referenced by writeTabulatedData().

1670 {
1672  missingVEInterpolationError(__PRETTY_FUNCTION__);
1674 
1676  return _property_ve_ipol[_k_idx]->sample(v, e);
1677  else if (_construct_pT_from_ve)
1678  {
1679  Real T = _T_from_v_e_ipol->sample(v, e);
1680  Real p = _p_from_v_e_ipol->sample(v, e);
1681  return k_from_p_T(p, T);
1682  }
1683  else if (_fp)
1684  return _fp->k_from_v_e(v, e);
1685  else
1686  NeedTabulationOrFPError("k_from_v_e", "k");
1687 }
virtual Real k_from_p_T(Real pressure, Real temperature) const override
const bool _create_direct_ve_interpolations
Whether the object has direct (v,e) interpolations (whether created from file or from _fp) ...
std::vector< std::unique_ptr< BidimensionalInterpolation > > _property_ve_ipol
Vector of bi-dimensional interpolation of fluid properties directly in (v,e)
std::unique_ptr< BidimensionalInterpolation > _p_from_v_e_ipol
Bi-dimensional interpolation of pressure from (v,e)
std::unique_ptr< BidimensionalInterpolation > _T_from_v_e_ipol
Bi-dimensional interpolation of temperature from (v,e)
bool _construct_pT_from_ve
if the lookup table p(v, e) and T(v, e) should be constructed
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...
const SinglePhaseFluidProperties *const _fp
SinglePhaseFluidPropertiesPT UserObject.
void missingVEInterpolationError(const std::string &function_name) const
Standardized error message for missing interpolation.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
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...

◆ k_from_v_e() [2/2]

void TabulatedFluidProperties::k_from_v_e ( Real  v,
Real  e,
Real k,
Real dk_dv,
Real dk_de 
) const
overridevirtual

Definition at line 1690 of file TabulatedFluidProperties.C.

1691 {
1693  missingVEInterpolationError(__PRETTY_FUNCTION__);
1695 
1697  _property_ve_ipol[_k_idx]->sampleValueAndDerivatives(v, e, k, dk_dv, dk_de);
1698  else if (_construct_pT_from_ve)
1699  {
1700  Real p, dp_dv, dp_de;
1701  _p_from_v_e_ipol->sampleValueAndDerivatives(v, e, p, dp_dv, dp_de);
1702  Real T, dT_dv, dT_de;
1703  _T_from_v_e_ipol->sampleValueAndDerivatives(v, e, T, dT_dv, dT_de);
1704  Real dk_dp, dk_dT;
1705  k_from_p_T(p, T, k, dk_dp, dk_dT);
1706  dk_dv = dk_dp * dp_dv + dk_dT * dT_dv;
1707  dk_de = dk_dp * dp_de + dk_dT * dT_de;
1708  }
1709  else if (_fp)
1710  _fp->k_from_v_e(v, e, k, dk_dv, dk_de);
1711  else
1712  NeedTabulationOrFPError("k_from_v_e with derivatives", "k");
1713 }
virtual Real k_from_p_T(Real pressure, Real temperature) const override
const bool _create_direct_ve_interpolations
Whether the object has direct (v,e) interpolations (whether created from file or from _fp) ...
std::vector< std::unique_ptr< BidimensionalInterpolation > > _property_ve_ipol
Vector of bi-dimensional interpolation of fluid properties directly in (v,e)
std::unique_ptr< BidimensionalInterpolation > _p_from_v_e_ipol
Bi-dimensional interpolation of pressure from (v,e)
std::unique_ptr< BidimensionalInterpolation > _T_from_v_e_ipol
Bi-dimensional interpolation of temperature from (v,e)
bool _construct_pT_from_ve
if the lookup table p(v, e) and T(v, e) should be constructed
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...
const SinglePhaseFluidProperties *const _fp
SinglePhaseFluidPropertiesPT UserObject.
void missingVEInterpolationError(const std::string &function_name) const
Standardized error message for missing interpolation.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
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...
static const std::string k
Definition: NS.h:134

◆ makeZeroAndOne() [1/2]

template<typename T >
std::pair< T, T > SinglePhaseFluidProperties::makeZeroAndOne ( const T )
staticprotectedinherited

Given a type example, this method returns zero and unity representations of that type (first and second members of returned pair respectively)

Definition at line 478 of file SinglePhaseFluidProperties.h.

Referenced by SinglePhaseFluidProperties::xyDerivatives().

479 {
480  return {T{0, 0}, T{1, 0}};
481 }

◆ makeZeroAndOne() [2/2]

template<>
std::pair<Real, Real> SinglePhaseFluidProperties::makeZeroAndOne ( const Real )
inlineinherited

Definition at line 485 of file SinglePhaseFluidProperties.h.

486 {
487  return {Real{0}, Real{1}};
488 }
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

◆ missingVEInterpolationError()

void TabulatedFluidProperties::missingVEInterpolationError ( const std::string &  function_name) const
protected

Standardized error message for missing interpolation.

Definition at line 2791 of file TabulatedFluidProperties.C.

Referenced by c_from_v_e(), cp_from_v_e(), cv_from_v_e(), g_from_v_e(), k_from_v_e(), mu_from_v_e(), p_from_v_e(), s_from_v_e(), and T_from_v_e().

2792 {
2793  mooseError(function_name +
2794  ": to call this function you must:\n-add this property to the list to the list of "
2795  "'interpolated_properties'\n and then either:\n-construct (p, T) from (v, e) "
2796  "tabulations using the 'construct_pT_from_ve' parameter\n-load (v,e) interpolation "
2797  "tables using the 'fluid_property_ve_file' parameter");
2798 }
void mooseError(Args &&... args) const

◆ molarMass()

Real TabulatedFluidProperties::molarMass ( ) const
overridevirtual

Molar mass [kg/mol].

Returns
molar mass

Reimplemented from SinglePhaseFluidProperties.

Definition at line 388 of file TabulatedFluidProperties.C.

389 {
390  if (_fp)
391  return _fp->molarMass();
392  else
393  TabulationNotImplementedError("molarMass");
394 }
virtual Real molarMass() const
Molar mass [kg/mol].
const SinglePhaseFluidProperties *const _fp
SinglePhaseFluidPropertiesPT UserObject.
void TabulationNotImplementedError(const std::string &desired_routine) const
Utility to forward errors related to fluid properties methods not implemented.

◆ mu_from_p_T() [1/2]

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

Definition at line 986 of file TabulatedFluidProperties.C.

Referenced by mu_from_v_e().

987 {
989  {
992  }
993  else
994  {
995  if (_fp)
996  return _fp->mu_from_p_T(pressure, temperature);
997  else
998  NeedTabulationOrFPError("mu_from_p_T", "viscosity");
999  }
1000 }
const bool _create_direct_pT_interpolations
Whether the object has direct (p,T) interpolations (whether created from file or from _fp) ...
static const std::string temperature
Definition: NS.h:60
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...
const SinglePhaseFluidProperties *const _fp
SinglePhaseFluidPropertiesPT UserObject.
static const std::string pressure
Definition: NS.h:57
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...
std::vector< std::unique_ptr< BidimensionalInterpolation > > _property_ipol
Vector of bi-dimensional interpolation of fluid properties.

◆ 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

Definition at line 1003 of file TabulatedFluidProperties.C.

1005 {
1007  {
1009  _property_ipol[_viscosity_idx]->sampleValueAndDerivatives(
1010  pressure, temperature, mu, dmu_dp, dmu_dT);
1011  }
1012  else
1013  {
1014  if (_fp)
1015  _fp->mu_from_p_T(pressure, temperature, mu, dmu_dp, dmu_dT);
1016  else
1017  NeedTabulationOrFPError("mu_from_p_T with derivatives", "viscosity");
1018  }
1019 }
const bool _create_direct_pT_interpolations
Whether the object has direct (p,T) interpolations (whether created from file or from _fp) ...
static const std::string temperature
Definition: NS.h:60
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...
const SinglePhaseFluidProperties *const _fp
SinglePhaseFluidPropertiesPT UserObject.
static const std::string pressure
Definition: NS.h:57
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...
std::vector< std::unique_ptr< BidimensionalInterpolation > > _property_ipol
Vector of bi-dimensional interpolation of fluid properties.
const double mu

◆ mu_from_v_e() [1/2]

Real TabulatedFluidProperties::mu_from_v_e ( Real  v,
Real  e 
) const
overridevirtual

Definition at line 1622 of file TabulatedFluidProperties.C.

Referenced by writeTabulatedData().

1623 {
1625  missingVEInterpolationError(__PRETTY_FUNCTION__);
1627 
1629  return _property_ve_ipol[_viscosity_idx]->sample(v, e);
1630  else if (_construct_pT_from_ve)
1631  {
1632  Real p = _p_from_v_e_ipol->sample(v, e);
1633  Real T = _T_from_v_e_ipol->sample(v, e);
1634  return mu_from_p_T(p, T);
1635  }
1636  else if (_fp)
1637  return _fp->mu_from_v_e(v, e);
1638  else
1639  NeedTabulationOrFPError("mu_from_v_e", "viscosity");
1640 }
const bool _create_direct_ve_interpolations
Whether the object has direct (v,e) interpolations (whether created from file or from _fp) ...
std::vector< std::unique_ptr< BidimensionalInterpolation > > _property_ve_ipol
Vector of bi-dimensional interpolation of fluid properties directly in (v,e)
std::unique_ptr< BidimensionalInterpolation > _p_from_v_e_ipol
Bi-dimensional interpolation of pressure from (v,e)
std::unique_ptr< BidimensionalInterpolation > _T_from_v_e_ipol
Bi-dimensional interpolation of temperature from (v,e)
bool _construct_pT_from_ve
if the lookup table p(v, e) and T(v, e) should be constructed
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...
const SinglePhaseFluidProperties *const _fp
SinglePhaseFluidPropertiesPT UserObject.
void missingVEInterpolationError(const std::string &function_name) const
Standardized error message for missing interpolation.
virtual Real mu_from_p_T(Real pressure, Real temperature) const override
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
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...

◆ mu_from_v_e() [2/2]

void TabulatedFluidProperties::mu_from_v_e ( Real  v,
Real  e,
Real mu,
Real dmu_dv,
Real dmu_de 
) const
overridevirtual

Definition at line 1643 of file TabulatedFluidProperties.C.

1644 {
1646  missingVEInterpolationError(__PRETTY_FUNCTION__);
1648 
1650  _property_ve_ipol[_viscosity_idx]->sampleValueAndDerivatives(v, e, mu, dmu_dv, dmu_de);
1651  else if (_construct_pT_from_ve)
1652  {
1653  Real p, dp_dv, dp_de;
1654  _p_from_v_e_ipol->sampleValueAndDerivatives(v, e, p, dp_dv, dp_de);
1655  Real T, dT_dv, dT_de;
1656  _T_from_v_e_ipol->sampleValueAndDerivatives(v, e, T, dT_dv, dT_de);
1657  Real dmu_dp, dmu_dT;
1658  mu_from_p_T(p, T, mu, dmu_dp, dmu_dT);
1659  dmu_dv = dmu_dp * dp_dv + dmu_dT * dT_dv;
1660  dmu_de = dmu_dp * dp_de + dmu_dT * dT_de;
1661  }
1662  else if (_fp)
1663  _fp->mu_from_v_e(v, e, mu, dmu_dv, dmu_de);
1664  else
1665  NeedTabulationOrFPError("mu_from_v_e with derivatives", "viscosity");
1666 }
const bool _create_direct_ve_interpolations
Whether the object has direct (v,e) interpolations (whether created from file or from _fp) ...
std::vector< std::unique_ptr< BidimensionalInterpolation > > _property_ve_ipol
Vector of bi-dimensional interpolation of fluid properties directly in (v,e)
std::unique_ptr< BidimensionalInterpolation > _p_from_v_e_ipol
Bi-dimensional interpolation of pressure from (v,e)
std::unique_ptr< BidimensionalInterpolation > _T_from_v_e_ipol
Bi-dimensional interpolation of temperature from (v,e)
bool _construct_pT_from_ve
if the lookup table p(v, e) and T(v, e) should be constructed
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...
const SinglePhaseFluidProperties *const _fp
SinglePhaseFluidPropertiesPT UserObject.
void missingVEInterpolationError(const std::string &function_name) const
Standardized error message for missing interpolation.
virtual Real mu_from_p_T(Real pressure, Real temperature) const override
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
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...
const double mu

◆ NeedTabulationError()

void TabulatedFluidProperties::NeedTabulationError ( const std::string &  needed_property) const
protected

Utility to forward errors related to properties being requested for tabulation, but no tabulation is present This should generally be used as an 'else' condition to if (_interpolate_needed_property)

Definition at line 1911 of file TabulatedFluidProperties.C.

Referenced by e_from_p_T(), h_from_p_T(), and s_from_p_T().

1912 {
1913  mooseError("Property '" + needed_property +
1914  "' is marked as interpolated but neither of the following methods are active:\n- "
1915  "(p,T) interpolation created from fluid properties ('create_pT_interpolations' "
1916  "parameter)\n- a (p,T) tabulation file ('fluid_property_file')\n- (v,e) interpolation "
1917  "created from fluid properties or a (p,T) tabulation ('create_ve_interpolations' "
1918  "parameter)\n- a (v,e) tabulation file ('fluid_property_ve_file' parameter)");
1919 }
void mooseError(Args &&... args) const

◆ NeedTabulationOrFPError()

void TabulatedFluidProperties::NeedTabulationOrFPError ( const std::string &  desired_routine,
const std::string &  needed_property 
) const
protected

Utility to forward errors related to fluid properties needing more data for their computation This should generally be used as an 'else' condition to if (_interpolate_property) / else if (_fp)

Definition at line 1900 of file TabulatedFluidProperties.C.

Referenced by c_from_p_T(), c_from_v_e(), cp_from_p_T(), cp_from_v_e(), cv_from_p_T(), cv_from_v_e(), e_from_p_T(), e_from_v_h(), h_from_p_T(), k_from_p_T(), k_from_v_e(), mu_from_p_T(), mu_from_v_e(), p_from_v_e(), rho_from_p_T(), s_from_p_T(), s_from_v_e(), T_from_p_h(), T_from_p_rho(), T_from_v_e(), and v_from_p_T().

1902 {
1903  mooseError(
1904  "TabulatedFluidProperties can only call the function '" + desired_routine +
1905  "' when either:\n- the property '" + needed_property +
1906  "' is tabulated and listed in the 'interpolated_properties' parameter.\n- the 'input_fp' "
1907  "parameter is provided.");
1908 }
void mooseError(Args &&... args) const

◆ p_from_v_e() [1/3]

Real TabulatedFluidProperties::p_from_v_e ( Real  v,
Real  e 
) const
overridevirtual

Derivatives like dc_dv & dc_de are computed using the chain rule dy/dx(p,T) = dy/dp * dp/dx + dy/dT * dT/dx where y = c, cp, cv...

& x = v, e

Definition at line 1375 of file TabulatedFluidProperties.C.

Referenced by TabulatedBicubicFluidProperties::constructInterpolation(), e_from_p_rho(), v_from_p_T(), and writeTabulatedData().

1376 {
1378  missingVEInterpolationError(__PRETTY_FUNCTION__);
1380 
1382  return _property_ve_ipol[_p_idx]->sample(v, e);
1383  else if (_construct_pT_from_ve)
1384  return _p_from_v_e_ipol->sample(v, e);
1385  else if (_fp)
1386  return _fp->p_from_v_e(v, e);
1387  else
1388  NeedTabulationOrFPError("p_from_v_e", "pressure");
1389 }
const bool _create_direct_ve_interpolations
Whether the object has direct (v,e) interpolations (whether created from file or from _fp) ...
std::vector< std::unique_ptr< BidimensionalInterpolation > > _property_ve_ipol
Vector of bi-dimensional interpolation of fluid properties directly in (v,e)
std::unique_ptr< BidimensionalInterpolation > _p_from_v_e_ipol
Bi-dimensional interpolation of pressure from (v,e)
bool _construct_pT_from_ve
if the lookup table p(v, e) and T(v, e) should be constructed
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...
const SinglePhaseFluidProperties *const _fp
SinglePhaseFluidPropertiesPT UserObject.
void missingVEInterpolationError(const std::string &function_name) const
Standardized error message for missing interpolation.
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...

◆ p_from_v_e() [2/3]

void TabulatedFluidProperties::p_from_v_e ( Real  v,
Real  e,
Real p,
Real dp_dv,
Real dp_de 
) const
overridevirtual

Definition at line 1392 of file TabulatedFluidProperties.C.

1393 {
1395  missingVEInterpolationError(__PRETTY_FUNCTION__);
1397 
1399  _property_ve_ipol[_p_idx]->sampleValueAndDerivatives(v, e, p, dp_dv, dp_de);
1400  else if (_construct_pT_from_ve)
1401  _p_from_v_e_ipol->sampleValueAndDerivatives(v, e, p, dp_dv, dp_de);
1402  else if (_fp)
1403  _fp->p_from_v_e(v, e, p, dp_dv, dp_de);
1404  else
1405  NeedTabulationOrFPError("p_from_v_e with derivatives", "pressure");
1406 }
const bool _create_direct_ve_interpolations
Whether the object has direct (v,e) interpolations (whether created from file or from _fp) ...
std::vector< std::unique_ptr< BidimensionalInterpolation > > _property_ve_ipol
Vector of bi-dimensional interpolation of fluid properties directly in (v,e)
std::unique_ptr< BidimensionalInterpolation > _p_from_v_e_ipol
Bi-dimensional interpolation of pressure from (v,e)
bool _construct_pT_from_ve
if the lookup table p(v, e) and T(v, e) should be constructed
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...
const SinglePhaseFluidProperties *const _fp
SinglePhaseFluidPropertiesPT UserObject.
void missingVEInterpolationError(const std::string &function_name) const
Standardized error message for missing interpolation.
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...

◆ p_from_v_e() [3/3]

void TabulatedFluidProperties::p_from_v_e ( const ADReal v,
const ADReal e,
ADReal p,
ADReal dp_dv,
ADReal dp_de 
) const
overridevirtual

Definition at line 1409 of file TabulatedFluidProperties.C.

1411 {
1413  missingVEInterpolationError(__PRETTY_FUNCTION__);
1414  ADReal vc = v, ec = e;
1415  checkInputVariablesVE(vc, ec);
1416 
1418  _property_ve_ipol[_p_idx]->sampleValueAndDerivatives(vc, ec, p, dp_dv, dp_de);
1419  else if (_construct_pT_from_ve)
1420  _p_from_v_e_ipol->sampleValueAndDerivatives(vc, ec, p, dp_dv, dp_de);
1421  else if (_fp)
1422  _fp->p_from_v_e(vc, ec, p, dp_dv, dp_de);
1423  else
1424  NeedTabulationOrFPError("AD p_from_v_e with derivatives", "pressure");
1425 }
const bool _create_direct_ve_interpolations
Whether the object has direct (v,e) interpolations (whether created from file or from _fp) ...
DualNumber< Real, DNDerivativeType, false > ADReal
std::vector< std::unique_ptr< BidimensionalInterpolation > > _property_ve_ipol
Vector of bi-dimensional interpolation of fluid properties directly in (v,e)
std::unique_ptr< BidimensionalInterpolation > _p_from_v_e_ipol
Bi-dimensional interpolation of pressure from (v,e)
bool _construct_pT_from_ve
if the lookup table p(v, e) and T(v, e) should be constructed
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...
const SinglePhaseFluidProperties *const _fp
SinglePhaseFluidPropertiesPT UserObject.
void missingVEInterpolationError(const std::string &function_name) const
Standardized error message for missing interpolation.
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...

◆ p_T_from_h_s()

template<typename T >
void SinglePhaseFluidProperties::p_T_from_h_s ( const T h,
const T s,
Real  p0,
Real  T0,
T pressure,
T temperature,
bool &  conversion_succeeded 
) const
inherited

Determines (p,T) from (h,s) using Newton Solve in 2D Useful for conversion between different sets of state variables.

Parameters
[in]hspecific enthalpy (J / kg)
[in]sspecific entropy (J/K*kg)
[in]p0initial guess for pressure (Pa / kg)
[in]T0initial guess for temperature (K)
[out]fluidpressure (Pa / kg)
[out]Temperature(K)

Definition at line 599 of file SinglePhaseFluidProperties.h.

Referenced by T_from_h_s().

606 {
607  auto h_lambda = [&](const T & pressure, const T & temperature, T & new_h, T & dh_dp, T & dh_dT)
608  { h_from_p_T(pressure, temperature, new_h, dh_dp, dh_dT); };
609  auto s_lambda = [&](const T & pressure, const T & temperature, T & new_s, T & ds_dp, T & ds_dT)
610  { s_from_p_T(pressure, temperature, new_s, ds_dp, ds_dT); };
611  try
612  {
614  s,
615  p0,
616  T0,
617  pressure,
618  temperature,
619  _tolerance,
620  _tolerance,
621  h_lambda,
622  s_lambda,
623  "p_T_from_h_s",
626  conversion_succeeded = true;
627  }
628  catch (MooseException &)
629  {
630  conversion_succeeded = false;
631  }
632 
633  if (!conversion_succeeded)
634  mooseDoOnce(mooseWarning("Conversion from (h, s)=(", h, ", ", s, ") to (p, T) failed"));
635 }
void NewtonSolve2D(const T &f, const T &g, const Real x0, const Real y0, T &x_final, T &y_final, const Real f_tol, const Real g_tol, const Functor1 &f_from_x_y, const Functor2 &g_from_x_y, const std::string &caller_name="", const unsigned int max_its=100, bool debug=false)
NewtonSolve2D does a 2D Newton Solve to solve for the x and y such that: f = f_from_x_y(x, y) and g = g_from_x_y(x, y).
static const std::string temperature
Definition: NS.h:60
const Real _tolerance
Newton&#39;s method may be used to convert between variable sets.
const bool _verbose_newton
Whether to output information about newton solves to console.
e e e e s T T T T T rho v v T e h
const unsigned int _max_newton_its
Maximum number of iterations for the variable conversion newton solves.
static const std::string pressure
Definition: NS.h:57
void mooseWarning(Args &&... args) const

◆ p_T_from_v_e()

template<typename CppType >
void SinglePhaseFluidProperties::p_T_from_v_e ( const CppType &  v,
const CppType &  e,
Real  p0,
Real  T0,
CppType &  p,
CppType &  T,
bool &  conversion_succeeded 
) const
inherited

Determines (p,T) from (v,e) using Newton Solve in 2D Useful for conversion between different sets of state variables.

Parameters
[in]vspecific volume (m^3 / kg)
[in]especific internal energy (J / kg)
[in]p0initial guess for pressure (Pa / kg)
[in]T0initial guess for temperature (K)
[out]fluidpressure (Pa / kg)
[out]Temperature(K)

Definition at line 513 of file SinglePhaseFluidProperties.h.

Referenced by TabulatedBicubicFluidProperties::constructInterpolation(), TemperaturePressureFunctionFluidProperties::cp_from_v_e(), TemperaturePressureFunctionFluidProperties::cv_from_v_e(), g_from_v_e(), TemperaturePressureFunctionFluidProperties::k_from_v_e(), TemperaturePressureFunctionFluidProperties::mu_from_v_e(), and TemperaturePressureFunctionFluidProperties::T_from_v_e().

520 {
521  auto v_lambda = [&](const CppType & pressure,
522  const CppType & temperature,
523  CppType & new_v,
524  CppType & dv_dp,
525  CppType & dv_dT) { v_from_p_T(pressure, temperature, new_v, dv_dp, dv_dT); };
526  auto e_lambda = [&](const CppType & pressure,
527  const CppType & temperature,
528  CppType & new_e,
529  CppType & de_dp,
530  CppType & de_dT) { e_from_p_T(pressure, temperature, new_e, de_dp, de_dT); };
531  try
532  {
534  e,
535  p0,
536  T0,
537  p,
538  T,
539  _tolerance,
540  _tolerance,
541  v_lambda,
542  e_lambda,
543  "p_T_from_v_e",
546  conversion_succeeded = true;
547  }
548  catch (MooseException &)
549  {
550  conversion_succeeded = false;
551  }
552 
553  if (!conversion_succeeded)
554  mooseDoOnce(mooseWarning("Conversion from (v, e)=(", v, ", ", e, ") to (p, T) failed"));
555 }
void NewtonSolve2D(const T &f, const T &g, const Real x0, const Real y0, T &x_final, T &y_final, const Real f_tol, const Real g_tol, const Functor1 &f_from_x_y, const Functor2 &g_from_x_y, const std::string &caller_name="", const unsigned int max_its=100, bool debug=false)
NewtonSolve2D does a 2D Newton Solve to solve for the x and y such that: f = f_from_x_y(x, y) and g = g_from_x_y(x, y).
static const std::string temperature
Definition: NS.h:60
const Real _tolerance
Newton&#39;s method may be used to convert between variable sets.
const bool _verbose_newton
Whether to output information about newton solves to console.
const unsigned int _max_newton_its
Maximum number of iterations for the variable conversion newton solves.
static const std::string pressure
Definition: NS.h:57
void mooseWarning(Args &&... args) const

◆ p_T_from_v_h()

template<typename T >
void SinglePhaseFluidProperties::p_T_from_v_h ( const T v,
const T h,
Real  p0,
Real  T0,
T pressure,
T temperature,
bool &  conversion_succeeded 
) const
inherited

Determines (p,T) from (v,h) using Newton Solve in 2D Useful for conversion between different sets of state variables.

Parameters
[in]vspecific volume (m^3 / kg)
[in]hspecific enthalpy (J / kg)
[in]p0initial guess for pressure (Pa / kg)
[in]T0initial guess for temperature (K)
[out]fluidpressure (Pa / kg)
[out]Temperature(K)

Definition at line 559 of file SinglePhaseFluidProperties.h.

Referenced by TabulatedBicubicFluidProperties::constructInterpolation().

566 {
567  auto v_lambda = [&](const T & pressure, const T & temperature, T & new_v, T & dv_dp, T & dv_dT)
568  { v_from_p_T(pressure, temperature, new_v, dv_dp, dv_dT); };
569  auto h_lambda = [&](const T & pressure, const T & temperature, T & new_h, T & dh_dp, T & dh_dT)
570  { h_from_p_T(pressure, temperature, new_h, dh_dp, dh_dT); };
571  try
572  {
574  h,
575  p0,
576  T0,
577  pressure,
578  temperature,
579  _tolerance,
580  _tolerance,
581  v_lambda,
582  h_lambda,
583  "p_T_from_v_h",
586  conversion_succeeded = true;
587  }
588  catch (MooseException &)
589  {
590  conversion_succeeded = false;
591  }
592 
593  if (!conversion_succeeded)
594  mooseDoOnce(mooseWarning("Conversion from (v, h)=(", v, ", ", h, ") to (p, T) failed"));
595 }
void NewtonSolve2D(const T &f, const T &g, const Real x0, const Real y0, T &x_final, T &y_final, const Real f_tol, const Real g_tol, const Functor1 &f_from_x_y, const Functor2 &g_from_x_y, const std::string &caller_name="", const unsigned int max_its=100, bool debug=false)
NewtonSolve2D does a 2D Newton Solve to solve for the x and y such that: f = f_from_x_y(x, y) and g = g_from_x_y(x, y).
static const std::string temperature
Definition: NS.h:60
const Real _tolerance
Newton&#39;s method may be used to convert between variable sets.
const bool _verbose_newton
Whether to output information about newton solves to console.
e e e e s T T T T T rho v v T e h
const unsigned int _max_newton_its
Maximum number of iterations for the variable conversion newton solves.
static const std::string pressure
Definition: NS.h:57
void mooseWarning(Args &&... args) const

◆ propfunc() [1/12]

SinglePhaseFluidProperties::propfunc ( p  ,
v  ,
 
)
inherited

Compute a fluid property given for the state defined by two given properties.

For all functions, the first two arguments are the given properties that define the fluid state. For the two-argument variants, the desired property is the return value. The five-argument variants also provide partial derivatives dx/da and dx/db where x is the desired property being computed, a is the first given property, and b is the second given property. The desired property, dx/da, and dx/db are stored into the 3rd, 4th, and 5th arguments respectively.

Properties/parameters used in these function are listed below with their units:

p pressure [Pa] T temperature [K] e specific internal energy [J/kg] v specific volume [m^3/kg] rho density [kg/m^3] h specific enthalpy [J/kg] s specific entropy [J/(kg*K)] mu viscosity [Pa*s] k thermal conductivity [W/(m*K)] c speed of sound [m/s] cp constant-pressure specific heat [J/K] cv constant-volume specific heat [J/K] beta volumetric thermal expansion coefficient [1/K] g Gibbs free energy [J] pp_sat partial pressure at saturation [Pa] gamma Adiabatic ratio (cp/cv) [-]

As an example:

// calculate pressure given specific vol and energy: auto pressure = your_fluid_properties_object.p_from_v_e(specific_vol, specific_energy);

// or use the derivative variant: Real dp_dv = 0; // derivative will be stored into here Real dp_de = 0; // derivative will be stored into here your_fluid_properties_object.p_from_v_e(specific_vol, specific_energy, pressure, dp_dv, dp_de);

Automatic differentiation (AD) support is provided through x_from_a_b(ADReal a, ADReal b) and x_from_a_b(ADReal a, ADReal b, ADReal x, ADReal dx_da, ADReal dx_db) versions of the functions where a and b must be ADReal/DualNumber's calculated using all AD-supporting values:

auto v = 1/rho; // rho must be an AD non-linear variable. auto e = rhoE/rho - vel_energy; // rhoE and vel_energy must be AD variables/numbers also. auto pressure = your_fluid_properties_object.p_from_v_e(v, e); // pressure now contains partial derivatives w.r.t. all degrees of freedom

◆ propfunc() [2/12]

e SinglePhaseFluidProperties::propfunc ( c  ,
v  ,
 
)
inherited

◆ propfunc() [3/12]

e e SinglePhaseFluidProperties::propfunc ( cv  ,
v  ,
 
)
inherited

◆ propfunc() [4/12]

e e e SinglePhaseFluidProperties::propfunc ( ,
v  ,
 
)
inherited

◆ propfunc() [5/12]

e e e e SinglePhaseFluidProperties::propfunc ( ,
h  ,
p   
)
inherited

◆ propfunc() [6/12]

e e e e s SinglePhaseFluidProperties::propfunc ( ,
v  ,
h   
)
inherited

◆ propfunc() [7/12]

e e e e s T SinglePhaseFluidProperties::propfunc ( pp_sat  ,
p  ,
T   
)
inherited

◆ propfunc() [8/12]

e e e e s T T SinglePhaseFluidProperties::propfunc ( ,
rho  ,
T   
)
inherited

◆ propfunc() [9/12]

e e e e s T T T T T SinglePhaseFluidProperties::propfunc ( rho  ,
p  ,
T   
)
inherited

◆ propfunc() [10/12]

e e e e s T T T T T rho SinglePhaseFluidProperties::propfunc ( ,
T  ,
v   
)
inherited

◆ propfunc() [11/12]

e e e e s T T T T T rho v SinglePhaseFluidProperties::propfunc ( h  ,
T  ,
v   
)
inherited

◆ propfunc() [12/12]

e e e e s T T T T T rho v v SinglePhaseFluidProperties::propfunc ( cv  ,
T  ,
v   
)
inherited

◆ propfuncWithDefault() [1/7]

e e e e s T T T SinglePhaseFluidProperties::propfuncWithDefault ( cp  ,
p  ,
T   
)
inherited

◆ propfuncWithDefault() [2/7]

e e e e s T T T T SinglePhaseFluidProperties::propfuncWithDefault ( mu  ,
p  ,
T   
)
inherited

◆ propfuncWithDefault() [3/7]

e e e e s T T T T T rho v v T SinglePhaseFluidProperties::propfuncWithDefault ( h  ,
v  ,
 
)
inherited

◆ propfuncWithDefault() [4/7]

e e e e s T T T T T rho v v T e SinglePhaseFluidProperties::propfuncWithDefault ( p  ,
h  ,
 
)
inherited

◆ propfuncWithDefault() [5/7]

e e e e s T T T T T rho v v T e p SinglePhaseFluidProperties::propfuncWithDefault ( T  ,
p  ,
h   
)
inherited

◆ propfuncWithDefault() [6/7]

e e e e s T T T T T rho v v T e p T SinglePhaseFluidProperties::propfuncWithDefault ( v  ,
p  ,
T   
)
inherited

◆ propfuncWithDefault() [7/7]

e e e e s T T T T T rho v v T e p T T SinglePhaseFluidProperties::propfuncWithDefault ( gamma  ,
v  ,
 
)
inherited

◆ readFileTabulationData()

void TabulatedFluidProperties::readFileTabulationData ( bool  use_pT)
protected

Read tabulation data from file.

Definition at line 2335 of file TabulatedFluidProperties.C.

Referenced by initialSetup().

2336 {
2337  std::string file_name;
2338  if (use_pT)
2339  {
2340  _console << name() + ": Reading tabulated properties from " << _file_name_in << std::endl;
2341  _csv_reader.read();
2342  file_name = _file_name_in;
2343  }
2344  else
2345  {
2346  _console << name() + ": Reading tabulated properties from " << _file_name_ve_in << std::endl;
2348  _csv_reader.read();
2349  file_name = _file_name_ve_in;
2350  }
2351 
2352  const std::vector<std::string> & column_names = _csv_reader.getNames();
2353 
2354  // These columns form the grid and must be present in the file
2355  std::vector<std::string> required_columns;
2356  if (use_pT)
2357  required_columns = {"pressure", "temperature"};
2358  else
2359  required_columns = {"specific_volume", "internal_energy"};
2360 
2361  // Check that all required columns are present
2362  for (std::size_t i = 0; i < required_columns.size(); ++i)
2363  {
2364  if (std::find(column_names.begin(), column_names.end(), required_columns[i]) ==
2365  column_names.end())
2366  mooseError("No ",
2367  required_columns[i],
2368  " data read in ",
2369  file_name,
2370  ". A column named ",
2371  required_columns[i],
2372  " must be present");
2373  }
2374 
2375  // These columns can be present in the file
2376  std::vector<std::string> property_columns = {
2377  "density", "enthalpy", "viscosity", "k", "c", "cv", "cp", "entropy"};
2378  if (use_pT)
2379  property_columns.push_back("internal_energy");
2380  else
2381  {
2382  property_columns.push_back("pressure");
2383  property_columns.push_back("temperature");
2384  }
2385 
2386  // Check that any property names read from the file are present in the list of possible
2387  // properties, and if they are, add them to the list of read properties
2388  for (std::size_t i = 0; i < column_names.size(); ++i)
2389  {
2390  // Only check properties not in _required_columns
2391  if (std::find(required_columns.begin(), required_columns.end(), column_names[i]) ==
2392  required_columns.end())
2393  {
2394  if (std::find(property_columns.begin(), property_columns.end(), column_names[i]) ==
2395  property_columns.end())
2396  mooseWarning(column_names[i],
2397  " read in ",
2398  file_name,
2399  " tabulation file is not one of the properties that TabulatedFluidProperties "
2400  "understands. It will be ignored.");
2401  // We could be reading a (v,e) tabulation after having read a (p,T) tabulation, do not
2402  // insert twice
2403  // Also only allow properties specified as interpolated if user passed the parameter
2404  else if (std::find(_interpolated_properties.begin(),
2406  column_names[i]) == _interpolated_properties.end() &&
2407  (!isParamSetByUser("interpolated_properties") ||
2408  _interpolated_properties_enum.contains(column_names[i])))
2409  _interpolated_properties.push_back(column_names[i]);
2410  }
2411  }
2412 
2413  std::map<std::string, unsigned int> data_index;
2414  for (std::size_t i = 0; i < column_names.size(); ++i)
2415  {
2416  auto it = std::find(column_names.begin(), column_names.end(), column_names[i]);
2417  data_index[column_names[i]] = std::distance(column_names.begin(), it);
2418  }
2419 
2420  const std::vector<std::vector<Real>> & column_data = _csv_reader.getData();
2421 
2422  // Extract the pressure and temperature data vectors
2423  if (use_pT)
2424  {
2425  _pressure = column_data[data_index.find("pressure")->second];
2426  _temperature = column_data[data_index.find("temperature")->second];
2427  }
2428  else
2429  {
2430  _specific_volume = column_data[data_index.find("specific_volume")->second];
2431  _internal_energy = column_data[data_index.find("internal_energy")->second];
2432  }
2433 
2434  if (use_pT)
2435  checkFileTabulationGrids(_pressure, _temperature, file_name, "pressure", "temperature");
2436  else
2439  file_name,
2440  "specific volume",
2441  "specific internal energy");
2442 
2443  if (use_pT)
2444  {
2445  _num_p = _pressure.size();
2446  _num_T = _temperature.size();
2447 
2448  // Minimum and maximum pressure and temperature. Note that _pressure and
2449  // _temperature are sorted
2450  _pressure_min = _pressure.front();
2451  _pressure_max = _pressure.back();
2452  _temperature_min = _temperature.front();
2453  _temperature_max = _temperature.back();
2454  checkInitialGuess(true);
2455 
2456  // Extract the fluid property data from the file
2457  for (std::size_t i = 0; i < _interpolated_properties.size(); ++i)
2458  _properties.push_back(column_data[data_index.find(_interpolated_properties[i])->second]);
2459  }
2460  else
2461  {
2462  _num_v = _specific_volume.size();
2463  _num_e = _internal_energy.size();
2464 
2465  // Minimum and maximum specific internal energy and specific volume
2466  _v_min = _specific_volume.front();
2467  _v_max = _specific_volume.back();
2468  _e_min = _internal_energy.front();
2469  _e_max = _internal_energy.back();
2470 
2471  // We cannot overwrite the tabulated data grid with a grid generated from user-input for the
2472  // purpose of creating (p,T) to (v,e) interpolations
2474  paramError("construct_pT_from_ve",
2475  "Reading a (v,e) tabulation and generating (p,T) to (v,e) interpolation tables is "
2476  "not supported at this time.");
2477 
2478  // Make sure we use the tabulation bounds
2479  _e_bounds_specified = true;
2480  _v_bounds_specified = true;
2481 
2482  // Extract the fluid property data from the file
2483  _properties_ve.reserve(_interpolated_properties.size());
2484  for (std::size_t i = 0; i < _interpolated_properties.size(); ++i)
2485  _properties_ve.push_back(column_data[data_index.find(_interpolated_properties[i])->second]);
2486 
2487  // Obtain the min/max T, p and check the initial guess
2488  const auto & p_col = column_data[data_index.find("pressure")->second];
2489  _pressure_min = *std::min_element(p_col.begin(), p_col.end());
2490  _pressure_max = *std::max_element(p_col.begin(), p_col.end());
2491  const auto & T_col = column_data[data_index.find("temperature")->second];
2492  _temperature_min = *std::min_element(T_col.begin(), T_col.end());
2493  _temperature_max = *std::max_element(T_col.begin(), T_col.end());
2494  checkInitialGuess(true);
2495  }
2496 }
FileName _file_name_ve_in
File name of input (v,e) tabulated data file.
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)
void paramError(const std::string &param, Args... args) const
Real _temperature_max
Maximum temperature in tabulated data.
Real _e_max
Maximum internal energy in tabulated data (can be user-specified)
Real _e_min
Minimum internal energy in tabulated data (can be user-specified)
Real _pressure_max
Maximum pressure in tabulated data.
bool _e_bounds_specified
Whether the specific internal energy bounds were set by the user.
MooseUtils::DelimitedFileReader _csv_reader
The MOOSE delimited file reader.
MultiMooseEnum _interpolated_properties_enum
Properties to be interpolated entered in the input file.
bool _v_bounds_specified
Whether the specific volume bounds were set by the user.
unsigned int _num_v
Number of specific volume points in the tabulated data.
bool contains(const std::string &value) const
bool _construct_pT_from_ve
if the lookup table p(v, e) and T(v, e) should be constructed
void setFileName(const std::string &new_file)
Real _temperature_min
Minimum temperature in tabulated data.
const std::string & name() const
Real _v_min
Minimum specific volume in tabulated data (can be user-specified)
std::vector< std::string > _interpolated_properties
List of properties to be interpolated.
const std::vector< std::vector< T > > & getData() const
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 (read from file OR computed from _fp)
unsigned int _num_p
Number of pressure points in the tabulated data.
std::vector< std::vector< Real > > _properties_ve
Tabulated fluid properties in (v,e) (read from file OR computed from _fp)
Real _v_max
Maximum specific volume in tabulated data (can be user-specified)
void mooseWarning(Args &&... args) const
std::vector< Real > _specific_volume
Specific volume vector.
void mooseError(Args &&... args) const
virtual void checkInitialGuess(bool post_reading_tabulation) const
Checks initial guess for Newton Method.
std::vector< Real > _internal_energy
Specific internal energy vector.
const ConsoleStream _console
const std::vector< std::string > & getNames() const
bool isParamSetByUser(const std::string &name) const
FileName _file_name_in
File name of input tabulated data file.
unsigned int _num_e
Number of internal energy points in tabulated data.

◆ rho_e_from_p_T()

void SinglePhaseFluidProperties::rho_e_from_p_T ( Real  p,
Real  T,
Real rho,
Real drho_dp,
Real drho_dT,
Real e,
Real de_dp,
Real de_dT 
) const
virtualinherited

Definition at line 438 of file SinglePhaseFluidProperties.C.

446 {
447  rho_from_p_T(p, T, rho, drho_dp, drho_dT);
448  e_from_p_T(p, T, e, de_dp, de_dT);
449 }

◆ rho_from_p_s() [1/2]

Real TabulatedFluidProperties::rho_from_p_s ( Real  p,
Real  s 
) const
overridevirtual

Definition at line 592 of file TabulatedFluidProperties.C.

593 {
594  Real T = T_from_p_s(p, s);
595  return rho_from_p_T(p, T);
596 }
virtual Real T_from_p_s(Real p, Real s) const
virtual Real rho_from_p_T(Real pressure, Real temperature) const override
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

◆ rho_from_p_s() [2/2]

void TabulatedFluidProperties::rho_from_p_s ( Real  p,
Real  s,
Real rho,
Real drho_dp,
Real drho_ds 
) const
overridevirtual

Definition at line 599 of file TabulatedFluidProperties.C.

601 {
602  Real T, dT_dp, dT_ds;
603  T_from_p_s(p, s, T, dT_dp, dT_ds);
604  Real drho_dp_T, drho_dT;
605  rho_from_p_T(p, T, rho, drho_dp_T, drho_dT);
606  drho_dp = drho_dT * dT_dp + drho_dp_T;
607  drho_ds = drho_dT * dT_ds;
608 }
virtual Real T_from_p_s(Real p, Real s) const
virtual Real rho_from_p_T(Real pressure, Real temperature) const override
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

◆ rho_from_p_T() [1/4]

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

Definition at line 503 of file TabulatedFluidProperties.C.

Referenced by e_from_p_rho(), e_from_p_T(), rho_from_p_s(), rho_from_p_T(), and T_from_p_rho().

504 {
506  {
509  }
511  return 1. / v_from_p_T(pressure, temperature);
512  else
513  {
514  if (_fp)
515  return _fp->rho_from_p_T(pressure, temperature);
516  else
517  NeedTabulationOrFPError("rho_from_p_T", "density");
518  }
519 }
virtual Real v_from_p_T(Real pressure, Real temperature) const override
const bool _create_direct_ve_interpolations
Whether the object has direct (v,e) interpolations (whether created from file or from _fp) ...
const bool _create_direct_pT_interpolations
Whether the object has direct (p,T) interpolations (whether created from file or from _fp) ...
static const std::string temperature
Definition: NS.h:60
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...
const SinglePhaseFluidProperties *const _fp
SinglePhaseFluidPropertiesPT UserObject.
static const std::string pressure
Definition: NS.h:57
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...
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< BidimensionalInterpolation > > _property_ipol
Vector of bi-dimensional interpolation of fluid properties.

◆ rho_from_p_T() [2/4]

ADReal TabulatedFluidProperties::rho_from_p_T ( const ADReal pressure,
const ADReal temperature 
) const
overridevirtual

Definition at line 522 of file TabulatedFluidProperties.C.

523 {
525  {
526  ADReal pressure_nc = pressure, temperature_nc = temperature;
527  checkInputVariables(pressure_nc, temperature_nc);
528  return _property_ipol[_density_idx]->sample(pressure_nc, temperature_nc);
529  }
531  return 1. / v_from_p_T(pressure, temperature);
532  else
533  {
534  if (_fp)
535  return _fp->rho_from_p_T(pressure, temperature);
536  else
537  NeedTabulationOrFPError("AD rho_from_p_T", "density");
538  }
539 }
virtual Real v_from_p_T(Real pressure, Real temperature) const override
const bool _create_direct_ve_interpolations
Whether the object has direct (v,e) interpolations (whether created from file or from _fp) ...
const bool _create_direct_pT_interpolations
Whether the object has direct (p,T) interpolations (whether created from file or from _fp) ...
static const std::string temperature
Definition: NS.h:60
DualNumber< Real, DNDerivativeType, false > ADReal
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...
const SinglePhaseFluidProperties *const _fp
SinglePhaseFluidPropertiesPT UserObject.
static const std::string pressure
Definition: NS.h:57
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...
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< BidimensionalInterpolation > > _property_ipol
Vector of bi-dimensional interpolation of fluid properties.

◆ rho_from_p_T() [3/4]

void TabulatedFluidProperties::rho_from_p_T ( Real  pressure,
Real  temperature,
Real rho,
Real drho_dp,
Real drho_dT 
) const
overridevirtual

Definition at line 542 of file TabulatedFluidProperties.C.

544 {
546  {
548  _property_ipol[_density_idx]->sampleValueAndDerivatives(
549  pressure, temperature, rho, drho_dp, drho_dT);
550  }
552  {
554  // use finite differencing stencil
556  Real eps = 1e-8;
557  drho_dp = (rho_from_p_T(pressure * (1 + eps), temperature) - rho) / (eps * pressure);
558  drho_dT = (rho_from_p_T(pressure, temperature * (1 + eps)) - rho) / (eps * temperature);
559  }
560  else
561  {
562  if (_fp)
563  _fp->rho_from_p_T(pressure, temperature, rho, drho_dp, drho_dT);
564  else
565  NeedTabulationOrFPError("rho_from_p_T with derivatives", "density");
566  }
567 }
const bool _create_direct_ve_interpolations
Whether the object has direct (v,e) interpolations (whether created from file or from _fp) ...
const bool _create_direct_pT_interpolations
Whether the object has direct (p,T) interpolations (whether created from file or from _fp) ...
const Real eps
static const std::string temperature
Definition: NS.h:60
virtual Real rho_from_p_T(Real pressure, Real temperature) const override
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...
const SinglePhaseFluidProperties *const _fp
SinglePhaseFluidPropertiesPT UserObject.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
static const std::string pressure
Definition: NS.h:57
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...
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< BidimensionalInterpolation > > _property_ipol
Vector of bi-dimensional interpolation of fluid properties.

◆ rho_from_p_T() [4/4]

void TabulatedFluidProperties::rho_from_p_T ( const ADReal pressure,
const ADReal temperature,
ADReal rho,
ADReal drho_dp,
ADReal drho_dT 
) const
overridevirtual

Definition at line 570 of file TabulatedFluidProperties.C.

575 {
577  {
580  _property_ipol[_density_idx]->sampleValueAndDerivatives(p, T, rho, drho_dp, drho_dT);
581  }
582  else
583  {
584  if (_fp)
585  _fp->rho_from_p_T(pressure, temperature, rho, drho_dp, drho_dT);
586  else
587  NeedTabulationOrFPError("AD rho_from_p_T with derivatives", "density");
588  }
589 }
const bool _create_direct_pT_interpolations
Whether the object has direct (p,T) interpolations (whether created from file or from _fp) ...
static const std::string temperature
Definition: NS.h:60
DualNumber< Real, DNDerivativeType, false > ADReal
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...
const SinglePhaseFluidProperties *const _fp
SinglePhaseFluidPropertiesPT UserObject.
static const std::string pressure
Definition: NS.h:57
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...
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< BidimensionalInterpolation > > _property_ipol
Vector of bi-dimensional interpolation of fluid properties.

◆ rho_mu_from_p_T() [1/3]

void SinglePhaseFluidProperties::rho_mu_from_p_T ( Real  p,
Real  T,
Real rho,
Real mu 
) const
virtualinherited

Combined methods.

These methods are particularly useful for the PorousFlow module, where density and viscosity are typically both computed everywhere. The combined methods allow the most efficient means of calculating both properties, especially where rho(p, T) and mu(rho, T). In this case, an extra density calculation would be required to calculate mu(p, T). All property names are described above.

Reimplemented in Water97FluidProperties, CO2FluidProperties, HydrogenFluidProperties, and NitrogenFluidProperties.

Definition at line 452 of file SinglePhaseFluidProperties.C.

Referenced by PorousFlowWaterNCG::gasProperties(), PorousFlowBrineCO2::gasProperties(), and PorousFlowWaterNCG::liquidProperties().

453 {
454  rho = rho_from_p_T(p, T);
455  mu = mu_from_p_T(p, T);
456 }
const double mu

◆ rho_mu_from_p_T() [2/3]

void SinglePhaseFluidProperties::rho_mu_from_p_T ( Real  p,
Real  T,
Real rho,
Real drho_dp,
Real drho_dT,
Real mu,
Real dmu_dp,
Real dmu_dT 
) const
virtualinherited

Reimplemented in Water97FluidProperties, CO2FluidProperties, HydrogenFluidProperties, and NitrogenFluidProperties.

Definition at line 459 of file SinglePhaseFluidProperties.C.

467 {
468  rho_from_p_T(p, T, rho, drho_dp, drho_dT);
469  mu_from_p_T(p, T, mu, dmu_dp, dmu_dT);
470 }
const double mu

◆ rho_mu_from_p_T() [3/3]

void SinglePhaseFluidProperties::rho_mu_from_p_T ( const ADReal p,
const ADReal T,
ADReal rho,
ADReal mu 
) const
virtualinherited

Definition at line 473 of file SinglePhaseFluidProperties.C.

477 {
478  rho = rho_from_p_T(p, T);
479  mu = mu_from_p_T(p, T);
480 }
const double mu

◆ s_from_h_p() [1/2]

Real TabulatedFluidProperties::s_from_h_p ( Real  h,
Real  pressure 
) const
overridevirtual

Definition at line 1874 of file TabulatedFluidProperties.C.

1875 {
1876  Real T = T_from_p_h(pressure, enthalpy);
1877  return s_from_p_T(pressure, T);
1878 }
virtual Real s_from_p_T(Real pressure, Real temperature) const override
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
virtual Real T_from_p_h(Real pressure, Real enthalpy) const override
static const std::string pressure
Definition: NS.h:57

◆ s_from_h_p() [2/2]

void TabulatedFluidProperties::s_from_h_p ( Real  h,
Real  pressure,
Real s,
Real ds_dh,
Real ds_dp 
) const
overridevirtual

Definition at line 1881 of file TabulatedFluidProperties.C.

1883 {
1884  if (_fp)
1885  _fp->s_from_h_p(h, pressure, s, ds_dh, ds_dp);
1886  else
1887  TabulationNotImplementedError("s_from_h_p with derivatives");
1888 }
e e e e s T T T T T rho v v T e h
const SinglePhaseFluidProperties *const _fp
SinglePhaseFluidPropertiesPT UserObject.
static const std::string pressure
Definition: NS.h:57
void TabulationNotImplementedError(const std::string &desired_routine) const
Utility to forward errors related to fluid properties methods not implemented.

◆ s_from_p_T() [1/2]

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

Definition at line 1163 of file TabulatedFluidProperties.C.

Referenced by g_from_v_e(), s_from_h_p(), s_from_v_e(), and T_from_p_s().

1164 {
1166  {
1168  return _property_ipol[_entropy_idx]->sample(pressure, temperature);
1169  }
1170  else
1171  {
1172  if (_fp)
1173  return _fp->s_from_p_T(pressure, temperature);
1174  else
1175  NeedTabulationOrFPError("s_from_p_T", "entropy");
1176  }
1177 }
const bool _create_direct_pT_interpolations
Whether the object has direct (p,T) interpolations (whether created from file or from _fp) ...
static const std::string temperature
Definition: NS.h:60
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...
const SinglePhaseFluidProperties *const _fp
SinglePhaseFluidPropertiesPT UserObject.
static const std::string pressure
Definition: NS.h:57
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...
std::vector< std::unique_ptr< BidimensionalInterpolation > > _property_ipol
Vector of bi-dimensional interpolation of fluid properties.

◆ 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

Definition at line 1180 of file TabulatedFluidProperties.C.

1181 {
1183  {
1186  _property_ipol[_entropy_idx]->sampleValueAndDerivatives(p, T, s, ds_dp, ds_dT);
1188  {
1189  Real v, e, dv_dp, dv_dT, de_dp, de_dT;
1190  SinglePhaseFluidProperties::v_e_from_p_T(p, T, v, dv_dp, dv_dT, e, de_dp, de_dT);
1191  Real ds_dv, ds_de;
1192  _property_ve_ipol[_entropy_idx]->sampleValueAndDerivatives(v, e, s, ds_dv, ds_de);
1193  ds_dp = ds_dv * dv_dp + ds_de * de_dp;
1194  ds_dT = ds_dv * dv_dT + ds_de * de_dT;
1195  }
1196  else
1197  NeedTabulationError("entropy");
1198  }
1199  else
1200  {
1201  if (_fp)
1202  _fp->s_from_p_T(p, T, s, ds_dp, ds_dT);
1203  else
1204  NeedTabulationOrFPError("s_from_p_T with derivatives", "entropy");
1205  }
1206 }
const bool _create_direct_ve_interpolations
Whether the object has direct (v,e) interpolations (whether created from file or from _fp) ...
const bool _create_direct_pT_interpolations
Whether the object has direct (p,T) interpolations (whether created from file or from _fp) ...
void v_e_from_p_T(const CppType &p, const CppType &T, CppType &v, CppType &e) const
std::vector< std::unique_ptr< BidimensionalInterpolation > > _property_ve_ipol
Vector of bi-dimensional interpolation of fluid properties directly in (v,e)
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...
const SinglePhaseFluidProperties *const _fp
SinglePhaseFluidPropertiesPT UserObject.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
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...
std::vector< std::unique_ptr< BidimensionalInterpolation > > _property_ipol
Vector of bi-dimensional interpolation of fluid properties.
void NeedTabulationError(const std::string &needed_property) const
Utility to forward errors related to properties being requested for tabulation, but no tabulation is ...

◆ s_from_v_e() [1/2]

Real TabulatedFluidProperties::s_from_v_e ( Real  v,
Real  e 
) const
overridevirtual

Definition at line 1716 of file TabulatedFluidProperties.C.

Referenced by writeTabulatedData().

1717 {
1719  missingVEInterpolationError(__PRETTY_FUNCTION__);
1721 
1723  return _property_ve_ipol[_entropy_idx]->sample(v, e);
1724  else if (_construct_pT_from_ve)
1725  {
1726  Real T = _T_from_v_e_ipol->sample(v, e);
1727  Real p = _p_from_v_e_ipol->sample(v, e);
1728  return s_from_p_T(p, T);
1729  }
1730  else if (_fp)
1731  return _fp->s_from_v_e(v, e);
1732  else
1733  NeedTabulationOrFPError("s_from_v_e", "entropy");
1734 }
const bool _create_direct_ve_interpolations
Whether the object has direct (v,e) interpolations (whether created from file or from _fp) ...
virtual Real s_from_p_T(Real pressure, Real temperature) const override
std::vector< std::unique_ptr< BidimensionalInterpolation > > _property_ve_ipol
Vector of bi-dimensional interpolation of fluid properties directly in (v,e)
std::unique_ptr< BidimensionalInterpolation > _p_from_v_e_ipol
Bi-dimensional interpolation of pressure from (v,e)
std::unique_ptr< BidimensionalInterpolation > _T_from_v_e_ipol
Bi-dimensional interpolation of temperature from (v,e)
bool _construct_pT_from_ve
if the lookup table p(v, e) and T(v, e) should be constructed
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...
const SinglePhaseFluidProperties *const _fp
SinglePhaseFluidPropertiesPT UserObject.
void missingVEInterpolationError(const std::string &function_name) const
Standardized error message for missing interpolation.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
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...

◆ s_from_v_e() [2/2]

void TabulatedFluidProperties::s_from_v_e ( Real  v,
Real  e,
Real s,
Real ds_dv,
Real ds_de 
) const
overridevirtual

Definition at line 1737 of file TabulatedFluidProperties.C.

1738 {
1740  missingVEInterpolationError(__PRETTY_FUNCTION__);
1742 
1744  _property_ve_ipol[_entropy_idx]->sampleValueAndDerivatives(v, e, s, ds_dv, ds_de);
1745  else if (_construct_pT_from_ve)
1746  {
1747  Real p, T, dT_dv, dT_de, dp_dv, dp_de;
1748  _T_from_v_e_ipol->sampleValueAndDerivatives(v, e, T, dT_dv, dT_de);
1749  _p_from_v_e_ipol->sampleValueAndDerivatives(v, e, p, dp_dv, dp_de);
1750  Real ds_dp, ds_dT;
1751  s_from_p_T(p, T, s, ds_dp, ds_dT);
1752  ds_dv = ds_dp * dp_dv + ds_dT * dT_dv;
1753  ds_dv = ds_dp * dp_de + ds_dT * dT_de;
1754  }
1755  else if (_fp)
1756  _fp->s_from_v_e(v, e, s, ds_dv, ds_de);
1757  else
1758  NeedTabulationOrFPError("s_from_v_e", "entropy");
1759 }
const bool _create_direct_ve_interpolations
Whether the object has direct (v,e) interpolations (whether created from file or from _fp) ...
virtual Real s_from_p_T(Real pressure, Real temperature) const override
std::vector< std::unique_ptr< BidimensionalInterpolation > > _property_ve_ipol
Vector of bi-dimensional interpolation of fluid properties directly in (v,e)
std::unique_ptr< BidimensionalInterpolation > _p_from_v_e_ipol
Bi-dimensional interpolation of pressure from (v,e)
std::unique_ptr< BidimensionalInterpolation > _T_from_v_e_ipol
Bi-dimensional interpolation of temperature from (v,e)
bool _construct_pT_from_ve
if the lookup table p(v, e) and T(v, e) should be constructed
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...
const SinglePhaseFluidProperties *const _fp
SinglePhaseFluidPropertiesPT UserObject.
void missingVEInterpolationError(const std::string &function_name) const
Standardized error message for missing interpolation.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
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...

◆ subdomainSetup()

virtual void FluidProperties::subdomainSetup ( )
inlinefinalvirtualinherited

Reimplemented from ThreadedGeneralUserObject.

Definition at line 38 of file FluidProperties.h.

38 {}

◆ T_from_h_s()

Real TabulatedFluidProperties::T_from_h_s ( Real  h,
Real  s 
) const
virtual

Definition at line 1794 of file TabulatedFluidProperties.C.

1795 {
1796  Real p0 = _p_initial_guess;
1797  Real T0 = _T_initial_guess;
1798  Real p, T;
1799  bool conversion_succeeded;
1800  p_T_from_h_s(h, s, p0, T0, p, T, conversion_succeeded);
1801  return T;
1802 }
e e e e s T T T T T rho v v T e h
void p_T_from_h_s(const T &h, const T &s, Real p0, Real T0, T &pressure, T &temperature, bool &conversion_succeeded) const
Determines (p,T) from (h,s) using Newton Solve in 2D Useful for conversion between different sets of ...
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const Real _p_initial_guess
Initial guess for pressure (or pressure used to compute the initial guess)
const Real _T_initial_guess
Initial guess for temperature (or temperature used to compute the initial guess)

◆ T_from_p_h() [1/2]

Real TabulatedFluidProperties::T_from_p_h ( Real  pressure,
Real  enthalpy 
) const
overridevirtual

Definition at line 1805 of file TabulatedFluidProperties.C.

Referenced by s_from_h_p().

1806 {
1808  {
1809  auto lambda = [&](Real pressure, Real current_T, Real & new_h, Real & dh_dp, Real & dh_dT)
1810  { h_from_p_T(pressure, current_T, new_h, dh_dp, dh_dT); };
1812  enthalpy,
1814  _tolerance,
1815  lambda,
1816  name() + "::T_from_p_h",
1819  .first;
1820  // check for nans
1821  if (std::isnan(T))
1822  mooseError("Conversion from enthalpy (h = ",
1823  enthalpy,
1824  ") and pressure (p = ",
1825  pressure,
1826  ") to temperature failed to converge.");
1827  return T;
1828  }
1829  else if (_fp)
1830  return _fp->T_from_p_h(pressure, enthalpy);
1831  else
1832  NeedTabulationOrFPError("T_from_p_h", "temperature");
1833 }
const bool _create_direct_ve_interpolations
Whether the object has direct (v,e) interpolations (whether created from file or from _fp) ...
const bool _create_direct_pT_interpolations
Whether the object has direct (p,T) interpolations (whether created from file or from _fp) ...
const Real _tolerance
Newton&#39;s method may be used to convert between variable sets.
const bool _verbose_newton
Whether to output information about newton solves to console.
const std::string & name() const
virtual Real h_from_p_T(Real p, Real T) const override
std::pair< T, T > NewtonSolve(const T &x, const T &y, const Real z_initial_guess, const Real tolerance, const Functor &y_from_x_z, const std::string &caller_name, const unsigned int max_its=100, const bool verbose=false)
NewtonSolve does a 1D Newton Solve to solve the equation y = f(x, z) for variable z...
const SinglePhaseFluidProperties *const _fp
SinglePhaseFluidPropertiesPT UserObject.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const unsigned int _max_newton_its
Maximum number of iterations for the variable conversion newton solves.
static const std::string pressure
Definition: NS.h:57
void mooseError(Args &&... args) const
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...
const Real _T_initial_guess
Initial guess for temperature (or temperature used to compute the initial guess)

◆ T_from_p_h() [2/2]

ADReal TabulatedFluidProperties::T_from_p_h ( const ADReal pressure,
const ADReal enthalpy 
) const
overridevirtual

Definition at line 1836 of file TabulatedFluidProperties.C.

1837 {
1838  using std::isnan;
1840  {
1841  auto lambda =
1842  [&](ADReal pressure, ADReal current_T, ADReal & new_h, ADReal & dh_dp, ADReal & dh_dT)
1843  {
1844  h_from_p_T(pressure.value(), current_T.value(), new_h.value(), dh_dp.value(), dh_dT.value());
1845  // Reconstruct derivatives
1846  new_h.derivatives() =
1847  dh_dp.value() * pressure.derivatives() + dh_dT.value() * current_T.derivatives();
1848  };
1850  enthalpy,
1852  _tolerance,
1853  lambda,
1854  name() + "::T_from_p_h",
1857  .first;
1858  // check for nans
1859  if (isnan(T))
1860  mooseError("Conversion from enthalpy (h = ",
1861  enthalpy,
1862  ") and pressure (p = ",
1863  pressure,
1864  ") to temperature failed to converge.");
1865  return T;
1866  }
1867  else if (_fp)
1868  return _fp->T_from_p_h(pressure, enthalpy);
1869  else
1870  NeedTabulationOrFPError("T_from_p_h", "temperature");
1871 }
const bool _create_direct_ve_interpolations
Whether the object has direct (v,e) interpolations (whether created from file or from _fp) ...
const bool _create_direct_pT_interpolations
Whether the object has direct (p,T) interpolations (whether created from file or from _fp) ...
DualNumber< Real, DNDerivativeType, false > ADReal
const Real _tolerance
Newton&#39;s method may be used to convert between variable sets.
const bool _verbose_newton
Whether to output information about newton solves to console.
const std::string & name() const
virtual Real h_from_p_T(Real p, Real T) const override
std::pair< T, T > NewtonSolve(const T &x, const T &y, const Real z_initial_guess, const Real tolerance, const Functor &y_from_x_z, const std::string &caller_name, const unsigned int max_its=100, const bool verbose=false)
NewtonSolve does a 1D Newton Solve to solve the equation y = f(x, z) for variable z...
const SinglePhaseFluidProperties *const _fp
SinglePhaseFluidPropertiesPT UserObject.
const unsigned int _max_newton_its
Maximum number of iterations for the variable conversion newton solves.
static const std::string pressure
Definition: NS.h:57
void mooseError(Args &&... args) const
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...
const Real _T_initial_guess
Initial guess for temperature (or temperature used to compute the initial guess)

◆ T_from_p_rho() [1/3]

Real TabulatedFluidProperties::T_from_p_rho ( Real  pressure,
Real  rho 
) const
virtual

Definition at line 795 of file TabulatedFluidProperties.C.

Referenced by e_from_p_rho(), and T_from_p_rho().

796 {
799  {
801  auto lambda = [&](Real p, Real current_T, Real & new_rho, Real & drho_dp, Real & drho_dT)
802  { rho_from_p_T(p, current_T, new_rho, drho_dp, drho_dT); };
804  rho,
806  _tolerance,
807  lambda,
808  name() + "::T_from_p_rho",
811  .first;
812  }
815  else
816  NeedTabulationOrFPError("T_from_p_rho", "temperature");
817  // check for nans
818  if (std::isnan(T))
819  mooseError("Conversion from pressure (p = ",
820  pressure,
821  ") and density (rho = ",
822  rho,
823  ") to temperature failed to converge.");
824  return T;
825 }
const bool _create_direct_ve_interpolations
Whether the object has direct (v,e) interpolations (whether created from file or from _fp) ...
const bool _create_direct_pT_interpolations
Whether the object has direct (p,T) interpolations (whether created from file or from _fp) ...
virtual Real T_from_v_e(Real v, Real e) const override
const Real _tolerance
Newton&#39;s method may be used to convert between variable sets.
const bool _verbose_newton
Whether to output information about newton solves to console.
const std::string & name() const
virtual Real e_from_p_rho(Real pressure, Real rho) const override
std::pair< T, T > NewtonSolve(const T &x, const T &y, const Real z_initial_guess, const Real tolerance, const Functor &y_from_x_z, const std::string &caller_name, const unsigned int max_its=100, const bool verbose=false)
NewtonSolve does a 1D Newton Solve to solve the equation y = f(x, z) for variable z...
virtual Real rho_from_p_T(Real pressure, Real temperature) const override
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...
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const unsigned int _max_newton_its
Maximum number of iterations for the variable conversion newton solves.
static const std::string pressure
Definition: NS.h:57
void mooseError(Args &&... args) const
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_density
Set of flags to note whether a property is to be interpolated.
const Real _T_initial_guess
Initial guess for temperature (or temperature used to compute the initial guess)

◆ T_from_p_rho() [2/3]

ADReal TabulatedFluidProperties::T_from_p_rho ( const ADReal pressure,
const ADReal rho 
) const
virtual

Definition at line 828 of file TabulatedFluidProperties.C.

829 {
831  {
832  auto lambda =
833  [&](ADReal p, ADReal current_T, ADReal & new_rho, ADReal & drho_dp, ADReal & drho_dT)
834  { rho_from_p_T(p, current_T, new_rho, drho_dp, drho_dT); };
836  rho,
838  _tolerance,
839  lambda,
840  name() + "::T_from_p_rho",
843  .first;
844  // check for nans
845  if (std::isnan(T.value()))
846  mooseError("Conversion from pressure (p = ",
847  pressure,
848  ") and density (rho = ",
849  rho,
850  ") to temperature failed to converge.");
851  return T;
852  }
854  return T_from_v_e(1. / rho, e_from_p_rho(pressure, rho));
855  else
856  NeedTabulationOrFPError("AD T_from_p_rho", "temperature");
857 }
const bool _create_direct_ve_interpolations
Whether the object has direct (v,e) interpolations (whether created from file or from _fp) ...
virtual Real T_from_v_e(Real v, Real e) const override
DualNumber< Real, DNDerivativeType, false > ADReal
const Real _tolerance
Newton&#39;s method may be used to convert between variable sets.
const bool _verbose_newton
Whether to output information about newton solves to console.
const std::string & name() const
virtual Real e_from_p_rho(Real pressure, Real rho) const override
std::pair< T, T > NewtonSolve(const T &x, const T &y, const Real z_initial_guess, const Real tolerance, const Functor &y_from_x_z, const std::string &caller_name, const unsigned int max_its=100, const bool verbose=false)
NewtonSolve does a 1D Newton Solve to solve the equation y = f(x, z) for variable z...
virtual Real rho_from_p_T(Real pressure, Real temperature) const override
const unsigned int _max_newton_its
Maximum number of iterations for the variable conversion newton solves.
static const std::string pressure
Definition: NS.h:57
void mooseError(Args &&... args) const
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_density
Set of flags to note whether a property is to be interpolated.
const Real _T_initial_guess
Initial guess for temperature (or temperature used to compute the initial guess)

◆ T_from_p_rho() [3/3]

void TabulatedFluidProperties::T_from_p_rho ( Real  pressure,
Real  rho,
Real T,
Real dT_dp,
Real dT_drho 
) const
virtual

Definition at line 860 of file TabulatedFluidProperties.C.

862 {
864  Real eps = 1e-8;
865  dT_dp = (T_from_p_rho(pressure * (1 + eps), rho) - T) / (eps * pressure);
866  dT_drho = (T_from_p_rho(pressure, rho * (1 + eps)) - T) / (eps * rho);
867 }
const Real eps
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
static const std::string pressure
Definition: NS.h:57
virtual Real T_from_p_rho(Real pressure, Real rho) const

◆ T_from_p_s() [1/2]

Real TabulatedFluidProperties::T_from_p_s ( Real  p,
Real  s 
) const
virtual

Definition at line 870 of file TabulatedFluidProperties.C.

Referenced by rho_from_p_s(), and T_from_p_s().

871 {
872  auto lambda = [&](Real p, Real current_T, Real & new_s, Real & ds_dp, Real & ds_dT)
873  { s_from_p_T(p, current_T, new_s, ds_dp, ds_dT); };
875  s,
877  _tolerance,
878  lambda,
879  name() + "::T_from_p_s",
882  .first;
883  // check for nans
884  if (std::isnan(T))
885  mooseError("Conversion from pressure (p = ",
886  pressure,
887  ") and entropy (s = ",
888  s,
889  ") to temperature failed to converge.");
890  return T;
891 }
virtual Real s_from_p_T(Real pressure, Real temperature) const override
const Real _tolerance
Newton&#39;s method may be used to convert between variable sets.
const bool _verbose_newton
Whether to output information about newton solves to console.
const std::string & name() const
std::pair< T, T > NewtonSolve(const T &x, const T &y, const Real z_initial_guess, const Real tolerance, const Functor &y_from_x_z, const std::string &caller_name, const unsigned int max_its=100, const bool verbose=false)
NewtonSolve does a 1D Newton Solve to solve the equation y = f(x, z) for variable z...
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const unsigned int _max_newton_its
Maximum number of iterations for the variable conversion newton solves.
static const std::string pressure
Definition: NS.h:57
void mooseError(Args &&... args) const
const Real _T_initial_guess
Initial guess for temperature (or temperature used to compute the initial guess)

◆ T_from_p_s() [2/2]

void TabulatedFluidProperties::T_from_p_s ( Real  p,
Real  s,
Real T,
Real dT_dp,
Real dT_ds 
) const
virtual

Definition at line 894 of file TabulatedFluidProperties.C.

896 {
897  T = T_from_p_s(pressure, s);
898  Real eps = 1e-8;
899  dT_dp = (T_from_p_s(pressure * (1 + eps), s) - T) / (eps * pressure);
900  dT_ds = (T_from_p_s(pressure, s * (1 + eps)) - T) / (eps * s);
901 }
const Real eps
virtual Real T_from_p_s(Real p, Real s) const
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
static const std::string pressure
Definition: NS.h:57

◆ T_from_v_e() [1/3]

Real TabulatedFluidProperties::T_from_v_e ( Real  v,
Real  e 
) const
overridevirtual

Definition at line 1428 of file TabulatedFluidProperties.C.

Referenced by TabulatedBicubicFluidProperties::constructInterpolation(), e_from_p_T(), T_from_p_rho(), v_from_p_T(), and writeTabulatedData().

1429 {
1431  missingVEInterpolationError(__PRETTY_FUNCTION__);
1433 
1435  return _property_ve_ipol[_T_idx]->sample(v, e);
1436  else if (_construct_pT_from_ve)
1437  return _T_from_v_e_ipol->sample(v, e);
1438  else if (_fp)
1439  return _fp->T_from_v_e(v, e);
1440  else
1441  NeedTabulationOrFPError("T_from_v_e", "temperature");
1442 }
const bool _create_direct_ve_interpolations
Whether the object has direct (v,e) interpolations (whether created from file or from _fp) ...
std::vector< std::unique_ptr< BidimensionalInterpolation > > _property_ve_ipol
Vector of bi-dimensional interpolation of fluid properties directly in (v,e)
std::unique_ptr< BidimensionalInterpolation > _T_from_v_e_ipol
Bi-dimensional interpolation of temperature from (v,e)
bool _construct_pT_from_ve
if the lookup table p(v, e) and T(v, e) should be constructed
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...
const SinglePhaseFluidProperties *const _fp
SinglePhaseFluidPropertiesPT UserObject.
void missingVEInterpolationError(const std::string &function_name) const
Standardized error message for missing interpolation.
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...

◆ T_from_v_e() [2/3]

void TabulatedFluidProperties::T_from_v_e ( Real  v,
Real  e,
Real T,
Real dT_dv,
Real dT_de 
) const
overridevirtual

Definition at line 1445 of file TabulatedFluidProperties.C.

1446 {
1448  missingVEInterpolationError(__PRETTY_FUNCTION__);
1450 
1452  _property_ve_ipol[_T_idx]->sampleValueAndDerivatives(v, e, T, dT_dv, dT_de);
1453  else if (_construct_pT_from_ve)
1454  _T_from_v_e_ipol->sampleValueAndDerivatives(v, e, T, dT_dv, dT_de);
1455  else if (_fp)
1456  _fp->T_from_v_e(v, e, T, dT_dv, dT_de);
1457  else
1458  NeedTabulationOrFPError("T_from_v_e with derivatives", "temperature");
1459 }
const bool _create_direct_ve_interpolations
Whether the object has direct (v,e) interpolations (whether created from file or from _fp) ...
std::vector< std::unique_ptr< BidimensionalInterpolation > > _property_ve_ipol
Vector of bi-dimensional interpolation of fluid properties directly in (v,e)
std::unique_ptr< BidimensionalInterpolation > _T_from_v_e_ipol
Bi-dimensional interpolation of temperature from (v,e)
bool _construct_pT_from_ve
if the lookup table p(v, e) and T(v, e) should be constructed
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...
const SinglePhaseFluidProperties *const _fp
SinglePhaseFluidPropertiesPT UserObject.
void missingVEInterpolationError(const std::string &function_name) const
Standardized error message for missing interpolation.
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...

◆ T_from_v_e() [3/3]

void TabulatedFluidProperties::T_from_v_e ( const ADReal v,
const ADReal e,
ADReal p,
ADReal dp_dv,
ADReal dp_de 
) const
overridevirtual

Definition at line 1462 of file TabulatedFluidProperties.C.

1464 {
1466  missingVEInterpolationError(__PRETTY_FUNCTION__);
1467  ADReal vc = v, ec = e;
1468  checkInputVariablesVE(vc, ec);
1469 
1471  _property_ve_ipol[_T_idx]->sampleValueAndDerivatives(vc, ec, T, dT_dv, dT_de);
1472  else if (_construct_pT_from_ve)
1473  _T_from_v_e_ipol->sampleValueAndDerivatives(vc, ec, T, dT_dv, dT_de);
1474  else if (_fp)
1475  _fp->T_from_v_e(vc, ec, T, dT_dv, dT_de);
1476  else
1477  NeedTabulationOrFPError("AD T_from_v_e with derivatives", "temperature");
1478 }
const bool _create_direct_ve_interpolations
Whether the object has direct (v,e) interpolations (whether created from file or from _fp) ...
DualNumber< Real, DNDerivativeType, false > ADReal
std::vector< std::unique_ptr< BidimensionalInterpolation > > _property_ve_ipol
Vector of bi-dimensional interpolation of fluid properties directly in (v,e)
std::unique_ptr< BidimensionalInterpolation > _T_from_v_e_ipol
Bi-dimensional interpolation of temperature from (v,e)
bool _construct_pT_from_ve
if the lookup table p(v, e) and T(v, e) should be constructed
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...
const SinglePhaseFluidProperties *const _fp
SinglePhaseFluidPropertiesPT UserObject.
void missingVEInterpolationError(const std::string &function_name) const
Standardized error message for missing interpolation.
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...

◆ TabulationNotImplementedError()

void TabulatedFluidProperties::TabulationNotImplementedError ( const std::string &  desired_routine) const
protected

Utility to forward errors related to fluid properties methods not implemented.

Definition at line 1891 of file TabulatedFluidProperties.C.

Referenced by criticalDensity(), criticalPressure(), criticalTemperature(), henryCoefficients(), molarMass(), s_from_h_p(), triplePointPressure(), triplePointTemperature(), vaporPressure(), and vaporTemperature().

1892 {
1893  mooseError("TabulatedFluidProperties can only call the function '" + desired_routine +
1894  "' when the 'input_fp' parameter is provided. It is currently not implemented using "
1895  "tabulations, and this property is simply forwarded to the FluidProperties specified "
1896  "in the 'input_fp' parameter");
1897 }
void mooseError(Args &&... args) const

◆ threadJoin()

virtual void FluidProperties::threadJoin ( const UserObject )
inlinefinalvirtualinherited

Reimplemented from ThreadedGeneralUserObject.

Definition at line 37 of file FluidProperties.h.

37 {}

◆ triplePointPressure()

Real TabulatedFluidProperties::triplePointPressure ( ) const
overridevirtual

Triple point pressure.

Returns
triple point pressure (Pa)

Reimplemented from SinglePhaseFluidProperties.

Definition at line 1326 of file TabulatedFluidProperties.C.

1327 {
1328 
1329  if (_fp)
1330  return _fp->triplePointPressure();
1331  else
1332  TabulationNotImplementedError("triplePointPressure");
1333 }
virtual Real triplePointPressure() const
Triple point pressure.
const SinglePhaseFluidProperties *const _fp
SinglePhaseFluidPropertiesPT UserObject.
void TabulationNotImplementedError(const std::string &desired_routine) const
Utility to forward errors related to fluid properties methods not implemented.

◆ triplePointTemperature()

Real TabulatedFluidProperties::triplePointTemperature ( ) const
overridevirtual

Triple point temperature.

Returns
triple point temperature (K)

Reimplemented from SinglePhaseFluidProperties.

Definition at line 1336 of file TabulatedFluidProperties.C.

1337 {
1338 
1339  if (_fp)
1340  return _fp->triplePointTemperature();
1341  else
1342  TabulationNotImplementedError("triplePointTemperature");
1343 }
virtual Real triplePointTemperature() const
Triple point temperature.
const SinglePhaseFluidProperties *const _fp
SinglePhaseFluidPropertiesPT UserObject.
void TabulationNotImplementedError(const std::string &desired_routine) const
Utility to forward errors related to fluid properties methods not implemented.

◆ v_e_from_p_T() [1/2]

template<typename CppType >
void SinglePhaseFluidProperties::v_e_from_p_T ( const CppType &  p,
const CppType &  T,
CppType &  v,
CppType &  e 
) const
inherited

Definition at line 639 of file SinglePhaseFluidProperties.h.

Referenced by h_from_p_T(), and s_from_p_T().

643 {
644  const CppType rho = rho_from_p_T(p, T);
645  v = 1.0 / rho;
646  try
647  {
648  // more likely to not involve a Newton search
649  e = e_from_p_T(p, T);
650  }
651  catch (...)
652  {
653  e = e_from_p_rho(p, rho);
654  }
655 }

◆ v_e_from_p_T() [2/2]

template<typename CppType >
void SinglePhaseFluidProperties::v_e_from_p_T ( const CppType &  p,
const CppType &  T,
CppType &  v,
CppType &  dv_dp,
CppType &  dv_dT,
CppType &  e,
CppType &  de_dp,
CppType &  de_dT 
) const
inherited

Definition at line 659 of file SinglePhaseFluidProperties.h.

667 {
668  CppType rho, drho_dp, drho_dT;
669  rho_from_p_T(p, T, rho, drho_dp, drho_dT);
670 
671  v = 1.0 / rho;
672  const CppType dv_drho = -1.0 / (rho * rho);
673  dv_dp = dv_drho * drho_dp;
674  dv_dT = dv_drho * drho_dT;
675 
676  CppType de_dp_partial, de_drho;
677  e_from_p_rho(p, rho, e, de_dp_partial, de_drho);
678  de_dp = de_dp_partial + de_drho * drho_dp;
679  de_dT = de_drho * drho_dT;
680 }

◆ 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 IdealGasFluidProperties, CaloricallyImperfectGas, and StiffenedGasFluidProperties.

Definition at line 489 of file SinglePhaseFluidProperties.C.

490 {
491  mooseError(__PRETTY_FUNCTION__, " not implemented.");
492 }
void mooseError(Args &&... args) const

◆ v_from_p_T() [1/3]

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

Definition at line 397 of file TabulatedFluidProperties.C.

Referenced by rho_from_p_T().

398 {
400  {
402  return 1.0 / _property_ipol[_density_idx]->sample(pressure, temperature);
403  }
405  {
407  Real v, e;
408  auto p_from_v_e = [&](Real v, Real e, Real & new_p, Real & dp_dv, Real & dp_de)
409  { this->p_from_v_e(v, e, new_p, dp_dv, dp_de); };
410  auto T_from_v_e = [&](Real v, Real e, Real & new_T, Real & dT_dv, Real & dT_de)
411  { this->T_from_v_e(v, e, new_T, dT_dv, dT_de); };
413  temperature,
414  (_v_min + _v_max) / 2,
415  (_e_min + _e_max) / 2,
416  v,
417  e,
418  _tolerance,
419  _tolerance,
420  p_from_v_e,
421  T_from_v_e,
422  name() + "::v_from_p_T",
425  return v;
426  }
427  else
428  {
429  if (_fp)
430  return 1.0 / _fp->rho_from_p_T(pressure, temperature);
431  else
432  NeedTabulationOrFPError("AD v_from_p_T", "density");
433  }
434 }
const bool _create_direct_ve_interpolations
Whether the object has direct (v,e) interpolations (whether created from file or from _fp) ...
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 T_from_v_e(Real v, Real e) const override
void NewtonSolve2D(const T &f, const T &g, const Real x0, const Real y0, T &x_final, T &y_final, const Real f_tol, const Real g_tol, const Functor1 &f_from_x_y, const Functor2 &g_from_x_y, const std::string &caller_name="", const unsigned int max_its=100, bool debug=false)
NewtonSolve2D does a 2D Newton Solve to solve for the x and y such that: f = f_from_x_y(x, y) and g = g_from_x_y(x, y).
Real _e_min
Minimum internal energy in tabulated data (can be user-specified)
static const std::string temperature
Definition: NS.h:60
const Real _tolerance
Newton&#39;s method may be used to convert between variable sets.
const bool _verbose_newton
Whether to output information about newton solves to console.
const std::string & name() const
Real _v_min
Minimum specific volume in tabulated data (can be user-specified)
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...
const SinglePhaseFluidProperties *const _fp
SinglePhaseFluidPropertiesPT UserObject.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const unsigned int _max_newton_its
Maximum number of iterations for the variable conversion newton solves.
Real _v_max
Maximum specific volume in tabulated data (can be user-specified)
static const std::string pressure
Definition: NS.h:57
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 *...
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...
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< BidimensionalInterpolation > > _property_ipol
Vector of bi-dimensional interpolation of fluid properties.

◆ v_from_p_T() [2/3]

ADReal TabulatedFluidProperties::v_from_p_T ( const ADReal pressure,
const ADReal temperature 
) const
overridevirtual

Definition at line 437 of file TabulatedFluidProperties.C.

438 {
440  {
441  ADReal pressure_nc = pressure, temperature_nc = temperature;
442  checkInputVariables(pressure_nc, temperature_nc);
443  return 1.0 / _property_ipol[_density_idx]->sample(pressure_nc, temperature_nc);
444  }
446  {
447  ADReal pressure_nc = pressure, temperature_nc = temperature;
448  checkInputVariables(pressure_nc, temperature_nc);
449  ADReal v, e;
450  auto p_from_v_e = [&](ADReal v, ADReal e, ADReal & new_p, ADReal & dp_dv, ADReal & dp_de)
451  { this->p_from_v_e(v, e, new_p, dp_dv, dp_de); };
452  auto T_from_v_e = [&](ADReal v, ADReal e, ADReal & new_T, ADReal & dT_dv, ADReal & dT_de)
453  { this->T_from_v_e(v, e, new_T, dT_dv, dT_de); };
455  temperature_nc,
456  (_v_min + _v_max) / 2,
457  (_e_min + _e_max) / 2,
458  v,
459  e,
460  _tolerance,
461  _tolerance,
462  p_from_v_e,
463  T_from_v_e,
464  name() + "::v_from_p_T",
467  return v;
468  }
469  else
470  {
471  if (_fp)
472  return 1.0 / _fp->rho_from_p_T(pressure, temperature);
473  else
474  NeedTabulationOrFPError("AD v_from_p_T", "density");
475  }
476 }
const bool _create_direct_ve_interpolations
Whether the object has direct (v,e) interpolations (whether created from file or from _fp) ...
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 T_from_v_e(Real v, Real e) const override
void NewtonSolve2D(const T &f, const T &g, const Real x0, const Real y0, T &x_final, T &y_final, const Real f_tol, const Real g_tol, const Functor1 &f_from_x_y, const Functor2 &g_from_x_y, const std::string &caller_name="", const unsigned int max_its=100, bool debug=false)
NewtonSolve2D does a 2D Newton Solve to solve for the x and y such that: f = f_from_x_y(x, y) and g = g_from_x_y(x, y).
Real _e_min
Minimum internal energy in tabulated data (can be user-specified)
static const std::string temperature
Definition: NS.h:60
DualNumber< Real, DNDerivativeType, false > ADReal
const Real _tolerance
Newton&#39;s method may be used to convert between variable sets.
const bool _verbose_newton
Whether to output information about newton solves to console.
const std::string & name() const
Real _v_min
Minimum specific volume in tabulated data (can be user-specified)
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...
const SinglePhaseFluidProperties *const _fp
SinglePhaseFluidPropertiesPT UserObject.
const unsigned int _max_newton_its
Maximum number of iterations for the variable conversion newton solves.
Real _v_max
Maximum specific volume in tabulated data (can be user-specified)
static const std::string pressure
Definition: NS.h:57
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 *...
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...
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< BidimensionalInterpolation > > _property_ipol
Vector of bi-dimensional interpolation of fluid properties.

◆ v_from_p_T() [3/3]

void TabulatedFluidProperties::v_from_p_T ( Real  pressure,
Real  temperature,
Real v,
Real dv_dp,
Real dv_dT 
) const
overridevirtual

Definition at line 479 of file TabulatedFluidProperties.C.

481 {
482  Real rho = 0, drho_dp = 0, drho_dT = 0;
484  {
486  _property_ipol[_density_idx]->sampleValueAndDerivatives(
487  pressure, temperature, rho, drho_dp, drho_dT);
488  }
489  else
490  {
491  if (_fp)
492  _fp->rho_from_p_T(pressure, temperature, rho, drho_dp, drho_dT);
493  else
494  NeedTabulationOrFPError("v_from_p_T with derivatives", "density");
495  }
496  // convert from rho to v
497  v = 1.0 / rho;
498  dv_dp = -drho_dp / (rho * rho);
499  dv_dT = -drho_dT / (rho * rho);
500 }
const bool _create_direct_pT_interpolations
Whether the object has direct (p,T) interpolations (whether created from file or from _fp) ...
static const std::string temperature
Definition: NS.h:60
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...
const SinglePhaseFluidProperties *const _fp
SinglePhaseFluidPropertiesPT UserObject.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
static const std::string pressure
Definition: NS.h:57
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...
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< BidimensionalInterpolation > > _property_ipol
Vector of bi-dimensional interpolation of fluid properties.

◆ validParams()

InputParameters TabulatedFluidProperties::validParams ( )
static

Definition at line 24 of file TabulatedFluidProperties.C.

Referenced by TabulatedBicubicFluidProperties::validParams().

25 {
27  params.addClassDescription(
28  "Single phase fluid properties computed using bi-dimensional interpolation of tabulated "
29  "values.");
30 
31  // Which interpolations to create
32  params.addParam<bool>("create_pT_interpolations",
33  true,
34  "Whether to load (from file) or create (from a fluid property object) "
35  "properties interpolations from pressure and temperature");
36  params.addParam<bool>(
37  "create_ve_interpolations",
38  false,
39  "Whether to load (from file) or create (from a fluid property object) "
40  "properties interpolations from specific volume and specific internal energy");
41 
42  // Input / output
43  params.addParam<UserObjectName>("fp", "The name of the FluidProperties UserObject");
44  params.deprecateParam("fp", "input_fp", "12/12/26");
45  // deprecate to be able to put "fp" in the GlobalParams without creating issues with TabulatedFP
46  params.addParam<FileName>("fluid_property_file",
47  "Name of the csv file containing the tabulated fluid property data.");
48  params.addParam<FileName>(
49  "fluid_property_ve_file",
50  "Name of the csv file containing the tabulated (v,e) fluid property data.");
51  params.addParam<FileName>("fluid_property_output_file",
52  "Name of the CSV file which can be output with the tabulation. This "
53  "file can then be read as a 'fluid_property_file'");
54  params.addParam<FileName>(
55  "fluid_property_ve_output_file",
56  "Name of the CSV file which can be output with the (v,e) tabulation. This "
57  "file can then be read as a 'fluid_property_ve_file'");
58  params.addDeprecatedParam<bool>(
59  "save_file",
60  "Whether to save the csv fluid properties file",
61  "This parameter is no longer required. Whether to save a CSV tabulation file is controlled "
62  "by specifying the 'fluid_property_output_file' parameter");
63  params.addParam<bool>("skip_header_tabulation",
64  false,
65  "Whether to skip the header in the tabulation output, useful for testing");
66 
67  // Data source on a per-property basis
68  MultiMooseEnum properties(
69  "density enthalpy internal_energy viscosity k c cv cp entropy pressure temperature",
70  "density enthalpy internal_energy viscosity");
71  params.addParam<MultiMooseEnum>("interpolated_properties",
72  properties,
73  "Properties to interpolate. If unspecified and a data file is "
74  "provided, the properties from the data file will be used. If "
75  "specified, some properties from the data file can be ignored.");
76 
77  // (p,T) grid parameters
78  params.addRangeCheckedParam<Real>(
79  "temperature_min", 300, "temperature_min > 0", "Minimum temperature for tabulated data.");
80  params.addParam<Real>("temperature_max", 500, "Maximum temperature for tabulated data.");
81  params.addRangeCheckedParam<Real>(
82  "pressure_min", 1e5, "pressure_min > 0", "Minimum pressure for tabulated data.");
83  params.addParam<Real>("pressure_max", 50.0e6, "Maximum pressure for tabulated data.");
84  params.addRangeCheckedParam<unsigned int>(
85  "num_T", 100, "num_T > 0", "Number of points to divide temperature range.");
86  params.addRangeCheckedParam<unsigned int>(
87  "num_p", 100, "num_p > 0", "Number of points to divide pressure range.");
88 
89  // (v,e) grid parameters
90  params.addParam<Real>("e_min", "Minimum specific internal energy for tabulated data.");
91  params.addParam<Real>("e_max", "Maximum specific internal energy for tabulated data.");
92  params.addRangeCheckedParam<Real>(
93  "v_min", "v_min > 0", "Minimum specific volume for tabulated data.");
94  params.addRangeCheckedParam<Real>(
95  "v_max", "v_max > 0", "Maximum specific volume for tabulated data.");
96  params.addParam<bool>("construct_pT_from_ve",
97  false,
98  "If the lookup table (p, T) as functions of (v, e) should be constructed.");
99  params.addParam<bool>("construct_pT_from_vh",
100  false,
101  "If the lookup table (p, T) as functions of (v, h) should be constructed.");
102  params.addRangeCheckedParam<unsigned int>(
103  "num_v",
104  100,
105  "num_v > 0",
106  "Number of points to divide specific volume range for (v,e) lookups.");
107  params.addRangeCheckedParam<unsigned int>("num_e",
108  100,
109  "num_e > 0",
110  "Number of points to divide specific internal energy "
111  "range for (v,e) lookups.");
112  params.addParam<bool>(
113  "use_log_grid_v",
114  false,
115  "Option to use a base-10 logarithmically-spaced grid for specific volume instead of a "
116  "linearly-spaced grid.");
117  params.addParam<bool>(
118  "use_log_grid_e",
119  false,
120  "Option to use a base-10 logarithmically-spaced grid for specific internal energy instead "
121  "of a linearly-spaced grid.");
122  params.addParam<bool>(
123  "use_log_grid_h",
124  false,
125  "Option to use a base-10 logarithmically-spaced grid for specific enthalpy instead "
126  "of a linearly-spaced grid.");
127 
128  // Out of bounds behavior
129  params.addDeprecatedParam<bool>(
130  "error_on_out_of_bounds",
131  "Whether pressure or temperature from tabulation exceeding user-specified bounds leads to "
132  "an error.",
133  "This parameter has been replaced by the 'out_of_bounds_behavior' parameter which offers "
134  "more flexibility. The option to error is called 'throw' in that parameter.");
135  // NOTE: this enum must remain the same as OOBBehavior in the header
136  MooseEnum OOBBehavior("ignore throw declare_invalid warn_invalid set_to_closest_bound", "throw");
137  params.addParam<MooseEnum>("out_of_bounds_behavior",
138  OOBBehavior,
139  "Property evaluation behavior when evaluated outside the "
140  "user-specified or tabulation-specified bounds");
141 
142  // This is generally a bad idea. However, several properties have not been tabulated so several
143  // tests are relying on the original fp object to provide the value (for example for the
144  // vaporPressure())
145  params.addParam<bool>(
146  "allow_fp_and_tabulation", false, "Whether to allow the two sources of data concurrently");
147 
148  params.addParamNamesToGroup("fluid_property_file fluid_property_ve_file "
149  "fluid_property_output_file fluid_property_ve_output_file",
150  "Tabulation file read/write");
151  params.addParamNamesToGroup("construct_pT_from_ve construct_pT_from_vh",
152  "Variable set conversion");
153  params.addParamNamesToGroup("temperature_min temperature_max pressure_min pressure_max e_min "
154  "e_max v_min v_max error_on_out_of_bounds out_of_bounds_behavior",
155  "Tabulation and interpolation bounds");
156  params.addParamNamesToGroup(
157  "num_T num_p num_v num_e use_log_grid_v use_log_grid_e use_log_grid_h",
158  "Tabulation and interpolation discretization");
159 
160  return params;
161 }
void addDeprecatedParam(const std::string &name, const T &value, const std::string &doc_string, const std::string &deprecation_message)
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
static InputParameters validParams()
void deprecateParam(const std::string &old_name, const std::string &new_name, const std::string &removal_date)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
void addClassDescription(const std::string &doc_string)
void addRangeCheckedParam(const std::string &name, const T &value, const std::string &parsed_function, const std::string &doc_string)
OOBBehavior
Enum specifying all the behavior on out of bounds data options.
void addParamNamesToGroup(const std::string &space_delim_names, const std::string group_name)

◆ vaporPressure() [1/3]

Real TabulatedFluidProperties::vaporPressure ( Real  T) const
overridevirtual

Vapor pressure.

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

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

Reimplemented from SinglePhaseFluidProperties.

Definition at line 1289 of file TabulatedFluidProperties.C.

1290 {
1291  if (_fp)
1292  return _fp->vaporPressure(temperature);
1293  else
1294  TabulationNotImplementedError("vaporPressure");
1295 }
static const std::string temperature
Definition: NS.h:60
const SinglePhaseFluidProperties *const _fp
SinglePhaseFluidPropertiesPT UserObject.
void TabulationNotImplementedError(const std::string &desired_routine) const
Utility to forward errors related to fluid properties methods not implemented.
virtual Real vaporPressure(Real T) const
Vapor pressure.

◆ vaporPressure() [2/3]

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

Reimplemented from SinglePhaseFluidProperties.

Definition at line 1298 of file TabulatedFluidProperties.C.

1299 {
1300  if (_fp)
1301  _fp->vaporPressure(temperature, psat, dpsat_dT);
1302  else
1303  TabulationNotImplementedError("vaporPressure");
1304 }
static const std::string temperature
Definition: NS.h:60
const SinglePhaseFluidProperties *const _fp
SinglePhaseFluidPropertiesPT UserObject.
void TabulationNotImplementedError(const std::string &desired_routine) const
Utility to forward errors related to fluid properties methods not implemented.
virtual Real vaporPressure(Real T) const
Vapor pressure.

◆ vaporPressure() [3/3]

ADReal SinglePhaseFluidProperties::vaporPressure ( const ADReal T) const
virtualinherited

Definition at line 393 of file SinglePhaseFluidProperties.C.

394 {
395  Real p = 0.0;
396  Real temperature = T.value();
397  Real dpdT = 0.0;
398 
399  vaporPressure(temperature, p, dpdT);
400 
401  ADReal result = p;
402  result.derivatives() = T.derivatives() * dpdT;
403 
404  return result;
405 }
static const std::string temperature
Definition: NS.h:60
DualNumber< Real, DNDerivativeType, false > ADReal
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
virtual Real vaporPressure(Real T) const
Vapor pressure.

◆ vaporTemperature() [1/3]

Real TabulatedFluidProperties::vaporTemperature ( Real  p) const
overridevirtual

Vapor temperature.

Used to delineate liquid and gas phases. Valid for pressures between the triple point pressure and the critical pressure

Parameters
pfluid pressure (Pa)
[out]saturationtemperature (K)
[out]derivativeof saturation temperature wrt pressure

Reimplemented from SinglePhaseFluidProperties.

Definition at line 1307 of file TabulatedFluidProperties.C.

1308 {
1309  if (_fp)
1310  return _fp->vaporTemperature(pressure);
1311  else
1312  TabulationNotImplementedError("vaporTemperature");
1313 }
virtual Real vaporTemperature(Real p) const
Vapor temperature.
const SinglePhaseFluidProperties *const _fp
SinglePhaseFluidPropertiesPT UserObject.
static const std::string pressure
Definition: NS.h:57
void TabulationNotImplementedError(const std::string &desired_routine) const
Utility to forward errors related to fluid properties methods not implemented.

◆ vaporTemperature() [2/3]

void TabulatedFluidProperties::vaporTemperature ( Real  pressure,
Real Tsat,
Real dTsat_dp 
) const
overridevirtual

Reimplemented from SinglePhaseFluidProperties.

Definition at line 1316 of file TabulatedFluidProperties.C.

1317 {
1318 
1319  if (_fp)
1320  _fp->vaporTemperature(pressure, Tsat, dTsat_dp);
1321  else
1322  TabulationNotImplementedError("vaporTemperature");
1323 }
virtual Real vaporTemperature(Real p) const
Vapor temperature.
const SinglePhaseFluidProperties *const _fp
SinglePhaseFluidPropertiesPT UserObject.
static const std::string pressure
Definition: NS.h:57
void TabulationNotImplementedError(const std::string &desired_routine) const
Utility to forward errors related to fluid properties methods not implemented.

◆ vaporTemperature() [3/3]

ADReal SinglePhaseFluidProperties::vaporTemperature ( const ADReal p) const
virtualinherited

Definition at line 423 of file SinglePhaseFluidProperties.C.

424 {
425  Real T = 0.0;
426  Real pressure = p.value();
427  Real dTdp = 0.0;
428 
429  vaporTemperature(pressure, T, dTdp);
430 
431  ADReal result = T;
432  result.derivatives() = p.derivatives() * dTdp;
433 
434  return result;
435 }
DualNumber< Real, DNDerivativeType, false > ADReal
virtual Real vaporTemperature(Real p) const
Vapor temperature.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
static const std::string pressure
Definition: NS.h:57

◆ 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 1922 of file TabulatedFluidProperties.C.

Referenced by initialSetup().

1923 {
1924  if (processor_id() == 0)
1925  {
1926  // Write out the (p, T) interpolation tables
1927  if (_file_name_out != "")
1928  {
1929  file_name = file_name.empty() ? "fluid_properties_" + name() + "_out.csv" : file_name;
1930  MooseUtils::checkFileWriteable(file_name);
1931 
1932  std::ofstream file_out(file_name.c_str());
1933 
1934  if (!getParam<bool>("skip_header_tabulation"))
1935  {
1936  // Write out date and fluid type
1937  time_t now = std::time(&now);
1938  file_out << "# " << (_fp ? _fp->fluidName() : "")
1939  << " properties (p,T) tabulation created by TabulatedFluidProperties on "
1940  << ctime(&now) << "\n";
1941  }
1942 
1943  // Write out column names
1944  file_out << "pressure, temperature";
1945  for (std::size_t i = 0; i < _interpolated_properties.size(); ++i)
1946  if (_interpolated_properties[i] != "pressure" &&
1947  _interpolated_properties[i] != "temperature")
1948  file_out << ", " << _interpolated_properties[i];
1949  file_out << "\n";
1950 
1951  // Write out the fluid property data
1952  for (unsigned int p = 0; p < _num_p; ++p)
1953  for (unsigned int t = 0; t < _num_T; ++t)
1954  {
1955  file_out << _pressure[p] << ", " << _temperature[t];
1956  for (std::size_t i = 0; i < _properties.size(); ++i)
1957  file_out << ", " << _properties[i][p * _num_T + t];
1958  file_out << "\n";
1959  }
1960 
1961  file_out << std::flush;
1962  file_out.close();
1963  }
1964 
1965  // Write out the (v,e) interpolation tables
1967  {
1968  const auto file_name_ve = (_file_name_ve_out == "")
1969  ? std::regex_replace(file_name, std::regex("\\.csv"), "_ve.csv")
1971  MooseUtils::checkFileWriteable(file_name_ve);
1972  std::ofstream file_out(file_name_ve.c_str());
1973 
1974  // Write out date and fluid type
1975  if (!getParam<bool>("skip_header_tabulation"))
1976  {
1977  time_t now = std::time(&now);
1978  file_out << "# " << (_fp ? _fp->fluidName() : "")
1979  << " properties (v,e) tabulation created by TabulatedFluidProperties on "
1980  << ctime(&now) << "\n";
1981  }
1982 
1983  // Write out column names
1984  file_out << "specific_volume, internal_energy, pressure, temperature";
1985  for (const auto i : index_range(_interpolated_properties))
1986  // Avoid writing the fixed columns twice
1987  if (_interpolated_properties[i] != "internal_energy" &&
1988  _interpolated_properties[i] != "pressure" &&
1989  _interpolated_properties[i] != "temperature")
1990  file_out << ", " << _interpolated_properties[i];
1991  file_out << "\n";
1992 
1993  // Write out the fluid property data
1994  for (const auto v : make_range(_num_v))
1995  for (const auto e : make_range(_num_e))
1996  {
1997  const auto v_val = _specific_volume[v];
1998  const auto e_val = _internal_energy[e];
1999  // Use the expected source for the grid. Note that the tabulations are already created
2002  {
2003  pressure = _p_from_v_e_ipol->sample(v_val, e_val);
2004  temperature = _T_from_v_e_ipol->sample(v_val, e_val);
2005  }
2006  else
2007  {
2008  pressure = p_from_v_e(v_val, e_val);
2009  temperature = T_from_v_e(v_val, e_val);
2010  }
2011  file_out << v_val << ", " << e_val << ", " << pressure << ", " << temperature
2012  << (_interpolated_properties.size() ? ", " : "");
2013  for (const auto i : index_range(_interpolated_properties))
2014  {
2015  bool add_comma = true;
2016  if (i == _density_idx)
2017  file_out << 1. / v_val;
2018  else if (i == _enthalpy_idx)
2019  file_out << h_from_v_e(v_val, e_val);
2020  // Note that we could use (p,T) routine to generate this instead of (v,e)
2021  // Or could use the _properties_ve array similar to what we do for (pressure,
2022  // temperature)
2023  else if (i == _viscosity_idx)
2024  file_out << mu_from_v_e(v_val, e_val);
2025  else if (i == _k_idx)
2026  file_out << k_from_v_e(v_val, e_val);
2027  else if (i == _c_idx)
2028  file_out << c_from_v_e(v_val, e_val);
2029  else if (i == _cv_idx)
2030  file_out << cv_from_v_e(v_val, e_val);
2031  else if (i == _cp_idx)
2032  file_out << cp_from_v_e(v_val, e_val);
2033  else if (i == _entropy_idx)
2034  file_out << s_from_v_e(v_val, e_val);
2035  else
2036  add_comma = false;
2037  if (i != _interpolated_properties.size() - 1 && add_comma)
2038  file_out << ", ";
2039  }
2040 
2041  file_out << "\n";
2042  }
2043 
2044  file_out << std::flush;
2045  file_out.close();
2046  }
2047  }
2048 }
const bool _create_direct_ve_interpolations
Whether the object has direct (v,e) interpolations (whether created from file or from _fp) ...
virtual Real T_from_v_e(Real v, Real e) const override
static const std::string temperature
Definition: NS.h:60
std::unique_ptr< BidimensionalInterpolation > _p_from_v_e_ipol
Bi-dimensional interpolation of pressure from (v,e)
std::unique_ptr< BidimensionalInterpolation > _T_from_v_e_ipol
Bi-dimensional interpolation of temperature from (v,e)
FileName _file_name_ve_out
File name of output (v,e) tabulated data file.
unsigned int _num_v
Number of specific volume points in the tabulated data.
bool _construct_pT_from_ve
if the lookup table p(v, e) and T(v, e) should be constructed
const std::string & name() const
FileName _file_name_out
File name of output tabulated data file.
virtual Real k_from_v_e(Real v, Real e) const override
virtual Real cv_from_v_e(Real v, Real e) const override
std::vector< std::string > _interpolated_properties
List of properties to be interpolated.
virtual Real c_from_v_e(Real v, Real e) const override
std::vector< Real > _pressure
Pressure vector.
std::vector< Real > _temperature
Temperature vector.
unsigned int _num_T
Number of temperature points in the tabulated data.
const SinglePhaseFluidProperties *const _fp
SinglePhaseFluidPropertiesPT UserObject.
virtual Real s_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)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
unsigned int _num_p
Number of pressure points in the tabulated data.
static const std::string pressure
Definition: NS.h:57
IntRange< T > make_range(T beg, T end)
std::vector< Real > _specific_volume
Specific volume vector.
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 *...
virtual Real cp_from_v_e(Real v, Real e) const override
unsigned int _density_idx
Index of each property.
e e e e s T T T T T rho v v T e p T T virtual T std::string fluidName() const
Fluid name.
std::vector< Real > _internal_energy
Specific internal energy vector.
bool checkFileWriteable(const std::string &filename, bool throw_on_unwritable)
virtual Real mu_from_v_e(Real v, Real e) const override
processor_id_type processor_id() const
auto index_range(const T &sizable)
unsigned int _num_e
Number of internal energy points in tabulated data.

◆ xyDerivatives()

template<typename T , typename Functor >
void SinglePhaseFluidProperties::xyDerivatives ( const T  x,
const T y,
T z,
T dz_dx,
T dz_dy,
const Functor z_from_x_y 
)
staticprotectedinherited

Computes the dependent variable z and its derivatives with respect to the independent variables x and y using the simple two parameter z_from_x_y functor.

The derivatives are computed using a compound automatic differentiation type

Definition at line 492 of file SinglePhaseFluidProperties.h.

Referenced by Water97FluidProperties::e_from_p_rho_template(), Water97FluidProperties::h_from_p_T_template(), Water97FluidProperties::rho_from_p_T_template(), and Water97FluidProperties::v_from_p_T_template().

494 {
496  const auto [zero, one] = makeZeroAndOne(x);
497 
498  CompoundType x_c(x, zero);
499  auto & x_cd = x_c.derivatives();
500  x_cd[0] = one;
501  CompoundType y_c(y, zero);
502  auto & y_cd = y_c.derivatives();
503  y_cd[1] = one;
504 
505  const auto z_c = z_from_x_y(x_c, y_c);
506  z = z_c.value();
507  dz_dx = z_c.derivatives()[0];
508  dz_dy = z_c.derivatives()[1];
509 }
static std::pair< T, T > makeZeroAndOne(const T &)
Given a type example, this method returns zero and unity representations of that type (first and seco...
const std::vector< double > y
const Number zero
const std::vector< double > x

Member Data Documentation

◆ _allow_fp_and_tabulation

const bool TabulatedFluidProperties::_allow_fp_and_tabulation
protected

Whether to allow a fp object when a tabulation is in use.

Definition at line 328 of file TabulatedFluidProperties.h.

Referenced by TabulatedFluidProperties().

◆ _allow_imperfect_jacobians

const bool FluidProperties::_allow_imperfect_jacobians
protectedinherited

◆ _c_idx

unsigned int TabulatedFluidProperties::_c_idx
protected

◆ _construct_pT_from_ve

bool TabulatedFluidProperties::_construct_pT_from_ve
protected

◆ _construct_pT_from_vh

bool TabulatedFluidProperties::_construct_pT_from_vh
protected

if the lookup table p(v, h) and T(v, h) should be constructed

Definition at line 366 of file TabulatedFluidProperties.h.

Referenced by checkInitialGuess(), TabulatedBicubicFluidProperties::constructInterpolation(), and e_from_v_h().

◆ _cp_idx

unsigned int TabulatedFluidProperties::_cp_idx
protected

◆ _create_direct_pT_interpolations

const bool TabulatedFluidProperties::_create_direct_pT_interpolations
protected

◆ _create_direct_ve_interpolations

const bool TabulatedFluidProperties::_create_direct_ve_interpolations
protected

◆ _csv_reader

MooseUtils::DelimitedFileReader TabulatedFluidProperties::_csv_reader
protected

The MOOSE delimited file reader.

Definition at line 361 of file TabulatedFluidProperties.h.

Referenced by readFileTabulationData(), and TabulatedFluidProperties().

◆ _cv_idx

unsigned int TabulatedFluidProperties::_cv_idx
protected

◆ _density_idx

unsigned int TabulatedFluidProperties::_density_idx
protected

◆ _e_bounds_specified

bool TabulatedFluidProperties::_e_bounds_specified
protected

Whether the specific internal energy bounds were set by the user.

Definition at line 405 of file TabulatedFluidProperties.h.

Referenced by createVEGridVectors(), readFileTabulationData(), and TabulatedFluidProperties().

◆ _e_max

Real TabulatedFluidProperties::_e_max
protected

Maximum internal energy in tabulated data (can be user-specified)

Definition at line 411 of file TabulatedFluidProperties.h.

Referenced by checkInputVariablesVE(), createVEGridVectors(), e_from_p_rho(), e_from_p_T(), readFileTabulationData(), TabulatedFluidProperties(), and v_from_p_T().

◆ _e_min

Real TabulatedFluidProperties::_e_min
protected

Minimum internal energy in tabulated data (can be user-specified)

Definition at line 409 of file TabulatedFluidProperties.h.

Referenced by checkInputVariablesVE(), createVEGridVectors(), e_from_p_rho(), e_from_p_T(), readFileTabulationData(), TabulatedFluidProperties(), and v_from_p_T().

◆ _enthalpy

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

Specific enthalpy vector.

Definition at line 295 of file TabulatedFluidProperties.h.

Referenced by TabulatedBicubicFluidProperties::constructInterpolation(), and createVHGridVectors().

◆ _enthalpy_idx

unsigned int TabulatedFluidProperties::_enthalpy_idx
protected

◆ _entropy_idx

unsigned int TabulatedFluidProperties::_entropy_idx
protected

◆ _file_name_in

FileName TabulatedFluidProperties::_file_name_in
protected

File name of input tabulated data file.

Definition at line 276 of file TabulatedFluidProperties.h.

Referenced by checkInitialGuess(), initialSetup(), readFileTabulationData(), and TabulatedFluidProperties().

◆ _file_name_out

FileName TabulatedFluidProperties::_file_name_out
protected

File name of output tabulated data file.

Definition at line 280 of file TabulatedFluidProperties.h.

Referenced by initialSetup(), and writeTabulatedData().

◆ _file_name_ve_in

FileName TabulatedFluidProperties::_file_name_ve_in
protected

File name of input (v,e) tabulated data file.

Definition at line 278 of file TabulatedFluidProperties.h.

Referenced by checkInitialGuess(), createVGridVector(), createVHGridVectors(), initialSetup(), readFileTabulationData(), and TabulatedFluidProperties().

◆ _file_name_ve_out

FileName TabulatedFluidProperties::_file_name_ve_out
protected

File name of output (v,e) tabulated data file.

Definition at line 282 of file TabulatedFluidProperties.h.

Referenced by writeTabulatedData().

◆ _fp

const SinglePhaseFluidProperties* const TabulatedFluidProperties::_fp
protected

◆ _h_max

Real TabulatedFluidProperties::_h_max
protected

Maximum specific enthalpy in tabulated data.

Definition at line 419 of file TabulatedFluidProperties.h.

Referenced by createVHGridVectors().

◆ _h_min

Real TabulatedFluidProperties::_h_min
protected

Minimum specific enthalpy in tabulated data.

Definition at line 417 of file TabulatedFluidProperties.h.

Referenced by createVHGridVectors().

◆ _initial_setup_done

bool TabulatedFluidProperties::_initial_setup_done
protected

keeps track of whether initialSetup has been performed

Definition at line 368 of file TabulatedFluidProperties.h.

Referenced by initialSetup().

◆ _internal_energy

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

◆ _internal_energy_idx

unsigned int TabulatedFluidProperties::_internal_energy_idx
protected

◆ _interpolate_c

bool TabulatedFluidProperties::_interpolate_c
protected

◆ _interpolate_cp

bool TabulatedFluidProperties::_interpolate_cp
protected

◆ _interpolate_cv

bool TabulatedFluidProperties::_interpolate_cv
protected

◆ _interpolate_density

bool TabulatedFluidProperties::_interpolate_density
protected

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

Definition at line 335 of file TabulatedFluidProperties.h.

Referenced by computePropertyIndicesInInterpolationVectors(), createVGridVector(), rho_from_p_T(), T_from_p_rho(), and v_from_p_T().

◆ _interpolate_enthalpy

bool TabulatedFluidProperties::_interpolate_enthalpy
protected

◆ _interpolate_entropy

bool TabulatedFluidProperties::_interpolate_entropy
protected

◆ _interpolate_internal_energy

bool TabulatedFluidProperties::_interpolate_internal_energy
protected

◆ _interpolate_k

bool TabulatedFluidProperties::_interpolate_k
protected

◆ _interpolate_pressure

bool TabulatedFluidProperties::_interpolate_pressure
protected

◆ _interpolate_temperature

bool TabulatedFluidProperties::_interpolate_temperature
protected

◆ _interpolate_viscosity

bool TabulatedFluidProperties::_interpolate_viscosity
protected

◆ _interpolated_properties

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

◆ _interpolated_properties_enum

MultiMooseEnum TabulatedFluidProperties::_interpolated_properties_enum
protected

Properties to be interpolated entered in the input file.

Definition at line 331 of file TabulatedFluidProperties.h.

Referenced by generateTabulatedData(), generateVETabulatedData(), and readFileTabulationData().

◆ _k_idx

unsigned int TabulatedFluidProperties::_k_idx
protected

◆ _log_space_e

bool TabulatedFluidProperties::_log_space_e
protected

log-space the internal energy interpolation grid axis instead of linear

Definition at line 376 of file TabulatedFluidProperties.h.

Referenced by createVEGridVectors(), and TabulatedFluidProperties().

◆ _log_space_h

bool TabulatedFluidProperties::_log_space_h
protected

log-space the enthalpy interpolation grid axis instead of linear

Definition at line 378 of file TabulatedFluidProperties.h.

Referenced by createVHGridVectors().

◆ _log_space_v

bool TabulatedFluidProperties::_log_space_v
protected

log-space the specific volume interpolation grid axis instead of linear

Definition at line 374 of file TabulatedFluidProperties.h.

Referenced by createVGridVector(), and TabulatedFluidProperties().

◆ _max_newton_its

const unsigned int SinglePhaseFluidProperties::_max_newton_its
protectedinherited

◆ _num_e

unsigned int TabulatedFluidProperties::_num_e
protected

◆ _num_p

unsigned int TabulatedFluidProperties::_num_p
protected

Number of pressure points in the tabulated data.

Definition at line 323 of file TabulatedFluidProperties.h.

Referenced by TabulatedBicubicFluidProperties::constructInterpolation(), generateTabulatedData(), readFileTabulationData(), and writeTabulatedData().

◆ _num_T

unsigned int TabulatedFluidProperties::_num_T
protected

Number of temperature points in the tabulated data.

Definition at line 321 of file TabulatedFluidProperties.h.

Referenced by TabulatedBicubicFluidProperties::constructInterpolation(), generateTabulatedData(), readFileTabulationData(), and writeTabulatedData().

◆ _num_v

unsigned int TabulatedFluidProperties::_num_v
protected

◆ _OOBBehavior

MooseEnum TabulatedFluidProperties::_OOBBehavior
protected

◆ _p_from_v_e_ipol

std::unique_ptr<BidimensionalInterpolation> TabulatedFluidProperties::_p_from_v_e_ipol
protected

◆ _p_from_v_h_ipol

std::unique_ptr<BidimensionalInterpolation> TabulatedFluidProperties::_p_from_v_h_ipol
protected

Bidimensional interpolation of pressure from (v,h)

Definition at line 402 of file TabulatedFluidProperties.h.

Referenced by TabulatedBicubicFluidProperties::constructInterpolation(), and e_from_v_h().

◆ _p_idx

unsigned int TabulatedFluidProperties::_p_idx
protected

◆ _p_initial_guess

const Real SinglePhaseFluidProperties::_p_initial_guess
protectedinherited

◆ _pressure

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

◆ _pressure_max

Real TabulatedFluidProperties::_pressure_max
protected

◆ _pressure_min

Real TabulatedFluidProperties::_pressure_min
protected

◆ _properties

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

◆ _properties_ve

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

Tabulated fluid properties in (v,e) (read from file OR computed from _fp)

Definition at line 305 of file TabulatedFluidProperties.h.

Referenced by TabulatedBicubicFluidProperties::constructInterpolation(), createVHGridVectors(), generateVETabulatedData(), and readFileTabulationData().

◆ _property_ipol

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

◆ _property_ve_ipol

std::vector<std::unique_ptr<BidimensionalInterpolation> > TabulatedFluidProperties::_property_ve_ipol
protected

Vector of bi-dimensional interpolation of fluid properties directly in (v,e)

Definition at line 310 of file TabulatedFluidProperties.h.

Referenced by c_from_v_e(), TabulatedBicubicFluidProperties::constructInterpolation(), cp_from_v_e(), cv_from_v_e(), g_from_v_e(), h_from_p_T(), k_from_v_e(), mu_from_v_e(), p_from_v_e(), s_from_p_T(), s_from_v_e(), and T_from_v_e().

◆ _R

const Real FluidProperties::_R = 8.3144598
staticinherited

◆ _save_file

const bool TabulatedFluidProperties::_save_file
protected

Whether to save a generated fluid properties file to disk.

Definition at line 284 of file TabulatedFluidProperties.h.

Referenced by initialSetup().

◆ _specific_volume

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

◆ _T_c2k

const Real FluidProperties::_T_c2k
protectedinherited

◆ _T_from_v_e_ipol

std::unique_ptr<BidimensionalInterpolation> TabulatedFluidProperties::_T_from_v_e_ipol
protected

◆ _T_from_v_h_ipol

std::unique_ptr<BidimensionalInterpolation> TabulatedFluidProperties::_T_from_v_h_ipol
protected

Bi-dimensional interpolation of temperature from (v,h)

Definition at line 399 of file TabulatedFluidProperties.h.

Referenced by TabulatedBicubicFluidProperties::constructInterpolation(), and e_from_v_h().

◆ _T_idx

unsigned int TabulatedFluidProperties::_T_idx
protected

◆ _T_initial_guess

const Real SinglePhaseFluidProperties::_T_initial_guess
protectedinherited

◆ _temperature

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

◆ _temperature_max

Real TabulatedFluidProperties::_temperature_max
protected

◆ _temperature_min

Real TabulatedFluidProperties::_temperature_min
protected

◆ _tolerance

const Real SinglePhaseFluidProperties::_tolerance
protectedinherited

◆ _v_bounds_specified

bool TabulatedFluidProperties::_v_bounds_specified
protected

Whether the specific volume bounds were set by the user.

Definition at line 407 of file TabulatedFluidProperties.h.

Referenced by createVGridVector(), readFileTabulationData(), and TabulatedFluidProperties().

◆ _v_max

Real TabulatedFluidProperties::_v_max
protected

Maximum specific volume in tabulated data (can be user-specified)

Definition at line 415 of file TabulatedFluidProperties.h.

Referenced by checkInputVariablesVE(), TabulatedBicubicFluidProperties::checkNaNs(), createVGridVector(), readFileTabulationData(), TabulatedFluidProperties(), and v_from_p_T().

◆ _v_min

Real TabulatedFluidProperties::_v_min
protected

Minimum specific volume in tabulated data (can be user-specified)

Definition at line 413 of file TabulatedFluidProperties.h.

Referenced by checkInputVariablesVE(), TabulatedBicubicFluidProperties::checkNaNs(), createVGridVector(), readFileTabulationData(), TabulatedFluidProperties(), and v_from_p_T().

◆ _verbose_newton

const bool SinglePhaseFluidProperties::_verbose_newton
protectedinherited

◆ _viscosity_idx

unsigned int TabulatedFluidProperties::_viscosity_idx
protected

◆ h

e e e e s T T T T T rho v v T e SinglePhaseFluidProperties::h
inherited

Definition at line 212 of file SinglePhaseFluidProperties.h.

Referenced by SodiumSaturationFluidProperties::e_from_p_T(), NaKFluidProperties::e_from_p_T(), NaClFluidProperties::e_from_p_T(), LeadBismuthFluidProperties::e_from_p_T(), LeadLithiumFluidProperties::e_from_p_T(), LeadFluidProperties::e_from_p_T(), TemperaturePressureFunctionFluidProperties::e_from_p_T(), LinearFluidProperties::e_from_v_h(), CaloricallyImperfectGas::e_from_v_h(), StiffenedGasFluidProperties::e_from_v_h(), IdealGasFluidProperties::e_from_v_h(), Water97FluidProperties::e_from_v_h(), SimpleFluidProperties::e_from_v_h(), e_from_v_h(), HeliumFluidProperties::e_from_v_h(), g_from_v_e(), SodiumSaturationFluidProperties::h_from_p_T(), HelmholtzFluidProperties::h_from_p_T(), LinearFluidProperties::h_from_p_T(), StiffenedGasFluidProperties::h_from_p_T(), NaKFluidProperties::h_from_p_T(), LeadLithiumFluidProperties::h_from_p_T(), LeadBismuthFluidProperties::h_from_p_T(), LeadFluidProperties::h_from_p_T(), CaloricallyImperfectGas::h_from_p_T(), NaClFluidProperties::h_from_p_T(), h_from_p_T(), IdealGasFluidProperties::h_from_p_T(), SimpleFluidProperties::h_from_p_T(), TemperaturePressureFunctionFluidProperties::h_from_p_T(), Water97FluidProperties::h_from_p_T(), FlibeFluidProperties::h_from_p_T(), FlinakFluidProperties::h_from_p_T(), HeliumFluidProperties::h_from_p_T(), Water97FluidProperties::h_from_p_T_template(), StiffenedGasFluidProperties::h_from_T_v(), CaloricallyImperfectGas::h_from_T_v(), IdealGasFluidProperties::h_from_T_v(), LeadLithiumFluidProperties::h_from_v_e(), LeadBismuthFluidProperties::h_from_v_e(), LeadFluidProperties::h_from_v_e(), StiffenedGasFluidProperties::p_from_h_s(), CaloricallyImperfectGas::p_from_h_s(), IdealGasFluidProperties::p_from_h_s(), LeadBismuthFluidProperties::p_from_v_e(), LeadLithiumFluidProperties::p_from_v_e(), LeadFluidProperties::p_from_v_e(), SimpleFluidProperties::p_from_v_h(), SinglePhaseFluidProperties::p_T_from_h_s(), SinglePhaseFluidProperties::p_T_from_v_h(), Water97FluidProperties::p_T_from_v_h(), StiffenedGasFluidProperties::s_from_h_p(), CaloricallyImperfectGas::s_from_h_p(), IdealGasFluidProperties::s_from_h_p(), s_from_h_p(), Water97FluidProperties::s_from_h_p(), CaloricallyImperfectGas::T_from_h(), T_from_h_s(), LeadLithiumFluidProperties::T_from_p_h(), LeadBismuthFluidProperties::T_from_p_h(), LeadFluidProperties::T_from_p_h(), TemperaturePressureFunctionFluidProperties::T_from_p_h(), CaloricallyImperfectGas::T_from_p_h(), FlibeFluidProperties::T_from_p_h(), FlinakFluidProperties::T_from_p_h(), HeliumFluidProperties::T_from_p_h(), IdealGasFluidProperties::T_from_p_h(), SimpleFluidProperties::T_from_p_h(), Water97FluidProperties::T_from_p_h(), and SimpleFluidProperties::T_from_v_h().

◆ p [1/10]

e e e e SinglePhaseFluidProperties::p
inherited

Definition at line 190 of file SinglePhaseFluidProperties.h.

Referenced by LinearFluidProperties::beta_from_p_T(), CaloricallyImperfectGas::c_from_p_T(), Water97FluidProperties::c_from_p_T(), StiffenedGasFluidProperties::c_from_v_e(), HeliumFluidProperties::c_from_v_e(), Water97FluidProperties::c_from_v_e(), c_from_v_e(), LeadBismuthFluidProperties::cp_from_p_T(), LeadLithiumFluidProperties::cp_from_p_T(), LeadFluidProperties::cp_from_p_T(), IdealGasFluidProperties::cp_from_p_T(), TemperaturePressureFunctionFluidProperties::cp_from_p_T(), TemperaturePressureFunctionFluidProperties::cp_from_v_e(), Water97FluidProperties::cp_from_v_e(), cp_from_v_e(), LeadFluidProperties::cv_from_p_T(), LeadLithiumFluidProperties::cv_from_p_T(), LeadBismuthFluidProperties::cv_from_p_T(), IdealGasFluidProperties::cv_from_p_T(), LeadLithiumFluidProperties::cv_from_v_e(), LeadBismuthFluidProperties::cv_from_v_e(), LeadFluidProperties::cv_from_v_e(), TemperaturePressureFunctionFluidProperties::cv_from_v_e(), Water97FluidProperties::cv_from_v_e(), cv_from_v_e(), TestSinglePhaseFluidProperties::e_from_p_rho(), LinearTestFluidProperties::e_from_p_rho(), LinearFluidProperties::e_from_p_rho(), LeadLithiumFluidProperties::e_from_p_rho(), LeadBismuthFluidProperties::e_from_p_rho(), IdealGasFluidProperties::e_from_p_rho(), LeadFluidProperties::e_from_p_rho(), Water97FluidProperties::e_from_p_rho(), SimpleFluidProperties::e_from_p_rho(), TemperaturePressureFunctionFluidProperties::e_from_p_rho(), FlibeFluidProperties::e_from_p_rho(), FlinakFluidProperties::e_from_p_rho(), HeliumFluidProperties::e_from_p_rho(), Water97FluidProperties::e_from_p_rho_template(), LinearFluidProperties::e_from_p_T(), StiffenedGasFluidProperties::e_from_p_T(), LeadLithiumFluidProperties::e_from_p_T(), LeadBismuthFluidProperties::e_from_p_T(), LeadFluidProperties::e_from_p_T(), CaloricallyImperfectGas::e_from_p_T(), IdealGasFluidProperties::e_from_p_T(), Water97FluidProperties::e_from_v_h(), SimpleFluidProperties::e_from_v_h(), e_from_v_h(), StiffenedGasFluidProperties::g_from_v_e(), CaloricallyImperfectGas::g_from_v_e(), IdealGasFluidProperties::g_from_v_e(), g_from_v_e(), CaloricallyImperfectGas::gamma_from_p_T(), generateTabulatedData(), LinearFluidProperties::h_from_p_T(), StiffenedGasFluidProperties::h_from_p_T(), LeadLithiumFluidProperties::h_from_p_T(), LeadBismuthFluidProperties::h_from_p_T(), LeadFluidProperties::h_from_p_T(), CaloricallyImperfectGas::h_from_p_T(), IdealGasFluidProperties::h_from_p_T(), Water97FluidProperties::henryConstant(), LeadBismuthFluidProperties::k_from_p_T(), LeadLithiumFluidProperties::k_from_p_T(), LeadFluidProperties::k_from_p_T(), CaloricallyImperfectGas::k_from_p_T(), IdealGasFluidProperties::k_from_p_T(), CaloricallyImperfectGas::k_from_v_e(), TemperaturePressureFunctionFluidProperties::k_from_v_e(), k_from_v_e(), HeliumFluidProperties::k_from_v_e(), Water97FluidProperties::k_from_v_e_template(), LeadBismuthFluidProperties::mu_from_p_T(), LeadLithiumFluidProperties::mu_from_p_T(), LeadFluidProperties::mu_from_p_T(), CaloricallyImperfectGas::mu_from_v_e(), TemperaturePressureFunctionFluidProperties::mu_from_v_e(), mu_from_v_e(), StiffenedGasFluidProperties::p_from_h_s(), CaloricallyImperfectGas::p_from_h_s(), IdealGasFluidProperties::p_from_h_s(), StiffenedGasFluidProperties::p_from_T_v(), CaloricallyImperfectGas::p_from_T_v(), IdealGasFluidProperties::p_from_T_v(), LinearFluidProperties::p_from_v_e(), LeadFluidProperties::p_from_v_e(), LeadLithiumFluidProperties::p_from_v_e(), LeadBismuthFluidProperties::p_from_v_e(), LinearTestFluidProperties::p_from_v_e(), CaloricallyImperfectGas::p_from_v_e(), IdealGasFluidProperties::p_from_v_e(), FlibeFluidProperties::p_from_v_e(), FlinakFluidProperties::p_from_v_e(), HeliumFluidProperties::p_from_v_e(), TemperaturePressureFunctionFluidProperties::p_from_v_e(), SimpleFluidProperties::p_from_v_e(), p_from_v_e(), Water97FluidProperties::p_from_v_e_template(), SimpleFluidProperties::p_from_v_h(), SinglePhaseFluidProperties::p_T_from_v_e(), Water97FluidProperties::p_T_from_v_e(), SinglePhaseFluidProperties::rho_e_from_p_T(), StiffenedGasFluidProperties::rho_from_p_s(), rho_from_p_s(), CaloricallyImperfectGas::rho_from_p_s(), IdealGasFluidProperties::rho_from_p_s(), TestSinglePhaseFluidProperties::rho_from_p_T(), LinearTestFluidProperties::rho_from_p_T(), rho_from_p_T(), LinearFluidProperties::rho_from_p_T(), CaloricallyImperfectGas::rho_from_p_T(), LeadBismuthFluidProperties::rho_from_p_T(), LeadLithiumFluidProperties::rho_from_p_T(), LeadFluidProperties::rho_from_p_T(), IdealGasFluidProperties::rho_from_p_T(), SinglePhaseFluidProperties::rho_mu_from_p_T(), Water97FluidProperties::rho_T_from_v_e(), StiffenedGasFluidProperties::s_from_h_p(), CaloricallyImperfectGas::s_from_h_p(), IdealGasFluidProperties::s_from_h_p(), Water97FluidProperties::s_from_h_p(), CaloricallyImperfectGas::s_from_p_T(), IdealGasFluidProperties::s_from_p_T(), s_from_p_T(), CaloricallyImperfectGas::s_from_T_v(), IdealGasFluidProperties::s_from_T_v(), IdealGasFluidProperties::s_from_v_e(), s_from_v_e(), Water97FluidProperties::T_drhodT_from_p_rho(), T_from_h_s(), LeadBismuthFluidProperties::T_from_p_h(), LeadLithiumFluidProperties::T_from_p_h(), LeadFluidProperties::T_from_p_h(), TemperaturePressureFunctionFluidProperties::T_from_p_h(), CaloricallyImperfectGas::T_from_p_h(), SimpleFluidProperties::T_from_p_h(), Water97FluidProperties::T_from_p_h(), NaKFluidProperties::T_from_p_rho(), LeadLithiumFluidProperties::T_from_p_rho(), LeadBismuthFluidProperties::T_from_p_rho(), LeadFluidProperties::T_from_p_rho(), TemperaturePressureFunctionFluidProperties::T_from_p_rho(), FlibeFluidProperties::T_from_p_rho(), T_from_p_rho(), FlinakFluidProperties::T_from_p_rho(), SimpleFluidProperties::T_from_p_rho(), T_from_p_s(), TemperaturePressureFunctionFluidProperties::T_from_v_e(), FlibeFluidProperties::T_from_v_e(), FlinakFluidProperties::T_from_v_e(), SinglePhaseFluidProperties::v_e_from_p_T(), LeadLithiumFluidProperties::v_from_p_T(), LeadBismuthFluidProperties::v_from_p_T(), LeadFluidProperties::v_from_p_T(), Water97FluidProperties::vaporPressure(), SinglePhaseFluidProperties::vaporPressure(), Water97FluidProperties::vaporTemperature(), SinglePhaseFluidProperties::vaporTemperature(), and writeTabulatedData().

◆ p [2/10]

e e e e s SinglePhaseFluidProperties::p
inherited

Definition at line 192 of file SinglePhaseFluidProperties.h.

◆ p [3/10]

e e e e s T T SinglePhaseFluidProperties::p
inherited

Definition at line 196 of file SinglePhaseFluidProperties.h.

◆ p [4/10]

e e e e s T T T SinglePhaseFluidProperties::p
inherited

Definition at line 198 of file SinglePhaseFluidProperties.h.

◆ p [5/10]

e e e e s T T T T SinglePhaseFluidProperties::p
inherited

Definition at line 200 of file SinglePhaseFluidProperties.h.

◆ p [6/10]

e e e e s T T T T T SinglePhaseFluidProperties::p
inherited

Definition at line 202 of file SinglePhaseFluidProperties.h.

◆ p [7/10]

e e e e s T T T T T rho v v SinglePhaseFluidProperties::p
inherited

Definition at line 208 of file SinglePhaseFluidProperties.h.

◆ p [8/10]

e e e e s T T T T T rho v v T e p SinglePhaseFluidProperties::p
inherited

Definition at line 214 of file SinglePhaseFluidProperties.h.

◆ p [9/10]

e e e e s T T T T T rho v v T e p T SinglePhaseFluidProperties::p
inherited

Definition at line 216 of file SinglePhaseFluidProperties.h.

◆ p [10/10]

e e e e s T T T T T rho v v T e p T T SinglePhaseFluidProperties::p
inherited

Definition at line 218 of file SinglePhaseFluidProperties.h.

◆ rho

e e e e s T SinglePhaseFluidProperties::rho
inherited

Definition at line 194 of file SinglePhaseFluidProperties.h.

Referenced by HeliumFluidProperties::beta_from_p_T(), TemperaturePressureFunctionFluidProperties::beta_from_p_T(), FlinakFluidProperties::beta_from_p_T(), StiffenedGasFluidProperties::c2_from_p_rho(), HeliumFluidProperties::c_from_v_e(), TemperaturePressureFunctionFluidProperties::cp_from_p_T(), LeadFluidProperties::cv_from_p_T(), LeadLithiumFluidProperties::cv_from_p_T(), LeadBismuthFluidProperties::cv_from_p_T(), TemperaturePressureFunctionFluidProperties::cv_from_p_T(), TestSinglePhaseFluidProperties::e_from_p_rho(), LinearTestFluidProperties::e_from_p_rho(), LinearFluidProperties::e_from_p_rho(), e_from_p_rho(), LeadLithiumFluidProperties::e_from_p_rho(), LeadBismuthFluidProperties::e_from_p_rho(), IdealGasFluidProperties::e_from_p_rho(), LeadFluidProperties::e_from_p_rho(), Water97FluidProperties::e_from_p_rho(), SimpleFluidProperties::e_from_p_rho(), TemperaturePressureFunctionFluidProperties::e_from_p_rho(), FlibeFluidProperties::e_from_p_rho(), FlinakFluidProperties::e_from_p_rho(), HeliumFluidProperties::e_from_p_rho(), Water97FluidProperties::e_from_p_rho_template(), NaKFluidProperties::e_from_p_T(), LinearFluidProperties::e_from_p_T(), e_from_p_T(), NaClFluidProperties::e_from_p_T(), SalineMoltenSaltFluidProperties::e_from_p_T(), LinearFluidProperties::h_from_p_T(), TemperaturePressureFunctionFluidProperties::h_from_p_T(), Water97FluidProperties::k_from_p_T_template(), CO2FluidProperties::mu_from_p_T(), NitrogenFluidProperties::mu_from_p_T(), NaKFluidProperties::mu_from_p_T(), HydrogenFluidProperties::mu_from_p_T(), Water97FluidProperties::mu_from_p_T(), Water97FluidProperties::mu_from_p_T_template(), Water97FluidProperties::mu_from_v_e(), Water97FluidProperties::p_from_v_e_template(), Water97FluidProperties::p_T_from_v_e(), SinglePhaseFluidProperties::rho_e_from_p_T(), StiffenedGasFluidProperties::rho_from_p_s(), rho_from_p_s(), IdealGasFluidProperties::rho_from_p_s(), TestSinglePhaseFluidProperties::rho_from_p_T(), LinearTestFluidProperties::rho_from_p_T(), SodiumSaturationFluidProperties::rho_from_p_T(), PBSodiumFluidProperties::rho_from_p_T(), HelmholtzFluidProperties::rho_from_p_T(), NaKFluidProperties::rho_from_p_T(), rho_from_p_T(), CO2FluidProperties::rho_from_p_T(), LinearFluidProperties::rho_from_p_T(), NaClFluidProperties::rho_from_p_T(), LeadBismuthFluidProperties::rho_from_p_T(), LeadLithiumFluidProperties::rho_from_p_T(), CaloricallyImperfectGas::rho_from_p_T(), SalineMoltenSaltFluidProperties::rho_from_p_T(), LeadFluidProperties::rho_from_p_T(), IdealGasFluidProperties::rho_from_p_T(), Water97FluidProperties::rho_from_p_T(), SimpleFluidProperties::rho_from_p_T(), TemperaturePressureFunctionFluidProperties::rho_from_p_T(), FlibeFluidProperties::rho_from_p_T(), FlinakFluidProperties::rho_from_p_T(), HeliumFluidProperties::rho_from_p_T(), Water97FluidProperties::rho_from_p_T_template(), NitrogenFluidProperties::rho_mu_from_p_T(), HydrogenFluidProperties::rho_mu_from_p_T(), CO2FluidProperties::rho_mu_from_p_T(), Water97FluidProperties::rho_mu_from_p_T(), SinglePhaseFluidProperties::rho_mu_from_p_T(), Water97FluidProperties::rho_T_from_v_e(), Water97FluidProperties::T_drhodT_from_p_rho(), LeadLithiumFluidProperties::T_from_p_rho(), LeadBismuthFluidProperties::T_from_p_rho(), LeadFluidProperties::T_from_p_rho(), TemperaturePressureFunctionFluidProperties::T_from_p_rho(), FlibeFluidProperties::T_from_p_rho(), T_from_p_rho(), FlinakFluidProperties::T_from_p_rho(), SimpleFluidProperties::T_from_p_rho(), SinglePhaseFluidProperties::v_e_from_p_T(), v_from_p_T(), and TemperaturePressureFunctionFluidProperties::v_from_p_T().

◆ T [1/2]

e e e e s T T T T T rho SinglePhaseFluidProperties::T
inherited

Definition at line 204 of file SinglePhaseFluidProperties.h.

Referenced by LinearFluidProperties::beta_from_p_T(), IdealGasFluidProperties::beta_from_p_T(), LeadBismuthFluidProperties::bulk_modulus_from_p_T(), LeadLithiumFluidProperties::bulk_modulus_from_p_T(), LeadFluidProperties::bulk_modulus_from_p_T(), LeadLithiumFluidProperties::c_from_p_T(), CaloricallyImperfectGas::c_from_p_T(), Water97FluidProperties::c_from_p_T(), IdealGasFluidProperties::c_from_p_T(), Water97FluidProperties::c_from_p_T_template(), IdealGasFluidProperties::c_from_v_e(), LeadBismuthFluidProperties::c_from_v_e(), LeadLithiumFluidProperties::c_from_v_e(), LeadFluidProperties::c_from_v_e(), CaloricallyImperfectGas::c_from_v_e(), HeliumFluidProperties::c_from_v_e(), Water97FluidProperties::c_from_v_e(), c_from_v_e(), checkInputVariables(), checkInputVariablesVE(), LeadBismuthFluidProperties::cp_from_p_T(), LeadLithiumFluidProperties::cp_from_p_T(), LeadFluidProperties::cp_from_p_T(), CaloricallyImperfectGas::cp_from_p_T(), IdealGasFluidProperties::cp_from_p_T(), TemperaturePressureFunctionFluidProperties::cp_from_p_T(), Water97FluidProperties::cp_from_p_T_template(), CaloricallyImperfectGas::cp_from_T(), CaloricallyImperfectGas::cp_from_v_e(), LeadLithiumFluidProperties::cp_from_v_e(), LeadBismuthFluidProperties::cp_from_v_e(), LeadFluidProperties::cp_from_v_e(), TemperaturePressureFunctionFluidProperties::cp_from_v_e(), Water97FluidProperties::cp_from_v_e(), cp_from_v_e(), LeadFluidProperties::cv_from_p_T(), LeadLithiumFluidProperties::cv_from_p_T(), LeadBismuthFluidProperties::cv_from_p_T(), CaloricallyImperfectGas::cv_from_p_T(), IdealGasFluidProperties::cv_from_p_T(), Water97FluidProperties::cv_from_p_T_template(), CaloricallyImperfectGas::cv_from_T(), CaloricallyImperfectGas::cv_from_T_v(), CaloricallyImperfectGas::cv_from_v_e(), LeadLithiumFluidProperties::cv_from_v_e(), LeadBismuthFluidProperties::cv_from_v_e(), LeadFluidProperties::cv_from_v_e(), TemperaturePressureFunctionFluidProperties::cv_from_v_e(), Water97FluidProperties::cv_from_v_e(), cv_from_v_e(), Water97FluidProperties::d2gamma1_dpi2(), Water97FluidProperties::d2gamma1_dpitau(), Water97FluidProperties::d2gamma1_dtau2(), Water97FluidProperties::d2gamma2_dpi2(), Water97FluidProperties::d2gamma2_dpitau(), Water97FluidProperties::d2gamma2_dtau2(), Water97FluidProperties::d2gamma5_dpi2(), Water97FluidProperties::d2gamma5_dpitau(), Water97FluidProperties::d2gamma5_dtau2(), Water97FluidProperties::d2phi3_ddelta2(), Water97FluidProperties::d2phi3_ddeltatau(), Water97FluidProperties::d2phi3_dtau2(), Water97FluidProperties::densityRegion3(), Water97FluidProperties::dgamma1_dpi(), Water97FluidProperties::dgamma1_dtau(), Water97FluidProperties::dgamma2_dpi(), Water97FluidProperties::dgamma2_dtau(), Water97FluidProperties::dgamma5_dpi(), Water97FluidProperties::dgamma5_dtau(), Water97FluidProperties::dphi3_ddelta(), Water97FluidProperties::dphi3_dtau(), e_from_p_rho(), LeadLithiumFluidProperties::e_from_p_rho(), LeadBismuthFluidProperties::e_from_p_rho(), LeadFluidProperties::e_from_p_rho(), SimpleFluidProperties::e_from_p_rho(), LinearFluidProperties::e_from_p_T(), StiffenedGasFluidProperties::e_from_p_T(), LeadLithiumFluidProperties::e_from_p_T(), LeadBismuthFluidProperties::e_from_p_T(), CaloricallyImperfectGas::e_from_p_T(), LeadFluidProperties::e_from_p_T(), IdealGasFluidProperties::e_from_p_T(), Water97FluidProperties::e_from_p_T_template(), CaloricallyImperfectGas::e_from_T(), StiffenedGasFluidProperties::e_from_T_v(), CaloricallyImperfectGas::e_from_T_v(), IdealGasFluidProperties::e_from_T_v(), HeliumFluidProperties::e_from_T_v(), CaloricallyImperfectGas::e_from_v_h(), Water97FluidProperties::e_from_v_h(), SimpleFluidProperties::e_from_v_h(), e_from_v_h(), StiffenedGasFluidProperties::g_from_v_e(), CaloricallyImperfectGas::g_from_v_e(), IdealGasFluidProperties::g_from_v_e(), g_from_v_e(), Water97FluidProperties::gamma1(), Water97FluidProperties::gamma2(), Water97FluidProperties::gamma5(), CaloricallyImperfectGas::gamma_from_p_T(), LinearFluidProperties::h_from_p_T(), StiffenedGasFluidProperties::h_from_p_T(), LeadLithiumFluidProperties::h_from_p_T(), LeadBismuthFluidProperties::h_from_p_T(), LeadFluidProperties::h_from_p_T(), CaloricallyImperfectGas::h_from_p_T(), IdealGasFluidProperties::h_from_p_T(), Water97FluidProperties::h_from_p_T_template(), CaloricallyImperfectGas::h_from_T(), StiffenedGasFluidProperties::h_from_T_v(), CaloricallyImperfectGas::h_from_T_v(), IdealGasFluidProperties::h_from_T_v(), LeadLithiumFluidProperties::h_from_v_e(), LeadBismuthFluidProperties::h_from_v_e(), LeadFluidProperties::h_from_v_e(), Water97FluidProperties::henryConstant(), LeadBismuthFluidProperties::k_from_p_T(), LeadLithiumFluidProperties::k_from_p_T(), LeadFluidProperties::k_from_p_T(), CaloricallyImperfectGas::k_from_p_T(), IdealGasFluidProperties::k_from_p_T(), Water97FluidProperties::k_from_p_T_template(), Water97FluidProperties::k_from_rho_T_template(), CaloricallyImperfectGas::k_from_v_e(), LeadBismuthFluidProperties::k_from_v_e(), LeadLithiumFluidProperties::k_from_v_e(), LeadFluidProperties::k_from_v_e(), TemperaturePressureFunctionFluidProperties::k_from_v_e(), k_from_v_e(), HeliumFluidProperties::k_from_v_e(), SinglePhaseFluidProperties::makeZeroAndOne(), LeadBismuthFluidProperties::mu_from_p_T(), CaloricallyImperfectGas::mu_from_p_T(), LeadLithiumFluidProperties::mu_from_p_T(), LeadFluidProperties::mu_from_p_T(), IdealGasFluidProperties::mu_from_p_T(), Water97FluidProperties::mu_from_p_T_template(), Water97FluidProperties::mu_from_rho_T_template(), CaloricallyImperfectGas::mu_from_v_e(), LeadLithiumFluidProperties::mu_from_v_e(), LeadBismuthFluidProperties::mu_from_v_e(), LeadFluidProperties::mu_from_v_e(), TemperaturePressureFunctionFluidProperties::mu_from_v_e(), mu_from_v_e(), Water97FluidProperties::mu_from_v_e(), CaloricallyImperfectGas::p_from_h_s(), StiffenedGasFluidProperties::p_from_T_v(), CaloricallyImperfectGas::p_from_T_v(), IdealGasFluidProperties::p_from_T_v(), HeliumFluidProperties::p_from_T_v(), CaloricallyImperfectGas::p_from_v_e(), HeliumFluidProperties::p_from_v_e(), FlibeFluidProperties::p_from_v_e(), FlinakFluidProperties::p_from_v_e(), TemperaturePressureFunctionFluidProperties::p_from_v_e(), Water97FluidProperties::p_from_v_e_template(), SimpleFluidProperties::p_from_v_h(), SinglePhaseFluidProperties::p_T_from_h_s(), SinglePhaseFluidProperties::p_T_from_v_e(), SinglePhaseFluidProperties::p_T_from_v_h(), Water97FluidProperties::p_T_from_v_h(), Water97FluidProperties::phi3(), SinglePhaseFluidProperties::rho_e_from_p_T(), StiffenedGasFluidProperties::rho_from_p_s(), rho_from_p_s(), CaloricallyImperfectGas::rho_from_p_s(), IdealGasFluidProperties::rho_from_p_s(), TestSinglePhaseFluidProperties::rho_from_p_T(), LinearTestFluidProperties::rho_from_p_T(), rho_from_p_T(), LinearFluidProperties::rho_from_p_T(), CaloricallyImperfectGas::rho_from_p_T(), LeadLithiumFluidProperties::rho_from_p_T(), LeadBismuthFluidProperties::rho_from_p_T(), LeadFluidProperties::rho_from_p_T(), IdealGasFluidProperties::rho_from_p_T(), Water97FluidProperties::rho_from_p_T_template(), SinglePhaseFluidProperties::rho_mu_from_p_T(), CaloricallyImperfectGas::s_from_h_p(), s_from_h_p(), Water97FluidProperties::s_from_h_p(), CaloricallyImperfectGas::s_from_p_T(), IdealGasFluidProperties::s_from_p_T(), s_from_p_T(), StiffenedGasFluidProperties::s_from_T_v(), CaloricallyImperfectGas::s_from_T_v(), IdealGasFluidProperties::s_from_T_v(), CaloricallyImperfectGas::s_from_v_e(), IdealGasFluidProperties::s_from_v_e(), s_from_v_e(), Water97FluidProperties::subregionVolume(), Water97FluidProperties::T_drhodT_from_p_rho(), T_from_h_s(), LeadLithiumFluidProperties::T_from_p_h(), LeadBismuthFluidProperties::T_from_p_h(), LeadFluidProperties::T_from_p_h(), HelmholtzFluidProperties::T_from_p_h(), TemperaturePressureFunctionFluidProperties::T_from_p_h(), CaloricallyImperfectGas::T_from_p_h(), IdealGasFluidProperties::T_from_p_h(), T_from_p_h(), Water97FluidProperties::T_from_p_h(), NaKFluidProperties::T_from_p_rho(), LeadLithiumFluidProperties::T_from_p_rho(), LeadBismuthFluidProperties::T_from_p_rho(), LeadFluidProperties::T_from_p_rho(), TemperaturePressureFunctionFluidProperties::T_from_p_rho(), T_from_p_rho(), SimpleFluidProperties::T_from_p_rho(), T_from_p_s(), LinearFluidProperties::T_from_v_e(), LeadLithiumFluidProperties::T_from_v_e(), LeadBismuthFluidProperties::T_from_v_e(), LinearTestFluidProperties::T_from_v_e(), LeadFluidProperties::T_from_v_e(), CaloricallyImperfectGas::T_from_v_e(), TemperaturePressureFunctionFluidProperties::T_from_v_e(), IdealGasFluidProperties::T_from_v_e(), FlibeFluidProperties::T_from_v_e(), FlinakFluidProperties::T_from_v_e(), HeliumFluidProperties::T_from_v_e(), SimpleFluidProperties::T_from_v_e(), T_from_v_e(), SimpleFluidProperties::T_from_v_h(), Water97FluidProperties::tempXY(), SinglePhaseFluidProperties::v_e_from_p_T(), LeadBismuthFluidProperties::v_from_p_T(), LeadLithiumFluidProperties::v_from_p_T(), LeadFluidProperties::v_from_p_T(), SinglePhaseFluidProperties::vaporPressure(), Water97FluidProperties::vaporPressureTemplate(), Water97FluidProperties::vaporTemperature(), SinglePhaseFluidProperties::vaporTemperature(), and CaloricallyImperfectGas::Z_from_T().

◆ T [2/2]

e e e e s T T T T T rho v SinglePhaseFluidProperties::T
inherited

Definition at line 206 of file SinglePhaseFluidProperties.h.

◆ v [1/5]

SinglePhaseFluidProperties::v
inherited

Definition at line 182 of file SinglePhaseFluidProperties.h.

Referenced by StiffenedGasFluidProperties::c_from_v_e(), LinearFluidProperties::c_from_v_e(), TestSinglePhaseFluidProperties::c_from_v_e(), IdealGasFluidProperties::c_from_v_e(), LeadBismuthFluidProperties::c_from_v_e(), LeadLithiumFluidProperties::c_from_v_e(), LeadFluidProperties::c_from_v_e(), CaloricallyImperfectGas::c_from_v_e(), HeliumFluidProperties::c_from_v_e(), Water97FluidProperties::c_from_v_e(), SimpleFluidProperties::c_from_v_e(), c_from_v_e(), checkInputVariablesVE(), LinearFluidProperties::cp_from_v_e(), StiffenedGasFluidProperties::cp_from_v_e(), CaloricallyImperfectGas::cp_from_v_e(), TestSinglePhaseFluidProperties::cp_from_v_e(), LeadBismuthFluidProperties::cp_from_v_e(), LeadLithiumFluidProperties::cp_from_v_e(), LeadFluidProperties::cp_from_v_e(), IdealGasFluidProperties::cp_from_v_e(), SimpleFluidProperties::cp_from_v_e(), TemperaturePressureFunctionFluidProperties::cp_from_v_e(), FlibeFluidProperties::cp_from_v_e(), FlinakFluidProperties::cp_from_v_e(), HeliumFluidProperties::cp_from_v_e(), Water97FluidProperties::cp_from_v_e(), cp_from_v_e(), FlibeFluidProperties::cv_from_p_T(), FlinakFluidProperties::cv_from_p_T(), StiffenedGasFluidProperties::cv_from_v_e(), LinearFluidProperties::cv_from_v_e(), TestSinglePhaseFluidProperties::cv_from_v_e(), CaloricallyImperfectGas::cv_from_v_e(), LeadBismuthFluidProperties::cv_from_v_e(), LeadLithiumFluidProperties::cv_from_v_e(), LeadFluidProperties::cv_from_v_e(), IdealGasFluidProperties::cv_from_v_e(), SimpleFluidProperties::cv_from_v_e(), TemperaturePressureFunctionFluidProperties::cv_from_v_e(), FlibeFluidProperties::cv_from_v_e(), FlinakFluidProperties::cv_from_v_e(), Water97FluidProperties::cv_from_v_e(), HeliumFluidProperties::cv_from_v_e(), cv_from_v_e(), e_from_p_rho(), HeliumFluidProperties::e_from_p_rho(), SodiumSaturationFluidProperties::e_from_p_T(), e_from_p_T(), LeadBismuthFluidProperties::e_from_p_T(), LeadLithiumFluidProperties::e_from_p_T(), LeadFluidProperties::e_from_p_T(), FlibeFluidProperties::e_from_p_T(), FlinakFluidProperties::e_from_p_T(), StiffenedGasFluidProperties::e_from_T_v(), CaloricallyImperfectGas::e_from_T_v(), HeliumFluidProperties::e_from_T_v(), LinearFluidProperties::e_from_v_h(), CaloricallyImperfectGas::e_from_v_h(), StiffenedGasFluidProperties::e_from_v_h(), IdealGasFluidProperties::e_from_v_h(), Water97FluidProperties::e_from_v_h(), SimpleFluidProperties::e_from_v_h(), e_from_v_h(), HeliumFluidProperties::e_from_v_h(), StiffenedGasFluidProperties::g_from_v_e(), CaloricallyImperfectGas::g_from_v_e(), IdealGasFluidProperties::g_from_v_e(), g_from_v_e(), CaloricallyImperfectGas::gamma_from_v_e(), generateVETabulatedData(), h_from_p_T(), LeadLithiumFluidProperties::h_from_v_e(), LeadBismuthFluidProperties::h_from_v_e(), LeadFluidProperties::h_from_v_e(), StiffenedGasFluidProperties::k_from_v_e(), CaloricallyImperfectGas::k_from_v_e(), TestSinglePhaseFluidProperties::k_from_v_e(), LeadBismuthFluidProperties::k_from_v_e(), LeadLithiumFluidProperties::k_from_v_e(), LeadFluidProperties::k_from_v_e(), TemperaturePressureFunctionFluidProperties::k_from_v_e(), FlibeFluidProperties::k_from_v_e(), FlinakFluidProperties::k_from_v_e(), k_from_v_e(), Water97FluidProperties::k_from_v_e(), HeliumFluidProperties::k_from_v_e(), Water97FluidProperties::k_from_v_e_template(), LinearTestFluidProperties::mu_from_v_e(), TestSinglePhaseFluidProperties::mu_from_v_e(), CaloricallyImperfectGas::mu_from_v_e(), LeadBismuthFluidProperties::mu_from_v_e(), LeadLithiumFluidProperties::mu_from_v_e(), LeadFluidProperties::mu_from_v_e(), TemperaturePressureFunctionFluidProperties::mu_from_v_e(), FlibeFluidProperties::mu_from_v_e(), FlinakFluidProperties::mu_from_v_e(), mu_from_v_e(), Water97FluidProperties::mu_from_v_e(), HeliumFluidProperties::mu_from_v_e(), CaloricallyImperfectGas::p_from_h_s(), StiffenedGasFluidProperties::p_from_T_v(), CaloricallyImperfectGas::p_from_T_v(), IdealGasFluidProperties::p_from_T_v(), HeliumFluidProperties::p_from_T_v(), TestConservedVarFluidProperties::p_from_v_e(), LinearFluidProperties::p_from_v_e(), LeadFluidProperties::p_from_v_e(), LeadBismuthFluidProperties::p_from_v_e(), LeadLithiumFluidProperties::p_from_v_e(), LinearTestFluidProperties::p_from_v_e(), CaloricallyImperfectGas::p_from_v_e(), IdealGasFluidProperties::p_from_v_e(), HeliumFluidProperties::p_from_v_e(), FlinakFluidProperties::p_from_v_e(), FlibeFluidProperties::p_from_v_e(), SodiumSaturationFluidProperties::p_from_v_e(), TemperaturePressureFunctionFluidProperties::p_from_v_e(), Water97FluidProperties::p_from_v_e(), SimpleFluidProperties::p_from_v_e(), p_from_v_e(), Water97FluidProperties::p_from_v_e_template(), SimpleFluidProperties::p_from_v_h(), SinglePhaseFluidProperties::p_T_from_v_e(), Water97FluidProperties::p_T_from_v_e(), SinglePhaseFluidProperties::p_T_from_v_h(), Water97FluidProperties::p_T_from_v_h(), Water97FluidProperties::rho_T_from_v_e(), CaloricallyImperfectGas::s_from_h_p(), CaloricallyImperfectGas::s_from_p_T(), s_from_p_T(), StiffenedGasFluidProperties::s_from_T_v(), CaloricallyImperfectGas::s_from_T_v(), IdealGasFluidProperties::s_from_T_v(), TestSinglePhaseFluidProperties::s_from_v_e(), CaloricallyImperfectGas::s_from_v_e(), IdealGasFluidProperties::s_from_v_e(), s_from_v_e(), LinearFluidProperties::T_from_v_e(), LeadLithiumFluidProperties::T_from_v_e(), LeadBismuthFluidProperties::T_from_v_e(), LinearTestFluidProperties::T_from_v_e(), LeadFluidProperties::T_from_v_e(), CaloricallyImperfectGas::T_from_v_e(), TemperaturePressureFunctionFluidProperties::T_from_v_e(), SodiumSaturationFluidProperties::T_from_v_e(), IdealGasFluidProperties::T_from_v_e(), FlibeFluidProperties::T_from_v_e(), FlinakFluidProperties::T_from_v_e(), HeliumFluidProperties::T_from_v_e(), SimpleFluidProperties::T_from_v_e(), Water97FluidProperties::T_from_v_e(), T_from_v_e(), SimpleFluidProperties::T_from_v_h(), SinglePhaseFluidProperties::v_e_from_p_T(), StiffenedGasFluidProperties::v_e_spndl_from_T(), CaloricallyImperfectGas::v_e_spndl_from_T(), IdealGasFluidProperties::v_e_spndl_from_T(), SodiumSaturationFluidProperties::v_from_p_T(), v_from_p_T(), Water97FluidProperties::v_from_p_T(), LeadLithiumFluidProperties::v_from_p_T(), LeadBismuthFluidProperties::v_from_p_T(), LeadFluidProperties::v_from_p_T(), TemperaturePressureFunctionFluidProperties::v_from_p_T(), FlibeFluidProperties::v_from_p_T(), FlinakFluidProperties::v_from_p_T(), Water97FluidProperties::v_from_p_T_template(), and writeTabulatedData().

◆ v [2/5]

e SinglePhaseFluidProperties::v
inherited

Definition at line 184 of file SinglePhaseFluidProperties.h.

◆ v [3/5]

e e SinglePhaseFluidProperties::v
inherited

Definition at line 186 of file SinglePhaseFluidProperties.h.

◆ v [4/5]

e e e SinglePhaseFluidProperties::v
inherited

Definition at line 188 of file SinglePhaseFluidProperties.h.

◆ v [5/5]

e e e e s T T T T T rho v v T SinglePhaseFluidProperties::v
inherited

Definition at line 210 of file SinglePhaseFluidProperties.h.


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