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

Computes wall friction term for single phase flow. More...

#include <OneD3EqnMomentumFriction.h>

Inheritance diagram for OneD3EqnMomentumFriction:
[legend]

Public Types

typedef DerivativeMaterialPropertyNameInterface::SymbolName SymbolName
 

Public Member Functions

 OneD3EqnMomentumFriction (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 Real computeQpResidual () override
 
virtual Real computeQpJacobian () override
 
virtual Real computeQpOffDiagJacobian (unsigned int jvar) override
 
MaterialProperty< U > & declarePropertyDerivativeTHM (const std::string &base, const std::string &var_name, const unsigned int i=0)
 Method for declaring derivative material properties. More...
 
const MaterialProperty< U > & getMaterialPropertyDerivativeTHM (const std::string &base, const std::string &var_name, const unsigned int i=0)
 Method for retrieving derivative material properties. More...
 
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. More...
 

Protected Attributes

const VariableValue_A
 area More...
 
const MaterialProperty< Real > & _D_h
 Hydraulic diameter. More...
 
const MaterialProperty< Real > & _rho
 Density. More...
 
const MaterialProperty< Real > & _drho_darhoA
 
const MaterialProperty< Real > & _vel
 velocity More...
 
const MaterialProperty< Real > & _dvel_darhoA
 
const MaterialProperty< Real > & _dvel_darhouA
 
const MaterialProperty< Real > & _f_D
 Darcy friction factor. More...
 
const MaterialProperty< Real > & _df_D_darhoA
 
const MaterialProperty< Real > & _df_D_darhouA
 
const MaterialProperty< Real > & _df_D_darhoEA
 
unsigned int _arhoA_var_number
 
unsigned int _arhouA_var_number
 
unsigned int _arhoEA_var_number
 

Detailed Description

Computes wall friction term for single phase flow.

See RELAP-7 Theory Manual, pg. 71, Equation (230) {eq:wall_friction_force_2phase}

Definition at line 20 of file OneD3EqnMomentumFriction.h.

Constructor & Destructor Documentation

◆ OneD3EqnMomentumFriction()

OneD3EqnMomentumFriction::OneD3EqnMomentumFriction ( const InputParameters parameters)

Definition at line 31 of file OneD3EqnMomentumFriction.C.

33  _A(coupledValue("A")),
34  _D_h(getMaterialProperty<Real>("D_h")),
35  _rho(getMaterialProperty<Real>("rho")),
36  _drho_darhoA(getMaterialPropertyDerivativeTHM<Real>("rho", "arhoA")),
37  _vel(getMaterialProperty<Real>("vel")),
38  _dvel_darhoA(getMaterialPropertyDerivativeTHM<Real>("vel", "arhoA")),
39  _dvel_darhouA(getMaterialPropertyDerivativeTHM<Real>("vel", "arhouA")),
40  _f_D(getMaterialProperty<Real>("f_D")),
41  _df_D_darhoA(getMaterialPropertyDerivativeTHM<Real>("f_D", "arhoA")),
42  _df_D_darhouA(getMaterialPropertyDerivativeTHM<Real>("f_D", "arhouA")),
43  _df_D_darhoEA(getMaterialPropertyDerivativeTHM<Real>("f_D", "arhoEA")),
44  _arhoA_var_number(coupled("arhoA")),
45  _arhouA_var_number(coupled("arhouA")),
46  _arhoEA_var_number(coupled("arhoEA"))
47 {
48 }
const MaterialProperty< Real > & _f_D
Darcy friction factor.
const MaterialProperty< Real > & _df_D_darhoEA
const MaterialProperty< Real > & _vel
velocity
const MaterialProperty< Real > & _rho
Density.
const MaterialProperty< Real > & _dvel_darhoA
const MaterialProperty< Real > & _D_h
Hydraulic diameter.
const MaterialProperty< Real > & _drho_darhoA
const MaterialProperty< Real > & _dvel_darhouA
const MaterialProperty< Real > & _df_D_darhoA
const VariableValue & _A
area
const MaterialProperty< Real > & _df_D_darhouA

Member Function Documentation

◆ computeQpJacobian()

Real OneD3EqnMomentumFriction::computeQpJacobian ( )
overrideprotectedvirtual

Definition at line 58 of file OneD3EqnMomentumFriction.C.

59 {
60  return computeQpOffDiagJacobian(_var.number());
61 }
virtual Real computeQpOffDiagJacobian(unsigned int jvar) override

◆ computeQpOffDiagJacobian()

Real OneD3EqnMomentumFriction::computeQpOffDiagJacobian ( unsigned int  jvar)
overrideprotectedvirtual

Definition at line 64 of file OneD3EqnMomentumFriction.C.

Referenced by computeQpJacobian().

65 {
66  if (jvar == _arhoA_var_number)
67  {
68  const Real vel2 = _vel[_qp] * std::abs(_vel[_qp]);
69  const Real dvel2_darhoA = 2 * std::abs(_vel[_qp]) * _dvel_darhoA[_qp];
70  return (_df_D_darhoA[_qp] * _rho[_qp] * vel2 + _f_D[_qp] * _drho_darhoA[_qp] * vel2 +
71  _f_D[_qp] * _rho[_qp] * dvel2_darhoA) *
72  0.5 * _A[_qp] / _D_h[_qp] * _phi[_j][_qp] * _test[_i][_qp];
73  }
74  else if (jvar == _arhouA_var_number)
75  {
76  const Real vel2 = _vel[_qp] * std::abs(_vel[_qp]);
77  const Real dvel2_darhouA = 2 * std::abs(_vel[_qp]) * _dvel_darhouA[_qp];
78  return (_df_D_darhouA[_qp] * vel2 + _f_D[_qp] * dvel2_darhouA) * 0.5 * _rho[_qp] * _A[_qp] /
79  _D_h[_qp] * _phi[_j][_qp] * _test[_i][_qp];
80  }
81  else if (jvar == _arhoEA_var_number)
82  {
83  return _df_D_darhoEA[_qp] * 0.5 * _rho[_qp] * _vel[_qp] * std::abs(_vel[_qp]) * _A[_qp] /
84  _D_h[_qp] * _phi[_j][_qp] * _test[_i][_qp];
85  }
86  else
87  return 0;
88 }
const MaterialProperty< Real > & _f_D
Darcy friction factor.
const MaterialProperty< Real > & _df_D_darhoEA
const MaterialProperty< Real > & _vel
velocity
const MaterialProperty< Real > & _rho
Density.
const MaterialProperty< Real > & _dvel_darhoA
const MaterialProperty< Real > & _D_h
Hydraulic diameter.
const MaterialProperty< Real > & _drho_darhoA
const MaterialProperty< Real > & _dvel_darhouA
const MaterialProperty< Real > & _df_D_darhoA
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const VariableValue & _A
area
const MaterialProperty< Real > & _df_D_darhouA

◆ computeQpResidual()

Real OneD3EqnMomentumFriction::computeQpResidual ( )
overrideprotectedvirtual

Definition at line 51 of file OneD3EqnMomentumFriction.C.

52 {
53  return 0.5 * _f_D[_qp] * _rho[_qp] * _vel[_qp] * std::abs(_vel[_qp]) * _A[_qp] / _D_h[_qp] *
54  _test[_i][_qp];
55 }
const MaterialProperty< Real > & _f_D
Darcy friction factor.
const MaterialProperty< Real > & _vel
velocity
const MaterialProperty< Real > & _rho
Density.
const MaterialProperty< Real > & _D_h
Hydraulic diameter.
const VariableValue & _A
area

◆ declarePropertyDerivativeTHM()

MaterialProperty< U > & DerivativeMaterialInterfaceTHM< Kernel >::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 88 of file DerivativeMaterialInterfaceTHM.h.

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

◆ getMaterialPropertyDerivativeTHM()

const MaterialProperty< U > & DerivativeMaterialInterfaceTHM< Kernel >::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 98 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< Kernel >::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 115 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 }
const MaterialPropertyName derivativePropertyNameFirst(const MaterialPropertyName &base, const SymbolName &c1) const

