www.mooseframework.org
DynamicStressDivergenceTensors.C
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://www.mooseframework.org
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 
16 
17 InputParameters
19 {
20  InputParameters params = StressDivergenceTensors::validParams();
21  params.addClassDescription(
22  "Residual due to stress related Rayleigh damping and HHT time integration terms ");
23  params.addParam<MaterialPropertyName>("zeta",
24  0.0,
25  "Name of material property or a constant real "
26  "number defining the zeta parameter for the "
27  "Rayleigh damping.");
28  params.addParam<Real>("alpha", 0, "alpha parameter for HHT time integration");
29  params.addParam<bool>("static_initialization",
30  false,
31  "Set to true to get the system to "
32  "equilibrium under gravity by running a "
33  "quasi-static analysis (by solving Ku = F) "
34  "in the first time step");
35  return params;
36 }
37 
39  : StressDivergenceTensors(parameters),
40  _stress_older(getMaterialPropertyOlderByName<RankTwoTensor>(_base_name + "stress")),
41  _stress_old(getMaterialPropertyOldByName<RankTwoTensor>(_base_name + "stress")),
42  _zeta(getMaterialProperty<Real>("zeta")),
43  _alpha(getParam<Real>("alpha")),
44  _static_initialization(getParam<bool>("static_initialization"))
45 {
46 }
47 
48 Real
50 {
65  Real residual = 0.0;
66  if (_static_initialization && _t == _dt)
67  {
68  // If static inialization is true, then in the first step residual is only Ku which is
69  // stress.grad(test).
70  residual += _stress[_qp].row(_component) * _grad_test[_i][_qp];
71 
73  residual += _stress[_qp].trace() / 3.0 *
74  (_avg_grad_test[_i][_component] - _grad_test[_i][_qp](_component));
75  }
76  else if (_dt > 0)
77  {
78  residual +=
79  _stress[_qp].row(_component) * _grad_test[_i][_qp] *
80  (1.0 + _alpha + (1.0 + _alpha) * _zeta[_qp] / _dt) -
81  (_alpha + (1.0 + 2.0 * _alpha) * _zeta[_qp] / _dt) * _stress_old[_qp].row(_component) *
82  _grad_test[_i][_qp] +
83  (_alpha * _zeta[_qp] / _dt) * _stress_older[_qp].row(_component) * _grad_test[_i][_qp];
84 
86  residual += (_stress[_qp].trace() * (1.0 + _alpha + (1.0 + _alpha) * _zeta[_qp] / _dt) -
87  (_alpha + (1.0 + 2.0 * _alpha) * _zeta[_qp] / _dt) * _stress_old[_qp].trace() +
88  (_alpha * _zeta[_qp] / _dt) * _stress_older[_qp].trace()) /
89  3.0 * (_avg_grad_test[_i][_component] - _grad_test[_i][_qp](_component));
90  }
91 
92  return residual;
93 }
94 
95 Real
97 {
98  if (_static_initialization && _t == _dt)
100  else if (_dt > 0)
102  (1.0 + _alpha + (1.0 + _alpha) * _zeta[_qp] / _dt);
103  else
104  return 0.0;
105 }
106 
107 Real
109 {
110  bool active = true;
111 
112  for (unsigned int i = 0; i < _ndisp; ++i)
113  if (jvar == _disp_var[i])
114  active = true;
115 
116  if (active)
117  {
118  if (_static_initialization && _t == _dt)
120  else if (_dt > 0)
122  (1.0 + _alpha + (1.0 + _alpha) * _zeta[_qp] / _dt);
123  else
124  return 0.0;
125  }
126  if (_temp_coupled && jvar == _temp_var)
127  return 0.0;
128 
129  return 0;
130 }
DynamicStressDivergenceTensors
DynamicStressDivergenceTensors derives from StressDivergenceTensors and adds stress related Rayleigh ...
Definition: DynamicStressDivergenceTensors.h:23
StressDivergenceTensors::computeQpJacobian
virtual Real computeQpJacobian() override
Definition: StressDivergenceTensors.C:212
StressDivergenceTensors
StressDivergenceTensors mostly copies from StressDivergence.
Definition: StressDivergenceTensors.h:27
StressDivergenceTensors::_component
const unsigned int _component
Definition: StressDivergenceTensors.h:62
DynamicStressDivergenceTensors::_zeta
const MaterialProperty< Real > & _zeta
Definition: DynamicStressDivergenceTensors.h:39
StressDivergenceTensors::_disp_var
std::vector< unsigned int > _disp_var
Definition: StressDivergenceTensors.h:66
StressDivergenceTensors::computeQpOffDiagJacobian
virtual Real computeQpOffDiagJacobian(unsigned int jvar) override
Definition: StressDivergenceTensors.C:277
DynamicStressDivergenceTensors::_alpha
const Real _alpha
Definition: DynamicStressDivergenceTensors.h:40
StressDivergenceTensors::_temp_coupled
const bool _temp_coupled
Definition: StressDivergenceTensors.h:68
StressDivergenceTensors::_volumetric_locking_correction
bool _volumetric_locking_correction
Flag for volumetric locking correction.
Definition: StressDivergenceTensors.h:89
DynamicStressDivergenceTensors::DynamicStressDivergenceTensors
DynamicStressDivergenceTensors(const InputParameters &parameters)
Definition: DynamicStressDivergenceTensors.C:38
DynamicStressDivergenceTensors::computeQpJacobian
virtual Real computeQpJacobian()
Definition: DynamicStressDivergenceTensors.C:96
ElasticityTensorTools.h
DynamicStressDivergenceTensors::_static_initialization
const bool _static_initialization
Definition: DynamicStressDivergenceTensors.h:41
StressDivergenceTensors::validParams
static InputParameters validParams()
Definition: StressDivergenceTensors.C:26
DynamicStressDivergenceTensors::_stress_older
const MaterialProperty< RankTwoTensor > & _stress_older
Definition: DynamicStressDivergenceTensors.h:35
DynamicStressDivergenceTensors::computeQpResidual
virtual Real computeQpResidual()
Definition: DynamicStressDivergenceTensors.C:49
StressDivergenceTensors::_stress
const MaterialProperty< RankTwoTensor > & _stress
Definition: StressDivergenceTensors.h:53
StressDivergenceTensors::_avg_grad_test
std::vector< std::vector< Real > > _avg_grad_test
Gradient of test function averaged over the element. Used in volumetric locking correction calculatio...
Definition: StressDivergenceTensors.h:83
DynamicStressDivergenceTensors::validParams
static InputParameters validParams()
Definition: DynamicStressDivergenceTensors.C:18
StressDivergenceTensors::_ndisp
unsigned int _ndisp
Coupled displacement variables.
Definition: StressDivergenceTensors.h:65
DynamicStressDivergenceTensors.h
defineLegacyParams
defineLegacyParams(DynamicStressDivergenceTensors)
registerMooseObject
registerMooseObject("TensorMechanicsApp", DynamicStressDivergenceTensors)
RankTwoTensorTempl< Real >
DynamicStressDivergenceTensors::_stress_old
const MaterialProperty< RankTwoTensor > & _stress_old
Definition: DynamicStressDivergenceTensors.h:36
DynamicStressDivergenceTensors::computeQpOffDiagJacobian
virtual Real computeQpOffDiagJacobian(unsigned int jvar)
Definition: DynamicStressDivergenceTensors.C:108
StressDivergenceTensors::_temp_var
const unsigned int _temp_var
Definition: StressDivergenceTensors.h:69