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
TabulatedBicubicFluidProperties Class Reference

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

#include <TabulatedBicubicFluidProperties.h>

Inheritance diagram for TabulatedBicubicFluidProperties:
[legend]

Public Types

typedef DataFileName DataFileParameterType
 

Public Member Functions

 TabulatedBicubicFluidProperties (const InputParameters &parameters)
 
virtual void constructInterpolation () override
 
virtual void initialSetup () override
 
virtual std::string fluidName () const override
 Fluid name. More...
 
virtual Real molarMass () const override
 Molar mass [kg/mol]. More...
 
virtual Real rho_from_p_T (Real pressure, Real temperature) const override
 
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 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 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 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 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 ADReal vaporPressure (const ADReal &T) const
 
virtual Real vaporTemperature (Real pressure) const override
 Vapor temperature. More...
 
virtual void vaporTemperature (Real pressure, Real &Tsat, Real &dTsat_dp) const override
 
virtual ADReal vaporTemperature (const ADReal &p) const
 
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 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 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 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...
 
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
 
SubProblemgetSubProblem () const
 
bool shouldDuplicateInitialExecution () const
 
virtual Real spatialValue (const Point &) const
 
virtual const std::vector< Point > spatialPoints () 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)
 
void setPrimaryThreadCopy (UserObject *primary)
 
UserObjectprimaryThreadCopy ()
 
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 (IsKokkosObjectKey &&) 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 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 mooseInfo (Args &&... args) const
 
void callMooseError (std::string msg, const bool with_prefix, const hit::Node *node=nullptr) 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 UserObjectgetUserObjectBase (const std::string &param_name, bool is_dependency=true) const
 
const UserObjectgetUserObjectBaseByName (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)
 
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
 
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)
 
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)
 

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 reshapeData2D (unsigned int nrow, unsigned int ncol, const std::vector< Real > &vec, std::vector< std::vector< Real >> &mat)
 Forms a 2D matrix from a single std::vector. More...
 
void checkNaNs (Real min_1, Real max_1, Real min_2, Real max_2, unsigned int i, Real &variable_1, Real &variable_2, unsigned int &num_nans_1, unsigned int &num_nans_2)
 If Newton Method jacobian produces NaNs, set variable to min or max depending on situation. More...
 
void checkOutofBounds (Real min, Real max, Real &variable, unsigned int &num_out_bounds)
 If values go out of user defined range during Newton Method inversion, set variable to min or max depending on situation. More...
 
void outputWarnings (unsigned int num_nans_p, unsigned int num_nans_T, unsigned int num_out_bounds_p, unsigned int num_out_bounds_T, unsigned int convergence_failures, unsigned int number_points, std::string variable_set)
 
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 () 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 FluidPropertiesForwardError (const std::string &desired_routine) const
 
virtual void addPostprocessorDependencyHelper (const PostprocessorName &name) const override
 
virtual void addVectorPostprocessorDependencyHelper (const VectorPostprocessorName &name) const override
 
virtual void addUserObjectDependencyHelper (const UserObject &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 to create direct (p,T) interpolations. More...
 
const bool _create_direct_ve_interpolations
 Whether to create direct (v,e) interpolations. 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 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...
 
SubProblem_subproblem
 
FEProblemBase_fe_problem
 
SystemBase_sys
 
const THREAD_ID _tid
 
Assembly_assembly
 
const Moose::CoordinateSystemType_coord_sys
 
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 file.

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

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

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

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

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

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

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

and so on.

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

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

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

Definition at line 87 of file TabulatedBicubicFluidProperties.h.

Member Enumeration Documentation

◆ OOBBehavior

enum TabulatedFluidProperties::OOBBehavior
protectedinherited

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

Enumerator
Ignore 
Throw 
DeclareInvalid 
WarnInvalid 
SetToClosestBound 

Definition at line 353 of file TabulatedFluidProperties.h.

Constructor & Destructor Documentation

◆ TabulatedBicubicFluidProperties()

TabulatedBicubicFluidProperties::TabulatedBicubicFluidProperties ( const InputParameters parameters)

Definition at line 35 of file TabulatedBicubicFluidProperties.C.

37 {
38 }
const InputParameters & parameters() const
TabulatedFluidProperties(const InputParameters &parameters)

Member Function Documentation

◆ c_from_p_T() [1/2]

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

Definition at line 704 of file TabulatedFluidProperties.C.

Referenced by TabulatedFluidProperties::c_from_v_e().

705 {
707  {
709  return _property_ipol[_c_idx]->sample(pressure, temperature);
710  }
711  else
712  {
713  if (_fp)
714  return _fp->c_from_p_T(pressure, temperature);
715  else
716  paramError("interpolated_properties", "No data to interpolate for speed of sound.");
717  }
718 }
void paramError(const std::string &param, Args... args) const
const bool _create_direct_pT_interpolations
Whether to create direct (p,T) interpolations.
static const std::string temperature
Definition: NS.h:59
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:56
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
overridevirtualinherited

Definition at line 721 of file TabulatedFluidProperties.C.

723 {
725  {
727  _property_ipol[_c_idx]->sampleValueAndDerivatives(pressure, temperature, c, dc_dp, dc_dT);
728  }
729  else
730  {
731  if (_fp)
732  _fp->c_from_p_T(pressure, temperature, c, dc_dp, dc_dT);
733  else
734  paramError("interpolated_properties", "No data to interpolate for speed of sound.");
735  }
736 }
void paramError(const std::string &param, Args... args) const
const bool _create_direct_pT_interpolations
Whether to create direct (p,T) interpolations.
static const std::string temperature
Definition: NS.h:59
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:56
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
overridevirtualinherited

Definition at line 1121 of file TabulatedFluidProperties.C.

Referenced by TabulatedFluidProperties::writeTabulatedData().

1122 {
1124  missingVEInterpolationError(__PRETTY_FUNCTION__);
1126 
1128  return _property_ve_ipol[_c_idx]->sample(v, e);
1129  else if (_construct_pT_from_ve)
1130  {
1131  Real p = _p_from_v_e_ipol->sample(v, e);
1132  Real T = _T_from_v_e_ipol->sample(v, e);
1133  return c_from_p_T(p, T);
1134  }
1135  else if (_fp)
1136  return _fp->c_from_v_e(v, e);
1137  else
1138  mooseError(__PRETTY_FUNCTION__,
1139  "\nNo tabulation or fluid property 'fp' object to compute value");
1140 }
const bool _create_direct_ve_interpolations
Whether to create direct (v,e) interpolations.
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 mooseError(Args &&... args) const

◆ 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
overridevirtualinherited

Definition at line 1143 of file TabulatedFluidProperties.C.

1144 {
1146  missingVEInterpolationError(__PRETTY_FUNCTION__);
1148 
1150  _property_ve_ipol[_c_idx]->sampleValueAndDerivatives(v, e, c, dc_dv, dc_de);
1151  else if (_construct_pT_from_ve)
1152  {
1153  Real p, dp_dv, dp_de;
1154  _p_from_v_e_ipol->sampleValueAndDerivatives(v, e, p, dp_dv, dp_de);
1155  Real T, dT_dv, dT_de;
1156  _T_from_v_e_ipol->sampleValueAndDerivatives(v, e, T, dT_dv, dT_de);
1157  Real dc_dp, dc_dT;
1158  c_from_p_T(p, T, c, dc_dp, dc_dT);
1159  dc_dv = dc_dp * dp_dv + dc_dT * dT_dv;
1160  dc_de = dc_dp * dp_de + dc_dT * dT_de;
1161  }
1162  else if (_fp)
1163  _fp->c_from_v_e(v, e, c, dc_dv, dc_de);
1164  else
1165  mooseError(__PRETTY_FUNCTION__,
1166  "\nNo tabulation or fluid property 'fp' object to compute value");
1167 }
const bool _create_direct_ve_interpolations
Whether to create direct (v,e) interpolations.
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 mooseError(Args &&... args) const

◆ 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 
)
protectedinherited

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

Referenced by TabulatedFluidProperties::readFileTabulationData().

2048 {
2049  // NOTE: We kept the comments in terms of pressure & temperature for clarity
2050  // Pressure (v1) and temperature (v2) data contains duplicates due to the csv format.
2051  // First, check that pressure (v1) is monotonically increasing
2052  if (!std::is_sorted(v1.begin(), v1.end()))
2053  mooseError("The column data for ", v1_name, " is not monotonically increasing in ", file_name);
2054 
2055  // The first pressure (v1) value is repeated for each temperature (v2) value. Counting the
2056  // number of repeats provides the number of temperature (v2) values
2057  auto num_v2 = std::count(v1.begin(), v1.end(), v1.front());
2058 
2059  // Now remove the duplicates in the pressure (v1) vector
2060  auto last_unique = std::unique(v1.begin(), v1.end());
2061  v1.erase(last_unique, v1.end());
2062 
2063  // Check that the number of rows in the csv file is equal to _num_v1 * _num_v2
2064  // v2 is currently the same size as the column_data (will get trimmed at the end)
2065  if (v2.size() != v1.size() * libMesh::cast_int<unsigned int>(num_v2))
2066  mooseError("The number of rows in ",
2067  file_name,
2068  " is not equal to the number of unique ",
2069  v1_name,
2070  " values ",
2071  v1.size(),
2072  " multiplied by the number of unique ",
2073  v2_name,
2074  " values ",
2075  num_v2);
2076 
2077  // Need to make sure that the temperature (v2) values are provided in ascending order
2078  std::vector<Real> base_v2(v2.begin(), v2.begin() + num_v2);
2079  if (!std::is_sorted(base_v2.begin(), base_v2.end()))
2080  mooseError("The column data for ", v2_name, " is not monotonically increasing in ", file_name);
2081 
2082  // Need to make sure that the temperature (v2) are repeated for each pressure (v1) grid point
2083  auto it_v2 = v2.begin() + num_v2;
2084  for (const auto i : make_range(v1.size() - 1))
2085  {
2086  std::vector<Real> repeated_v2(it_v2, it_v2 + num_v2);
2087  if (repeated_v2 != base_v2)
2088  mooseError(v2_name,
2089  " values for ",
2090  v1_name,
2091  " ",
2092  v1[i + 1],
2093  " are not identical to values for ",
2094  v1[0]);
2095 
2096  std::advance(it_v2, num_v2);
2097  }
2098 
2099  // At this point, all temperature (v2) data has been provided in ascending order
2100  // identically for each pressure (v1) value, so we can just keep the first range
2101  v2.erase(v2.begin() + num_v2, v2.end());
2102 }
IntRange< T > make_range(T beg, T end)
void mooseError(Args &&... args) const

◆ checkInitialGuess()

void TabulatedFluidProperties::checkInitialGuess ( ) const
protectedvirtualinherited

Checks initial guess for Newton Method.

Definition at line 1870 of file TabulatedFluidProperties.C.

Referenced by TabulatedFluidProperties::TabulatedFluidProperties().

1871 {
1873  {
1874  if (_p_initial_guess < _pressure_min || _p_initial_guess > _pressure_max)
1875  mooseWarning("Pressure initial guess for (p,T), (v,e) conversions " +
1877  " is outside the range of tabulated "
1878  "pressure (" +
1880 
1881  if (_T_initial_guess < _temperature_min || _T_initial_guess > _temperature_max)
1882  mooseWarning("Temperature initial guess for (p,T), (v,e) conversions " +
1884  " is outside the range of tabulated "
1885  "temperature (" +
1887  ").");
1888  }
1889 }
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)

◆ checkInputVariables()

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

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

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

