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

Computes dynamic viscosity. More...

#include <DynamicViscosityMaterial.h>

Inheritance diagram for DynamicViscosityMaterial:
[legend]

Public Types

typedef DerivativeMaterialPropertyNameInterface::SymbolName SymbolName
 

Public Member Functions

 DynamicViscosityMaterial (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 () override
 
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 & _mu_name
 Dynamic viscosity name.
 
MaterialProperty< Real > & _mu
 
MaterialProperty< Real > *const _dmu_dbeta
 
MaterialProperty< Real > & _dmu_darhoA
 
MaterialProperty< Real > & _dmu_darhouA
 
MaterialProperty< Real > & _dmu_darhoEA
 
const MaterialProperty< Real > & _v
 Specific volume.
 
const MaterialProperty< Real > *const _dv_dbeta
 
const MaterialProperty< Real > & _dv_darhoA
 
const MaterialProperty< Real > & _e
 Specific internal energy.
 
const MaterialProperty< Real > & _de_darhoA
 
const MaterialProperty< Real > & _de_darhouA
 
const MaterialProperty< Real > & _de_darhoEA
 
const SinglePhaseFluidProperties_fp_1phase
 Single-phase fluid properties.
 

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 dynamic viscosity.

Definition at line 20 of file DynamicViscosityMaterial.h.

Constructor & Destructor Documentation

◆ DynamicViscosityMaterial()

DynamicViscosityMaterial::DynamicViscosityMaterial ( const InputParameters parameters)

Definition at line 36 of file DynamicViscosityMaterial.C.

38
39 _mu_name(getParam<MaterialPropertyName>("mu")),
40 _mu(declareProperty<Real>(_mu_name)),
41 _dmu_dbeta(isParamValid("beta") ? &declarePropertyDerivativeTHM<Real>(_mu_name, "beta")
42 : nullptr),
46
47 _v(getMaterialProperty<Real>("v")),
48 _dv_dbeta(isParamValid("beta") ? &getMaterialPropertyDerivativeTHM<Real>("v", "beta")
49 : nullptr),
51
52 _e(getMaterialProperty<Real>("e")),
56
57 _fp_1phase(getUserObject<SinglePhaseFluidProperties>("fp_1phase"))
58{
59}
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< Real > & _de_darhoA
const MaterialProperty< Real > & _de_darhoEA
const MaterialProperty< Real > & _v
Specific volume.
MaterialProperty< Real > & _dmu_darhoEA
const SinglePhaseFluidProperties & _fp_1phase
Single-phase fluid properties.
MaterialProperty< Real > & _mu
const MaterialProperty< Real > & _de_darhouA
const MaterialProperty< Real > *const _dv_dbeta
const MaterialPropertyName & _mu_name
Dynamic viscosity name.
MaterialProperty< Real > & _dmu_darhouA
MaterialProperty< Real > *const _dmu_dbeta
MaterialProperty< Real > & _dmu_darhoA
const MaterialProperty< Real > & _e
Specific internal energy.
const MaterialProperty< Real > & _dv_darhoA
Common class for single phase fluid properties.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

Member Function Documentation

◆ computeQpProperties()

void DynamicViscosityMaterial::computeQpProperties ( )
overrideprotectedvirtual

Definition at line 62 of file DynamicViscosityMaterial.C.

63{
64 Real dmu_dv, dmu_de;
65 _fp_1phase.mu_from_v_e(_v[_qp], _e[_qp], _mu[_qp], dmu_dv, dmu_de);
66
67 if (isParamValid("beta"))
68 (*_dmu_dbeta)[_qp] = dmu_dv * (*_dv_dbeta)[_qp];
69 _dmu_darhoA[_qp] = dmu_dv * _dv_darhoA[_qp] + dmu_de * _de_darhoA[_qp];
70 _dmu_darhouA[_qp] = dmu_de * _de_darhouA[_qp];
71 _dmu_darhoEA[_qp] = dmu_de * _de_darhoEA[_qp];
72}

◆ 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 DynamicViscosityMaterial::validParams ( )
static

Definition at line 16 of file DynamicViscosityMaterial.C.

17{
19
20 params.addCoupledVar("beta", "Remapped volume fraction of liquid");
21 params.addRequiredCoupledVar("arhoA", "alpha*rho*A");
22 params.addRequiredCoupledVar("arhouA", "alpha*rho*vel*A");
23 params.addRequiredCoupledVar("arhoEA", "alpha*rho*E*A");
24
25 params.addRequiredParam<MaterialPropertyName>("mu", "Dynamic viscosity property");
26 params.addRequiredParam<MaterialPropertyName>("v", "Specific volume property");
27 params.addRequiredParam<MaterialPropertyName>("e", "Specific internal energy property");
28
29 params.addRequiredParam<UserObjectName>("fp_1phase", "Single-phase fluid properties");
30
31 params.addClassDescription("Computes the dynamic viscosity as a material property");
32
33 return params;
34}
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

◆ _de_darhoA

const MaterialProperty<Real>& DynamicViscosityMaterial::_de_darhoA
protected

Definition at line 45 of file DynamicViscosityMaterial.h.

Referenced by computeQpProperties().

◆ _de_darhoEA

const MaterialProperty<Real>& DynamicViscosityMaterial::_de_darhoEA
protected

Definition at line 47 of file DynamicViscosityMaterial.h.

Referenced by computeQpProperties().

◆ _de_darhouA

const MaterialProperty<Real>& DynamicViscosityMaterial::_de_darhouA
protected

Definition at line 46 of file DynamicViscosityMaterial.h.

Referenced by computeQpProperties().

◆ _dmu_darhoA

MaterialProperty<Real>& DynamicViscosityMaterial::_dmu_darhoA
protected

Definition at line 34 of file DynamicViscosityMaterial.h.

Referenced by computeQpProperties().

◆ _dmu_darhoEA

MaterialProperty<Real>& DynamicViscosityMaterial::_dmu_darhoEA
protected

Definition at line 36 of file DynamicViscosityMaterial.h.

Referenced by computeQpProperties().

◆ _dmu_darhouA

MaterialProperty<Real>& DynamicViscosityMaterial::_dmu_darhouA
protected

Definition at line 35 of file DynamicViscosityMaterial.h.

Referenced by computeQpProperties().

◆ _dmu_dbeta

MaterialProperty<Real>* const DynamicViscosityMaterial::_dmu_dbeta
protected

Definition at line 33 of file DynamicViscosityMaterial.h.

◆ _dv_darhoA

const MaterialProperty<Real>& DynamicViscosityMaterial::_dv_darhoA
protected

Definition at line 41 of file DynamicViscosityMaterial.h.

Referenced by computeQpProperties().

◆ _dv_dbeta

const MaterialProperty<Real>* const DynamicViscosityMaterial::_dv_dbeta
protected

Definition at line 40 of file DynamicViscosityMaterial.h.

◆ _e

const MaterialProperty<Real>& DynamicViscosityMaterial::_e
protected

Specific internal energy.

Definition at line 44 of file DynamicViscosityMaterial.h.

Referenced by computeQpProperties().

◆ _fp_1phase

const SinglePhaseFluidProperties& DynamicViscosityMaterial::_fp_1phase
protected

Single-phase fluid properties.

Definition at line 50 of file DynamicViscosityMaterial.h.

Referenced by computeQpProperties().

◆ _mu

MaterialProperty<Real>& DynamicViscosityMaterial::_mu
protected

Definition at line 32 of file DynamicViscosityMaterial.h.

Referenced by computeQpProperties().

◆ _mu_name

const MaterialPropertyName& DynamicViscosityMaterial::_mu_name
protected

Dynamic viscosity name.

Definition at line 29 of file DynamicViscosityMaterial.h.

◆ _v

const MaterialProperty<Real>& DynamicViscosityMaterial::_v
protected

Specific volume.

Definition at line 39 of file DynamicViscosityMaterial.h.

Referenced by computeQpProperties().


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