www.mooseframework.org
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
INSADMaterial< compute_stage > Class Template Reference

#include <INSADMaterial.h>

Inheritance diagram for INSADMaterial< compute_stage >:
[legend]

Public Member Functions

 INSADMaterial (const InputParameters &parameters)
 

Protected Member Functions

virtual void computeQpProperties () override
 
const ADMaterialProperty (Real) &_mu
 viscosity More...
 
const ADMaterialProperty (Real) &_rho
 density More...
 
 ADMaterialProperty (Real) &_mass_strong_residual
 The strong residual of the mass continuity equation. More...
 
 ADMaterialProperty (RealVectorValue) &_convective_strong_residual
 Strong residual corresponding to the momentum convective term. More...
 
 ADMaterialProperty (RealVectorValue) &_td_strong_residual
 Strong residual corresponding to the momentum transient term. More...
 
 ADMaterialProperty (RealVectorValue) &_gravity_strong_residual
 Strong residual corresponding to the momentum gravity term. More...
 
 ADMaterialProperty (RealVectorValue) &_momentum_strong_residual
 The strong residual of the momentum equation. More...
 

Protected Attributes

const ADVectorVariableValue & _velocity
 velocity More...
 
const ADVectorVariableGradient & _grad_velocity
 gradient of velocity More...
 
const ADVariableGradient & _grad_p
 gradient of the pressure More...
 
const bool _transient_term
 Whether we are performing a transient or steady simulation. More...
 
const ADVectorVariableValue * _velocity_dot
 Time derivative of the velocity, e.g. the acceleration. More...
 
const bool _integrate_p_by_parts
 Whether to integrate the pressure term in the momentum equations by parts. More...
 
const bool _include_viscous_term_in_strong_form
 Whether to include the strong form of the viscous term in the momentum equation strong residual. More...
 
bool _gravity_set
 Whether the user set a gravity vector. If none is set, we assume there is no gravity term in the simulation. More...
 
RealVectorValue _gravity
 The gravity vector; should be in units of acceleration. More...
 
MaterialProperty< RealVectorValue > & _mms_function_strong_residual
 Strong residual corresponding to the mms function term. More...
 
Function & _x_vel_fn
 The x velocity mms forcing function. More...
 
Function & _y_vel_fn
 The y velocity mms forcing function. More...
 
Function & _z_vel_fn
 The z velocity mms forcing function. More...
 
 usingMaterialMembers
 

Detailed Description

template<ComputeStage compute_stage>
class INSADMaterial< compute_stage >

Definition at line 22 of file INSADMaterial.h.

Constructor & Destructor Documentation

◆ INSADMaterial()

template<ComputeStage compute_stage>
INSADMaterial< compute_stage >::INSADMaterial ( const InputParameters &  parameters)

Definition at line 41 of file INSADMaterial.C.

42  : ADMaterial<compute_stage>(parameters),
43  _velocity(adCoupledVectorValue("velocity")),
44  _grad_velocity(adCoupledVectorGradient("velocity")),
45  _grad_p(adCoupledGradient("pressure")),
46  _mu(adGetADMaterialProperty<Real>("mu_name")),
47  _rho(adGetADMaterialProperty<Real>("rho_name")),
48  _transient_term(adGetParam<bool>("transient_term")),
49  _velocity_dot(_transient_term ? &adCoupledVectorDot("velocity") : nullptr),
50  _integrate_p_by_parts(adGetParam<bool>("integrate_p_by_parts")),
51  _include_viscous_term_in_strong_form(adGetParam<bool>("include_viscous_term_in_strong_form")),
52  _mass_strong_residual(adDeclareADProperty<Real>("mass_strong_residual")),
53  _convective_strong_residual(adDeclareADProperty<RealVectorValue>("convective_strong_residual")),
54  _td_strong_residual(adDeclareADProperty<RealVectorValue>("td_strong_residual")),
55  _gravity_strong_residual(adDeclareADProperty<RealVectorValue>("gravity_strong_residual")),
57  adDeclareProperty<RealVectorValue>("mms_function_strong_residual")),
58  _momentum_strong_residual(adDeclareADProperty<RealVectorValue>("momentum_strong_residual")),
59  _x_vel_fn(getFunction("function_x")),
60  _y_vel_fn(getFunction("function_y")),
61  _z_vel_fn(getFunction("function_z"))
62 {
63  if (parameters.isParamSetByUser("gravity"))
64  {
65  _gravity_set = true;
66  _gravity = adGetParam<RealVectorValue>("gravity");
67  }
68  else
69  _gravity_set = false;
70  if (adGetParam<bool>("include_viscous_term_in_strong_form"))
71  mooseError("Sorry no TypeNTensor operations are currently implemented, so we cannot add the "
72  "strong form contribution of the viscous term. Note that for linear elements, this "
73  "introduces no error, and in general for bi-linear elements, the error is small");
74 }
Function & _y_vel_fn
The y velocity mms forcing function.
Definition: INSADMaterial.h:92
const ADVectorVariableValue * _velocity_dot
Time derivative of the velocity, e.g. the acceleration.
Definition: INSADMaterial.h:54
const bool _transient_term
Whether we are performing a transient or steady simulation.
Definition: INSADMaterial.h:51
MaterialProperty< RealVectorValue > & _mms_function_strong_residual
Strong residual corresponding to the mms function term.
Definition: INSADMaterial.h:83
const bool _integrate_p_by_parts
Whether to integrate the pressure term in the momentum equations by parts.
Definition: INSADMaterial.h:57
const ADVariableGradient & _grad_p
gradient of the pressure
Definition: INSADMaterial.h:42
RealVectorValue _gravity
The gravity vector; should be in units of acceleration.
Definition: INSADMaterial.h:68
Function & _x_vel_fn
The x velocity mms forcing function.
Definition: INSADMaterial.h:89
const ADVectorVariableGradient & _grad_velocity
gradient of velocity
Definition: INSADMaterial.h:39
Function & _z_vel_fn
The z velocity mms forcing function.
Definition: INSADMaterial.h:95
const bool _include_viscous_term_in_strong_form
Whether to include the strong form of the viscous term in the momentum equation strong residual...
Definition: INSADMaterial.h:62
const ADVectorVariableValue & _velocity
velocity
Definition: INSADMaterial.h:36
bool _gravity_set
Whether the user set a gravity vector. If none is set, we assume there is no gravity term in the simu...
Definition: INSADMaterial.h:65