1785 {
1786  using std::max, std::min;
1787 
1788  if (_OOBBehavior == Ignore)
1789  return;
1790  else if (MooseUtils::absoluteFuzzyGreaterThan(_pressure_min, pressure, libMesh::TOLERANCE) ||
1791  MooseUtils::absoluteFuzzyGreaterThan(pressure, _pressure_max, libMesh::TOLERANCE))
1792  {
1793  if (_OOBBehavior == Throw)
1794  throw MooseException("Pressure " + Moose::stringify(pressure) +
1795  " is outside the range of tabulated pressure (" +
1798 
1799  else
1800  {
1803  flagInvalidSolution("Pressure out of bounds");
1804  else if (_OOBBehavior == WarnInvalid)
1805  flagSolutionWarning("Pressure out of bounds");
1806  }
1807  }
1808 
1809  if (MooseUtils::absoluteFuzzyGreaterThan(_temperature_min, temperature, libMesh::TOLERANCE) ||
1810  MooseUtils::absoluteFuzzyGreaterThan(temperature, _temperature_max, libMesh::TOLERANCE))
1811  {
1812  if (_OOBBehavior == Throw)
1813  throw MooseException("Temperature " + Moose::stringify(temperature) +
1814  " is outside the range of tabulated temperature (" +
1817  else
1818  {
1821  flagInvalidSolution("Temperature out of bounds");
1822  else if (_OOBBehavior == WarnInvalid)
1823  flagSolutionWarning("Temperature out of bounds");
1824  }
1825  }
1826 }
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:59
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:56
auto min(const L &left, const R &right)

◆ checkInputVariablesVE()

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

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

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

1831 {
1832  using std::max, std::min;
1833 
1834  if (_OOBBehavior == Ignore)
1835  return;
1836  else if (e < _e_min || e > _e_max)
1837  {
1838  if (_OOBBehavior == Throw)
1839  throw MooseException("Specific internal energy " + Moose::stringify(e) +
1840  " is outside the range of tabulated specific internal energies (" +
1841  Moose::stringify(_e_min) + ", " + Moose::stringify(_e_max) + ").");
1842  else
1843  {
1844  e = max(_e_min, min(e, _e_max));
1846  flagInvalidSolution("Specific internal energy out of bounds");
1847  else if (_OOBBehavior == WarnInvalid)
1848  flagSolutionWarning("Specific internal energy out of bounds");
1849  }
1850  }
1851 
1852  if (v < _v_min || v > _v_max)
1853  {
1854  if (_OOBBehavior == Throw)
1855  throw MooseException("Specific volume " + Moose::stringify(v) +
1856  " is outside the range of tabulated specific volumes (" +
1857  Moose::stringify(_v_min) + ", " + Moose::stringify(_v_max) + ").");
1858  else
1859  {
1860  v = max(T(_v_min), min(v, T(_v_max)));
1862  flagInvalidSolution("Specific volume out of bounds");
1863  else if (_OOBBehavior == WarnInvalid)
1864  flagSolutionWarning("Specific volume out of bounds");
1865  }
1866  }
1867 }
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)

◆ checkNaNs()

void TabulatedBicubicFluidProperties::checkNaNs ( Real  min_1,
Real  max_1,
Real  min_2,
Real  max_2,
unsigned int  i,
Real variable_1,
Real variable_2,
unsigned int num_nans_1,
unsigned int num_nans_2 
)
protected

If Newton Method jacobian produces NaNs, set variable to min or max depending on situation.

Parameters
min_1minimum value of pressure
max_1maximum value of pressure
min_2minimum value of temperature
max_2maximum value of temperature
itrack iteration to get correct data point
variable_1pressure value
variable_2temperature value
num_nans_1track number of nans produced for pressure
num_nans_2track number of nans produced for temperature

Definition at line 272 of file TabulatedBicubicFluidProperties.C.

Referenced by constructInterpolation().

281 {
282  // replace nan values with pmax or pmin
283  if (std::isnan(variable_1))
284  {
285  if (_specific_volume[i] > ((_v_min + _v_max) / 2))
286  variable_1 = min_1;
287  else if (_specific_volume[i] < ((_v_min + _v_max) / 2))
288  variable_1 = max_1;
289  num_nans_1++;
290  }
291  // replace nan values with Tmax or Tmin
292  if (std::isnan(variable_2))
293  {
294  if (_specific_volume[i] > ((_v_min + _v_max) / 2))
295  variable_2 = max_2;
296  else if (_specific_volume[i] < ((_v_min + _v_max) / 2))
297  variable_2 = min_2;
298  num_nans_2++;
299  }
300 }
Real _v_min
Minimum specific volume in tabulated data (can be user-specified)
Real _v_max
Maximum specific volume in tabulated data (can be user-specified)
std::vector< Real > _specific_volume
Specific volume vector.

◆ checkOutofBounds()

void TabulatedBicubicFluidProperties::checkOutofBounds ( Real  min,
Real  max,
Real variable,
unsigned int num_out_bounds 
)
protected

If values go out of user defined range during Newton Method inversion, set variable to min or max depending on situation.

Parameters
minminimum value of variable
maxmaximum value of variable
variablevariable of interest (pressure or temperature)
num_out_boundstrack number of values out of user defined bounds

Definition at line 303 of file TabulatedBicubicFluidProperties.C.

Referenced by constructInterpolation().

307 {
308  if (variable < min)
309  {
310  variable = min;
311  num_out_bounds++;
312  }
313  else if (variable > max)
314  {
315  variable = max;
316  num_out_bounds++;
317  }
318 }
auto max(const L &left, const R &right)
auto min(const L &left, const R &right)

◆ computePropertyIndicesInInterpolationVectors()

void TabulatedFluidProperties::computePropertyIndicesInInterpolationVectors ( )
protectedinherited

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

Definition at line 2105 of file TabulatedFluidProperties.C.

Referenced by TabulatedFluidProperties::initialSetup().

2106 {
2107  // At this point, all properties read or generated are able to be used by
2108  // TabulatedFluidProperties. Now set flags and indexes for each property in
2109  //_interpolated_properties to use in property calculations
2110  for (std::size_t i = 0; i < _interpolated_properties.size(); ++i)
2111  {
2112  if (_interpolated_properties[i] == "density")
2113  {
2114  _interpolate_density = true;
2115  _density_idx = i;
2116  }
2117  else if (_interpolated_properties[i] == "enthalpy")
2118  {
2119  _interpolate_enthalpy = true;
2120  _enthalpy_idx = i;
2121  }
2122  else if (_interpolated_properties[i] == "internal_energy")
2123  {
2126  }
2127  else if (_interpolated_properties[i] == "viscosity")
2128  {
2129  _interpolate_viscosity = true;
2130  _viscosity_idx = i;
2131  }
2132  else if (_interpolated_properties[i] == "k")
2133  {
2134  _interpolate_k = true;
2135  _k_idx = i;
2136  }
2137  else if (_interpolated_properties[i] == "c")
2138  {
2139  _interpolate_c = true;
2140  _c_idx = i;
2141  }
2142  else if (_interpolated_properties[i] == "cp")
2143  {
2144  _interpolate_cp = true;
2145  _cp_idx = i;
2146  }
2147  else if (_interpolated_properties[i] == "cv")
2148  {
2149  _interpolate_cv = true;
2150  _cv_idx = i;
2151  }
2152  else if (_interpolated_properties[i] == "entropy")
2153  {
2154  _interpolate_entropy = true;
2155  _entropy_idx = i;
2156  }
2157  else if (_interpolated_properties[i] == "pressure")
2158  {
2159  _interpolate_pressure = true;
2160  _p_idx = i;
2161  }
2162  else if (_interpolated_properties[i] == "temperature")
2163  {
2164  _interpolate_temperature = true;
2165  _T_idx = i;
2166  }
2167  else
2168  mooseError("Specified property '" + _interpolated_properties[i] +
2169  "' is present in the tabulation but is not currently leveraged by the code in the "
2170  "TabulatedFluidProperties. If it is spelled correctly, then please contact a "
2171  "MOOSE or fluid properties module developer.");
2172  }
2173 }
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()

void TabulatedBicubicFluidProperties::constructInterpolation ( )
overridevirtual

Implements TabulatedFluidProperties.

Definition at line 41 of file TabulatedBicubicFluidProperties.C.

42 {
43  // Construct bicubic interpolants from tabulated data
44  std::vector<std::vector<Real>> data_matrix;
45 
47  {
48  _property_ipol.resize(_properties.size());
49  for (const auto i : index_range(_property_ipol))
50  {
51  reshapeData2D(_num_p, _num_T, _properties[i], data_matrix);
52  _property_ipol[i] =
53  std::make_unique<BicubicInterpolation>(_pressure, _temperature, data_matrix);
54  }
55  }
56 
58  {
59  _property_ve_ipol.resize(_properties_ve.size());
60 
61  for (const auto i : index_range(_property_ve_ipol))
62  {
63  reshapeData2D(_num_v, _num_e, _properties_ve[i], data_matrix);
65  std::make_unique<BicubicInterpolation>(_specific_volume, _internal_energy, data_matrix);
66  }
67  }
68 
69  bool conversion_succeeded = true;
70  unsigned int fail_counter_ve = 0;
71  unsigned int fail_counter_vh = 0;
72  // Create interpolations of (p,T) from (v,e)
74  {
75  // Grids in specific volume and internal energy can be either linear or logarithmic
76  // NOTE: this could have been called already when generating tabulated data
78 
79  // initialize vectors for interpolation
80  std::vector<std::vector<Real>> p_from_v_e(_num_v);
81  std::vector<std::vector<Real>> T_from_v_e(_num_v);
82 
83  unsigned int num_p_nans_ve = 0, num_T_nans_ve = 0, num_p_out_bounds_ve = 0,
84  num_T_out_bounds_ve = 0;
85 
86  for (unsigned int i = 0; i < _num_v; ++i)
87  {
88  Real p_guess = _p_initial_guess;
89  Real T_guess = _T_initial_guess;
90  p_from_v_e[i].resize(_num_e);
91  T_from_v_e[i].resize(_num_e);
92  for (unsigned int j = 0; j < _num_e; ++j)
93  {
94  Real p_ve, T_ve;
95  // Using an input fluid property instead of the tabulation will get more exact inversions
96  if (_fp)
101  p_ve,
102  T_ve,
103  conversion_succeeded);
104  else
105  {
106  // The inversion may step outside of the domain of definition of the interpolations,
107  // which are restricted to the range of the input CSV file
108  const auto old_error_behavior = _OOBBehavior;
112  p_guess,
113  T_guess,
114  p_ve,
115  T_ve,
116  conversion_succeeded);
117  _OOBBehavior = old_error_behavior;
118  // track number of times convergence failed
119  if (!conversion_succeeded)
120  ++fail_counter_ve;
121  }
122 
123  // check for NaNs in Newton Method
128  i,
129  p_ve,
130  T_ve,
131  num_p_nans_ve,
132  num_T_nans_ve);
133 
134  // replace out of bounds pressure values with pmax or pmin
135  checkOutofBounds(_pressure_min, _pressure_max, p_ve, num_p_out_bounds_ve);
136  // replace out of bounds temperature values with Tmax or Tmin
137  checkOutofBounds(_temperature_min, _temperature_max, T_ve, num_T_out_bounds_ve);
138 
139  p_from_v_e[i][j] = p_ve;
140  T_from_v_e[i][j] = T_ve;
141 
142  p_guess = p_ve;
143  T_guess = T_ve;
144  }
145  }
146  // output warning if nans or values out of bounds
147  outputWarnings(num_p_nans_ve,
148  num_T_nans_ve,
149  num_p_out_bounds_ve,
150  num_T_out_bounds_ve,
151  fail_counter_ve,
152  _num_e * _num_v,
153  "(v,e)");
154 
155  // the bicubic interpolation object are init'ed now
157  std::make_unique<BicubicInterpolation>(_specific_volume, _internal_energy, p_from_v_e);
159  std::make_unique<BicubicInterpolation>(_specific_volume, _internal_energy, T_from_v_e);
160  }
161 
162  // Create interpolations of (p,T) from (v,h)
164  {
165  // Grids in specific volume and enthalpy can be either linear or logarithmic
166  // NOTE: the specific volume grid could have been created when generating tabulated data
168 
169  // initialize vectors for interpolation
170  std::vector<std::vector<Real>> p_from_v_h(_num_v);
171  std::vector<std::vector<Real>> T_from_v_h(_num_v);
172 
173  unsigned int num_p_nans_vh = 0, num_T_nans_vh = 0, num_p_out_bounds_vh = 0,
174  num_T_out_bounds_vh = 0;
175 
176  for (unsigned int i = 0; i < _num_v; ++i)
177  {
178  Real p_guess = _p_initial_guess;
179  Real T_guess = _T_initial_guess;
180  p_from_v_h[i].resize(_num_e);
181  T_from_v_h[i].resize(_num_e);
182  for (unsigned int j = 0; j < _num_e; ++j)
183  {
184  Real p_vh, T_vh;
185  // Using an input fluid property instead of the tabulation will get more exact inversions
186  if (_fp)
188  _enthalpy[j],
191  p_vh,
192  T_vh,
193  conversion_succeeded);
194  else
195  {
196  // The inversion may step outside of the domain of definition of the interpolations,
197  // which are restricted to the range of the input CSV file
198  const auto old_error_behavior = _OOBBehavior;
201  _enthalpy[j],
202  p_guess,
203  T_guess,
204  p_vh,
205  T_vh,
206  conversion_succeeded);
207  _OOBBehavior = old_error_behavior;
208  // track number of times convergence failed
209  if (!conversion_succeeded)
210  ++fail_counter_vh;
211  }
212 
213  // check for NaNs in Newton Method
218  i,
219  p_vh,
220  T_vh,
221  num_p_nans_vh,
222  num_T_nans_vh);
223 
224  // replace out of bounds pressure values with pmax or pmin
225  checkOutofBounds(_pressure_min, _pressure_max, p_vh, num_p_out_bounds_vh);
226  // replace out of bounds temperature values with Tmax or Tmin
227  checkOutofBounds(_temperature_min, _temperature_max, T_vh, num_T_out_bounds_vh);
228 
229  p_from_v_h[i][j] = p_vh;
230  T_from_v_h[i][j] = T_vh;
231 
232  p_guess = p_vh;
233  T_guess = T_vh;
234  }
235  }
236  // output warnings if nans our values out of bounds
237  outputWarnings(num_p_nans_vh,
238  num_T_nans_vh,
239  num_p_out_bounds_vh,
240  num_T_out_bounds_vh,
241  fail_counter_vh,
242  _num_e * _num_v,
243  "(v,h)");
244 
245  // the bicubic interpolation object are init'ed now
247  std::make_unique<BicubicInterpolation>(_specific_volume, _enthalpy, p_from_v_h);
249  std::make_unique<BicubicInterpolation>(_specific_volume, _enthalpy, T_from_v_h);
250  }
251 }
const bool _create_direct_ve_interpolations
Whether to create direct (v,e) interpolations.
std::unique_ptr< BidimensionalInterpolation > _p_from_v_h_ipol
Bidimensional interpolation of pressure from (v,h)
void p_T_from_v_h(const T &v, const T &h, Real p0, Real T0, T &pressure, T &temperature, bool &conversion_succeeded) const
Determines (p,T) from (v,h) using Newton Solve in 2D Useful for conversion between different sets of ...
const bool _create_direct_pT_interpolations
Whether to create direct (p,T) interpolations.
Real _temperature_max
Maximum temperature in tabulated data.
void checkNaNs(Real min_1, Real max_1, Real min_2, Real max_2, unsigned int i, Real &variable_1, Real &variable_2, unsigned int &num_nans_1, unsigned int &num_nans_2)
If Newton Method jacobian produces NaNs, set variable to min or max depending on situation.
virtual Real T_from_v_e(Real v, Real e) const override
Real _pressure_max
Maximum pressure in tabulated data.
MooseEnum _OOBBehavior
User-selected out-of-bounds behavior.
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 ...
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)
std::vector< Real > _enthalpy
Specific enthalpy vector.
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.
void createVHGridVectors()
Create (or reset) the grid vectors for the specific volume and enthalpy interpolation The order of pr...
bool _construct_pT_from_vh
if the lookup table p(v, h) and T(v, h) should be constructed
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.
std::vector< std::vector< Real > > _properties_ve
Tabulated fluid properties in (v,e) (read from file OR computed from _fp)
void checkOutofBounds(Real min, Real max, Real &variable, unsigned int &num_out_bounds)
If values go out of user defined range during Newton Method inversion, set variable to min or max dep...
const Real _p_initial_guess
Initial guess for pressure (or pressure used to compute the initial guess)
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 *...
std::vector< Real > _internal_energy
Specific internal energy vector.
std::unique_ptr< BidimensionalInterpolation > _T_from_v_h_ipol
Bi-dimensional interpolation of temperature from (v,h)
static const std::complex< double > j(0, 1)
Complex number "j" (also known as "i")
std::vector< std::unique_ptr< BidimensionalInterpolation > > _property_ipol
Vector of bi-dimensional interpolation of fluid properties.
const Real _T_initial_guess
Initial guess for temperature (or temperature used to compute the initial guess)
void reshapeData2D(unsigned int nrow, unsigned int ncol, const std::vector< Real > &vec, std::vector< std::vector< Real >> &mat)
Forms a 2D matrix from a single std::vector.
auto index_range(const T &sizable)
void outputWarnings(unsigned int num_nans_p, unsigned int num_nans_T, unsigned int num_out_bounds_p, unsigned int num_out_bounds_T, unsigned int convergence_failures, unsigned int number_points, std::string variable_set)
unsigned int _num_e
Number of internal energy points in tabulated data.

◆ cp_from_p_T() [1/2]

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

Definition at line 739 of file TabulatedFluidProperties.C.

Referenced by TabulatedFluidProperties::cp_from_v_e().

740 {
742  {
744  return _property_ipol[_cp_idx]->sample(pressure, temperature);
745  }
746  else
747  {
748  if (_fp)
749  return _fp->cp_from_p_T(pressure, temperature);
750  else
751  paramError("interpolated_properties",
752  "No data to interpolate for specific heat capacity at constant pressure.");
753  }
754 }
void paramError(const std::string &param, Args... args) const
const bool _create_direct_pT_interpolations
Whether to create direct (p,T) interpolations.
static const std::string temperature
Definition: NS.h:59
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:56
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
overridevirtualinherited

Definition at line 757 of file TabulatedFluidProperties.C.

759 {
761  {
763  _property_ipol[_cp_idx]->sampleValueAndDerivatives(pressure, temperature, cp, dcp_dp, dcp_dT);
764  }
765  else
766  {
767  if (_fp)
768  _fp->cp_from_p_T(pressure, temperature, cp, dcp_dp, dcp_dT);
769  else
770  paramError("interpolated_properties",
771  "No data to interpolate for specific heat capacity at constant pressure.");
772  }
773 }
void paramError(const std::string &param, Args... args) const
const bool _create_direct_pT_interpolations
Whether to create direct (p,T) interpolations.
static const std::string temperature
Definition: NS.h:59
static const std::string cp
Definition: NS.h:121
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:56
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
overridevirtualinherited

Definition at line 1170 of file TabulatedFluidProperties.C.

Referenced by TabulatedFluidProperties::writeTabulatedData().

1171 {
1173  missingVEInterpolationError(__PRETTY_FUNCTION__);
1175 
1177  return _property_ve_ipol[_cp_idx]->sample(v, e);
1178  else if (_construct_pT_from_ve)
1179  {
1180  Real p = _p_from_v_e_ipol->sample(v, e);
1181  Real T = _T_from_v_e_ipol->sample(v, e);
1182  return cp_from_p_T(p, T);
1183  }
1184  else if (_fp)
1185  return _fp->cp_from_v_e(v, e);
1186  else
1187  mooseError(__PRETTY_FUNCTION__,
1188  "\nNo tabulation or fluid property 'fp' object to compute value");
1189 }
const bool _create_direct_ve_interpolations
Whether to create direct (v,e) interpolations.
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 mooseError(Args &&... args) const

◆ 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
overridevirtualinherited

Definition at line 1192 of file TabulatedFluidProperties.C.

1193 {
1195  missingVEInterpolationError(__PRETTY_FUNCTION__);
1197 
1199  _property_ve_ipol[_cp_idx]->sampleValueAndDerivatives(v, e, cp, dcp_dv, dcp_de);
1200  else if (_construct_pT_from_ve)
1201  {
1202  Real p, dp_dv, dp_de;
1203  _p_from_v_e_ipol->sampleValueAndDerivatives(v, e, p, dp_dv, dp_de);
1204  Real T, dT_dv, dT_de;
1205  _T_from_v_e_ipol->sampleValueAndDerivatives(v, e, T, dT_dv, dT_de);
1206  Real dcp_dp, dcp_dT;
1207  cp_from_p_T(p, T, cp, dcp_dp, dcp_dT);
1208  dcp_dv = dcp_dp * dp_dv + dcp_dT * dT_dv;
1209  dcp_de = dcp_dp * dp_de + dcp_dT * dT_de;
1210  }
1211  else if (_fp)
1212  _fp->cp_from_v_e(v, e, cp, dcp_dv, dcp_de);
1213  else
1214  mooseError(__PRETTY_FUNCTION__,
1215  "\nNo tabulation or fluid property 'fp' object to compute value");
1216 }
const bool _create_direct_ve_interpolations
Whether to create direct (v,e) interpolations.
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:121
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 mooseError(Args &&... args) const

◆ createVEGridVectors()

void TabulatedFluidProperties::createVEGridVectors ( )
protectedinherited

Definition at line 2225 of file TabulatedFluidProperties.C.

Referenced by constructInterpolation(), and TabulatedFluidProperties::generateVETabulatedData().