◆ validParams()

InputParameters OneD3EqnMomentumFriction::validParams ( )
static

Definition at line 15 of file OneD3EqnMomentumFriction.C.

16 {
18  params.addRequiredCoupledVar("A", "Cross-sectional area");
19  params.addRequiredParam<MaterialPropertyName>("D_h", "Hydraulic diameter");
20  params.addRequiredCoupledVar("arhoA", "Solution variable alpha*rho*A");
21  params.addRequiredCoupledVar("arhouA", "Solution variable alpha*rho*u*A");
22  params.addRequiredCoupledVar("arhoEA", "Solution variable alpha*rho*E*A");
23  params.addRequiredParam<MaterialPropertyName>("rho", "Density property");
24  params.addRequiredParam<MaterialPropertyName>("vel", "Velocity property");
25  params.addRequiredParam<MaterialPropertyName>("f_D",
26  "Darcy friction factor coefficient property");
27  params.addClassDescription("Computes wall friction term for single phase flow.");
28  return params;
29 }
static InputParameters validParams()
void addRequiredParam(const std::string &name, const std::string &doc_string)
void addRequiredCoupledVar(const std::string &name, const std::string &doc_string)
void addClassDescription(const std::string &doc_string)

Member Data Documentation

◆ _A

const VariableValue& OneD3EqnMomentumFriction::_A
protected

