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

Computes gravity term for the energy equation in 1-phase flow. More...

#include <OneD3EqnEnergyGravity.h>

Inheritance diagram for OneD3EqnEnergyGravity:
[legend]

Public Types

typedef DerivativeMaterialPropertyNameInterface::SymbolName SymbolName
 

Public Member Functions

 OneD3EqnEnergyGravity (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 ()
 
virtual Real computeQpJacobian ()
 
virtual Real computeQpOffDiagJacobian (unsigned int jvar)
 
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
 
const MaterialProperty< Real > & _rho
 
const MaterialProperty< Real > & _drho_darhoA
 
const MaterialProperty< Real > & _vel
 
const MaterialProperty< Real > & _dvel_darhoA
 
const MaterialProperty< Real > & _dvel_darhouA
 
const MaterialProperty< RealVectorValue > & _dir
 The direction of the flow channel. More...
 
const RealVectorValue_gravity_vector
 Gravitational acceleration vector. More...
 
const unsigned int _arhoA_var_number
 
const unsigned int _arhouA_var_number
 

Detailed Description

Computes gravity term for the energy equation in 1-phase flow.

Definition at line 18 of file OneD3EqnEnergyGravity.h.

Constructor & Destructor Documentation

◆ OneD3EqnEnergyGravity()

OneD3EqnEnergyGravity::OneD3EqnEnergyGravity ( const InputParameters parameters)

Definition at line 30 of file OneD3EqnEnergyGravity.C.

32  _A(coupledValue("A")),
33  _rho(getMaterialProperty<Real>("rho")),
34  _drho_darhoA(getMaterialPropertyDerivativeTHM<Real>("rho", "arhoA")),
35  _vel(getMaterialProperty<Real>("vel")),
36  _dvel_darhoA(getMaterialPropertyDerivativeTHM<Real>("vel", "arhoA")),
37  _dvel_darhouA(getMaterialPropertyDerivativeTHM<Real>("vel", "arhouA")),
38  _dir(getMaterialProperty<RealVectorValue>("direction")),
39  _gravity_vector(getParam<RealVectorValue>("gravity_vector")),
40  _arhoA_var_number(coupled("arhoA")),
41  _arhouA_var_number(coupled("arhouA"))
42 {
43 }
const MaterialProperty< RealVectorValue > & _dir
The direction of the flow channel.
const VariableValue & _A
const MaterialProperty< Real > & _dvel_darhouA
const RealVectorValue & _gravity_vector
Gravitational acceleration vector.
const MaterialProperty< Real > & _drho_darhoA
const MaterialProperty< Real > & _rho
const MaterialProperty< Real > & _vel
const MaterialProperty< Real > & _dvel_darhoA
const unsigned int _arhoA_var_number
const unsigned int _arhouA_var_number

Member Function Documentation

◆ computeQpJacobian()

Real OneD3EqnEnergyGravity::computeQpJacobian ( )
protectedvirtual

Definition at line 52 of file OneD3EqnEnergyGravity.C.

53 {
54  return 0;
55 }

◆ computeQpOffDiagJacobian()

Real OneD3EqnEnergyGravity::computeQpOffDiagJacobian ( unsigned int  jvar)
protectedvirtual

Definition at line 58 of file OneD3EqnEnergyGravity.C.

59 {
60  if (jvar == _arhoA_var_number)
61  {
62  return -(_drho_darhoA[_qp] * _vel[_qp] + _rho[_qp] * _dvel_darhoA[_qp]) * _A[_qp] *
63  _gravity_vector * _dir[_qp] * _phi[_j][_qp] * _test[_i][_qp];
64  }
65  else if (jvar == _arhouA_var_number)
66  {
67  return -_rho[_qp] * _dvel_darhouA[_qp] * _A[_qp] * _gravity_vector * _dir[_qp] * _phi[_j][_qp] *
68  _test[_i][_qp];
69  }
70  else
71  return 0;
72 }
const MaterialProperty< RealVectorValue > & _dir
The direction of the flow channel.
const VariableValue & _A
const MaterialProperty< Real > & _dvel_darhouA
const RealVectorValue & _gravity_vector
Gravitational acceleration vector.
const MaterialProperty< Real > & _drho_darhoA
const MaterialProperty< Real > & _rho
const MaterialProperty< Real > & _vel
const MaterialProperty< Real > & _dvel_darhoA
const unsigned int _arhoA_var_number
const unsigned int _arhouA_var_number

◆ computeQpResidual()

Real OneD3EqnEnergyGravity::computeQpResidual ( )
protectedvirtual

Definition at line 46 of file OneD3EqnEnergyGravity.C.

47 {
48  return -_rho[_qp] * _vel[_qp] * _A[_qp] * _gravity_vector * _dir[_qp] * _test[_i][_qp];
49 }
const MaterialProperty< RealVectorValue > & _dir
The direction of the flow channel.
const VariableValue & _A
const RealVectorValue & _gravity_vector
Gravitational acceleration vector.
const MaterialProperty< Real > & _rho
const MaterialProperty< Real > & _vel

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

Definition at line 15 of file OneD3EqnEnergyGravity.C.

16 {
18  params.addRequiredCoupledVar("A", "Cross-sectional area");
19  params.addRequiredCoupledVar("arhoA", "alpha*rho*A");
20  params.addRequiredCoupledVar("arhouA", "alpha*rho*u*A");
21  params.addRequiredParam<MaterialPropertyName>(
22  "direction", "The direction of the flow channel material property");
23  params.addRequiredParam<MaterialPropertyName>("rho", "Density property");
24  params.addRequiredParam<MaterialPropertyName>("vel", "Velocity property");
25  params.addRequiredParam<RealVectorValue>("gravity_vector", "Gravitational acceleration vector");
26  params.addClassDescription("Computes a gravity term for the energy equation in 1-phase flow");
27  return params;
28 }
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& OneD3EqnEnergyGravity::_A
protected

Definition at line 28 of file OneD3EqnEnergyGravity.h.

Referenced by computeQpOffDiagJacobian(), and computeQpResidual().

◆ _arhoA_var_number

const unsigned int OneD3EqnEnergyGravity::_arhoA_var_number
protected

Definition at line 42 of file OneD3EqnEnergyGravity.h.

Referenced by computeQpOffDiagJacobian().

◆ _arhouA_var_number

const unsigned int OneD3EqnEnergyGravity::_arhouA_var_number
protected

Definition at line 43 of file OneD3EqnEnergyGravity.h.

Referenced by computeQpOffDiagJacobian().

◆ _dir

const MaterialProperty<RealVectorValue>& OneD3EqnEnergyGravity::_dir
protected

The direction of the flow channel.

Definition at line 38 of file OneD3EqnEnergyGravity.h.

Referenced by computeQpOffDiagJacobian(), and computeQpResidual().

◆ _drho_darhoA

const MaterialProperty<Real>& OneD3EqnEnergyGravity::_drho_darhoA
protected

Definition at line 31 of file OneD3EqnEnergyGravity.h.

Referenced by computeQpOffDiagJacobian().

◆ _dvel_darhoA

const MaterialProperty<Real>& OneD3EqnEnergyGravity::_dvel_darhoA
protected

Definition at line 34 of file OneD3EqnEnergyGravity.h.

Referenced by computeQpOffDiagJacobian().

◆ _dvel_darhouA

const MaterialProperty<Real>& OneD3EqnEnergyGravity::_dvel_darhouA
protected

Definition at line 35 of file OneD3EqnEnergyGravity.h.

Referenced by computeQpOffDiagJacobian().

◆ _gravity_vector

const RealVectorValue& OneD3EqnEnergyGravity::_gravity_vector
protected

Gravitational acceleration vector.

Definition at line 40 of file OneD3EqnEnergyGravity.h.

Referenced by computeQpOffDiagJacobian(), and computeQpResidual().

◆ _rho

const MaterialProperty<Real>& OneD3EqnEnergyGravity::_rho
protected

Definition at line 30 of file OneD3EqnEnergyGravity.h.

Referenced by computeQpOffDiagJacobian(), and computeQpResidual().

◆ _vel

const MaterialProperty<Real>& OneD3EqnEnergyGravity::_vel
protected

Definition at line 33 of file OneD3EqnEnergyGravity.h.

Referenced by computeQpOffDiagJacobian(), and computeQpResidual().


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