2226 {
2228  if (!_e_bounds_specified)
2229  {
2230  if (_fp)
2231  {
2232  // extreme values of internal energy for the grid bounds
2237  _e_min = std::min({e1, e2, e3, e4});
2238  _e_max = std::max({e1, e2, e3, e4});
2239  }
2240  // if csv exists, get max and min values from csv file
2241  else
2242  {
2243  _e_min = *std::min_element(_properties[_internal_energy_idx].begin(),
2245  _e_max = *std::max_element(_properties[_internal_energy_idx].begin(),
2247  }
2248  }
2249 
2250  // Create e grid for interpolation
2251  _internal_energy.resize(_num_e);
2252  if (_log_space_e)
2253  {
2254  // incrementing the exponent linearly will yield a log-spaced grid after taking the value to
2255  // the power of 10
2256  if (_e_min < 0)
2257  mooseError("Logarithmic grid in specific energy can only be used with a positive specific "
2258  "energy. Current minimum: " +
2259  std::to_string(_e_min));
2260  Real de = (std::log10(_e_max) - std::log10(_e_min)) / ((Real)_num_e - 1);
2261  Real log_e_min = std::log10(_e_min);
2262  for (const auto j : make_range(_num_e))
2263  _internal_energy[j] = std::pow(10, log_e_min + j * de);
2264  }
2265  else
2266  {
2267  Real de = (_e_max - _e_min) / ((Real)_num_e - 1);
2268  for (const auto j : make_range(_num_e))
2269  _internal_energy[j] = _e_min + j * de;
2270  }
2271 }
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.
virtual Real e_from_p_T(Real pressure, Real temperature) const override
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
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 ( )
protectedinherited

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

Referenced by TabulatedFluidProperties::createVEGridVectors(), and TabulatedFluidProperties::createVHGridVectors().

2177 {
2178  mooseAssert(_file_name_ve_in.empty(), "We should be reading the specific volume grid from file");
2179  if (!_v_bounds_specified)
2180  {
2181  if (_fp)
2182  {
2183  // extreme values of specific volume for the grid bounds
2188  _v_min = std::min({v1, v2, v3, v4});
2189  _v_max = std::max({v1, v2, v3, v4});
2190  }
2191  // if csv exists, get max and min values from csv file
2192  else
2193  {
2194  Real rho_max =
2195  *std::max_element(_properties[_density_idx].begin(), _properties[_density_idx].end());
2196  Real rho_min =
2197  *std::min_element(_properties[_density_idx].begin(), _properties[_density_idx].end());
2198  _v_max = 1 / rho_min;
2199  _v_min = 1 / rho_max;
2200  }
2201  // Prevent changing the bounds of the grid
2202  _v_bounds_specified = true;
2203  }
2204 
2205  // Create v grid for interpolation
2206  _specific_volume.resize(_num_v);
2207  if (_log_space_v)
2208  {
2209  // incrementing the exponent linearly will yield a log-spaced grid after taking the value to
2210  // the power of 10
2211  Real dv = (std::log10(_v_max) - std::log10(_v_min)) / ((Real)_num_v - 1);
2212  Real log_v_min = std::log10(_v_min);
2213  for (unsigned int j = 0; j < _num_v; ++j)
2214  _specific_volume[j] = std::pow(10, log_v_min + j * dv);
2215  }
2216  else
2217  {
2218  Real dv = (_v_max - _v_min) / ((Real)_num_v - 1);
2219  for (unsigned int j = 0; j < _num_v; ++j)
2220  _specific_volume[j] = _v_min + j * dv;
2221  }
2222 }
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.
virtual Real v_from_p_T(Real pressure, Real temperature) const override
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)
std::vector< Real > _specific_volume
Specific volume vector.
unsigned int _density_idx
Index of each property.
static const std::complex< double > j(0, 1)
Complex number "j" (also known as "i")
MooseUnits pow(const MooseUnits &, int)

◆ createVHGridVectors()

void TabulatedFluidProperties::createVHGridVectors ( )
protectedinherited

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

Referenced by constructInterpolation().

2275 {
2276  if (_file_name_ve_in.empty())
2278  if (_fp)
2279  {
2280  // extreme values of enthalpy for the grid bounds
2285  _h_min = std::min({h1, h2, h3, h4});
2286  _h_max = std::max({h1, h2, h3, h4});
2287  }
2288  // if csv exists, get max and min values from csv file
2289  else if (_properties.size())
2290  {
2291  _h_max = *max_element(_properties[_enthalpy_idx].begin(), _properties[_enthalpy_idx].end());
2292  _h_min = *min_element(_properties[_enthalpy_idx].begin(), _properties[_enthalpy_idx].end());
2293  }
2294  else if (_properties_ve.size())
2295  {
2296  _h_max = *max_element(_properties[_enthalpy_idx].begin(), _properties[_enthalpy_idx].end());
2297  _h_min = *min_element(_properties[_enthalpy_idx].begin(), _properties[_enthalpy_idx].end());
2298  }
2299  else
2300  mooseError("Need a source to compute the enthalpy grid bounds: either a FP object, or a (p,T) "
2301  "tabulation file or a (v,e) tabulation file");
2302 
2303  // Create h grid for interpolation
2304  // enthalpy & internal energy use same # grid points
2305  _enthalpy.resize(_num_e);
2306  if (_log_space_h)
2307  {
2308  // incrementing the exponent linearly will yield a log-spaced grid after taking the value to
2309  // the power of 10
2310  if (_h_min < 0)
2311  mooseError("Logarithmic grid in specific energy can only be used with a positive enthalpy. "
2312  "Current minimum: " +
2313  std::to_string(_h_min));
2314  Real dh = (std::log10(_h_max) - std::log10(_h_min)) / ((Real)_num_e - 1);
2315  Real log_h_min = std::log10(_h_min);
2316  for (const auto j : make_range(_num_e))
2317  _enthalpy[j] = std::pow(10, log_h_min + j * dh);
2318  }
2319  else
2320  {
2321  Real dh = (_h_max - _h_min) / ((Real)_num_e - 1);
2322  for (const auto j : make_range(_num_e))
2323  _enthalpy[j] = _h_min + j * dh;
2324  }
2325 }
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.
virtual Real h_from_p_T(Real p, Real T) const override
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
overridevirtualinherited

Critical density.

Returns
critical density (kg/m^3)

Reimplemented from SinglePhaseFluidProperties.

Definition at line 1040 of file TabulatedFluidProperties.C.

1041 {
1042  if (_fp)
1043  return _fp->criticalDensity();
1044  else
1045  FluidPropertiesForwardError("criticalDensity");
1046 }
void FluidPropertiesForwardError(const std::string &desired_routine) const
const SinglePhaseFluidProperties *const _fp
SinglePhaseFluidPropertiesPT UserObject.
virtual Real criticalDensity() const
Critical density.

◆ 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 316 of file SinglePhaseFluidProperties.C.

317 {
318  return e_from_p_rho(criticalPressure(), criticalDensity());
319 }
virtual Real criticalDensity() const
Critical density.
virtual Real criticalPressure() const
Critical pressure.

◆ criticalPressure()

Real TabulatedFluidProperties::criticalPressure ( ) const
overridevirtualinherited

Critical pressure.

Returns
critical pressure (Pa)

Reimplemented from SinglePhaseFluidProperties.

Definition at line 1020 of file TabulatedFluidProperties.C.

1021 {
1022 
1023  if (_fp)
1024  return _fp->criticalPressure();
1025  else
1026  FluidPropertiesForwardError("criticalPressure");
1027 }
void FluidPropertiesForwardError(const std::string &desired_routine) const
const SinglePhaseFluidProperties *const _fp
SinglePhaseFluidPropertiesPT UserObject.
virtual Real criticalPressure() const
Critical pressure.

◆ criticalTemperature()

Real TabulatedFluidProperties::criticalTemperature ( ) const
overridevirtualinherited

Critical temperature.

Returns
critical temperature (K)

Reimplemented from SinglePhaseFluidProperties.

Definition at line 1030 of file TabulatedFluidProperties.C.

1031 {
1032 
1033  if (_fp)
1034  return _fp->criticalTemperature();
1035  else
1036  FluidPropertiesForwardError("criticalTemperature");
1037 }
void FluidPropertiesForwardError(const std::string &desired_routine) const
virtual Real criticalTemperature() const
Critical temperature.
const SinglePhaseFluidProperties *const _fp
SinglePhaseFluidPropertiesPT UserObject.

◆ cv_from_p_T() [1/2]

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

Definition at line 776 of file TabulatedFluidProperties.C.

Referenced by TabulatedFluidProperties::cv_from_v_e().

777 {
779  {
781  return _property_ipol[_cv_idx]->sample(pressure, temperature);
782  }
783  else
784  {
785  if (_fp)
786  return _fp->cv_from_p_T(pressure, temperature);
787  else
788  paramError("interpolated_properties",
789  "No data to interpolate for specific heat capacity at constant volume.");
790  }
791 }
void paramError(const std::string &param, Args... args) const
const bool _create_direct_pT_interpolations
Whether to create direct (p,T) interpolations.
static const std::string temperature
Definition: NS.h:59
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:56
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
overridevirtualinherited

Definition at line 794 of file TabulatedFluidProperties.C.

796 {
797  if (_interpolate_cv)
798  {
800  _property_ipol[_cv_idx]->sampleValueAndDerivatives(pressure, temperature, cv, dcv_dp, dcv_dT);
801  }
802  else
803  {
804  if (_fp)
805  _fp->cv_from_p_T(pressure, temperature, cv, dcv_dp, dcv_dT);
806  else
807  paramError("interpolated_properties",
808  "No data to interpolate for specific heat capacity at constant volume.");
809  }
810 }
static const std::string cv
Definition: NS.h:122
void paramError(const std::string &param, Args... args) const
static const std::string temperature
Definition: NS.h:59
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:56
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
overridevirtualinherited

Definition at line 1219 of file TabulatedFluidProperties.C.

Referenced by TabulatedFluidProperties::writeTabulatedData().

1220 {
1222  missingVEInterpolationError(__PRETTY_FUNCTION__);
1224 
1226  return _property_ve_ipol[_cv_idx]->sample(v, e);
1227  else if (_construct_pT_from_ve)
1228  {
1229  Real p = _p_from_v_e_ipol->sample(v, e);
1230  Real T = _T_from_v_e_ipol->sample(v, e);
1231  return cv_from_p_T(p, T);
1232  }
1233  else if (_fp)
1234  return _fp->cv_from_v_e(v, e);
1235  else
1236  mooseError(__PRETTY_FUNCTION__,
1237  "\nNo tabulation or fluid property 'fp' object to compute value");
1238 }
const bool _create_direct_ve_interpolations
Whether to create direct (v,e) interpolations.
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 mooseError(Args &&... args) const

◆ 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
overridevirtualinherited

Definition at line 1241 of file TabulatedFluidProperties.C.

1242 {
1244  missingVEInterpolationError(__PRETTY_FUNCTION__);
1246 
1248  _property_ve_ipol[_cv_idx]->sampleValueAndDerivatives(v, e, cv, dcv_dv, dcv_de);
1249  else if (_construct_pT_from_ve)
1250  {
1251  Real p, dp_dv, dp_de;
1252  _p_from_v_e_ipol->sampleValueAndDerivatives(v, e, p, dp_dv, dp_de);
1253  Real T, dT_dv, dT_de;
1254  _T_from_v_e_ipol->sampleValueAndDerivatives(v, e, T, dT_dv, dT_de);
1255  Real dcv_dp, dcv_dT;
1256  cv_from_p_T(p, T, cv, dcv_dp, dcv_dT);
1257  dcv_dv = dcv_dp * dp_dv + dcv_dT * dT_dv;
1258  dcv_de = dcv_dp * dp_de + dcv_dT * dT_de;
1259  }
1260  else if (_fp)
1261  _fp->cv_from_v_e(v, e, cv, dcv_dv, dcv_de);
1262  else
1263  mooseError(__PRETTY_FUNCTION__,
1264  "\nNo tabulation or fluid property 'fp' object to compute value");
1265 }
const bool _create_direct_ve_interpolations
Whether to create direct (v,e) interpolations.
static const std::string cv
Definition: NS.h:122
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 mooseError(Args &&... args) const

◆ e_from_p_rho() [1/2]

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

Definition at line 528 of file TabulatedFluidProperties.C.

529 {
531  Real e = e_from_p_T(pressure, T);
532  return e;
533 }
virtual Real e_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:56
virtual Real T_from_p_rho(Real pressure, Real rho) const

◆ e_from_p_rho() [2/2]

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

Definition at line 536 of file TabulatedFluidProperties.C.

538 {
539  // get derivatives of T wrt to pressure and density
540  Real T, dT_dp, dT_drho;
541  T_from_p_rho(pressure, rho, T, dT_dp, dT_drho);
542 
543  // Get e, then derivatives of e wrt pressure and temperature
544  Real de_dp_at_const_T, de_dT;
545  e_from_p_T(pressure, T, e, de_dp_at_const_T, de_dT);
546 
547  // Get the derivatives of density wrt pressure and temperature
548  Real rho_pT, drho_dp, drho_dT;
549  rho_from_p_T(pressure, T, rho_pT, drho_dp, drho_dT);
550 
551  // derivatives of e wrt pressure and rho (what we want from e_from_p_rho)
552  de_drho = de_dT * dT_drho;
553  de_dp = de_dp_at_const_T - (de_drho * drho_dp);
554 }
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:56
virtual Real T_from_p_rho(Real pressure, Real rho) const

◆ e_from_p_T() [1/2]

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

Definition at line 492 of file TabulatedFluidProperties.C.

Referenced by TabulatedFluidProperties::createVEGridVectors(), TabulatedFluidProperties::e_from_p_rho(), and TabulatedFluidProperties::e_from_v_h().

493 {
495  {
498  }
499  else
500  {
501  if (_fp)
502  return _fp->e_from_p_T(pressure, temperature);
503  else
504  paramError("fp", "No fluid properties or csv data provided for internal energy.");
505  }
506 }
void paramError(const std::string &param, Args... args) const
const bool _create_direct_pT_interpolations
Whether to create direct (p,T) interpolations.
static const std::string temperature
Definition: NS.h:59
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:56
std::vector< std::unique_ptr< BidimensionalInterpolation > > _property_ipol
Vector of bi-dimensional interpolation of fluid properties.

◆ e_from_p_T() [2/2]

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

Definition at line 509 of file TabulatedFluidProperties.C.

511 {
513  {
515  _property_ipol[_internal_energy_idx]->sampleValueAndDerivatives(
516  pressure, temperature, e, de_dp, de_dT);
517  }
518  else
519  {
520  if (_fp)
521  _fp->e_from_p_T(pressure, temperature, e, de_dp, de_dT);
522  else
523  paramError("fp", "No fluid properties or csv data provided for internal energy.");
524  }
525 }
void paramError(const std::string &param, Args... args) const
const bool _create_direct_pT_interpolations
Whether to create direct (p,T) interpolations.
static const std::string temperature
Definition: NS.h:59
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:56
std::vector< std::unique_ptr< BidimensionalInterpolation > > _property_ipol
Vector of bi-dimensional interpolation of fluid properties.

◆ e_from_v_h() [1/2]

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

Definition at line 883 of file TabulatedFluidProperties.C.

Referenced by TabulatedFluidProperties::e_from_v_h().

884 {
886  {
887  const Real p = _p_from_v_h_ipol->sample(v, h);
888  const Real T = _T_from_v_h_ipol->sample(v, h);
889  return e_from_p_T(p, T);
890  }
892  {
893  // Lambda computes h from v and the current_e
894  auto lambda = [&](Real v, Real current_e, Real & new_h, Real & dh_dv, Real & dh_de)
895  { h_from_v_e(v, current_e, new_h, dh_dv, dh_de); };
897  h,
898  /*e initial guess*/ h - _p_initial_guess * v,
899  _tolerance,
900  lambda,
901  name() + "::e_from_v_h",
903  .first;
904  return e;
905  }
906  else if (_fp)
907  return _fp->e_from_v_h(v, h);
908  else
909  mooseError(__PRETTY_FUNCTION__,
910  "\nNo tabulation or fluid property 'fp' object to compute value");
911 }
const bool _create_direct_ve_interpolations
Whether to create direct (v,e) interpolations.
std::unique_ptr< BidimensionalInterpolation > _p_from_v_h_ipol
Bidimensional interpolation of pressure from (v,h)
std::pair< T, T > NewtonSolve(const T &x, const T &y, const Real z_initial_guess, const Real tolerance, const Functor &func, const std::string &caller_name, const unsigned int max_its=100)
NewtonSolve does a 1D Newton Solve to solve the equation y = f(x, z) for variable z...
const Real _tolerance
Newton&#39;s method may be used to convert between variable sets.
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
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 mooseError(Args &&... args) const
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
overridevirtualinherited

Definition at line 914 of file TabulatedFluidProperties.C.

915 {
917  {
918  Real p = 0, dp_dv = 0, dp_dh = 0;
919  _p_from_v_h_ipol->sampleValueAndDerivatives(v, h, p, dp_dv, dp_dh);
920  Real T = 0, dT_dv = 0, dT_dh = 0;
921  _T_from_v_h_ipol->sampleValueAndDerivatives(v, h, T, dT_dv, dT_dh);
922  Real de_dp, de_dT;
923  e_from_p_T(p, T, e, de_dp, de_dT);
924  de_dv = de_dp * dp_dv + de_dT * dT_dv;
925  de_dh = de_dp * dp_dh + de_dT * dT_dh;
926  }
928  {
929  // Lambda computes h from v and the current_e
930  auto lambda = [&](Real v, Real current_e, Real & new_h, Real & dh_dv, Real & dh_de)
931  { h_from_v_e(v, current_e, new_h, dh_dv, dh_de); };
932  const auto e_data =
934  h,
935  /*e initial guess*/ h - _p_initial_guess * v,
936  _tolerance,
937  lambda,
938  name() + "::e_from_v_h",
940  e = e_data.first;
941  // Finite difference approximation
942  const auto e2 = e_from_v_h(v * (1 + TOLERANCE), h);
943  de_dv = (e2 - e) / (TOLERANCE * v);
944  de_dh = 1. / e_data.second;
945  }
946  else if (_fp)
947  _fp->e_from_v_h(v, h, e, de_dv, de_dh);
948  else
949  mooseError(__PRETTY_FUNCTION__,
950  "\nNo tabulation or fluid property 'fp' object to compute value");
951 }
const bool _create_direct_ve_interpolations
Whether to create direct (v,e) interpolations.
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
std::pair< T, T > NewtonSolve(const T &x, const T &y, const Real z_initial_guess, const Real tolerance, const Functor &func, const std::string &caller_name, const unsigned int max_its=100)
NewtonSolve does a 1D Newton Solve to solve the equation y = f(x, z) for variable z...
const Real _tolerance
Newton&#39;s method may be used to convert between variable sets.
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
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 mooseError(Args &&... args) const
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 479 of file SinglePhaseFluidProperties.C.

480 {
481  mooseError(__PRETTY_FUNCTION__, " not implemented.");
482 }
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
overridevirtualinherited

Fluid name.

Returns
string representing fluid name

Reimplemented from SinglePhaseFluidProperties.

Definition at line 356 of file TabulatedFluidProperties.C.

357 {
358  if (_fp)
359  return _fp->fluidName();
360  else
361  return "TabulationFromFile";
362 }
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.

◆ FluidPropertiesForwardError()

void TabulatedFluidProperties::FluidPropertiesForwardError ( const std::string &  desired_routine) const
protectedinherited

Definition at line 1503 of file TabulatedFluidProperties.C.

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

1504 {
1505  mooseError("TabulatedFluidProperties can only call the function '" + desired_routine +
1506  "' when the 'fp' parameter is provided. It is currently not implemented using "
1507  "tabulations, and this property is simply forwarded to the FluidProperties specified "
1508  "in the 'fp' parameter");
1509 }
void mooseError(Args &&... args) const

◆ g_from_v_e()

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

Definition at line 1388 of file TabulatedFluidProperties.C.

1389 {
1390  if (!_construct_pT_from_ve &&
1393  missingVEInterpolationError(__PRETTY_FUNCTION__);
1395 
1396  Real h, T = 0, s;
1398  {
1399  s = _property_ve_ipol[_entropy_idx]->sample(v, e);
1400  h = _property_ve_ipol[_enthalpy_idx]->sample(v, e);
1401  T = _property_ve_ipol[_T_idx]->sample(v, e);
1402  }
1404  {
1405  Real p0 = _p_initial_guess;
1406  Real T0 = _T_initial_guess;
1407  Real p = 0;
1408  bool conversion_succeeded;
1409  p_T_from_v_e(v, e, p0, T0, p, T, conversion_succeeded);
1410  s = s_from_p_T(p, T);
1411  h = h_from_p_T(p, T);
1412  }
1413  else
1414  mooseError(__PRETTY_FUNCTION__,
1415  "\nNo tabulation or fluid property 'fp' object to compute value");
1416  return h - T * s;
1417 }
const bool _create_direct_ve_interpolations
Whether to create direct (v,e) interpolations.
const unsigned int invalid_uint
const bool _create_direct_pT_interpolations
Whether to create direct (p,T) interpolations.
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 ( )
protectedvirtualinherited

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

Definition at line 1613 of file TabulatedFluidProperties.C.

Referenced by TabulatedFluidProperties::initialSetup().

1614 {
1615  mooseAssert(_fp, "We should not try to generate (p,T) tabulated data without a _fp user object");
1616  _pressure.resize(_num_p);
1617  _temperature.resize(_num_T);
1618 
1619  // Generate data for all properties entered in input file
1622 
1623  for (std::size_t i = 0; i < _interpolated_properties_enum.size(); ++i)
1625 
1626  for (const auto i : index_range(_properties))
1627  _properties[i].resize(_num_p * _num_T);
1628 
1629  // Temperature is divided equally into _num_T segments
1630  Real delta_T = (_temperature_max - _temperature_min) / static_cast<Real>(_num_T - 1);
1631 
1632  for (unsigned int j = 0; j < _num_T; ++j)
1633  _temperature[j] = _temperature_min + j * delta_T;
1634 
1635  // Divide the pressure into _num_p equal segments
1636  Real delta_p = (_pressure_max - _pressure_min) / static_cast<Real>(_num_p - 1);
1637 
1638  for (unsigned int i = 0; i < _num_p; ++i)
1639  _pressure[i] = _pressure_min + i * delta_p;
1640 
1641  // Generate the tabulated data at the pressure and temperature points
1642  for (const auto i : index_range(_properties))
1643  {
1644  if (_interpolated_properties[i] == "density")
1645  for (unsigned int p = 0; p < _num_p; ++p)
1646  for (unsigned int t = 0; t < _num_T; ++t)
1647  _properties[i][p * _num_T + t] = _fp->rho_from_p_T(_pressure[p], _temperature[t]);
1648 
1649  if (_interpolated_properties[i] == "enthalpy")
1650  for (unsigned int p = 0; p < _num_p; ++p)
1651  for (unsigned int t = 0; t < _num_T; ++t)
1652  _properties[i][p * _num_T + t] = _fp->h_from_p_T(_pressure[p], _temperature[t]);
1653 
1654  if (_interpolated_properties[i] == "internal_energy")
1655  for (unsigned int p = 0; p < _num_p; ++p)
1656  for (unsigned int t = 0; t < _num_T; ++t)
1657  _properties[i][p * _num_T + t] = _fp->e_from_p_T(_pressure[p], _temperature[t]);
1658 
1659  if (_interpolated_properties[i] == "viscosity")
1660  for (unsigned int p = 0; p < _num_p; ++p)
1661  for (unsigned int t = 0; t < _num_T; ++t)
1662  _properties[i][p * _num_T + t] = _fp->mu_from_p_T(_pressure[p], _temperature[t]);
1663 
1664  if (_interpolated_properties[i] == "k")
1665  for (unsigned int p = 0; p < _num_p; ++p)
1666  for (unsigned int t = 0; t < _num_T; ++t)
1667  _properties[i][p * _num_T + t] = _fp->k_from_p_T(_pressure[p], _temperature[t]);
1668 
1669  if (_interpolated_properties[i] == "c")
1670  for (unsigned int p = 0; p < _num_p; ++p)
1671  for (unsigned int t = 0; t < _num_T; ++t)
1672  _properties[i][p * _num_T + t] = _fp->c_from_p_T(_pressure[p], _temperature[t]);
1673 
1674  if (_interpolated_properties[i] == "cv")
1675  for (unsigned int p = 0; p < _num_p; ++p)
1676  for (unsigned int t = 0; t < _num_T; ++t)
1677  _properties[i][p * _num_T + t] = _fp->cv_from_p_T(_pressure[p], _temperature[t]);
1678 
1679  if (_interpolated_properties[i] == "cp")
1680  for (unsigned int p = 0; p < _num_p; ++p)
1681  for (unsigned int t = 0; t < _num_T; ++t)
1682  _properties[i][p * _num_T + t] = _fp->cp_from_p_T(_pressure[p], _temperature[t]);
1683 
1684  if (_interpolated_properties[i] == "entropy")
1685  for (unsigned int p = 0; p < _num_p; ++p)
1686  for (unsigned int t = 0; t < _num_T; ++t)
1687  _properties[i][p * _num_T + t] = _fp->s_from_p_T(_pressure[p], _temperature[t]);
1688  }
1689 }
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 ( )
protectedvirtualinherited

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

Referenced by TabulatedFluidProperties::initialSetup().

1693 {
1694  mooseAssert(_fp, "We should not try to generate (v,e) tabulated data without a _fp user object");
1695  _specific_volume.resize(_num_v);
1696  _internal_energy.resize(_num_e);
1697 
1698  // Generate data for all properties entered in input file
1701 
1702  // This is filled from the user input, so it does not matter than this operation is performed
1703  // for both the (p,T) and (v,e) tabulated data generation
1704  for (std::size_t i = 0; i < _interpolated_properties_enum.size(); ++i)
1706 
1707  for (const auto i : index_range(_properties_ve))
1708  _properties_ve[i].resize(_num_v * _num_e);
1709 
1710  // Grids in (v,e) are not read, so we either use user input or rely on (p,T) data
1712 
1713  // Generate the tabulated data at the pressure and temperature points
1714  for (const auto i : index_range(_properties_ve))
1715  {
1716  if (_interpolated_properties[i] == "density")
1717  for (unsigned int v = 0; v < _num_v; ++v)
1718  for (unsigned int e = 0; e < _num_e; ++e)
1719  _properties_ve[i][v * _num_e + e] = 1. / _specific_volume[v];
1720 
1721  if (_interpolated_properties[i] == "enthalpy")
1722  for (unsigned int v = 0; v < _num_v; ++v)
1723  for (unsigned int e = 0; e < _num_e; ++e)
1724  _properties_ve[i][v * _num_e + e] =
1725  _fp->h_from_v_e(_specific_volume[v], _internal_energy[e]);
1726 
1727  if (_interpolated_properties[i] == "internal_energy")
1728  for (unsigned int v = 0; v < _num_v; ++v)
1729  for (unsigned int e = 0; e < _num_e; ++e)
1730  _properties_ve[i][v * _num_e + e] = _internal_energy[e];
1731 
1732  if (_interpolated_properties[i] == "viscosity")
1733  for (unsigned int v = 0; v < _num_v; ++v)
1734  for (unsigned int e = 0; e < _num_e; ++e)
1735  _properties_ve[i][v * _num_e + e] =
1736  _fp->mu_from_v_e(_specific_volume[v], _internal_energy[e]);
1737 
1738  if (_interpolated_properties[i] == "k")
1739  for (unsigned int v = 0; v < _num_v; ++v)
1740  for (unsigned int e = 0; e < _num_e; ++e)
1741  _properties_ve[i][v * _num_e + e] =
1742  _fp->k_from_v_e(_specific_volume[v], _internal_energy[e]);
1743 
1744  if (_interpolated_properties[i] == "c")
1745  for (unsigned int v = 0; v < _num_v; ++v)
1746  for (unsigned int e = 0; e < _num_e; ++e)
1747  _properties_ve[i][v * _num_e + e] =
1748  _fp->c_from_v_e(_specific_volume[v], _internal_energy[e]);
1749 
1750  if (_interpolated_properties[i] == "cv")
1751  for (unsigned int v = 0; v < _num_v; ++v)
1752  for (unsigned int e = 0; e < _num_e; ++e)
1753  _properties_ve[i][v * _num_e + e] =
1754  _fp->cv_from_v_e(_specific_volume[v], _internal_energy[e]);
1755 
1756  if (_interpolated_properties[i] == "cp")
1757  for (unsigned int v = 0; v < _num_v; ++v)
1758  for (unsigned int e = 0; e < _num_e; ++e)
1759  _properties_ve[i][v * _num_e + e] =
1760  _fp->cp_from_v_e(_specific_volume[v], _internal_energy[e]);
1761 
1762  if (_interpolated_properties[i] == "entropy")
1763  for (unsigned int v = 0; v < _num_v; ++v)
1764  for (unsigned int e = 0; e < _num_e; ++e)
1765  _properties_ve[i][v * _num_e + e] =
1766  _fp->s_from_v_e(_specific_volume[v], _internal_energy[e]);
1767 
1768  if (_interpolated_properties[i] == "pressure")
1769  for (unsigned int v = 0; v < _num_v; ++v)
1770  for (unsigned int e = 0; e < _num_e; ++e)
1771  _properties_ve[i][v * _num_e + e] =
1772  _fp->p_from_v_e(_specific_volume[v], _internal_energy[e]);
1773 
1774  if (_interpolated_properties[i] == "temperature")
1775  for (unsigned int v = 0; v < _num_v; ++v)
1776  for (unsigned int e = 0; e < _num_e; ++e)
1777  _properties_ve[i][v * _num_e + e] =
1778  _fp->T_from_v_e(_specific_volume[v], _internal_energy[e]);
1779  }
1780 }
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
overridevirtualinherited

Definition at line 623 of file TabulatedFluidProperties.C.

Referenced by TabulatedFluidProperties::createVHGridVectors(), TabulatedFluidProperties::g_from_v_e(), TabulatedFluidProperties::T_from_p_h(), and TabulatedFluidProperties::writeTabulatedData().

624 {
626  {
629  }
630  else
631  {
632  if (_fp)
633  return _fp->h_from_p_T(pressure, temperature);
634  else
635  paramError("fp", "No fluid properties or csv data provided for enthalpy.");
636  }
637 }
void paramError(const std::string &param, Args... args) const
const bool _create_direct_pT_interpolations
Whether to create direct (p,T) interpolations.
static const std::string temperature
Definition: NS.h:59
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:56
std::vector< std::unique_ptr< BidimensionalInterpolation > > _property_ipol
Vector of bi-dimensional interpolation of fluid properties.

◆ h_from_p_T() [2/3]

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

Definition at line 640 of file TabulatedFluidProperties.C.

641 {
642  if (_fp) // Assuming _fp can handle ADReal types
643  return _fp->h_from_p_T(pressure, temperature);
644  else
645  FluidPropertiesForwardError("h_from_p_T");
646 }
static const std::string temperature
Definition: NS.h:59
void FluidPropertiesForwardError(const std::string &desired_routine) const
const SinglePhaseFluidProperties *const _fp
SinglePhaseFluidPropertiesPT UserObject.
static const std::string pressure
Definition: NS.h:56

◆ 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
overridevirtualinherited

Definition at line 649 of file TabulatedFluidProperties.C.

651 {
653  {
655  _property_ipol[_enthalpy_idx]->sampleValueAndDerivatives(
656  pressure, temperature, h, dh_dp, dh_dT);
657  }
658  else
659  {
660  if (_fp)
661  _fp->h_from_p_T(pressure, temperature, h, dh_dp, dh_dT);
662  else
663  paramError("fp", "No fluid properties or csv data provided for enthalpy.");
664  }
665 }
void paramError(const std::string &param, Args... args) const
const bool _create_direct_pT_interpolations
Whether to create direct (p,T) interpolations.
static const std::string temperature
Definition: NS.h:59
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.
static const std::string pressure
Definition: NS.h:56
std::vector< std::unique_ptr< BidimensionalInterpolation > > _property_ipol
Vector of bi-dimensional interpolation of fluid properties.

◆ henryCoefficients()

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

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

955 {
956  if (_fp)
957  return _fp->henryCoefficients();
958  else
959  FluidPropertiesForwardError("henryCoefficients");
960 }
virtual std::vector< Real > henryCoefficients() const
Henry&#39;s law coefficients for dissolution in water.
void FluidPropertiesForwardError(const std::string &desired_routine) const
const SinglePhaseFluidProperties *const _fp
SinglePhaseFluidPropertiesPT UserObject.

◆ initialize()

virtual void FluidProperties::initialize ( )
inlinefinalvirtualinherited

Implements ThreadedGeneralUserObject.

Definition at line 34 of file FluidProperties.h.

34 {}

◆ initialSetup()

void TabulatedFluidProperties::initialSetup ( )
overridevirtualinherited

Reimplemented from ThreadedGeneralUserObject.

Definition at line 300 of file TabulatedFluidProperties.C.

301 {
303  return;
304  _initial_setup_done = true;
305 
307  {
308  // If the user specified a (p, T) tabulation to read, use that
309  if (!_file_name_in.empty())
311  else
312  {
313  if (!_fp)
314  paramError(
315  "create_pT_interpolations",
316  "No FluidProperties (specified with 'fp' parameter) exists. Either specify a 'fp' or "
317  "specify a (p, T) tabulation file with the 'fluid_property_file' parameter");
318  _console << name() + ": Generating (p, T) tabulated data\n";
319  _console << std::flush;
320 
322  }
323  }
324 
326  {
327  // If the user specified a (v, e) tabulation to read, use that
328  if (!_file_name_ve_in.empty())
329  readFileTabulationData(false);
330  else
331  {
332  if (!_fp)
333  paramError(
334  "create_ve_interpolations",
335  "No FluidProperties (specified with 'fp' parameter) exists. Either specify a 'fp' or "
336  "specify a (v, e) tabulation file with the 'fluid_property_ve_file' parameter");
337  _console << name() + ": Generating (v, e) tabulated data\n";
338  _console << std::flush;
339 
341  }
342  }
343 
346 
347  // Write tabulated data to file
348  if (_save_file)
349  {
350  _console << name() + ": Writing tabulated data to " << _file_name_out << "\n";
352  }
353 }
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 to create direct (v,e) interpolations.
void paramError(const std::string &param, Args... args) const
const bool _create_direct_pT_interpolations
Whether to create direct (p,T) interpolations.
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
overridevirtualinherited

Definition at line 813 of file TabulatedFluidProperties.C.

Referenced by TabulatedFluidProperties::k_from_v_e().

814 {
816  {
818  return _property_ipol[_k_idx]->sample(pressure, temperature);
819  }
820  else
821  {
822  if (_fp)
823  return _fp->k_from_p_T(pressure, temperature);
824  else
825  paramError("interpolated_properties", "No data to interpolate for thermal conductivity.");
826  }
827 }
void paramError(const std::string &param, Args... args) const
const bool _create_direct_pT_interpolations
Whether to create direct (p,T) interpolations.
static const std::string temperature
Definition: NS.h:59
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:56
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
overridevirtualinherited

Definition at line 830 of file TabulatedFluidProperties.C.

832 {
834  {
836  return _property_ipol[_k_idx]->sampleValueAndDerivatives(
837  pressure, temperature, k, dk_dp, dk_dT);
838  }
839  else
840  {
841  if (_fp)
842  return _fp->k_from_p_T(pressure, temperature, k, dk_dp, dk_dT);
843  else
844  paramError("interpolated_properties", "No data to interpolate for thermal conductivity.");
845  }
846 }
void paramError(const std::string &param, Args... args) const
const bool _create_direct_pT_interpolations
Whether to create direct (p,T) interpolations.
static const std::string temperature
Definition: NS.h:59
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:56
std::vector< std::unique_ptr< BidimensionalInterpolation > > _property_ipol
Vector of bi-dimensional interpolation of fluid properties.
static const std::string k
Definition: NS.h:130

◆ k_from_v_e() [1/2]

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

Definition at line 1317 of file TabulatedFluidProperties.C.

Referenced by TabulatedFluidProperties::writeTabulatedData().

1318 {
1320  missingVEInterpolationError(__PRETTY_FUNCTION__);
1322 
1324  return _property_ve_ipol[_k_idx]->sample(v, e);
1325  else if (_construct_pT_from_ve)
1326  {
1327  Real T = _T_from_v_e_ipol->sample(v, e);
1328  Real p = _p_from_v_e_ipol->sample(v, e);
1329  return k_from_p_T(p, T);
1330  }
1331  else if (_fp)
1332  return _fp->k_from_v_e(v, e);
1333  else
1334  mooseError(__PRETTY_FUNCTION__,
1335  "\nNo tabulation or fluid property 'fp' object to compute value");
1336 }
virtual Real k_from_p_T(Real pressure, Real temperature) const override
const bool _create_direct_ve_interpolations
Whether to create direct (v,e) interpolations.
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 mooseError(Args &&... args) const

◆ 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
overridevirtualinherited

Definition at line 1339 of file TabulatedFluidProperties.C.

1340 {
1342  missingVEInterpolationError(__PRETTY_FUNCTION__);
1344 
1346  _property_ve_ipol[_k_idx]->sampleValueAndDerivatives(v, e, k, dk_dv, dk_de);
1347  else if (_construct_pT_from_ve)
1348  {
1349  Real p, dp_dv, dp_de;
1350  _p_from_v_e_ipol->sampleValueAndDerivatives(v, e, p, dp_dv, dp_de);
1351  Real T, dT_dv, dT_de;
1352  _T_from_v_e_ipol->sampleValueAndDerivatives(v, e, T, dT_dv, dT_de);
1353  Real dk_dp, dk_dT;
1354  k_from_p_T(p, T, k, dk_dp, dk_dT);
1355  dk_dv = dk_dp * dp_dv + dk_dT * dT_dv;
1356  dk_de = dk_dp * dp_de + dk_dT * dT_de;
1357  }
1358  else if (_fp)
1359  _fp->k_from_v_e(v, e, k, dk_dv, dk_de);
1360  else
1361  mooseError(__PRETTY_FUNCTION__,
1362  "\nNo tabulation or fluid property 'fp' object to compute value");
1363 }
virtual Real k_from_p_T(Real pressure, Real temperature) const override
const bool _create_direct_ve_interpolations
Whether to create direct (v,e) interpolations.
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 mooseError(Args &&... args) const
static const std::string k
Definition: NS.h:130

◆ 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 476 of file SinglePhaseFluidProperties.h.

Referenced by SinglePhaseFluidProperties::xyDerivatives().

477 {
478  return {T{0, 0}, T{1, 0}};
479 }

◆ makeZeroAndOne() [2/2]

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

Definition at line 483 of file SinglePhaseFluidProperties.h.

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

◆ missingVEInterpolationError()

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

Standardized error message for missing interpolation.

Definition at line 2328 of file TabulatedFluidProperties.C.

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

2329 {
2330  mooseError(function_name +
2331  ": to call this function you must:\n-add this property to the list to the list of "
2332  "'interpolated_properties'\n and then either:\n-construct (p, T) from (v, e) "
2333  "tabulations using the 'construct_pT_from_ve' parameter\n-load (v,e) interpolation "
2334  "tables using the 'fluid_property_ve_file' parameter");
2335 }
void mooseError(Args &&... args) const

◆ molarMass()

Real TabulatedFluidProperties::molarMass ( ) const
overridevirtualinherited

Molar mass [kg/mol].

Returns
molar mass

Reimplemented from SinglePhaseFluidProperties.

Definition at line 365 of file TabulatedFluidProperties.C.

366 {
367  if (_fp)
368  return _fp->molarMass();
369  else
370  FluidPropertiesForwardError("molarMass");
371 }
virtual Real molarMass() const
Molar mass [kg/mol].
void FluidPropertiesForwardError(const std::string &desired_routine) const
const SinglePhaseFluidProperties *const _fp
SinglePhaseFluidPropertiesPT UserObject.

◆ mu_from_p_T() [1/2]

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

Definition at line 668 of file TabulatedFluidProperties.C.

Referenced by TabulatedFluidProperties::mu_from_v_e().

669 {
671  {
674  }
675  else
676  {
677  if (_fp)
678  return _fp->mu_from_p_T(pressure, temperature);
679  else
680  paramError("fp", "No fluid properties or csv data provided for viscosity.");
681  }
682 }
void paramError(const std::string &param, Args... args) const
const bool _create_direct_pT_interpolations
Whether to create direct (p,T) interpolations.
static const std::string temperature
Definition: NS.h:59
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:56
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
overridevirtualinherited

Definition at line 685 of file TabulatedFluidProperties.C.

687 {
689  {
691  _property_ipol[_viscosity_idx]->sampleValueAndDerivatives(
692  pressure, temperature, mu, dmu_dp, dmu_dT);
693  }
694  else
695  {
696  if (_fp)
697  _fp->mu_from_p_T(pressure, temperature, mu, dmu_dp, dmu_dT);
698  else
699  paramError("fp", "No fluid properties or csv data provided for viscosity.");
700  }
701 }
void paramError(const std::string &param, Args... args) const
const bool _create_direct_pT_interpolations
Whether to create direct (p,T) interpolations.
static const std::string temperature
Definition: NS.h:59
static const std::string mu
Definition: NS.h:123
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:56
std::vector< std::unique_ptr< BidimensionalInterpolation > > _property_ipol
Vector of bi-dimensional interpolation of fluid properties.

◆ mu_from_v_e() [1/2]

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

Definition at line 1268 of file TabulatedFluidProperties.C.

Referenced by TabulatedFluidProperties::writeTabulatedData().

1269 {
1271  missingVEInterpolationError(__PRETTY_FUNCTION__);
1273 
1275  return _property_ve_ipol[_viscosity_idx]->sample(v, e);
1276  else if (_construct_pT_from_ve)
1277  {
1278  Real p = _p_from_v_e_ipol->sample(v, e);
1279  Real T = _T_from_v_e_ipol->sample(v, e);
1280  return mu_from_p_T(p, T);
1281  }
1282  else if (_fp)
1283  return _fp->mu_from_v_e(v, e);
1284  else
1285  mooseError(__PRETTY_FUNCTION__,
1286  "\nNo tabulation or fluid property 'fp' object to compute value");
1287 }
const bool _create_direct_ve_interpolations
Whether to create direct (v,e) interpolations.
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 mooseError(Args &&... args) const

◆ 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
overridevirtualinherited

Definition at line 1290 of file TabulatedFluidProperties.C.

1291 {
1293  missingVEInterpolationError(__PRETTY_FUNCTION__);
1295 
1297  _property_ve_ipol[_viscosity_idx]->sampleValueAndDerivatives(v, e, mu, dmu_dv, dmu_de);
1298  else if (_construct_pT_from_ve)
1299  {
1300  Real p, dp_dv, dp_de;
1301  _p_from_v_e_ipol->sampleValueAndDerivatives(v, e, p, dp_dv, dp_de);
1302  Real T, dT_dv, dT_de;
1303  _T_from_v_e_ipol->sampleValueAndDerivatives(v, e, T, dT_dv, dT_de);
1304  Real dmu_dp, dmu_dT;
1305  mu_from_p_T(p, T, mu, dmu_dp, dmu_dT);
1306  dmu_dv = dmu_dp * dp_dv + dmu_dT * dT_dv;
1307  dmu_de = dmu_dp * dp_de + dmu_dT * dT_de;
1308  }
1309  else if (_fp)
1310  _fp->mu_from_v_e(v, e, mu, dmu_dv, dmu_de);
1311  else
1312  mooseError(__PRETTY_FUNCTION__,
1313  "\nNo tabulation or fluid property 'fp' object to compute value");
1314 }
const bool _create_direct_ve_interpolations
Whether to create direct (v,e) interpolations.
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...
static const std::string mu
Definition: NS.h:123
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 mooseError(Args &&... args) const

◆ outputWarnings()

void TabulatedBicubicFluidProperties::outputWarnings ( unsigned int  num_nans_p,
unsigned int  num_nans_T,
unsigned int  num_out_bounds_p,
unsigned int  num_out_bounds_T,
unsigned int  convergence_failures,
unsigned int  number_points,
std::string  variable_set 
)
protected

Definition at line 321 of file TabulatedBicubicFluidProperties.C.

Referenced by constructInterpolation().

328 {
329  // make string variables before mooseWarning
330  std::string while_creating =
331  "While creating (p,T) from " + variable_set + " interpolation tables,\n";
332  std::string warning_message = while_creating;
333  std::string converge_fails = "Inversion to (p,T) from " + variable_set + " failed " +
334  std::to_string(convergence_failures) + " times\n";
335  std::string p_nans = "- " + std::to_string(num_nans_p) + " nans generated out of " +
336  std::to_string(number_points) + " points for pressure\n";
337  std::string T_nans = "- " + std::to_string(num_nans_T) + " nans generated out of " +
338  std::to_string(number_points) + " points for temperature\n";
339  std::string p_oob = "- " + std::to_string(num_out_bounds_p) + " of " +
340  std::to_string(number_points) + " pressure values were out of bounds\n";
341  std::string T_oob = "- " + std::to_string(num_out_bounds_T) + " of " +
342  std::to_string(number_points) + " temperature values were out of bounds\n";
343  std::string outcome = "The pressure and temperature values were replaced with their respective "
344  "min and max values.\n";
345 
346  // bounds are different depending on how the object is used
347  std::string source = (_fp ? "from input parameters" : "from tabulation file");
348 
349  // if any of these do not exist, do not want to print them
350  if (convergence_failures)
351  warning_message += converge_fails;
352  if (num_nans_p)
353  warning_message += p_nans;
354  if (num_nans_T)
355  warning_message += T_nans;
356  if (num_out_bounds_p)
357  {
358  warning_message += p_oob;
359  warning_message += ("Pressure bounds " + source + ": [" + std::to_string(_pressure_min) + ", " +
360  std::to_string(_pressure_max) + "]\n");
361  }
362  if (num_out_bounds_T)
363  {
364  warning_message += T_oob;
365  warning_message += ("Temperature bounds " + source + ": [" + std::to_string(_temperature_min) +
366  ", " + std::to_string(_temperature_max) + "]\n");
367  }
368  // print warning
369  if (num_nans_p || num_nans_T || num_out_bounds_p || num_out_bounds_T || convergence_failures)
370  mooseWarning(warning_message + outcome);
371 }
Real _temperature_max
Maximum temperature in tabulated data.
Real _pressure_max
Maximum pressure in tabulated data.
Real _temperature_min
Minimum temperature in tabulated data.
const SinglePhaseFluidProperties *const _fp
SinglePhaseFluidPropertiesPT UserObject.
Real _pressure_min
Minimum pressure in tabulated data.
void mooseWarning(Args &&... args) const

◆ p_from_v_e() [1/2]

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

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

Referenced by constructInterpolation().

1050 {
1052  missingVEInterpolationError(__PRETTY_FUNCTION__);
1054 
1056  return _property_ve_ipol[_p_idx]->sample(v, e);
1057  else if (_construct_pT_from_ve)
1058  return _p_from_v_e_ipol->sample(v, e);
1059  else if (_fp)
1060  return _fp->p_from_v_e(v, e);
1061  else
1062  mooseError(__PRETTY_FUNCTION__,
1063  "\nNo tabulation or fluid property 'fp' object to compute value");
1064 }
const bool _create_direct_ve_interpolations
Whether to create direct (v,e) interpolations.
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 mooseError(Args &&... args) const

◆ p_from_v_e() [2/2]

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

Definition at line 1067 of file TabulatedFluidProperties.C.

1068 {
1070  missingVEInterpolationError(__PRETTY_FUNCTION__);
1072 
1074  _property_ve_ipol[_p_idx]->sampleValueAndDerivatives(v, e, p, dp_dv, dp_de);
1075  else if (_construct_pT_from_ve)
1076  _p_from_v_e_ipol->sampleValueAndDerivatives(v, e, p, dp_dv, dp_de);
1077  else if (_fp)
1078  _fp->p_from_v_e(v, e, p, dp_dv, dp_de);
1079  else
1080  mooseError(__PRETTY_FUNCTION__,
1081  "\nNo tabulation or fluid property 'fp' object to compute value");
1082 }
const bool _create_direct_ve_interpolations
Whether to create direct (v,e) interpolations.
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 mooseError(Args &&... args) const

◆ 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 575 of file SinglePhaseFluidProperties.h.

Referenced by TabulatedFluidProperties::T_from_h_s().

582 {
583  auto h_lambda = [&](const T & pressure, const T & temperature, T & new_h, T & dh_dp, T & dh_dT)
584  { h_from_p_T(pressure, temperature, new_h, dh_dp, dh_dT); };
585  auto s_lambda = [&](const T & pressure, const T & temperature, T & new_s, T & ds_dp, T & ds_dT)
586  { s_from_p_T(pressure, temperature, new_s, ds_dp, ds_dT); };
587  try
588  {
590  h, s, p0, T0, pressure, temperature, _tolerance, _tolerance, h_lambda, s_lambda);
591  conversion_succeeded = true;
592  }
593  catch (MooseException &)
594  {
595  conversion_succeeded = false;
596  }
597 
598  if (!conversion_succeeded)
599  mooseDoOnce(mooseWarning("Conversion from (h, s)=(", h, ", ", s, ") to (p, T) failed"));
600 }
static const std::string temperature
Definition: NS.h:59
const Real _tolerance
Newton&#39;s method may be used to convert between variable sets.
e e e e s T T T T T rho v v T e h
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 &func1, const Functor2 &func2, const unsigned int max_its=100)
NewtonSolve2D does a 2D Newton Solve to solve for the x and y such that: f = func1(x, y) and g = func2(x, y).
static const std::string pressure
Definition: NS.h:56
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 511 of file SinglePhaseFluidProperties.h.

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