Member Function Documentation

◆ ADMaterialProperty() [1/7]

template<ComputeStage compute_stage>
const INSADMaterial< compute_stage >::ADMaterialProperty ( Real  ) &
protected

viscosity

◆ ADMaterialProperty() [2/7]

template<ComputeStage compute_stage>
const INSADMaterial< compute_stage >::ADMaterialProperty ( Real  ) &
protected

density

◆ ADMaterialProperty() [3/7]

template<ComputeStage compute_stage>
INSADMaterial< compute_stage >::ADMaterialProperty ( Real  ) &
protected

The strong residual of the mass continuity equation.

◆ ADMaterialProperty() [4/7]

template<ComputeStage compute_stage>
INSADMaterial< compute_stage >::ADMaterialProperty ( RealVectorValue  ) &
protected

Strong residual corresponding to the momentum convective term.

◆ ADMaterialProperty() [5/7]

template<ComputeStage compute_stage>
INSADMaterial< compute_stage >::ADMaterialProperty ( RealVectorValue  ) &
protected

Strong residual corresponding to the momentum transient term.

◆ ADMaterialProperty() [6/7]

template<ComputeStage compute_stage>
INSADMaterial< compute_stage >::ADMaterialProperty ( RealVectorValue  ) &
protected

Strong residual corresponding to the momentum gravity term.

◆ ADMaterialProperty() [7/7]

template<ComputeStage compute_stage>
INSADMaterial< compute_stage >::ADMaterialProperty ( RealVectorValue  ) &
protected

The strong residual of the momentum equation.

◆ computeQpProperties()

template<ComputeStage compute_stage>
void INSADMaterial< compute_stage >::computeQpProperties ( )
overrideprotectedvirtual

Reimplemented in INSADTauMaterial< compute_stage >.

Definition at line 78 of file INSADMaterial.C.

Referenced by INSADTauMaterial< compute_stage >::computeQpProperties().

79 {
80  _mass_strong_residual[_qp] = -_grad_velocity[_qp].tr();
81  _convective_strong_residual[_qp] = _rho[_qp] * _grad_velocity[_qp] * _velocity[_qp];
82  _td_strong_residual[_qp] =
83  _transient_term ? _rho[_qp] * (*_velocity_dot)[_qp] : ADRealVectorValue(0);
84  _gravity_strong_residual[_qp] = _gravity_set ? -_rho[_qp] * _gravity : ADRealVectorValue(0);
85  _mms_function_strong_residual[_qp] = -RealVectorValue(_x_vel_fn.value(_t, _q_point[_qp]),
86  _y_vel_fn.value(_t, _q_point[_qp]),
87  _z_vel_fn.value(_t, _q_point[_qp]));
88  _momentum_strong_residual[_qp] =
89  _gravity_strong_residual[_qp] + _mms_function_strong_residual[_qp] +
90  _convective_strong_residual[_qp] + _td_strong_residual[_qp] + _grad_p[_qp];
91 }
Function & _y_vel_fn
The y velocity mms forcing function.
Definition: INSADMaterial.h:92
const bool _transient_term
Whether we are performing a transient or steady simulation.
Definition: INSADMaterial.h:51
MaterialProperty< RealVectorValue > & _mms_function_strong_residual
Strong residual corresponding to the mms function term.
Definition: INSADMaterial.h:83
const ADVariableGradient & _grad_p
gradient of the pressure
Definition: INSADMaterial.h:42
RealVectorValue _gravity
The gravity vector; should be in units of acceleration.
Definition: INSADMaterial.h:68
Function & _x_vel_fn
The x velocity mms forcing function.
Definition: INSADMaterial.h:89
const ADVectorVariableGradient & _grad_velocity
gradient of velocity
Definition: INSADMaterial.h:39
Function & _z_vel_fn
The z velocity mms forcing function.
Definition: INSADMaterial.h:95
const ADVectorVariableValue & _velocity
velocity
Definition: INSADMaterial.h:36
bool _gravity_set
Whether the user set a gravity vector. If none is set, we assume there is no gravity term in the simu...
Definition: INSADMaterial.h:65

