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

ADStressDivergenceRZTensors is the automatic differentiation version of StressDivergenceRZTensors. More...

#include <ADStressDivergenceRZTensors.h>

Inheritance diagram for ADStressDivergenceRZTensors< compute_stage >:
[legend]

Public Member Functions

 ADStressDivergenceRZTensors (const InputParameters &parameters)
 

Protected Member Functions

void initialSetup () override
 
ADResidual computeQpResidual () override
 
void precalculateResidual () override
 
const ADMaterialProperty (RankTwoTensor) &_stress
 

Protected Attributes

 usingStressDivergenceTensorsMembers
 
const std::string _base_name
 
const unsigned int _component
 
const unsigned int _ndisp
 Coupled displacement variables. More...
 
std::vector< unsigned int > _disp_var
 
std::vector< ADReal > _avg_grad_test
 Gradient of test function averaged over the element. Used in volumetric locking correction calculation. More...
 
const bool _volumetric_locking_correction
 Flag for volumetric locking correction. More...
 
 usingKernelMembers
 

Detailed Description

template<ComputeStage compute_stage>
class ADStressDivergenceRZTensors< compute_stage >

ADStressDivergenceRZTensors is the automatic differentiation version of StressDivergenceRZTensors.

Within this kernel the first component of the displacements refers to displacement in the radial direction and the second component refers to displacement in the axial direction. The COORD_TYPE in the Problem block must be set to RZ.

Definition at line 16 of file ADStressDivergenceRZTensors.h.

Constructor & Destructor Documentation

◆ ADStressDivergenceRZTensors()

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

Definition at line 31 of file ADStressDivergenceRZTensors.C.

34 {
35 }
ADStressDivergenceTensors is the automatic differentiation version of StressDivergenceTensors.

Member Function Documentation

◆ ADMaterialProperty()

template<ComputeStage compute_stage>
const ADStressDivergenceTensors< compute_stage >::ADMaterialProperty ( RankTwoTensor  ) &
protectedinherited

◆ computeQpResidual()

template<ComputeStage compute_stage>
ADResidual ADStressDivergenceRZTensors< compute_stage >::computeQpResidual ( )
overrideprotected

Definition at line 48 of file ADStressDivergenceRZTensors.C.

49 {
50  ADResidual div = 0.0;
51  if (_component == 0)
52  {
53  div = _grad_test[_i][_qp](0) * _stress[_qp](0, 0) +
54  (_test[_i][_qp] / _ad_q_point[_qp](0)) * _stress[_qp](2, 2) +
55  _grad_test[_i][_qp](1) * _stress[_qp](0, 1); // stress_{rz}
56 
57  // volumetric locking correction
59  div += (_avg_grad_test[_i] - _grad_test[_i][_qp](0) - _test[_i][_qp] / _ad_q_point[_qp](0)) *
60  (_stress[_qp].trace()) / 3.0;
61  }
62  else if (_component == 1)
63  {
64  div = _grad_test[_i][_qp](1) * _stress[_qp](1, 1) +
65  _grad_test[_i][_qp](0) * _stress[_qp](1, 0); // stress_{zr}
66 
67  // volumetric locking correction
69  div += (_avg_grad_test[_i] - _grad_test[_i][_qp](1)) * (_stress[_qp].trace()) / 3.0;
70  }
71  else
72  mooseError("Invalid component for this AxisymmetricRZ problem.");
73 
74  return div;
75 }
std::vector< ADReal > _avg_grad_test
Gradient of test function averaged over the element. Used in volumetric locking correction calculatio...
const bool _volumetric_locking_correction
Flag for volumetric locking correction.

◆ initialSetup()

template<ComputeStage compute_stage>
void ADStressDivergenceRZTensors< compute_stage >::initialSetup ( )
overrideprotected

Definition at line 39 of file ADStressDivergenceRZTensors.C.

40 {
41  if (getBlockCoordSystem() != Moose::COORD_RZ)
42  mooseError("The coordinate system in the Problem block must be set to RZ for axisymmetric "
43  "geometries.");
44 }

◆ precalculateResidual()

template<ComputeStage compute_stage>
void ADStressDivergenceRZTensors< compute_stage >::precalculateResidual ( )
overrideprotected

Definition at line 79 of file ADStressDivergenceRZTensors.C.

80 {
82  return;
83 
84  ADReal ad_current_elem_volume = 0.0;
85  for (unsigned int qp = 0; qp < _qrule->n_points(); qp++)
86  ad_current_elem_volume += _ad_JxW[qp] * _ad_coord[qp];
87 
88  // calculate volume averaged value of shape function derivative
89  _avg_grad_test.resize(_test.size());
90  for (_i = 0; _i < _test.size(); ++_i)
91  {
92  _avg_grad_test[_i] = 0.0;
93  for (_qp = 0; _qp < _qrule->n_points(); ++_qp)
94  {
95  if (_component == 0)
96  _avg_grad_test[_i] +=
97  (_grad_test[_i][_qp](_component) + _test[_i][_qp] / _ad_q_point[_qp](0)) *
98  _ad_JxW[_qp] * _ad_coord[_qp];
99  else
100  _avg_grad_test[_i] += _grad_test[_i][_qp](_component) * _ad_JxW[_qp] * _ad_coord[_qp];
101  }
102  _avg_grad_test[_i] /= ad_current_elem_volume;
103  }
104 }
std::vector< ADReal > _avg_grad_test
Gradient of test function averaged over the element. Used in volumetric locking correction calculatio...
const bool _volumetric_locking_correction
Flag for volumetric locking correction.

Member Data Documentation

◆ _avg_grad_test

template<ComputeStage compute_stage>
std::vector<ADReal> ADStressDivergenceTensors< compute_stage >::_avg_grad_test
protectedinherited

Gradient of test function averaged over the element. Used in volumetric locking correction calculation.

Definition at line 59 of file ADStressDivergenceTensors.h.

◆ _base_name

template<ComputeStage compute_stage>
const std::string ADStressDivergenceTensors< compute_stage >::_base_name
protectedinherited

Definition at line 49 of file ADStressDivergenceTensors.h.

◆ _component

template<ComputeStage compute_stage>
const unsigned int ADStressDivergenceTensors< compute_stage >::_component
protectedinherited

◆ _disp_var

template<ComputeStage compute_stage>
std::vector<unsigned int> ADStressDivergenceTensors< compute_stage >::_disp_var
protectedinherited

◆ _ndisp

template<ComputeStage compute_stage>
const unsigned int ADStressDivergenceTensors< compute_stage >::_ndisp
protectedinherited

Coupled displacement variables.

Definition at line 55 of file ADStressDivergenceTensors.h.

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

◆ _volumetric_locking_correction

template<ComputeStage compute_stage>
const bool ADStressDivergenceTensors< compute_stage >::_volumetric_locking_correction
protectedinherited

Flag for volumetric locking correction.

Definition at line 62 of file ADStressDivergenceTensors.h.

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

◆ usingKernelMembers

template<ComputeStage compute_stage>
ADStressDivergenceTensors< compute_stage >::usingKernelMembers
protectedinherited

Definition at line 64 of file ADStressDivergenceTensors.h.

◆ usingStressDivergenceTensorsMembers

template<ComputeStage compute_stage>
ADStressDivergenceRZTensors< compute_stage >::usingStressDivergenceTensorsMembers
protected

Definition at line 38 of file ADStressDivergenceRZTensors.h.


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