518 {
519  auto v_lambda = [&](const CppType & pressure,
520  const CppType & temperature,
521  CppType & new_v,
522  CppType & dv_dp,
523  CppType & dv_dT) { v_from_p_T(pressure, temperature, new_v, dv_dp, dv_dT); };
524  auto e_lambda = [&](const CppType & pressure,
525  const CppType & temperature,
526  CppType & new_e,
527  CppType & de_dp,
528  CppType & de_dT) { e_from_p_T(pressure, temperature, new_e, de_dp, de_dT); };
529  try
530  {
532  v, e, p0, T0, p, T, _tolerance, _tolerance, v_lambda, e_lambda);
533  conversion_succeeded = true;
534  }
535  catch (MooseException &)
536  {
537  conversion_succeeded = false;
538  }
539 
540  if (!conversion_succeeded)
541  mooseDoOnce(mooseWarning("Conversion from (v, e)=(", v, ", ", e, ") to (p, T) failed"));
542 }
static const std::string temperature
Definition: NS.h:59
const Real _tolerance
Newton&#39;s method may be used to convert between variable sets.
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 &func1, const Functor2 &func2, const unsigned int max_its=100)
NewtonSolve2D does a 2D Newton Solve to solve for the x and y such that: f = func1(x, y) and g = func2(x, y).
static const std::string pressure
Definition: NS.h:56
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 546 of file SinglePhaseFluidProperties.h.

