https://mooseframework.inl.gov
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes | List of all members
ReynoldsNumberMaterial Class Reference

Computes Reynolds number as a material property. More...

#include <ReynoldsNumberMaterial.h>

Inheritance diagram for ReynoldsNumberMaterial:
[legend]

Public Types

typedef DerivativeMaterialPropertyNameInterface::SymbolName SymbolName
 

Public Member Functions

 ReynoldsNumberMaterial (const InputParameters &parameters)
 
const GenericMaterialProperty< U, is_ad > & getDefaultMaterialProperty (const std::string &name)
 
const GenericMaterialProperty< U, is_ad > & getDefaultMaterialPropertyByName (const std::string &name)
 
void validateDerivativeMaterialPropertyBase (const std::string &base)
 
const MaterialPropertyName derivativePropertyName (const MaterialPropertyName &base, const std::vector< SymbolName > &c) const
 
const MaterialPropertyName derivativePropertyNameFirst (const MaterialPropertyName &base, const SymbolName &c1) const
 
const MaterialPropertyName derivativePropertyNameSecond (const MaterialPropertyName &base, const SymbolName &c1, const SymbolName &c2) const
 
const MaterialPropertyName derivativePropertyNameThird (const MaterialPropertyName &base, const SymbolName &c1, const SymbolName &c2, const SymbolName &c3) const
 
GenericMaterialProperty< U, is_ad > & declarePropertyDerivative (const std::string &base, const std::vector< VariableName > &c)
 
GenericMaterialProperty< U, is_ad > & declarePropertyDerivative (const std::string &base, const std::vector< SymbolName > &c)
 
GenericMaterialProperty< U, is_ad > & declarePropertyDerivative (const std::string &base, const SymbolName &c1, const SymbolName &c2="", const SymbolName &c3="")
 
GenericMaterialProperty< U, is_ad > & declarePropertyDerivative (const std::string &base, const std::vector< VariableName > &c)
 
GenericMaterialProperty< U, is_ad > & declarePropertyDerivative (const std::string &base, const std::vector< SymbolName > &c)
 
GenericMaterialProperty< U, is_ad > & declarePropertyDerivative (const std::string &base, const SymbolName &c1, const SymbolName &c2="", const SymbolName &c3="")
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, const std::vector< VariableName > &c)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, const std::vector< SymbolName > &c)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, const SymbolName &c1, const SymbolName &c2="", const SymbolName &c3="")
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, const SymbolName &c1, unsigned int v2, unsigned int v3=libMesh::invalid_uint)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, unsigned int v1, unsigned int v2=libMesh::invalid_uint, unsigned int v3=libMesh::invalid_uint)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, const std::vector< VariableName > &c)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, const std::vector< SymbolName > &c)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, const SymbolName &c1, const SymbolName &c2="", const SymbolName &c3="")
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, const SymbolName &c1, unsigned int v2, unsigned int v3=libMesh::invalid_uint)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, unsigned int v1, unsigned int v2=libMesh::invalid_uint, unsigned int v3=libMesh::invalid_uint)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivativeByName (const MaterialPropertyName &base, const std::vector< VariableName > &c)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivativeByName (const MaterialPropertyName &base, const std::vector< SymbolName > &c)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivativeByName (const MaterialPropertyName &base, const SymbolName &c1, const SymbolName &c2="", const SymbolName &c3="")
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivativeByName (const MaterialPropertyName &base, const std::vector< VariableName > &c)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivativeByName (const MaterialPropertyName &base, const std::vector< SymbolName > &c)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivativeByName (const MaterialPropertyName &base, const SymbolName &c1, const SymbolName &c2="", const SymbolName &c3="")
 
void validateCoupling (const MaterialPropertyName &base, const std::vector< VariableName > &c, bool validate_aux=true)
 
void validateCoupling (const MaterialPropertyName &base, const VariableName &c1="", const VariableName &c2="", const VariableName &c3="")
 
void validateCoupling (const MaterialPropertyName &base, const std::vector< VariableName > &c, bool validate_aux=true)
 
void validateCoupling (const MaterialPropertyName &base, const VariableName &c1="", const VariableName &c2="", const VariableName &c3="")
 
void validateNonlinearCoupling (const MaterialPropertyName &base, const VariableName &c1="", const VariableName &c2="", const VariableName &c3="")
 
