www.mooseframework.org
StressDivergenceRSpherical.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 
12 #include "Material.h"
13 #include "SymmElasticityTensor.h"
14 
15 registerMooseObjectDeprecated("SolidMechanicsApp", StressDivergenceRSpherical, "07/30/2020 24:00");
16 
17 template <>
18 InputParameters
20 {
21  InputParameters params = validParams<Kernel>();
22  params.addRequiredParam<unsigned int>("component",
23  "An integer corresponding to the direction "
24  "the variable this kernel acts in. (0 for r, "
25  "1 for z)");
26  params.addCoupledVar("disp_r", "The r displacement");
27  // params.addCoupledVar("disp_z", "The z displacement");
28  params.addCoupledVar("temp", "The temperature");
29 
30  params.addParam<Real>("zeta", 0.0, "Stiffness dependent damping parameter for Rayleigh damping");
31  params.addParam<Real>("alpha", 0.0, "alpha parameter for HHT time integration");
32  params.addParam<std::string>(
33  "appended_property_name", "", "Name appended to material properties to make them unique");
34  params.addParam<bool>("volumetric_locking_correction",
35  true,
36  "Set to false to turn off volumetric locking correction");
37 
38  params.set<bool>("use_displaced_mesh") = true;
39 
40  return params;
41 }
42 
43 StressDivergenceRSpherical::StressDivergenceRSpherical(const InputParameters & parameters)
44  : Kernel(parameters),
45  _stress(getMaterialProperty<SymmTensor>("stress")),
46  _Jacobian_mult(getMaterialProperty<SymmElasticityTensor>("Jacobian_mult")),
47  _d_stress_dT(getMaterialProperty<SymmTensor>("d_stress_dT")),
48  _component(getParam<unsigned int>("component")),
49  _temp_coupled(isCoupled("temp")),
50  _temp_var(_temp_coupled ? coupled("temp") : 0)
51 {
52  mooseDeprecated(name(), ": StressDivergenceRSpherical is deprecated. \
53  The solid_mechanics module will be removed from MOOSE on July 31, 2020. \
54  Please update your input files to utilize the tensor_mechanics equivalents of \
55  models based on solid_mechanics. A detailed migration guide that was developed \
56  for BISON, but which is generally applicable to any MOOSE model is available at: \
57  https://mooseframework.org/bison/tutorials/mechanics_conversion/overview.html");
58 }
59 
60 Real
62 {
63  Real div(0);
64  if (_component == 0)
65  {
66  div = _grad_test[_i][_qp](0) * _stress[_qp].xx() +
67  _test[_i][_qp] / _q_point[_qp](0) * _stress[_qp].yy() +
68  _test[_i][_qp] / _q_point[_qp](0) * _stress[_qp].zz();
69  }
70  return div;
71 }
72 
73 Real
75 {
76  Real val(1);
77  if (_component == 0)
78  {
79  SymmTensor test, phi;
80  test.xx() = _grad_test[_i][_qp](0);
81  test.yy() = _test[_i][_qp] / _q_point[_qp](0);
82  test.zz() = test.yy();
83  phi.xx() = _grad_phi[_j][_qp](0);
84  phi.yy() = _phi[_j][_qp] / _q_point[_qp](0);
85  phi.zz() = phi.yy();
86 
87  SymmTensor tmp(_Jacobian_mult[_qp] * phi);
88  val = test.doubleContraction(tmp);
89  }
90  else if (_i != _j)
91  {
92  val = 0;
93  }
94  return val;
95 }
96 
97 Real
99 {
100 
101  if (_temp_coupled && jvar == _temp_var)
102  {
103  SymmTensor test;
104  test.xx() = _grad_test[_i][_qp](0);
105  test.yy() = _test[_i][_qp] / _q_point[_qp](0);
106  test.zz() = test.yy();
107  return _d_stress_dT[_qp].doubleContraction(test) * _phi[_j][_qp];
108  }
109 
110  return 0;
111 }
SymmElasticityTensor.h
SymmTensor::xx
Real xx() const
Definition: SymmTensor.h:131
validParams< StressDivergenceRSpherical >
InputParameters validParams< StressDivergenceRSpherical >()
Definition: StressDivergenceRSpherical.C:19
SymmTensor::zz
Real zz() const
Definition: SymmTensor.h:133
StressDivergenceRSpherical::computeQpOffDiagJacobian
virtual Real computeQpOffDiagJacobian(unsigned int jvar)
Definition: StressDivergenceRSpherical.C:98
StressDivergenceRSpherical::_d_stress_dT
const MaterialProperty< SymmTensor > & _d_stress_dT
Definition: StressDivergenceRSpherical.h:33
SymmTensor::doubleContraction
Real doubleContraction(const SymmTensor &rhs) const
Definition: SymmTensor.h:259
StressDivergenceRSpherical::_temp_var
const unsigned int _temp_var
Definition: StressDivergenceRSpherical.h:38
StressDivergenceRSpherical::_temp_coupled
const bool _temp_coupled
Definition: StressDivergenceRSpherical.h:37
StressDivergenceRSpherical::computeQpResidual
virtual Real computeQpResidual()
Definition: StressDivergenceRSpherical.C:61
SymmElasticityTensor
This class defines a basic set of capabilities any elasticity tensor should have.
Definition: SymmElasticityTensor.h:55
StressDivergenceRSpherical
Definition: StressDivergenceRSpherical.h:18
StressDivergenceRSpherical::_Jacobian_mult
const MaterialProperty< SymmElasticityTensor > & _Jacobian_mult
Definition: StressDivergenceRSpherical.h:32
StressDivergenceRSpherical.h
name
const std::string name
Definition: Setup.h:21
StressDivergenceRSpherical::computeQpJacobian
virtual Real computeQpJacobian()
Definition: StressDivergenceRSpherical.C:74
SymmTensor
Definition: SymmTensor.h:21
StressDivergenceRSpherical::StressDivergenceRSpherical
StressDivergenceRSpherical(const InputParameters &parameters)
Definition: StressDivergenceRSpherical.C:43
StressDivergenceRSpherical::_stress
const MaterialProperty< SymmTensor > & _stress
Definition: StressDivergenceRSpherical.h:31
SymmTensor::yy
Real yy() const
Definition: SymmTensor.h:132
StressDivergenceRSpherical::_component
const unsigned int _component
Definition: StressDivergenceRSpherical.h:36
registerMooseObjectDeprecated
registerMooseObjectDeprecated("SolidMechanicsApp", StressDivergenceRSpherical, "07/30/2020 24:00")