Referenced by constructInterpolation().

553 {
554  auto v_lambda = [&](const T & pressure, const T & temperature, T & new_v, T & dv_dp, T & dv_dT)
555  { v_from_p_T(pressure, temperature, new_v, dv_dp, dv_dT); };
556  auto h_lambda = [&](const T & pressure, const T & temperature, T & new_h, T & dh_dp, T & dh_dT)
557  { h_from_p_T(pressure, temperature, new_h, dh_dp, dh_dT); };
558  try
559  {
561  v, h, p0, T0, pressure, temperature, _tolerance, _tolerance, v_lambda, h_lambda);
562  conversion_succeeded = true;
563  }
564  catch (MooseException &)
565  {
566  conversion_succeeded = false;
567  }
568 
569  if (!conversion_succeeded)
570  mooseDoOnce(mooseWarning("Conversion from (v, h)=(", v, ", ", h, ") to (p, T) failed"));
571 }
static const std::string temperature
Definition: NS.h:59
const Real _tolerance
Newton&#39;s method may be used to convert between variable sets.
e e e e s T T T T T rho v v T e h
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 &func1, const Functor2 &func2, const unsigned int max_its=100)
NewtonSolve2D does a 2D Newton Solve to solve for the x and y such that: f = func1(x, y) and g = func2(x, y).
static const std::string pressure
Definition: NS.h:56
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)
protectedinherited

Read tabulation data from file.

Definition at line 1892 of file TabulatedFluidProperties.C.

Referenced by TabulatedFluidProperties::initialSetup().

