https://mooseframework.inl.gov
ADDynamicStressDivergenceTensors.C
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://mooseframework.inl.gov
3 //*
4 //* All rights reserved, see COPYRIGHT for full restrictions
5 //* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6 //*
7 //* Licensed under LGPL 2.1, please see LICENSE for details
8 //* https://www.gnu.org/licenses/lgpl-2.1.html
9 
11 #include "ElasticityTensorTools.h"
12 
14 
17 {
19  params.addClassDescription(
20  "Residual due to stress related Rayleigh damping and HHT time integration terms");
21  params.addParam<MaterialPropertyName>("zeta",
22  0.0,
23  "Name of material property or a constant real "
24  "number defining the zeta parameter for the "
25  "Rayleigh damping.");
26  params.addParam<Real>("alpha", 0, "alpha parameter for HHT time integration");
27  params.addParam<bool>("static_initialization",
28  false,
29  "Set to true to get the system to "
30  "equilibrium under gravity by running a "
31  "quasi-static analysis (by solving Ku = F) "
32  "in the first time step");
33  return params;
34 }
35 
37  const InputParameters & parameters)
38  : ADStressDivergenceTensors(parameters),
39  _stress_older(getMaterialPropertyOlder<RankTwoTensor>(_base_name + "stress")),
40  _stress_old(getMaterialPropertyOld<RankTwoTensor>(_base_name + "stress")),
41  _zeta(getMaterialProperty<Real>("zeta")),
42  _alpha(getParam<Real>("alpha")),
43  _static_initialization(getParam<bool>("static_initialization"))
44 {
45 }
46 
47 ADReal
49 {
64  ADReal residual;
65  if (_static_initialization && _t == _dt)
66  {
67  // If static initialization is true, then in the first step residual is only Ku which is
68  // stress.grad(test).
69  residual = _stress[_qp].row(_component) * _grad_test[_i][_qp];
70 
72  residual +=
73  _stress[_qp].trace() / 3.0 * (_avg_grad_test[_i] - _grad_test[_i][_qp](_component));
74  }
75  else if (_dt > 0)
76  {
77  residual =
79  (1.0 + _alpha + (1.0 + _alpha) * _zeta[_qp] / _dt) -
80  (_alpha + (1.0 + 2.0 * _alpha) * _zeta[_qp] / _dt) * _stress_old[_qp].row(_component) *
81  _grad_test[_i][_qp] +
83 
85  residual += (_stress[_qp].trace() * (1.0 + _alpha + (1.0 + _alpha) * _zeta[_qp] / _dt) -
86  (_alpha + (1.0 + 2.0 * _alpha) * _zeta[_qp] / _dt) * _stress_old[_qp].trace() +
87  (_alpha * _zeta[_qp] / _dt) * _stress_older[_qp].trace()) /
89  }
90  else
91  residual = 0.0;
92 
93  return residual;
94 }
const MaterialProperty< RankTwoTensor > & _stress_old
std::vector< ADReal > _avg_grad_test
Gradient of test function averaged over the element. Used in volumetric locking correction calculatio...
const ADTemplateVariableTestGradient< T > & _grad_test
const unsigned int _component
An integer corresponding to the direction this kernel acts in.
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
registerMooseObject("SolidMechanicsApp", ADDynamicStressDivergenceTensors)
const ADMaterialProperty< R2 > & _stress
The stress tensor that the divergence operator operates on.
DualNumber< Real, DNDerivativeType, true > ADReal
const MaterialProperty< RankTwoTensor > & _stress_older
{@ The old and older states of the stress tensor that the divergence operator operates on ...
unsigned int _i
ADDynamicStressDivergenceTensors is the automatic differentiation version of DynamicStressDivergenceT...
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const bool _volumetric_locking_correction
Flag for volumetric locking correction.
void addClassDescription(const std::string &doc_string)
ADDynamicStressDivergenceTensors(const InputParameters &parameters)
ADStressDivergenceTensors is the automatic differentiation version of StressDivergenceTensors.
unsigned int _qp