void validateNonlinearCoupling (const MaterialPropertyName &base, const VariableName &c1="", const VariableName &c2="", const VariableName &c3="")
 
const MaterialPropertyName propertyName (const MaterialPropertyName &base, const std::vector< SymbolName > &c) const
 
const MaterialPropertyName propertyName (const MaterialPropertyName &base, const std::vector< SymbolName > &c) const
 
const MaterialPropertyName propertyNameFirst (const MaterialPropertyName &base, const SymbolName &c1) const
 
const MaterialPropertyName propertyNameFirst (const MaterialPropertyName &base, const SymbolName &c1) const
 
const MaterialPropertyName propertyNameSecond (const MaterialPropertyName &base, const SymbolName &c1, const SymbolName &c2) const
 
const MaterialPropertyName propertyNameSecond (const MaterialPropertyName &base, const SymbolName &c1, const SymbolName &c2) const
 
const MaterialPropertyName propertyNameThird (const MaterialPropertyName &base, const SymbolName &c1, const SymbolName &c2, const SymbolName &c3) const
 
const MaterialPropertyName propertyNameThird (const MaterialPropertyName &base, const SymbolName &c1, const SymbolName &c2, const SymbolName &c3) const
 

Static Public Member Functions

static InputParameters validParams ()
 

Protected Member Functions

virtual void computeQpProperties ()
 
MaterialProperty< U > & declarePropertyDerivativeTHM (const std::string &base, const std::string &var_name, const unsigned int i=0)
 Method for declaring derivative material properties.
 
const MaterialProperty< U > & getMaterialPropertyDerivativeTHM (const std::string &base, const std::string &var_name, const unsigned int i=0)
 Method for retrieving derivative material properties.
 
const MaterialProperty< U > & getMaterialPropertyDerivativeTHMPhase (const std::string &base, bool property_is_liquid, const std::string &var_name, bool var_is_liquid, const unsigned int i=0)
 Method for retrieving derivative material properties corresponding to phase-dependent derivatives.
 

Protected Attributes

const MaterialPropertyName & _Re_name
 Reynolds number property name.
 
const MaterialProperty< Real > & _rho
 Density of the phase.
 
const MaterialProperty< Real > *const _drho_dbeta
 
const MaterialProperty< Real > & _drho_darhoA
 
const MaterialProperty< Real > & _vel
 Velocity of the phase.
 
const MaterialProperty< Real > & _dvel_darhoA
 
const MaterialProperty< Real > & _dvel_darhouA
 
const MaterialProperty< Real > & _D_h
 Hydraulic diameter.
 
const MaterialProperty< Real > & _mu
 Dynamic viscosity of the phase.
 
const MaterialProperty< Real > *const _dmu_dbeta
 
const MaterialProperty< Real > & _dmu_darhoA
 
const MaterialProperty< Real > & _dmu_darhouA
 
const MaterialProperty< Real > & _dmu_darhoEA
 
MaterialProperty< Real > & _Re
 Reynolds.
 
MaterialProperty< Real > *const _dRe_dbeta
 
MaterialProperty< Real > & _dRe_darhoA
 
MaterialProperty< Real > & _dRe_darhouA
 
MaterialProperty< Real > & _dRe_darhoEA
 

Private Member Functions

bool haveMaterialProperty (const std::string &prop_name)
 
std::vector< VariableName > buildVariableVector (const VariableName &c1, const VariableName &c2, const VariableName &c3)
 
void validateCouplingHelper (const MaterialPropertyName &base, const std::vector< VariableName > &c, const System &system, std::vector< VariableName > &missing)
 
bool isNotObjectVariable (const VariableName &name)
 

Private Attributes

FEProblemBase_dmi_fe_problem
 

Detailed Description

Computes Reynolds number as a material property.

Definition at line 20 of file ReynoldsNumberMaterial.h.

Constructor & Destructor Documentation

◆ ReynoldsNumberMaterial()

ReynoldsNumberMaterial::ReynoldsNumberMaterial ( const InputParameters parameters)

Definition at line 38 of file ReynoldsNumberMaterial.C.