1893 {
1894  std::string file_name;
1895  if (use_pT)
1896  {
1897  _console << name() + ": Reading tabulated properties from " << _file_name_in << std::endl;
1898  _csv_reader.read();
1899  file_name = _file_name_in;
1900  }
1901  else
1902  {
1903  _console << name() + ": Reading tabulated properties from " << _file_name_ve_in << std::endl;
1905  _csv_reader.read();
1906  file_name = _file_name_ve_in;
1907  }
1908 
1909  const std::vector<std::string> & column_names = _csv_reader.getNames();
1910 
1911  // These columns form the grid and must be present in the file
1912  std::vector<std::string> required_columns;
1913  if (use_pT)
1914  required_columns = {"pressure", "temperature"};
1915  else
1916  required_columns = {"specific_volume", "internal_energy"};
1917 
1918  // Check that all required columns are present
1919  for (std::size_t i = 0; i < required_columns.size(); ++i)
1920  {
1921  if (std::find(column_names.begin(), column_names.end(), required_columns[i]) ==
1922  column_names.end())
1923  mooseError("No ",
1924  required_columns[i],
1925  " data read in ",
1926  file_name,
1927  ". A column named ",
1928  required_columns[i],
1929  " must be present");
1930  }
1931 
1932  // These columns can be present in the file
1933  std::vector<std::string> property_columns = {
1934  "density", "enthalpy", "viscosity", "k", "c", "cv", "cp", "entropy"};
1935  if (use_pT)
1936  property_columns.push_back("internal_energy");
1937  else
1938  {
1939  property_columns.push_back("pressure");
1940  property_columns.push_back("temperature");
1941  }
1942 
1943  // Check that any property names read from the file are present in the list of possible
1944  // properties, and if they are, add them to the list of read properties
1945  for (std::size_t i = 0; i < column_names.size(); ++i)
1946  {
1947  // Only check properties not in _required_columns
1948  if (std::find(required_columns.begin(), required_columns.end(), column_names[i]) ==
1949  required_columns.end())
1950  {
1951  if (std::find(property_columns.begin(), property_columns.end(), column_names[i]) ==
1952  property_columns.end())
1953  mooseWarning(column_names[i],
1954  " read in ",
1955  file_name,
1956  " tabulation file is not one of the properties that TabulatedFluidProperties "
1957  "understands. It will be ignored.");
1958  // We could be reading a (v,e) tabulation after having read a (p,T) tabulation, do not
1959  // insert twice
1960  else if (std::find(_interpolated_properties.begin(),
1962  column_names[i]) == _interpolated_properties.end())
1963  _interpolated_properties.push_back(column_names[i]);
1964  }
1965  }
1966 
1967  std::map<std::string, unsigned int> data_index;
1968  for (std::size_t i = 0; i < column_names.size(); ++i)
1969  {
1970  auto it = std::find(column_names.begin(), column_names.end(), column_names[i]);
1971  data_index[column_names[i]] = std::distance(column_names.begin(), it);
1972  }
1973 
1974  const std::vector<std::vector<Real>> & column_data = _csv_reader.getData();
1975 
1976  // Extract the pressure and temperature data vectors
1977  if (use_pT)
1978  {
1979  _pressure = column_data[data_index.find("pressure")->second];
1980  _temperature = column_data[data_index.find("temperature")->second];
1981  }
1982  else
1983  {
1984  _specific_volume = column_data[data_index.find("specific_volume")->second];
1985  _internal_energy = column_data[data_index.find("internal_energy")->second];
1986  }
1987 
1988  if (use_pT)
1989  checkFileTabulationGrids(_pressure, _temperature, file_name, "pressure", "temperature");
1990  else
1993  file_name,
1994  "specific volume",
1995  "specific internal energy");
1996 
1997  if (use_pT)
1998  {
1999  _num_p = _pressure.size();
2000  _num_T = _temperature.size();
2001 
2002  // Minimum and maximum pressure and temperature. Note that _pressure and
2003  // _temperature are sorted
2004  _pressure_min = _pressure.front();
2005  _pressure_max = _pressure.back();
2006  _temperature_min = _temperature.front();
2007  _temperature_max = _temperature.back();
2008 
2009  // Extract the fluid property data from the file
2010  for (std::size_t i = 0; i < _interpolated_properties.size(); ++i)
2011  _properties.push_back(column_data[data_index.find(_interpolated_properties[i])->second]);
2012  }
2013  else
2014  {
2015  _num_v = _specific_volume.size();
2016  _num_e = _internal_energy.size();
2017 
2018  // Minimum and maximum specific internal energy and specific volume
2019  _v_min = _specific_volume.front();
2020  _v_max = _specific_volume.back();
2021  _e_min = _internal_energy.front();
2022  _e_max = _internal_energy.back();
2023 
2024  // We cannot overwrite the tabulated data grid with a grid generated from user-input for the
2025  // purpose of creating (p,T) to (v,e) interpolations
2027  paramError("construct_pT_from_ve",
2028  "Reading a (v,e) tabulation and generating (p,T) to (v,e) interpolation tables is "
2029  "not supported at this time.");
2030 
2031  // Make sure we use the tabulation bounds
2032  _e_bounds_specified = true;
2033  _v_bounds_specified = true;
2034 
2035  // Extract the fluid property data from the file
2036  _properties_ve.reserve(_interpolated_properties.size());
2037  for (std::size_t i = 0; i < _interpolated_properties.size(); ++i)
2038  _properties_ve.push_back(column_data[data_index.find(_interpolated_properties[i])->second]);
2039  }
2040 }
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.
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 _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
std::vector< Real > _internal_energy
Specific internal energy vector.
const ConsoleStream _console
const std::vector< std::string > & getNames() const
FileName _file_name_in
File name of input tabulated data file.
unsigned int _num_e
Number of internal energy points in tabulated data.

◆ reshapeData2D()

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

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

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

Definition at line 254 of file TabulatedBicubicFluidProperties.C.

Referenced by constructInterpolation().

258 {
259  if (!vec.empty())
260  {
261  mat.resize(nrow);
262  for (unsigned int i = 0; i < nrow; ++i)
263  mat[i].resize(ncol);
264 
265  for (unsigned int i = 0; i < nrow; ++i)
266  for (unsigned int j = 0; j < ncol; ++j)
267  mat[i][j] = vec[i * ncol + j];
268  }
269 }
static const std::complex< double > j(0, 1)
Complex number "j" (also known as "i")

◆ 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 434 of file SinglePhaseFluidProperties.C.

442 {
443  rho_from_p_T(p, T, rho, drho_dp, drho_dT);
444  e_from_p_T(p, T, e, de_dp, de_dT);
445 }

◆ rho_from_p_s() [1/2]

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

Definition at line 473 of file TabulatedFluidProperties.C.

474 {
475  Real T = T_from_p_s(p, s);
476  return rho_from_p_T(p, T);
477 }
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
overridevirtualinherited

Definition at line 480 of file TabulatedFluidProperties.C.

482 {
483  Real T, dT_dp, dT_ds;
484  T_from_p_s(p, s, T, dT_dp, dT_ds);
485  Real drho_dp_T, drho_dT;
486  rho_from_p_T(p, T, rho, drho_dp_T, drho_dT);
487  drho_dp = drho_dT * dT_dp + drho_dp_T;
488  drho_ds = drho_dT * dT_ds;
489 }
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/3]

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

Definition at line 415 of file TabulatedFluidProperties.C.

Referenced by TabulatedFluidProperties::e_from_p_rho(), TabulatedFluidProperties::rho_from_p_s(), and TabulatedFluidProperties::T_from_p_rho().

416 {
418  {
421  }
422  else
423  {
424  if (_fp)
425  return _fp->rho_from_p_T(pressure, temperature);
426  else
427  paramError("fp", "No fluid properties or csv data provided for density.");
428  }
429 }
void paramError(const std::string &param, Args... args) const
const bool _create_direct_pT_interpolations
Whether to create direct (p,T) interpolations.
static const std::string temperature
Definition: NS.h:59
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:56
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/3]

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

Definition at line 432 of file TabulatedFluidProperties.C.

434 {
436  {
438  _property_ipol[_density_idx]->sampleValueAndDerivatives(
439  pressure, temperature, rho, drho_dp, drho_dT);
440  }
441  else
442  {
443  if (_fp)
444  _fp->rho_from_p_T(pressure, temperature, rho, drho_dp, drho_dT);
445  else
446  paramError("fp", "No fluid properties or csv data provided for density.");
447  }
448 }
void paramError(const std::string &param, Args... args) const
const bool _create_direct_pT_interpolations
Whether to create direct (p,T) interpolations.
static const std::string temperature
Definition: NS.h:59
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:56
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/3]

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

Definition at line 451 of file TabulatedFluidProperties.C.

456 {
458  {
461  _property_ipol[_density_idx]->sampleValueAndDerivatives(p, T, rho, drho_dp, drho_dT);
462  }
463  else
464  {
465  if (_fp)
466  _fp->rho_from_p_T(pressure, temperature, rho, drho_dp, drho_dT);
467  else
468  paramError("fp", "No fluid properties or csv data provided for density.");
469  }
470 }
void paramError(const std::string &param, Args... args) const
const bool _create_direct_pT_interpolations
Whether to create direct (p,T) interpolations.
static const std::string temperature
Definition: NS.h:59
DualNumber< Real, DNDerivativeType, true > 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:56
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 448 of file SinglePhaseFluidProperties.C.

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

449 {
450  rho = rho_from_p_T(p, T);
451  mu = mu_from_p_T(p, T);
452 }
static const std::string mu
Definition: NS.h:123

◆ 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 455 of file SinglePhaseFluidProperties.C.

463 {
464  rho_from_p_T(p, T, rho, drho_dp, drho_dT);
465  mu_from_p_T(p, T, mu, dmu_dp, dmu_dT);
466 }
static const std::string mu
Definition: NS.h:123

◆ 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 469 of file SinglePhaseFluidProperties.C.

473 {
474  rho = rho_from_p_T(p, T);
475  mu = mu_from_p_T(p, T);
476 }
static const std::string mu
Definition: NS.h:123

◆ s_from_h_p() [1/2]

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

Definition at line 1485 of file TabulatedFluidProperties.C.

1486 {
1487  Real T = T_from_p_h(pressure, enthalpy);
1488  return s_from_p_T(pressure, T);
1489 }
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:56

◆ 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
overridevirtualinherited

Definition at line 1492 of file TabulatedFluidProperties.C.

1494 {
1495 
1496  if (_fp)
1497  _fp->s_from_h_p(h, pressure, s, ds_dh, ds_dp);
1498  else
1499  mooseError("fp", "s_from_h_p derivatives not implemented.");
1500 }
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:56
void mooseError(Args &&... args) const

◆ s_from_p_T() [1/2]

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

Definition at line 849 of file TabulatedFluidProperties.C.

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

850 {
852  {
855  }
856  else
857  {
858  if (_fp)
859  return _fp->s_from_p_T(pressure, temperature);
860  else
861  paramError("interpolated_properties", "No data to interpolate for entropy.");
862  }
863 }
void paramError(const std::string &param, Args... args) const
const bool _create_direct_pT_interpolations
Whether to create direct (p,T) interpolations.
static const std::string temperature
Definition: NS.h:59
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:56
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
overridevirtualinherited

Definition at line 866 of file TabulatedFluidProperties.C.

867 {
869  {
871  _property_ipol[_entropy_idx]->sampleValueAndDerivatives(p, T, s, ds_dp, ds_dT);
872  }
873  else
874  {
875  if (_fp)
876  _fp->s_from_p_T(p, T, s, ds_dp, ds_dT);
877  else
878  paramError("interpolated_properties", "No data to interpolate for entropy.");
879  }
880 }
void paramError(const std::string &param, Args... args) const
const bool _create_direct_pT_interpolations
Whether to create direct (p,T) interpolations.
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.
std::vector< std::unique_ptr< BidimensionalInterpolation > > _property_ipol
Vector of bi-dimensional interpolation of fluid properties.

◆ s_from_v_e()

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

Definition at line 1366 of file TabulatedFluidProperties.C.

Referenced by TabulatedFluidProperties::writeTabulatedData().

1367 {
1369  missingVEInterpolationError(__PRETTY_FUNCTION__);
1371 
1373  return _property_ve_ipol[_entropy_idx]->sample(v, e);
1374  else if (_construct_pT_from_ve)
1375  {
1376  Real T = _T_from_v_e_ipol->sample(v, e);
1377  Real p = _p_from_v_e_ipol->sample(v, e);
1378  return s_from_p_T(p, T);
1379  }
1380  else if (_fp)
1381  return _fp->s_from_v_e(v, e);
1382  else
1383  mooseError(__PRETTY_FUNCTION__,
1384  "\nNo tabulation or fluid property 'fp' object to compute value");
1385 }
const bool _create_direct_ve_interpolations
Whether to create direct (v,e) interpolations.
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 mooseError(Args &&... args) const

◆ 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
virtualinherited

Definition at line 1420 of file TabulatedFluidProperties.C.

1421 {
1422  Real p0 = _p_initial_guess;
1423  Real T0 = _T_initial_guess;
1424  Real p, T;
1425  bool conversion_succeeded;
1426  p_T_from_h_s(h, s, p0, T0, p, T, conversion_succeeded);
1427  return T;
1428 }
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
overridevirtualinherited

Definition at line 1431 of file TabulatedFluidProperties.C.

Referenced by TabulatedFluidProperties::s_from_h_p().

1432 {
1433  if (_fp)
1434  return _fp->T_from_p_h(pressure, enthalpy);
1435  else
1436  {
1437  auto lambda = [&](Real pressure, Real current_T, Real & new_h, Real & dh_dp, Real & dh_dT)
1438  { h_from_p_T(pressure, current_T, new_h, dh_dp, dh_dT); };
1440  pressure, enthalpy, _T_initial_guess, _tolerance, lambda, name() + "::T_from_p_h")
1441  .first;
1442  // check for nans
1443  if (std::isnan(T))
1444  mooseError("Conversion from enthalpy (h = ",
1445  enthalpy,
1446  ") and pressure (p = ",
1447  pressure,
1448  ") to temperature failed to converge.");
1449  return T;
1450  }
1451 }
std::pair< T, T > NewtonSolve(const T &x, const T &y, const Real z_initial_guess, const Real tolerance, const Functor &func, const std::string &caller_name, const unsigned int max_its=100)
NewtonSolve does a 1D Newton Solve to solve the equation y = f(x, z) for variable z...
const Real _tolerance
Newton&#39;s method may be used to convert between variable sets.
const std::string & name() const
virtual Real h_from_p_T(Real p, Real T) const override
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:56
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_h() [2/2]

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

Definition at line 1454 of file TabulatedFluidProperties.C.

1455 {
1456  using std::isnan;
1457  if (_fp)
1458  return _fp->T_from_p_h(pressure, enthalpy);
1459  else
1460  {
1461  auto lambda =
1462  [&](ADReal pressure, ADReal current_T, ADReal & new_h, ADReal & dh_dp, ADReal & dh_dT)
1463  {
1464  h_from_p_T(pressure.value(), current_T.value(), new_h.value(), dh_dp.value(), dh_dT.value());
1465  // Reconstruct derivatives
1466  new_h.derivatives() =
1467  dh_dp.value() * pressure.derivatives() + dh_dT.value() * current_T.derivatives();
1468  };
1469  ADReal T =
1471  pressure, enthalpy, _T_initial_guess, _tolerance, lambda, name() + "::T_from_p_h")
1472  .first;
1473  // check for nans
1474  if (isnan(T))
1475  mooseError("Conversion from enthalpy (h = ",
1476  enthalpy,
1477  ") and pressure (p = ",
1478  pressure,
1479  ") to temperature failed to converge.");
1480  return T;
1481  }
1482 }
DualNumber< Real, DNDerivativeType, true > ADReal
std::pair< T, T > NewtonSolve(const T &x, const T &y, const Real z_initial_guess, const Real tolerance, const Functor &func, const std::string &caller_name, const unsigned int max_its=100)
NewtonSolve does a 1D Newton Solve to solve the equation y = f(x, z) for variable z...
const Real _tolerance
Newton&#39;s method may be used to convert between variable sets.
const std::string & name() const
virtual Real h_from_p_T(Real p, Real T) const override
const SinglePhaseFluidProperties *const _fp
SinglePhaseFluidPropertiesPT UserObject.
static const std::string pressure
Definition: NS.h:56
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_rho() [1/2]

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

Definition at line 557 of file TabulatedFluidProperties.C.

Referenced by TabulatedFluidProperties::e_from_p_rho(), and TabulatedFluidProperties::T_from_p_rho().

558 {
559  auto lambda = [&](Real p, Real current_T, Real & new_rho, Real & drho_dp, Real & drho_dT)
560  { rho_from_p_T(p, current_T, new_rho, drho_dp, drho_dT); };
562  rho,
564  _tolerance,
565  lambda,
566  name() + "::T_from_p_rho",
568  .first;
569  // check for nans
570  if (std::isnan(T))
571  mooseError("Conversion from pressure (p = ",
572  pressure,
573  ") and density (rho = ",
574  rho,
575  ") to temperature failed to converge.");
576  return T;
577 }
std::pair< T, T > NewtonSolve(const T &x, const T &y, const Real z_initial_guess, const Real tolerance, const Functor &func, const std::string &caller_name, const unsigned int max_its=100)
NewtonSolve does a 1D Newton Solve to solve the equation y = f(x, z) for variable z...
const Real _tolerance
Newton&#39;s method may be used to convert between variable sets.
const std::string & name() const
virtual Real rho_from_p_T(Real pressure, Real temperature) const override
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:56
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_rho() [2/2]

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

Definition at line 580 of file TabulatedFluidProperties.C.

582 {
584  Real eps = 1e-8;
585  dT_dp = (T_from_p_rho(pressure * (1 + eps), rho) - T) / (eps * pressure);
586  dT_drho = (T_from_p_rho(pressure, rho * (1 + eps)) - T) / (eps * rho);
587 }
const Real eps
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
static const std::string pressure
Definition: NS.h:56
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
virtualinherited

Definition at line 590 of file TabulatedFluidProperties.C.

Referenced by TabulatedFluidProperties::rho_from_p_s(), and TabulatedFluidProperties::T_from_p_s().

