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

ADCompute2DSmallStrain defines a strain tensor, assuming small strains, in 2D geometries / simulations. More...

#include <ADCompute2DSmallStrain.h>

Inheritance diagram for ADCompute2DSmallStrain< compute_stage >:
[legend]

Public Member Functions

 ADCompute2DSmallStrain (const InputParameters &parameters)
 
void initialSetup () override
 
virtual void computeProperties () override
 

Protected Member Functions

virtual void displacementIntegrityCheck () override
 
virtual ADReal computeOutOfPlaneStrain ()=0
 
virtual void initQpStatefulProperties () override
 
 ADMaterialProperty (RankTwoTensor) &_mechanical_strain
 
 ADMaterialProperty (RankTwoTensor) &_total_strain
 
const ADMaterialProperty (RankTwoTensor) *_global_strain
 

Protected Attributes

const unsigned int _out_of_plane_direction
 
 usingComputeSmallStrainMembers
 
 usingComputeStrainBaseMembers
 
const unsigned int _ndisp
 Coupled displacement variables. More...
 
std::vector< const ADVariableValue * > _disp
 
std::vector< const ADVariableGradient * > _grad_disp
 
std::string _base_name
 
std::vector< MaterialPropertyName > _eigenstrain_names
 
std::vector< const ADMaterialProperty(RankTwoTensor) * > _eigenstrains
 
const bool _volumetric_locking_correction
 
const Real & _current_elem_volume
 
 usingMaterialMembers
 

Detailed Description

template<ComputeStage compute_stage>
class ADCompute2DSmallStrain< compute_stage >

ADCompute2DSmallStrain defines a strain tensor, assuming small strains, in 2D geometries / simulations.

ComputePlaneSmallStrain acts as a base class for ComputePlaneSmallStrain and ComputeAxisymmetricRZSmallStrain through the computeOutOfPlaneStrain method.

Definition at line 21 of file ADCompute2DSmallStrain.h.

Constructor & Destructor Documentation

◆ ADCompute2DSmallStrain()

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

Definition at line 24 of file ADCompute2DSmallStrain.C.

26  _out_of_plane_direction(adGetParam<MooseEnum>("out_of_plane_direction"))
27 {
28 }
ADComputeSmallStrain defines a strain tensor, assuming small strains.
const unsigned int _out_of_plane_direction

Member Function Documentation

◆ ADMaterialProperty() [1/3]

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

◆ ADMaterialProperty() [2/3]

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

◆ ADMaterialProperty() [3/3]

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

◆ computeOutOfPlaneStrain()

template<ComputeStage compute_stage>
virtual ADReal ADCompute2DSmallStrain< compute_stage >::computeOutOfPlaneStrain ( )
protectedpure virtual

◆ computeProperties()

template<ComputeStage compute_stage>
void ADCompute2DSmallStrain< compute_stage >::computeProperties ( )
overridevirtual

Reimplemented from ADComputeSmallStrain< compute_stage >.

Definition at line 52 of file ADCompute2DSmallStrain.C.

53 {
54  const auto o0 = _out_of_plane_direction;
55  const auto o1 = (_out_of_plane_direction + 1) % 3;
56  const auto o2 = (_out_of_plane_direction + 2) % 3;
57 
58  ADReal volumetric_strain = 0.0;
59  for (_qp = 0; _qp < _qrule->n_points(); ++_qp)
60  {
61  _total_strain[_qp](o0, o0) = computeOutOfPlaneStrain();
62  _total_strain[_qp](o1, o1) = (*_grad_disp[o1])[_qp](o1);
63  _total_strain[_qp](o2, o2) = (*_grad_disp[o2])[_qp](o2);
64  _total_strain[_qp](o1, o2) = ((*_grad_disp[o1])[_qp](o2) + (*_grad_disp[o2])[_qp](o1)) / 2.0;
65  _total_strain[_qp](o2, o1) = _total_strain[_qp](o1, o2); // force the symmetrical strain tensor
66 
68  volumetric_strain += _total_strain[_qp].trace() * _JxW[_qp] * _coord[_qp];
69  }
70 
72  volumetric_strain /= _current_elem_volume;
73 
74  for (_qp = 0; _qp < _qrule->n_points(); ++_qp)
75  {
77  {
78  const ADReal correction = (volumetric_strain - _total_strain[_qp].trace()) / 3.0;
79  _total_strain[_qp](0, 0) += correction;
80  _total_strain[_qp](1, 1) += correction;
81  _total_strain[_qp](2, 2) += correction;
82  }
83 
84  _mechanical_strain[_qp] = _total_strain[_qp];
85 
86  // Remove the eigenstrains
87  for (const auto es : _eigenstrains)
88  _mechanical_strain[_qp] -= (*es)[_qp];
89  }
90 
91  copyDualNumbersToValues();
92 }
virtual ADReal computeOutOfPlaneStrain()=0
const unsigned int _out_of_plane_direction
std::vector< const ADMaterialProperty(RankTwoTensor) * > _eigenstrains
const bool _volumetric_locking_correction
const Real & _current_elem_volume
std::vector< const ADVariableGradient * > _grad_disp