40
41 _Re_name(getParam<MaterialPropertyName>("Re")),
42
43 _rho(getMaterialProperty<Real>("rho")),
44 _drho_dbeta(isCoupled("beta") ? &getMaterialPropertyDerivativeTHM<Real>("rho", "beta")
45 : nullptr),
47
48 _vel(getMaterialProperty<Real>("vel")),
51
52 _D_h(getMaterialProperty<Real>("D_h")),
53
54 _mu(getMaterialProperty<Real>("mu")),
55 _dmu_dbeta(isCoupled("beta") ? &getMaterialPropertyDerivative<Real>("mu", "beta") : nullptr),
59
60 _Re(declareProperty<Real>(_Re_name)),
61 _dRe_dbeta(isCoupled("beta") ? &declarePropertyDerivativeTHM<Real>(_Re_name, "beta") : nullptr),
65{
66}
MaterialProperty< U > & declarePropertyDerivativeTHM(const std::string &base, const std::string &var_name, const unsigned int i=0)
Method for declaring derivative material properties.
const MaterialProperty< U > & getMaterialPropertyDerivativeTHM(const std::string &base, const std::string &var_name, const unsigned int i=0)
Method for retrieving derivative material properties.
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative(const std::string &base, const std::vector< VariableName > &c)
MaterialProperty< Real > & _Re
Reynolds.
const MaterialProperty< Real > & _dmu_darhouA
const MaterialProperty< Real > & _drho_darhoA
MaterialProperty< Real > & _dRe_darhoEA
const MaterialProperty< Real > & _dvel_darhoA
const MaterialProperty< Real > & _rho
Density of the phase.
const MaterialProperty< Real > & _dmu_darhoA
const MaterialProperty< Real > & _D_h
Hydraulic diameter.
const MaterialProperty< Real > *const _drho_dbeta
MaterialProperty< Real > & _dRe_darhoA
const MaterialProperty< Real > *const _dmu_dbeta
const MaterialPropertyName & _Re_name
Reynolds number property name.
MaterialProperty< Real > *const _dRe_dbeta
MaterialProperty< Real > & _dRe_darhouA
const MaterialProperty< Real > & _mu
Dynamic viscosity of the phase.
const MaterialProperty< Real > & _vel
Velocity of the phase.
const MaterialProperty< Real > & _dmu_darhoEA
const MaterialProperty< Real > & _dvel_darhouA
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

Member Function Documentation

◆ computeQpProperties()

void ReynoldsNumberMaterial::computeQpProperties ( )
protectedvirtual

Definition at line 69 of file ReynoldsNumberMaterial.C.

70{
71 _Re[_qp] = THM::Reynolds(1., _rho[_qp], _vel[_qp], _D_h[_qp], _mu[_qp]);
72
73 const Real dRe_drho = std::fabs(_vel[_qp]) * _D_h[_qp] / _mu[_qp];
74 const Real dRe_dvel = MathUtils::sign(_vel[_qp]) * _rho[_qp] * _D_h[_qp] / _mu[_qp];
75 const Real dRe_dmu = -_rho[_qp] * std::fabs(_vel[_qp]) * _D_h[_qp] / std::pow(_mu[_qp], 2);
76
77 if (isCoupled("beta"))
78 (*_dRe_dbeta)[_qp] = dRe_drho * (*_drho_dbeta)[_qp] + dRe_dmu * (*_dmu_dbeta)[_qp];
79 _dRe_darhoA[_qp] =
80 dRe_drho * _drho_darhoA[_qp] + dRe_dvel * _dvel_darhoA[_qp] + dRe_dmu * _dmu_darhoA[_qp];
81 _dRe_darhouA[_qp] = dRe_dvel * _dvel_darhouA[_qp] + dRe_dmu * _dmu_darhouA[_qp];
82 _dRe_darhoEA[_qp] = dRe_dmu * _dmu_darhoEA[_qp];
83}
T sign(T x)
auto Reynolds(const T1 &volume_fraction, const T2 &rho, const T3 &vel, const T4 &D_h, const T5 &mu)
Compute Reynolds number.
Definition Numerics.h:118

◆ declarePropertyDerivativeTHM()

MaterialProperty< U > & DerivativeMaterialInterfaceTHM< Material >::declarePropertyDerivativeTHM ( const std::string &  base,
const std::string &  var_name,
const unsigned int  i = 0 
)
protectedinherited

Method for declaring derivative material properties.