591 {
592  auto lambda = [&](Real p, Real current_T, Real & new_s, Real & ds_dp, Real & ds_dT)
593  { s_from_p_T(p, current_T, new_s, ds_dp, ds_dT); };
595  s,
597  _tolerance,
598  lambda,
599  name() + "::T_from_p_s",
601  .first;
602  // check for nans
603  if (std::isnan(T))
604  mooseError("Conversion from pressure (p = ",
605  pressure,
606  ") and entropy (s = ",
607  s,
608  ") to temperature failed to converge.");
609  return T;
610 }
virtual Real s_from_p_T(Real pressure, Real temperature) const override
std::pair< T, T > NewtonSolve(const T &x, const T &y, const Real z_initial_guess, const Real tolerance, const Functor &func, const std::string &caller_name, const unsigned int max_its=100)
NewtonSolve does a 1D Newton Solve to solve the equation y = f(x, z) for variable z...
const Real _tolerance
Newton&#39;s method may be used to convert between variable sets.
const std::string & name() const
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:56
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
virtualinherited

Definition at line 613 of file TabulatedFluidProperties.C.

615 {
616  T = T_from_p_s(pressure, s);
617  Real eps = 1e-8;
618  dT_dp = (T_from_p_s(pressure * (1 + eps), s) - T) / (eps * pressure);
619  dT_ds = (T_from_p_s(pressure, s * (1 + eps)) - T) / (eps * s);
620 }
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:56

◆ T_from_v_e() [1/2]

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

Definition at line 1085 of file TabulatedFluidProperties.C.

Referenced by constructInterpolation().

1086 {
1088  missingVEInterpolationError(__PRETTY_FUNCTION__);
1090 
1092  return _property_ve_ipol[_T_idx]->sample(v, e);
1093  else if (_construct_pT_from_ve)
1094  return _T_from_v_e_ipol->sample(v, e);
1095  else if (_fp)
1096  return _fp->T_from_v_e(v, e);
1097  else
1098  mooseError(__PRETTY_FUNCTION__,
1099  "\nNo tabulation or fluid property 'fp' object to compute value");
1100 }
const bool _create_direct_ve_interpolations
Whether to create direct (v,e) interpolations.
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 mooseError(Args &&... args) const

◆ T_from_v_e() [2/2]

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

Definition at line 1103 of file TabulatedFluidProperties.C.

1104 {
1106  missingVEInterpolationError(__PRETTY_FUNCTION__);
1108 
1110  _property_ve_ipol[_T_idx]->sampleValueAndDerivatives(v, e, T, dT_dv, dT_de);
1111  else if (_construct_pT_from_ve)
1112  _T_from_v_e_ipol->sampleValueAndDerivatives(v, e, T, dT_dv, dT_de);
1113  else if (_fp)
1114  _fp->T_from_v_e(v, e, T, dT_dv, dT_de);
1115  else
1116  mooseError(__PRETTY_FUNCTION__,
1117  "\nNo tabulation or fluid property 'fp' object to compute value");
1118 }
const bool _create_direct_ve_interpolations
Whether to create direct (v,e) interpolations.
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 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
overridevirtualinherited

Triple point pressure.

Returns
triple point pressure (Pa)

Reimplemented from SinglePhaseFluidProperties.

Definition at line 1000 of file TabulatedFluidProperties.C.

1001 {
1002 
1003  if (_fp)
1004  return _fp->triplePointPressure();
1005  else
1006  FluidPropertiesForwardError("triplePointPressure");
1007 }
void FluidPropertiesForwardError(const std::string &desired_routine) const
virtual Real triplePointPressure() const
Triple point pressure.
const SinglePhaseFluidProperties *const _fp
SinglePhaseFluidPropertiesPT UserObject.

◆ triplePointTemperature()

Real TabulatedFluidProperties::triplePointTemperature ( ) const
overridevirtualinherited

Triple point temperature.

Returns
triple point temperature (K)

Reimplemented from SinglePhaseFluidProperties.

Definition at line 1010 of file TabulatedFluidProperties.C.

1011 {
1012 
1013  if (_fp)
1014  return _fp->triplePointTemperature();
1015  else
1016  FluidPropertiesForwardError("triplePointTemperature");
1017 }
virtual Real triplePointTemperature() const
Triple point temperature.
void FluidPropertiesForwardError(const std::string &desired_routine) const
const SinglePhaseFluidProperties *const _fp
SinglePhaseFluidPropertiesPT UserObject.

◆ 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 604 of file SinglePhaseFluidProperties.h.

608 {
609  const CppType rho = rho_from_p_T(p, T);
610  v = 1.0 / rho;
611  try
612  {
613  // more likely to not involve a Newton search
614  e = e_from_p_T(p, T);
615  }
616  catch (...)
617  {
618  e = e_from_p_rho(p, rho);
619  }
620 }

◆ 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 624 of file SinglePhaseFluidProperties.h.

632 {
633  CppType rho, drho_dp, drho_dT;
634  rho_from_p_T(p, T, rho, drho_dp, drho_dT);
635 
636  v = 1.0 / rho;
637  const CppType dv_drho = -1.0 / (rho * rho);
638  dv_dp = dv_drho * drho_dp;
639  dv_dT = dv_drho * drho_dT;
640 
641  CppType de_dp_partial, de_drho;
642  e_from_p_rho(p, rho, e, de_dp_partial, de_drho);
643  de_dp = de_dp_partial + de_drho * drho_dp;
644  de_dT = de_drho * drho_dT;
645 }

◆ 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 485 of file SinglePhaseFluidProperties.C.

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

◆ v_from_p_T() [1/2]

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

Definition at line 374 of file TabulatedFluidProperties.C.

Referenced by TabulatedFluidProperties::createVGridVector().

375 {
377  {
379  return 1.0 / _property_ipol[_density_idx]->sample(pressure, temperature);
380  }
381  else
382  {
383  if (_fp)
384  return 1.0 / _fp->rho_from_p_T(pressure, temperature);
385  else
386  paramError("fp", "No fluid properties or csv data provided for density.");
387  }
388 }
void paramError(const std::string &param, Args... args) const
const bool _create_direct_pT_interpolations
Whether to create direct (p,T) interpolations.
static const std::string temperature
Definition: NS.h:59
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:56
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/2]

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

Definition at line 391 of file TabulatedFluidProperties.C.

393 {
394  Real rho = 0, drho_dp = 0, drho_dT = 0;
396  {
398  _property_ipol[_density_idx]->sampleValueAndDerivatives(
399  pressure, temperature, rho, drho_dp, drho_dT);
400  }
401  else
402  {
403  if (_fp)
404  _fp->rho_from_p_T(pressure, temperature, rho, drho_dp, drho_dT);
405  else
406  paramError("fp", "No fluid properties or csv data provided for density.");
407  }
408  // convert from rho to v
409  v = 1.0 / rho;
410  dv_dp = -drho_dp / (rho * rho);
411  dv_dT = -drho_dT / (rho * rho);
412 }
void paramError(const std::string &param, Args... args) const
const bool _create_direct_pT_interpolations
Whether to create direct (p,T) interpolations.
static const std::string temperature
Definition: NS.h:59
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:56
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 TabulatedBicubicFluidProperties::validParams ( )
static

Definition at line 27 of file TabulatedBicubicFluidProperties.C.

28 {
30  params.addClassDescription(
31  "Fluid properties using bicubic interpolation on tabulated values provided");
32  return params;
33 }
static InputParameters validParams()
void addClassDescription(const std::string &doc_string)

◆ vaporPressure() [1/3]

Real TabulatedFluidProperties::vaporPressure ( Real  T) const
overridevirtualinherited

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

964 {
965  if (_fp)
966  return _fp->vaporPressure(temperature);
967  else
968  FluidPropertiesForwardError("vaporPressure");
969 }
static const std::string temperature
Definition: NS.h:59
void FluidPropertiesForwardError(const std::string &desired_routine) const
const SinglePhaseFluidProperties *const _fp
SinglePhaseFluidPropertiesPT UserObject.
virtual Real vaporPressure(Real T) const
Vapor pressure.

◆ vaporPressure() [2/3]

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

Reimplemented from SinglePhaseFluidProperties.

Definition at line 972 of file TabulatedFluidProperties.C.

973 {
974  if (_fp)
975  _fp->vaporPressure(temperature, psat, dpsat_dT);
976  else
977  FluidPropertiesForwardError("vaporPressure");
978 }
static const std::string temperature
Definition: NS.h:59
void FluidPropertiesForwardError(const std::string &desired_routine) const
const SinglePhaseFluidProperties *const _fp
SinglePhaseFluidPropertiesPT UserObject.
virtual Real vaporPressure(Real T) const
Vapor pressure.

◆ vaporPressure() [3/3]

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

Definition at line 389 of file SinglePhaseFluidProperties.C.

390 {
391  Real p = 0.0;
392  Real temperature = T.value();
393  Real dpdT = 0.0;
394 
395  vaporPressure(temperature, p, dpdT);
396 
397  ADReal result = p;
398  result.derivatives() = T.derivatives() * dpdT;
399 
400  return result;
401 }
static const std::string temperature
Definition: NS.h:59
DualNumber< Real, DNDerivativeType, true > 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
overridevirtualinherited

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

982 {
983  if (_fp)
984  return _fp->vaporTemperature(pressure);
985  else
986  FluidPropertiesForwardError("vaporTemperature");
987 }
virtual Real vaporTemperature(Real p) const
Vapor temperature.
void FluidPropertiesForwardError(const std::string &desired_routine) const
const SinglePhaseFluidProperties *const _fp
SinglePhaseFluidPropertiesPT UserObject.
static const std::string pressure
Definition: NS.h:56

◆ vaporTemperature() [2/3]

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

Reimplemented from SinglePhaseFluidProperties.

Definition at line 990 of file TabulatedFluidProperties.C.

991 {
992 
993  if (_fp)
994  _fp->vaporTemperature(pressure, Tsat, dTsat_dp);
995  else
996  FluidPropertiesForwardError("vaporTemperature");
997 }
virtual Real vaporTemperature(Real p) const
Vapor temperature.
void FluidPropertiesForwardError(const std::string &desired_routine) const
const SinglePhaseFluidProperties *const _fp
SinglePhaseFluidPropertiesPT UserObject.
static const std::string pressure
Definition: NS.h:56

◆ vaporTemperature() [3/3]

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

Definition at line 419 of file SinglePhaseFluidProperties.C.

420 {
421  Real T = 0.0;
422  Real pressure = p.value();
423  Real dTdp = 0.0;
424 
425  vaporTemperature(pressure, T, dTdp);
426 
427  ADReal result = T;
428  result.derivatives() = p.derivatives() * dTdp;
429 
430  return result;
431 }
DualNumber< Real, DNDerivativeType, true > 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:56

◆ writeTabulatedData()

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

Writes tabulated data to a file.

Parameters
file_namename of the file to be written

Definition at line 1512 of file TabulatedFluidProperties.C.

Referenced by TabulatedFluidProperties::initialSetup().

1513 {
1514  file_name = file_name.empty() ? "fluid_properties_" + name() + "_out.csv" : file_name;
1515  if (processor_id() == 0)
1516  {
1517  {
1518  MooseUtils::checkFileWriteable(file_name);
1519 
1520  std::ofstream file_out(file_name.c_str());
1521 
1522  // Write out date and fluid type
1523  time_t now = std::time(&now);
1524  if (_fp)
1525  file_out << "# " << _fp->fluidName()
1526  << " properties created by TabulatedFluidProperties on " << ctime(&now) << "\n";
1527  else
1528  file_out << "# tabulated properties created by TabulatedFluidProperties on " << ctime(&now)
1529  << "\n";
1530 
1531  // Write out column names
1532  file_out << "pressure, temperature";
1533  for (std::size_t i = 0; i < _interpolated_properties.size(); ++i)
1534  file_out << ", " << _interpolated_properties[i];
1535  file_out << "\n";
1536 
1537  // Write out the fluid property data
1538  for (unsigned int p = 0; p < _num_p; ++p)
1539  for (unsigned int t = 0; t < _num_T; ++t)
1540  {
1541  file_out << _pressure[p] << ", " << _temperature[t];
1542  for (std::size_t i = 0; i < _properties.size(); ++i)
1543  file_out << ", " << _properties[i][p * _num_T + t];
1544  file_out << "\n";
1545  }
1546 
1547  file_out << std::flush;
1548  file_out.close();
1549  }
1550 
1551  // Write out the (v,e) to (p,T) conversions
1553  {
1554  const auto file_name_ve = (_file_name_ve_out == "")
1555  ? std::regex_replace(file_name, std::regex("\\.csv"), "_ve.csv")
1557  MooseUtils::checkFileWriteable(file_name_ve);
1558  std::ofstream file_out(file_name_ve.c_str());
1559 
1560  // Write out column names
1561  file_out << "specific_volume, internal_energy, pressure, temperature";
1562  for (const auto i : index_range(_properties))
1563  if (_interpolated_properties[i] != "internal_energy")
1564  file_out << ", " << _interpolated_properties[i];
1565  file_out << "\n";
1566 
1567  // Write out the fluid property data
1568  for (const auto v : make_range(_num_v))
1569  for (const auto e : make_range(_num_e))
1570  {
1571  const auto v_val = _specific_volume[v];
1572  const auto e_val = _internal_energy[e];
1573  const auto pressure = _p_from_v_e_ipol->sample(v_val, e_val);
1574  const auto temperature = _T_from_v_e_ipol->sample(v_val, e_val);
1575  file_out << v_val << ", " << e_val << ", " << pressure << ", " << temperature << ", ";
1576  for (const auto i : index_range(_properties))
1577  {
1578  bool add_comma = true;
1579  if (i == _density_idx)
1580  file_out << 1 / v_val;
1581  else if (i == _enthalpy_idx)
1582  file_out << h_from_p_T(pressure, temperature);
1583  // Note that we could use (p,T) routine to generate this instead of (v,e)
1584  // Or could use the _properties_ve array
1585  else if (i == _viscosity_idx)
1586  file_out << mu_from_v_e(v_val, e_val);
1587  else if (i == _k_idx)
1588  file_out << k_from_v_e(v_val, e_val);
1589  else if (i == _c_idx)
1590  file_out << c_from_v_e(v_val, e_val);
1591  else if (i == _cv_idx)
1592  file_out << cv_from_v_e(v_val, e_val);
1593  else if (i == _cp_idx)
1594  file_out << cp_from_v_e(v_val, e_val);
1595  else if (i == _entropy_idx)
1596  file_out << s_from_v_e(v_val, e_val);
1597  else
1598  add_comma = false;
1599  if (i != _properties.size() - 1 && add_comma)
1600  file_out << ", ";
1601  }
1602 
1603  file_out << "\n";
1604  }
1605 
1606  file_out << std::flush;
1607  file_out.close();
1608  }
1609  }
1610 }
static const std::string temperature
Definition: NS.h:59
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
virtual Real h_from_p_T(Real p, Real T) const override
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)
unsigned int _num_p
Number of pressure points in the tabulated data.
static const std::string pressure
Definition: NS.h:56
IntRange< T > make_range(T beg, T end)
std::vector< Real > _specific_volume
Specific volume vector.
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 490 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().

492 {
494  const auto [zero, one] = makeZeroAndOne(x);
495 
496  CompoundType x_c(x, zero);
497  auto & x_cd = x_c.derivatives();
498  x_cd[0] = one;
499  CompoundType y_c(y, zero);
500  auto & y_cd = y_c.derivatives();
501  y_cd[1] = one;
502 
503  const auto z_c = z_from_x_y(x_c, y_c);
504  z = z_c.value();
505  dz_dx = z_c.derivatives()[0];
506  dz_dy = z_c.derivatives()[1];
507 }
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
protectedinherited

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

Definition at line 298 of file TabulatedFluidProperties.h.

Referenced by TabulatedFluidProperties::TabulatedFluidProperties().

◆ _allow_imperfect_jacobians

const bool FluidProperties::_allow_imperfect_jacobians
protectedinherited

Flag to set unimplemented Jacobian entries to zero.

Definition at line 47 of file FluidProperties.h.

Referenced by VaporMixtureFluidProperties::imperfectJacobianMessage(), and SinglePhaseFluidProperties::unimplementedDerivativeMethod().

◆ _c_idx

unsigned int TabulatedFluidProperties::_c_idx
protectedinherited

◆ _construct_pT_from_ve

bool TabulatedFluidProperties::_construct_pT_from_ve
protectedinherited

◆ _construct_pT_from_vh

bool TabulatedFluidProperties::_construct_pT_from_vh
protectedinherited

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

Definition at line 336 of file TabulatedFluidProperties.h.

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

◆ _cp_idx

unsigned int TabulatedFluidProperties::_cp_idx
protectedinherited

◆ _create_direct_pT_interpolations

const bool TabulatedFluidProperties::_create_direct_pT_interpolations
protectedinherited

◆ _create_direct_ve_interpolations

const bool TabulatedFluidProperties::_create_direct_ve_interpolations
protectedinherited

◆ _csv_reader

MooseUtils::DelimitedFileReader TabulatedFluidProperties::_csv_reader
protectedinherited

◆ _cv_idx

unsigned int TabulatedFluidProperties::_cv_idx
protectedinherited

◆ _density_idx

unsigned int TabulatedFluidProperties::_density_idx
protectedinherited

◆ _e_bounds_specified

bool TabulatedFluidProperties::_e_bounds_specified
protectedinherited

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

Definition at line 375 of file TabulatedFluidProperties.h.

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

◆ _e_max

Real TabulatedFluidProperties::_e_max
protectedinherited

◆ _e_min

Real TabulatedFluidProperties::_e_min
protectedinherited

◆ _enthalpy

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

Specific enthalpy vector.

Definition at line 265 of file TabulatedFluidProperties.h.

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

◆ _enthalpy_idx

unsigned int TabulatedFluidProperties::_enthalpy_idx
protectedinherited

◆ _entropy_idx

unsigned int TabulatedFluidProperties::_entropy_idx
protectedinherited