area

Definition at line 31 of file OneD3EqnMomentumFriction.h.

Referenced by computeQpOffDiagJacobian(), and computeQpResidual().

◆ _arhoA_var_number

unsigned int OneD3EqnMomentumFriction::_arhoA_var_number
protected

Definition at line 51 of file OneD3EqnMomentumFriction.h.

Referenced by computeQpOffDiagJacobian().

◆ _arhoEA_var_number

unsigned int OneD3EqnMomentumFriction::_arhoEA_var_number
protected

Definition at line 53 of file OneD3EqnMomentumFriction.h.

Referenced by computeQpOffDiagJacobian().

◆ _arhouA_var_number

unsigned int OneD3EqnMomentumFriction::_arhouA_var_number
protected

Definition at line 52 of file OneD3EqnMomentumFriction.h.

Referenced by computeQpOffDiagJacobian().

◆ _D_h

const MaterialProperty<Real>& OneD3EqnMomentumFriction::_D_h
protected

Hydraulic diameter.

Definition at line 34 of file OneD3EqnMomentumFriction.h.

Referenced by computeQpOffDiagJacobian(), and computeQpResidual().

◆ _df_D_darhoA

const MaterialProperty<Real>& OneD3EqnMomentumFriction::_df_D_darhoA
protected

Definition at line 47 of file OneD3EqnMomentumFriction.h.

Referenced by computeQpOffDiagJacobian().

◆ _df_D_darhoEA

const MaterialProperty<Real>& OneD3EqnMomentumFriction::_df_D_darhoEA
protected

Definition at line 49 of file OneD3EqnMomentumFriction.h.

Referenced by computeQpOffDiagJacobian().

◆ _df_D_darhouA

const MaterialProperty<Real>& OneD3EqnMomentumFriction::_df_D_darhouA
protected

Definition at line 48 of file OneD3EqnMomentumFriction.h.

Referenced by computeQpOffDiagJacobian().

◆ _drho_darhoA

const MaterialProperty<Real>& OneD3EqnMomentumFriction::_drho_darhoA
protected

Definition at line 38 of file OneD3EqnMomentumFriction.h.

Referenced by computeQpOffDiagJacobian().

◆ _dvel_darhoA

const MaterialProperty<Real>& OneD3EqnMomentumFriction::_dvel_darhoA
protected

Definition at line 42 of file OneD3EqnMomentumFriction.h.

Referenced by computeQpOffDiagJacobian().

◆ _dvel_darhouA

const MaterialProperty<Real>& OneD3EqnMomentumFriction::_dvel_darhouA
protected

Definition at line 43 of file OneD3EqnMomentumFriction.h.

Referenced by computeQpOffDiagJacobian().

◆ _f_D

const MaterialProperty<Real>& OneD3EqnMomentumFriction::_f_D
protected

Darcy friction factor.

Definition at line 46 of file OneD3EqnMomentumFriction.h.

Referenced by computeQpOffDiagJacobian(), and computeQpResidual().

◆ _rho

const MaterialProperty<Real>& OneD3EqnMomentumFriction::_rho
protected

Density.

Definition at line 37 of file OneD3EqnMomentumFriction.h.

Referenced by computeQpOffDiagJacobian(), and computeQpResidual().

◆ _vel

const MaterialProperty<Real>& OneD3EqnMomentumFriction::_vel
protected

velocity

Definition at line 41 of file OneD3EqnMomentumFriction.h.

Referenced by computeQpOffDiagJacobian(), and computeQpResidual().


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