Member Data Documentation

◆ _grad_p

template<ComputeStage compute_stage>
const ADVariableGradient& INSADMaterial< compute_stage >::_grad_p
protected

gradient of the pressure

Definition at line 42 of file INSADMaterial.h.

◆ _grad_velocity

template<ComputeStage compute_stage>
const ADVectorVariableGradient& INSADMaterial< compute_stage >::_grad_velocity
protected

gradient of velocity

Definition at line 39 of file INSADMaterial.h.

◆ _gravity

template<ComputeStage compute_stage>
RealVectorValue INSADMaterial< compute_stage >::_gravity
protected

The gravity vector; should be in units of acceleration.

Definition at line 68 of file INSADMaterial.h.

Referenced by INSADMaterial< compute_stage >::INSADMaterial().

◆ _gravity_set

template<ComputeStage compute_stage>
bool INSADMaterial< compute_stage >::_gravity_set
protected

Whether the user set a gravity vector. If none is set, we assume there is no gravity term in the simulation.

Definition at line 65 of file INSADMaterial.h.

Referenced by INSADMaterial< compute_stage >::INSADMaterial().

◆ _include_viscous_term_in_strong_form

template<ComputeStage compute_stage>
const bool INSADMaterial< compute_stage >::_include_viscous_term_in_strong_form
protected

Whether to include the strong form of the viscous term in the momentum equation strong residual.

The method is more consistent if set to true, but it incurs quite a bit more computational expense. Note that at present we don't actually support the true value of this member!

Definition at line 62 of file INSADMaterial.h.

◆ _integrate_p_by_parts

template<ComputeStage compute_stage>
const bool INSADMaterial< compute_stage >::_integrate_p_by_parts
protected

Whether to integrate the pressure term in the momentum equations by parts.

Definition at line 57 of file INSADMaterial.h.

◆ _mms_function_strong_residual

template<ComputeStage compute_stage>
MaterialProperty<RealVectorValue>& INSADMaterial< compute_stage >::_mms_function_strong_residual
protected

Strong residual corresponding to the mms function term.

Definition at line 83 of file INSADMaterial.h.

◆ _transient_term

template<ComputeStage compute_stage>
const bool INSADMaterial< compute_stage >::_transient_term
protected

Whether we are performing a transient or steady simulation.

Definition at line 51 of file INSADMaterial.h.

◆ _velocity

template<ComputeStage compute_stage>
const ADVectorVariableValue& INSADMaterial< compute_stage >::_velocity
protected

velocity

Definition at line 36 of file INSADMaterial.h.

◆ _velocity_dot

template<ComputeStage compute_stage>
const ADVectorVariableValue* INSADMaterial< compute_stage >::_velocity_dot
protected

Time derivative of the velocity, e.g. the acceleration.

Definition at line 54 of file INSADMaterial.h.

◆ _x_vel_fn

template<ComputeStage compute_stage>
Function& INSADMaterial< compute_stage >::_x_vel_fn
protected

The x velocity mms forcing function.

Definition at line 89 of file INSADMaterial.h.

◆ _y_vel_fn

template<ComputeStage compute_stage>
Function& INSADMaterial< compute_stage >::_y_vel_fn
protected

The y velocity mms forcing function.

Definition at line 92 of file INSADMaterial.h.

◆ _z_vel_fn

template<ComputeStage compute_stage>
Function& INSADMaterial< compute_stage >::_z_vel_fn
protected

The z velocity mms forcing function.

Definition at line 95 of file INSADMaterial.h.

◆ usingMaterialMembers

template<ComputeStage compute_stage>
INSADMaterial< compute_stage >::usingMaterialMembers
protected

Definition at line 97 of file INSADMaterial.h.


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