Template Parameters
UThe material property type
Parameters
baseThe name of the property to take the derivative of
var_nameThe name of the coupled variable vector containing the variable to take the derivative with respect to
iThe index of the variable to take the derivative with respect to within the coupled variable vector

Definition at line 32 of file DerivativeMaterialInterfaceTHM.h.

91{
92 return this->template declarePropertyDerivative<U>(base, this->coupledName(var_name, i));
93}

◆ getMaterialPropertyDerivativeTHM()

const MaterialProperty< U > & DerivativeMaterialInterfaceTHM< Material >::getMaterialPropertyDerivativeTHM ( const std::string &  base,
const std::string &  var_name,
const unsigned int  i = 0 
)
protectedinherited

Method for retrieving derivative material properties.

Template Parameters
UThe material property type
Parameters
baseThe name of the property to take the derivative of
var_nameThe name of the coupled variable vector containing the variable to take the derivative with respect to
iThe index of the variable to take the derivative with respect to within the coupled variable vector

Definition at line 47 of file DerivativeMaterialInterfaceTHM.h.

101{
102 // get the base property name
103 const std::string prop_name = this->getMaterialPropertyName(base);
104
105 // get the name of the variable which derivative is respect to
106 const std::string der_var_name = this->coupledName(var_name, i);
107
108 return this->template getMaterialPropertyByName<U>(
109 this->derivativePropertyNameFirst(prop_name, der_var_name));
110}
const MaterialPropertyName derivativePropertyNameFirst(const MaterialPropertyName &base, const SymbolName &c1) const

◆ getMaterialPropertyDerivativeTHMPhase()

const MaterialProperty< U > & DerivativeMaterialInterfaceTHM< Material >::getMaterialPropertyDerivativeTHMPhase ( const std::string &  base,
bool  property_is_liquid,
const std::string &  var_name,
bool  var_is_liquid,
const unsigned int  i = 0 
)
protectedinherited

Method for retrieving derivative material properties corresponding to phase-dependent derivatives.

The intended behavior of this function is as follows. If the material property and derivative variable correspond to the same phase, then the material property is retrieved as usual. Else, a zero-valued material property is returned, as it is assumed that the material property depends only upon the variables corresponding to its phase.

Template Parameters
UThe material property type
Parameters
baseThe name of the property to take the derivative of
property_is_liquidDoes the property correspond to the liquid phase?
var_nameThe name of the coupled variable vector containing the variable to take the derivative with respect to
var_is_liquidDoes the derivative variable correspond to the liquid phase?
iThe index of the variable to take the derivative with respect to within the coupled variable vector

Definition at line 71 of file DerivativeMaterialInterfaceTHM.h.

121{
122 if (property_is_liquid == var_is_liquid)
123 {
124 return getMaterialPropertyDerivativeTHM<U>(base, var_name, i);
125 }
126 else
127 {
128 const std::string prop_name = this->getMaterialPropertyName(base);
129 const std::string der_var_name = this->coupledName(var_name, i);
130 const std::string der_prop_name = this->derivativePropertyNameFirst(prop_name, der_var_name);
131 return this->template getZeroMaterialProperty<U>(der_prop_name);
132 }
133}

◆ validParams()

InputParameters ReynoldsNumberMaterial::validParams ( )
static

Definition at line 18 of file ReynoldsNumberMaterial.C.

19{
21
22 params.addCoupledVar("beta", "Remapped volume fraction of liquid");
23 params.addRequiredCoupledVar("arhoA", "alpha*rho*A");
24 params.addRequiredCoupledVar("arhouA", "alpha*rho*vel*A");
25 params.addRequiredCoupledVar("arhoEA", "alpha*rho*E*A");
26
27 params.addRequiredParam<MaterialPropertyName>("Re", "Reynolds number property name");
28 params.addRequiredParam<MaterialPropertyName>("rho", "Density of the phase");
29 params.addRequiredParam<MaterialPropertyName>("vel", "Velocity of the phase");
30 params.addRequiredParam<MaterialPropertyName>("D_h", "Hydraulic diameter");
31 params.addRequiredParam<MaterialPropertyName>("mu", "Dynamic viscosity of the phase");
32
33 params.addClassDescription("Computes Reynolds number as a material property");
34
35 return params;
36}
void addRequiredCoupledVar(const std::string &name, const std::string &doc_string)
void addRequiredParam(const std::string &name, const std::string &doc_string)
void addClassDescription(const std::string &doc_string)
void addCoupledVar(const std::string &name, const std::string &doc_string)
static InputParameters validParams()