◆ displacementIntegrityCheck()

template<ComputeStage compute_stage>
void ADCompute2DSmallStrain< compute_stage >::displacementIntegrityCheck ( )
overrideprotectedvirtual

Reimplemented from ADComputeStrainBase< compute_stage >.

Definition at line 96 of file ADCompute2DSmallStrain.C.

97 {
98  if (_out_of_plane_direction != 2 && _ndisp != 3)
99  mooseError("For 2D simulations where the out-of-plane direction is x or y the number of "
100  "supplied displacements must be three.");
101  else if (_out_of_plane_direction == 2 && _ndisp != 2)
102  mooseError("For 2D simulations where the out-of-plane direction is z the number of supplied "
103  "displacements must be two.");
104 }
const unsigned int _out_of_plane_direction
const unsigned int _ndisp
Coupled displacement variables.

◆ initialSetup()

template<ComputeStage compute_stage>
void ADCompute2DSmallStrain< compute_stage >::initialSetup ( )
override

Definition at line 32 of file ADCompute2DSmallStrain.C.

Referenced by ADComputeAxisymmetricRZSmallStrain< compute_stage >::initialSetup().

33 {
35  for (unsigned int i = 0; i < 3; ++i)
36  {
37  if (_out_of_plane_direction == i)
38  {
39  _disp[i] = &adZeroValue();
40  _grad_disp[i] = &adZeroGradient();
41  }
42  else
43  {
44  _disp[i] = &adCoupledValue("displacements", i);
45  _grad_disp[i] = &adCoupledGradient("displacements", i);
46  }
47  }
48 }
const unsigned int _out_of_plane_direction
virtual void displacementIntegrityCheck() override
std::vector< const ADVariableValue * > _disp
std::vector< const ADVariableGradient * > _grad_disp

◆ initQpStatefulProperties()

template<ComputeStage compute_stage>
void ADComputeStrainBase< compute_stage >::initQpStatefulProperties ( )
overrideprotectedvirtualinherited

Reimplemented in ADComputeIncrementalStrainBase< compute_stage >.

Definition at line 98 of file ADComputeStrainBase.C.

99 {
100  _mechanical_strain[_qp].zero();
101  _total_strain[_qp].zero();
102 }

Member Data Documentation

◆ _base_name

template<ComputeStage compute_stage>
std::string ADComputeStrainBase< compute_stage >::_base_name
protectedinherited

◆ _current_elem_volume

template<ComputeStage compute_stage>
const Real& ADComputeStrainBase< compute_stage >::_current_elem_volume
protectedinherited

Definition at line 70 of file ADComputeStrainBase.h.

◆ _disp

template<ComputeStage compute_stage>
std::vector<const ADVariableValue *> ADComputeStrainBase< compute_stage >::_disp
protectedinherited

Definition at line 56 of file ADComputeStrainBase.h.

◆ _eigenstrain_names

template<ComputeStage compute_stage>
std::vector<MaterialPropertyName> ADComputeStrainBase< compute_stage >::_eigenstrain_names
protectedinherited

◆ _eigenstrains

template<ComputeStage compute_stage>
std::vector<const ADMaterialProperty(RankTwoTensor) *> ADComputeStrainBase< compute_stage >::_eigenstrains
protectedinherited

◆ _grad_disp

template<ComputeStage compute_stage>
std::vector<const ADVariableGradient *> ADComputeStrainBase< compute_stage >::_grad_disp
protectedinherited

Definition at line 57 of file ADComputeStrainBase.h.

◆ _ndisp

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

Coupled displacement variables.

Definition at line 55 of file ADComputeStrainBase.h.

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

◆ _out_of_plane_direction

template<ComputeStage compute_stage>
const unsigned int ADCompute2DSmallStrain< compute_stage >::_out_of_plane_direction
protected

Definition at line 44 of file ADCompute2DSmallStrain.h.

◆ _volumetric_locking_correction

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

◆ usingComputeSmallStrainMembers

template<ComputeStage compute_stage>
ADCompute2DSmallStrain< compute_stage >::usingComputeSmallStrainMembers
protected

Definition at line 46 of file ADCompute2DSmallStrain.h.

◆ usingComputeStrainBaseMembers

template<ComputeStage compute_stage>
ADComputeSmallStrain< compute_stage >::usingComputeStrainBaseMembers
protectedinherited

Definition at line 34 of file ADComputeSmallStrain.h.

◆ usingMaterialMembers

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

Definition at line 72 of file ADComputeStrainBase.h.


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