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

#include <INSADTauMaterial.h>

Inheritance diagram for INSADTauMaterial< compute_stage >:
[legend]

Public Member Functions

 INSADTauMaterial (const InputParameters &parameters)
 

Protected Member Functions

virtual void computeProperties () override
 
virtual void computeQpProperties () override
 
void computeHMax ()
 
 ADMaterialProperty (Real) &_tau
 
template<>
void computeHMax ()
 
 ADMaterialProperty (RealVectorValue) &_convective_strong_residual
 Strong residual corresponding to the momentum convective term. More...
 

Protected Attributes

const Real _alpha
 
ADReal _hmax
 
 usingINSMaterialMembers
 
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 INSADTauMaterial< compute_stage >

Definition at line 16 of file INSADTauMaterial.h.

Constructor & Destructor Documentation

◆ INSADTauMaterial()

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

Definition at line 26 of file INSADTauMaterial.C.

27  : INSADMaterial<compute_stage>(parameters),
28  _alpha(adGetParam<Real>("alpha")),
29  _tau(adDeclareADProperty<Real>("tau"))
30 {
31 }

Member Function Documentation

◆ ADMaterialProperty() [1/2]

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

◆ ADMaterialProperty() [2/2]

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

Strong residual corresponding to the momentum convective term.

◆ computeHMax() [1/2]

template<ComputeStage compute_stage>
void INSADTauMaterial< compute_stage >::computeHMax ( )
protected

Definition at line 35 of file INSADTauMaterial.C.

36 {
37  _hmax = _current_elem->hmax();
38 }

◆ computeHMax() [2/2]

template<>
void INSADTauMaterial< JACOBIAN >::computeHMax ( )
protected

Definition at line 42 of file INSADTauMaterial.C.

43 {
44  if (!_displacements.size())
45  {
46  _hmax = _current_elem->hmax();
47  return;
48  }
49 
50  _hmax = 0;
51 
52  for (unsigned int n_outer = 0; n_outer < _current_elem->n_vertices(); n_outer++)
53  for (unsigned int n_inner = n_outer + 1; n_inner < _current_elem->n_vertices(); n_inner++)
54  {
55  VectorValue<DualReal> diff = (_current_elem->point(n_outer) - _current_elem->point(n_inner));
56  unsigned dimension = 0;
57  for (const auto & disp_num : _displacements)
58  {
59  diff(dimension)
60  .derivatives()[disp_num * _fe_problem.getNonlinearSystemBase().getMaxVarNDofsPerElem() +
61  n_outer] = 1.;
62  diff(dimension++)
63  .derivatives()[disp_num * _fe_problem.getNonlinearSystemBase().getMaxVarNDofsPerElem() +
64  n_inner] = -1.;
65  }
66 
67  _hmax = std::max(_hmax, diff.norm_sq());
68  }
69 
70  _hmax = std::sqrt(_hmax);
71 }

◆ computeProperties()

template<ComputeStage compute_stage>
void INSADTauMaterial< compute_stage >::computeProperties ( )
overrideprotectedvirtual

Definition at line 75 of file INSADTauMaterial.C.

76 {
77  computeHMax();
78 
79  Material::computeProperties();
80 }

◆ computeQpProperties()

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

Reimplemented from INSADMaterial< compute_stage >.

Definition at line 84 of file INSADTauMaterial.C.

85 {
87 
88  auto && nu = _mu[_qp] / _rho[_qp];
89  auto && transient_part = _transient_term ? 4. / (_dt * _dt) : 0.;
90  _tau[_qp] = _alpha / std::sqrt(transient_part +
91  (2. * _velocity[_qp].norm() / _hmax) *
92  (2. * _velocity[_qp].norm() / _hmax) +
93  9. * (4. * nu / (_hmax * _hmax)) * (4. * nu / (_hmax * _hmax)));
94 }
const bool _transient_term
Whether we are performing a transient or steady simulation.
Definition: INSADMaterial.h:52
virtual void computeQpProperties() override
Definition: INSADMaterial.C:78
const ADVectorVariableValue & _velocity
velocity
Definition: INSADMaterial.h:37

Member Data Documentation

◆ _alpha

template<ComputeStage compute_stage>
const Real INSADTauMaterial< compute_stage >::_alpha
protected

Definition at line 31 of file INSADTauMaterial.h.

◆ _grad_p

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

gradient of the pressure

Definition at line 43 of file INSADMaterial.h.

◆ _grad_velocity

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

gradient of velocity

Definition at line 40 of file INSADMaterial.h.

◆ _gravity

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

The gravity vector; should be in units of acceleration.

Definition at line 69 of file INSADMaterial.h.

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

◆ _gravity_set

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

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

Definition at line 66 of file INSADMaterial.h.

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

◆ _hmax

template<ComputeStage compute_stage>
ADReal INSADTauMaterial< compute_stage >::_hmax
protected

Definition at line 34 of file INSADTauMaterial.h.

◆ _include_viscous_term_in_strong_form

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

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 63 of file INSADMaterial.h.

◆ _integrate_p_by_parts

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

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

Definition at line 58 of file INSADMaterial.h.

◆ _mms_function_strong_residual

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

Strong residual corresponding to the mms function term.

Definition at line 84 of file INSADMaterial.h.

◆ _transient_term

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

Whether we are performing a transient or steady simulation.

Definition at line 52 of file INSADMaterial.h.

◆ _velocity

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

velocity

Definition at line 37 of file INSADMaterial.h.

◆ _velocity_dot

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

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

Definition at line 55 of file INSADMaterial.h.

◆ _x_vel_fn

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

The x velocity mms forcing function.

Definition at line 90 of file INSADMaterial.h.

◆ _y_vel_fn

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

The y velocity mms forcing function.

Definition at line 93 of file INSADMaterial.h.

◆ _z_vel_fn

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

The z velocity mms forcing function.

Definition at line 96 of file INSADMaterial.h.

◆ usingINSMaterialMembers

template<ComputeStage compute_stage>
INSADTauMaterial< compute_stage >::usingINSMaterialMembers
protected

Definition at line 36 of file INSADTauMaterial.h.

◆ usingMaterialMembers

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

Definition at line 98 of file INSADMaterial.h.


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