Member Data Documentation

◆ _D_h

const MaterialProperty<Real>& ReynoldsNumberMaterial::_D_h
protected

Hydraulic diameter.

Definition at line 42 of file ReynoldsNumberMaterial.h.

Referenced by computeQpProperties().

◆ _dmu_darhoA

const MaterialProperty<Real>& ReynoldsNumberMaterial::_dmu_darhoA
protected

Definition at line 47 of file ReynoldsNumberMaterial.h.

Referenced by computeQpProperties().

◆ _dmu_darhoEA

const MaterialProperty<Real>& ReynoldsNumberMaterial::_dmu_darhoEA
protected

Definition at line 49 of file ReynoldsNumberMaterial.h.

Referenced by computeQpProperties().

◆ _dmu_darhouA

const MaterialProperty<Real>& ReynoldsNumberMaterial::_dmu_darhouA
protected

Definition at line 48 of file ReynoldsNumberMaterial.h.

Referenced by computeQpProperties().

◆ _dmu_dbeta

const MaterialProperty<Real>* const ReynoldsNumberMaterial::_dmu_dbeta
protected

Definition at line 46 of file ReynoldsNumberMaterial.h.

◆ _dRe_darhoA

MaterialProperty<Real>& ReynoldsNumberMaterial::_dRe_darhoA
protected

Definition at line 54 of file ReynoldsNumberMaterial.h.

Referenced by computeQpProperties().

◆ _dRe_darhoEA

MaterialProperty<Real>& ReynoldsNumberMaterial::_dRe_darhoEA
protected

Definition at line 56 of file ReynoldsNumberMaterial.h.

Referenced by computeQpProperties().

◆ _dRe_darhouA

MaterialProperty<Real>& ReynoldsNumberMaterial::_dRe_darhouA
protected

Definition at line 55 of file ReynoldsNumberMaterial.h.

Referenced by computeQpProperties().

◆ _dRe_dbeta

MaterialProperty<Real>* const ReynoldsNumberMaterial::_dRe_dbeta
protected

Definition at line 53 of file ReynoldsNumberMaterial.h.

◆ _drho_darhoA

const MaterialProperty<Real>& ReynoldsNumberMaterial::_drho_darhoA
protected

Definition at line 34 of file ReynoldsNumberMaterial.h.

Referenced by computeQpProperties().

◆ _drho_dbeta

const MaterialProperty<Real>* const ReynoldsNumberMaterial::_drho_dbeta
protected

Definition at line 33 of file ReynoldsNumberMaterial.h.

◆ _dvel_darhoA

const MaterialProperty<Real>& ReynoldsNumberMaterial::_dvel_darhoA
protected

Definition at line 38 of file ReynoldsNumberMaterial.h.

Referenced by computeQpProperties().

◆ _dvel_darhouA

const MaterialProperty<Real>& ReynoldsNumberMaterial::_dvel_darhouA
protected

Definition at line 39 of file ReynoldsNumberMaterial.h.

Referenced by computeQpProperties().

◆ _mu

const MaterialProperty<Real>& ReynoldsNumberMaterial::_mu
protected

Dynamic viscosity of the phase.

Definition at line 45 of file ReynoldsNumberMaterial.h.

Referenced by computeQpProperties().

◆ _Re

MaterialProperty<Real>& ReynoldsNumberMaterial::_Re
protected

Reynolds.

Definition at line 52 of file ReynoldsNumberMaterial.h.

Referenced by computeQpProperties().

◆ _Re_name

const MaterialPropertyName& ReynoldsNumberMaterial::_Re_name
protected

Reynolds number property name.

Definition at line 29 of file ReynoldsNumberMaterial.h.

◆ _rho

const MaterialProperty<Real>& ReynoldsNumberMaterial::_rho
protected

Density of the phase.

Definition at line 32 of file ReynoldsNumberMaterial.h.

Referenced by computeQpProperties().

◆ _vel

const MaterialProperty<Real>& ReynoldsNumberMaterial::_vel
protected

Velocity of the phase.

Definition at line 37 of file ReynoldsNumberMaterial.h.

Referenced by computeQpProperties().


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