◆ _file_name_in

FileName TabulatedFluidProperties::_file_name_in
protectedinherited

◆ _file_name_out

FileName TabulatedFluidProperties::_file_name_out
protectedinherited

File name of output tabulated data file.

Definition at line 250 of file TabulatedFluidProperties.h.

Referenced by TabulatedFluidProperties::initialSetup().

◆ _file_name_ve_in

FileName TabulatedFluidProperties::_file_name_ve_in
protectedinherited

◆ _file_name_ve_out

FileName TabulatedFluidProperties::_file_name_ve_out
protectedinherited

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

Definition at line 252 of file TabulatedFluidProperties.h.

Referenced by TabulatedFluidProperties::writeTabulatedData().

◆ _fp

const SinglePhaseFluidProperties* const TabulatedFluidProperties::_fp
protectedinherited

SinglePhaseFluidPropertiesPT UserObject.

Definition at line 296 of file TabulatedFluidProperties.h.

Referenced by TabulatedFluidProperties::c_from_p_T(), TabulatedFluidProperties::c_from_v_e(), TabulatedFluidProperties::checkInitialGuess(), constructInterpolation(), TabulatedFluidProperties::cp_from_p_T(), TabulatedFluidProperties::cp_from_v_e(), TabulatedFluidProperties::createVEGridVectors(), TabulatedFluidProperties::createVGridVector(), TabulatedFluidProperties::createVHGridVectors(), TabulatedFluidProperties::criticalDensity(), TabulatedFluidProperties::criticalPressure(), TabulatedFluidProperties::criticalTemperature(), TabulatedFluidProperties::cv_from_p_T(), TabulatedFluidProperties::cv_from_v_e(), TabulatedFluidProperties::e_from_p_T(), TabulatedFluidProperties::e_from_v_h(), TabulatedFluidProperties::fluidName(), TabulatedFluidProperties::g_from_v_e(), TabulatedFluidProperties::generateTabulatedData(), TabulatedFluidProperties::generateVETabulatedData(), TabulatedFluidProperties::h_from_p_T(), TabulatedFluidProperties::henryCoefficients(), TabulatedFluidProperties::initialSetup(), TabulatedFluidProperties::k_from_p_T(), TabulatedFluidProperties::k_from_v_e(), TabulatedFluidProperties::molarMass(), TabulatedFluidProperties::mu_from_p_T(), TabulatedFluidProperties::mu_from_v_e(), outputWarnings(), TabulatedFluidProperties::p_from_v_e(), TabulatedFluidProperties::rho_from_p_T(), TabulatedFluidProperties::s_from_h_p(), TabulatedFluidProperties::s_from_p_T(), TabulatedFluidProperties::s_from_v_e(), TabulatedFluidProperties::T_from_p_h(), TabulatedFluidProperties::T_from_v_e(), TabulatedFluidProperties::TabulatedFluidProperties(), TabulatedFluidProperties::triplePointPressure(), TabulatedFluidProperties::triplePointTemperature(), TabulatedFluidProperties::v_from_p_T(), TabulatedFluidProperties::vaporPressure(), TabulatedFluidProperties::vaporTemperature(), and TabulatedFluidProperties::writeTabulatedData().

◆ _h_max

Real TabulatedFluidProperties::_h_max
protectedinherited

Maximum specific enthalpy in tabulated data.

Definition at line 389 of file TabulatedFluidProperties.h.

Referenced by TabulatedFluidProperties::createVHGridVectors().

◆ _h_min

Real TabulatedFluidProperties::_h_min
protectedinherited

Minimum specific enthalpy in tabulated data.

Definition at line 387 of file TabulatedFluidProperties.h.

Referenced by TabulatedFluidProperties::createVHGridVectors().

◆ _initial_setup_done

bool TabulatedFluidProperties::_initial_setup_done
protectedinherited

keeps track of whether initialSetup has been performed

Definition at line 338 of file TabulatedFluidProperties.h.

Referenced by TabulatedFluidProperties::initialSetup().

◆ _internal_energy

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

◆ _internal_energy_idx

unsigned int TabulatedFluidProperties::_internal_energy_idx
protectedinherited

◆ _interpolate_c

bool TabulatedFluidProperties::_interpolate_c
protectedinherited

◆ _interpolate_cp

bool TabulatedFluidProperties::_interpolate_cp
protectedinherited

◆ _interpolate_cv

bool TabulatedFluidProperties::_interpolate_cv
protectedinherited

◆ _interpolate_density

bool TabulatedFluidProperties::_interpolate_density
protectedinherited

◆ _interpolate_enthalpy

bool TabulatedFluidProperties::_interpolate_enthalpy
protectedinherited

◆ _interpolate_entropy

bool TabulatedFluidProperties::_interpolate_entropy
protectedinherited

◆ _interpolate_internal_energy

bool TabulatedFluidProperties::_interpolate_internal_energy
protectedinherited

◆ _interpolate_k

bool TabulatedFluidProperties::_interpolate_k
protectedinherited

◆ _interpolate_pressure

bool TabulatedFluidProperties::_interpolate_pressure
protectedinherited

◆ _interpolate_temperature

bool TabulatedFluidProperties::_interpolate_temperature
protectedinherited

◆ _interpolate_viscosity

bool TabulatedFluidProperties::_interpolate_viscosity
protectedinherited

◆ _interpolated_properties

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

◆ _interpolated_properties_enum

MultiMooseEnum TabulatedFluidProperties::_interpolated_properties_enum
protectedinherited

Properties to be interpolated entered in the input file.

Definition at line 301 of file TabulatedFluidProperties.h.

Referenced by TabulatedFluidProperties::generateTabulatedData(), and TabulatedFluidProperties::generateVETabulatedData().

◆ _k_idx

unsigned int TabulatedFluidProperties::_k_idx
protectedinherited

◆ _log_space_e

bool TabulatedFluidProperties::_log_space_e
protectedinherited

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

Definition at line 346 of file TabulatedFluidProperties.h.

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

◆ _log_space_h

bool TabulatedFluidProperties::_log_space_h
protectedinherited

log-space the enthalpy interpolation grid axis instead of linear

Definition at line 348 of file TabulatedFluidProperties.h.

Referenced by TabulatedFluidProperties::createVHGridVectors().

◆ _log_space_v

bool TabulatedFluidProperties::_log_space_v
protectedinherited

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

Definition at line 344 of file TabulatedFluidProperties.h.

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

◆ _max_newton_its

const unsigned int SinglePhaseFluidProperties::_max_newton_its
protectedinherited

◆ _num_e

unsigned int TabulatedFluidProperties::_num_e
protectedinherited

◆ _num_p

unsigned int TabulatedFluidProperties::_num_p
protectedinherited

◆ _num_T

unsigned int TabulatedFluidProperties::_num_T
protectedinherited

◆ _num_v

unsigned int TabulatedFluidProperties::_num_v
protectedinherited

◆ _OOBBehavior

MooseEnum TabulatedFluidProperties::_OOBBehavior
protectedinherited

◆ _p_from_v_e_ipol

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

◆ _p_from_v_h_ipol

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

Bidimensional interpolation of pressure from (v,h)

Definition at line 372 of file TabulatedFluidProperties.h.

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

◆ _p_idx

unsigned int TabulatedFluidProperties::_p_idx
protectedinherited

◆ _p_initial_guess

const Real SinglePhaseFluidProperties::_p_initial_guess
protectedinherited

◆ _pressure

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

◆ _pressure_max

Real TabulatedFluidProperties::_pressure_max
protectedinherited

◆ _pressure_min

Real TabulatedFluidProperties::_pressure_min
protectedinherited

◆ _properties

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

◆ _properties_ve

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

◆ _property_ipol

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

◆ _property_ve_ipol

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

◆ _R

const Real FluidProperties::_R = 8.3144598
staticinherited

◆ _save_file

const bool TabulatedFluidProperties::_save_file
protectedinherited

Whether to save a generated fluid properties file to disk.

Definition at line 254 of file TabulatedFluidProperties.h.

Referenced by TabulatedFluidProperties::initialSetup().

◆ _specific_volume

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

◆ _T_c2k

const Real FluidProperties::_T_c2k
protectedinherited

◆ _T_from_v_e_ipol

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

◆ _T_from_v_h_ipol

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

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

Definition at line 369 of file TabulatedFluidProperties.h.

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

◆ _T_idx

unsigned int TabulatedFluidProperties::_T_idx
protectedinherited

◆ _T_initial_guess

const Real SinglePhaseFluidProperties::_T_initial_guess
protectedinherited

◆ _temperature

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

◆ _temperature_max

Real TabulatedFluidProperties::_temperature_max
protectedinherited

◆ _temperature_min

Real TabulatedFluidProperties::_temperature_min
protectedinherited

◆ _tolerance

const Real SinglePhaseFluidProperties::_tolerance
protectedinherited

◆ _v_bounds_specified

bool TabulatedFluidProperties::_v_bounds_specified
protectedinherited

◆ _v_max

Real TabulatedFluidProperties::_v_max
protectedinherited

◆ _v_min

Real TabulatedFluidProperties::_v_min
protectedinherited

◆ _viscosity_idx

unsigned int TabulatedFluidProperties::_viscosity_idx
protectedinherited

◆ 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(), TabulatedFluidProperties::e_from_v_h(), SimpleFluidProperties::e_from_v_h(), TabulatedFluidProperties::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(), TabulatedFluidProperties::h_from_p_T(), LeadFluidProperties::h_from_p_T(), CaloricallyImperfectGas::h_from_p_T(), NaClFluidProperties::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(), LeadLithiumFluidProperties::p_from_v_e(), LeadFluidProperties::p_from_v_e(), LeadBismuthFluidProperties::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(), TabulatedFluidProperties::s_from_h_p(), Water97FluidProperties::s_from_h_p(), CaloricallyImperfectGas::T_from_h(), TabulatedFluidProperties::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(), 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(), TabulatedFluidProperties::c_from_v_e(), LeadLithiumFluidProperties::cp_from_p_T(), LeadBismuthFluidProperties::cp_from_p_T(), LeadFluidProperties::cp_from_p_T(), IdealGasFluidProperties::cp_from_p_T(), TemperaturePressureFunctionFluidProperties::cp_from_p_T(), TemperaturePressureFunctionFluidProperties::cp_from_v_e(), TabulatedFluidProperties::cp_from_v_e(), Water97FluidProperties::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(), TabulatedFluidProperties::cv_from_v_e(), Water97FluidProperties::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(), TabulatedFluidProperties::e_from_v_h(), SimpleFluidProperties::e_from_v_h(), StiffenedGasFluidProperties::g_from_v_e(), CaloricallyImperfectGas::g_from_v_e(), IdealGasFluidProperties::g_from_v_e(), TabulatedFluidProperties::g_from_v_e(), CaloricallyImperfectGas::gamma_from_p_T(), TabulatedFluidProperties::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(), TabulatedFluidProperties::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(), TabulatedFluidProperties::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(), TabulatedFluidProperties::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(), TabulatedFluidProperties::rho_from_p_s(), CaloricallyImperfectGas::rho_from_p_s(), IdealGasFluidProperties::rho_from_p_s(), TestSinglePhaseFluidProperties::rho_from_p_T(), LinearTestFluidProperties::rho_from_p_T(), TabulatedFluidProperties::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(), TabulatedFluidProperties::s_from_p_T(), CaloricallyImperfectGas::s_from_T_v(), IdealGasFluidProperties::s_from_T_v(), IdealGasFluidProperties::s_from_v_e(), TabulatedFluidProperties::s_from_v_e(), Water97FluidProperties::T_drhodT_from_p_rho(), TabulatedFluidProperties::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(), 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(), TabulatedFluidProperties::T_from_p_rho(), FlinakFluidProperties::T_from_p_rho(), SimpleFluidProperties::T_from_p_rho(), TabulatedFluidProperties::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(), LeadBismuthFluidProperties::v_from_p_T(), LeadLithiumFluidProperties::v_from_p_T(), LeadFluidProperties::v_from_p_T(), Water97FluidProperties::vaporPressure(), SinglePhaseFluidProperties::vaporPressure(), Water97FluidProperties::vaporTemperature(), SinglePhaseFluidProperties::vaporTemperature(), and TabulatedFluidProperties::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(), TabulatedFluidProperties::e_from_p_rho(), LeadBismuthFluidProperties::e_from_p_rho(), LeadLithiumFluidProperties::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(), 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(), TabulatedFluidProperties::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(), TabulatedFluidProperties::rho_from_p_T(), NaKFluidProperties::rho_from_p_T(), LinearFluidProperties::rho_from_p_T(), CO2FluidProperties::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(), TabulatedFluidProperties::T_from_p_rho(), FlinakFluidProperties::T_from_p_rho(), SimpleFluidProperties::T_from_p_rho(), SinglePhaseFluidProperties::v_e_from_p_T(), TabulatedFluidProperties::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(), LeadLithiumFluidProperties::bulk_modulus_from_p_T(), LeadBismuthFluidProperties::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(), TabulatedFluidProperties::c_from_v_e(), TabulatedFluidProperties::checkInputVariables(), TabulatedFluidProperties::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(), TabulatedFluidProperties::cp_from_v_e(), Water97FluidProperties::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(), TabulatedFluidProperties::cv_from_v_e(), Water97FluidProperties::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(), TabulatedFluidProperties::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(), TabulatedFluidProperties::e_from_v_h(), SimpleFluidProperties::e_from_v_h(), StiffenedGasFluidProperties::g_from_v_e(), CaloricallyImperfectGas::g_from_v_e(), IdealGasFluidProperties::g_from_v_e(), TabulatedFluidProperties::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(), LeadLithiumFluidProperties::k_from_v_e(), LeadBismuthFluidProperties::k_from_v_e(), LeadFluidProperties::k_from_v_e(), TemperaturePressureFunctionFluidProperties::k_from_v_e(), TabulatedFluidProperties::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(), TabulatedFluidProperties::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(), TabulatedFluidProperties::rho_from_p_s(), CaloricallyImperfectGas::rho_from_p_s(), IdealGasFluidProperties::rho_from_p_s(), TestSinglePhaseFluidProperties::rho_from_p_T(), LinearTestFluidProperties::rho_from_p_T(), TabulatedFluidProperties::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(), TabulatedFluidProperties::s_from_h_p(), Water97FluidProperties::s_from_h_p(), CaloricallyImperfectGas::s_from_p_T(), IdealGasFluidProperties::s_from_p_T(), TabulatedFluidProperties::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(), TabulatedFluidProperties::s_from_v_e(), Water97FluidProperties::subregionVolume(), Water97FluidProperties::T_drhodT_from_p_rho(), TabulatedFluidProperties::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(), TabulatedFluidProperties::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(), TabulatedFluidProperties::T_from_p_rho(), SimpleFluidProperties::T_from_p_rho(), TabulatedFluidProperties::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(), TabulatedFluidProperties::T_from_v_e(), SimpleFluidProperties::T_from_v_h(), Water97FluidProperties::tempXY(), SinglePhaseFluidProperties::v_e_from_p_T(), LeadLithiumFluidProperties::v_from_p_T(), LeadBismuthFluidProperties::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(), TabulatedFluidProperties::c_from_v_e(), TabulatedFluidProperties::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(), TabulatedFluidProperties::cp_from_v_e(), HeliumFluidProperties::cp_from_v_e(), Water97FluidProperties::cp_from_v_e(), FlibeFluidProperties::cv_from_p_T(), FlinakFluidProperties::cv_from_p_T(), LinearFluidProperties::cv_from_v_e(), StiffenedGasFluidProperties::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(), TabulatedFluidProperties::cv_from_v_e(), Water97FluidProperties::cv_from_v_e(), HeliumFluidProperties::cv_from_v_e(), HeliumFluidProperties::e_from_p_rho(), SodiumSaturationFluidProperties::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(), TabulatedFluidProperties::e_from_v_h(), SimpleFluidProperties::e_from_v_h(), StiffenedGasFluidProperties::g_from_v_e(), CaloricallyImperfectGas::g_from_v_e(), IdealGasFluidProperties::g_from_v_e(), TabulatedFluidProperties::g_from_v_e(), CaloricallyImperfectGas::gamma_from_v_e(), TabulatedFluidProperties::generateVETabulatedData(), LeadBismuthFluidProperties::h_from_v_e(), LeadLithiumFluidProperties::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(), TabulatedFluidProperties::k_from_v_e(), FlibeFluidProperties::k_from_v_e(), FlinakFluidProperties::k_from_v_e(), HeliumFluidProperties::k_from_v_e(), Water97FluidProperties::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(), TabulatedFluidProperties::mu_from_v_e(), FlinakFluidProperties::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(), LeadBismuthFluidProperties::p_from_v_e(), LeadFluidProperties::p_from_v_e(), LeadLithiumFluidProperties::p_from_v_e(), CaloricallyImperfectGas::p_from_v_e(), LinearTestFluidProperties::p_from_v_e(), IdealGasFluidProperties::p_from_v_e(), FlinakFluidProperties::p_from_v_e(), HeliumFluidProperties::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(), TabulatedFluidProperties::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(), 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(), TabulatedFluidProperties::s_from_v_e(), LinearFluidProperties::T_from_v_e(), LeadBismuthFluidProperties::T_from_v_e(), LeadLithiumFluidProperties::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(), TabulatedFluidProperties::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(), TabulatedFluidProperties::v_from_p_T(), Water97FluidProperties::v_from_p_T(), LeadBismuthFluidProperties::v_from_p_T(), LeadLithiumFluidProperties::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 TabulatedFluidProperties::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: