www.mooseframework.org
StressDivergenceRSpherical.C
Go to the documentation of this file.
1 /****************************************************************/
2 /* MOOSE - Multiphysics Object Oriented Simulation Environment */
3 /* */
4 /* All contents are licensed under LGPL V2.1 */
5 /* See LICENSE for full restrictions */
6 /****************************************************************/
8 
9 #include "Material.h"
10 #include "SymmElasticityTensor.h"
11 
12 template <>
13 InputParameters
15 {
16  InputParameters params = validParams<Kernel>();
17  params.addRequiredParam<unsigned int>("component",
18  "An integer corresponding to the direction "
19  "the variable this kernel acts in. (0 for r, "
20  "1 for z)");
21  params.addCoupledVar("disp_r", "The r displacement");
22  // params.addCoupledVar("disp_z", "The z displacement");
23  params.addCoupledVar("temp", "The temperature");
24 
25  params.set<bool>("use_displaced_mesh") = true;
26 
27  return params;
28 }
29 
30 StressDivergenceRSpherical::StressDivergenceRSpherical(const InputParameters & parameters)
31  : Kernel(parameters),
32  _stress(getMaterialProperty<SymmTensor>("stress")),
33  _Jacobian_mult(getMaterialProperty<SymmElasticityTensor>("Jacobian_mult")),
34  _d_stress_dT(getMaterialProperty<SymmTensor>("d_stress_dT")),
35  _component(getParam<unsigned int>("component")),
36  _temp_coupled(isCoupled("temp")),
37  _temp_var(_temp_coupled ? coupled("temp") : 0)
38 {
39 }
40 
41 Real
43 {
44  Real div(0);
45  if (_component == 0)
46  {
47  div = _grad_test[_i][_qp](0) * _stress[_qp].xx() +
48  _test[_i][_qp] / _q_point[_qp](0) * _stress[_qp].yy() +
49  _test[_i][_qp] / _q_point[_qp](0) * _stress[_qp].zz();
50  }
51  return div;
52 }
53 
54 Real
56 {
57  Real val(1);
58  if (_component == 0)
59  {
60  SymmTensor test, phi;
61  test.xx() = _grad_test[_i][_qp](0);
62  test.yy() = _test[_i][_qp] / _q_point[_qp](0);
63  test.zz() = test.yy();
64  phi.xx() = _grad_phi[_j][_qp](0);
65  phi.yy() = _phi[_j][_qp] / _q_point[_qp](0);
66  phi.zz() = phi.yy();
67 
68  SymmTensor tmp(_Jacobian_mult[_qp] * phi);
69  val = test.doubleContraction(tmp);
70  }
71  else if (_i != _j)
72  {
73  val = 0;
74  }
75  return val;
76 }
77 
78 Real
80 {
81 
82  if (_temp_coupled && jvar == _temp_var)
83  {
84  SymmTensor test;
85  test.xx() = _grad_test[_i][_qp](0);
86  test.yy() = _test[_i][_qp] / _q_point[_qp](0);
87  test.zz() = test.yy();
88  return _d_stress_dT[_qp].doubleContraction(test) * _phi[_j][_qp];
89  }
90 
91  return 0;
92 }
This class defines a basic set of capabilities any elasticity tensor should have. ...
const MaterialProperty< SymmElasticityTensor > & _Jacobian_mult
Real yy() const
Definition: SymmTensor.h:130
const MaterialProperty< SymmTensor > & _stress
Real xx() const
Definition: SymmTensor.h:129
StressDivergenceRSpherical(const InputParameters &parameters)
const MaterialProperty< SymmTensor > & _d_stress_dT
Real zz() const
Definition: SymmTensor.h:131
InputParameters validParams< StressDivergenceRSpherical >()
Real doubleContraction(const SymmTensor &rhs) const
Definition: SymmTensor.h:257
virtual Real computeQpOffDiagJacobian(unsigned int jvar)