13 #include "libmesh/quadrature.h"
23 params.addClassDescription(
24 "Calculate stress divergence for an axisymmetric problem in cylindrical coordinates.");
25 params.addRequiredRangeCheckedParam<
unsigned int>(
28 "An integer corresponding to the direction the variable this kernel acts in. (0 "
29 "refers to the radial and 1 to the axial displacement.)");
30 params.set<
bool>(
"use_displaced_mesh") =
true;
42 if (getBlockCoordSystem() != Moose::COORD_RZ)
43 mooseError(
"The coordinate system in the Problem block must be set to RZ for axisymmetric "
46 if (getBlockCoordSystem() == Moose::COORD_RZ && _fe_problem.getAxisymmetricRadialCoord() != 0)
47 mooseError(
"rz_coord_axis=Y is the only supported option for StressDivergenceRZTensors");
56 div = _grad_test[_i][_qp](0) *
_stress[_qp](0, 0) +
57 +(_test[_i][_qp] / _q_point[_qp](0)) *
_stress[_qp](2, 2) +
58 +_grad_test[_i][_qp](1) *
_stress[_qp](0, 1);
62 div += (
_avg_grad_test[_i][0] - _grad_test[_i][_qp](0) - _test[_i][_qp] / _q_point[_qp](0)) *
67 div = _grad_test[_i][_qp](1) *
_stress[_qp](1, 1) +
68 +_grad_test[_i][_qp](0) *
_stress[_qp](1, 0);
75 mooseError(
"Invalid component for this AxisymmetricRZ problem.");
89 for (
unsigned int i = 0; i <
_ndisp; ++i)
100 for (
unsigned k = 0; k < LIBMESH_DIM; ++k)
101 for (
unsigned l = 0; l < LIBMESH_DIM; ++l)
102 jac -= (_grad_test[_i][_qp](0) *
_Jacobian_mult[_qp](0, 0, k, l) +
103 _test[_i][_qp] / _q_point[_qp](0) *
_Jacobian_mult[_qp](2, 2, k, l) +
105 (*_deigenstrain_dT)[_qp](k, l);
106 return jac * _phi[_j][_qp];
110 for (
unsigned k = 0; k < LIBMESH_DIM; ++k)
111 for (
unsigned l = 0; l < LIBMESH_DIM; ++l)
112 jac -= (_grad_test[_i][_qp](1) *
_Jacobian_mult[_qp](1, 1, k, l) +
114 (*_deigenstrain_dT)[_qp](k, l);
115 return jac * _phi[_j][_qp];
127 Real first_term = 0.0;
131 test(0) = _grad_test[_i][_qp](0);
132 test(1) = _grad_test[_i][_qp](1);
133 test_z(2) = _test[_i][_qp] / _q_point[_qp](0);
137 test(0) = _grad_test[_i][_qp](0);
138 test(1) = _grad_test[_i][_qp](1);
143 phi(0) = _grad_phi[_j][_qp](0);
144 phi(1) = _grad_phi[_j][_qp](1);
145 phi_z(2) = _phi[_j][_qp] / _q_point[_qp](0);
149 phi(0) = _grad_phi[_j][_qp](0);
150 phi(1) = _grad_phi[_j][_qp](1);
165 first_term = first_sum + second_sum + mixed_sum1 + mixed_sum2;
167 else if (ivar == 0 && jvar == 1)
174 first_term = first_sum + mixed_sum2;
176 else if (ivar == 1 && jvar == 0)
183 first_term = second_sum + mixed_sum1;
185 else if (ivar == 1 && jvar == 1)
189 mooseError(
"Invalid component in Jacobian Calculation");
200 new_test(0) = _grad_test[_i][_qp](0) + _test[_i][_qp] / _q_point[_qp](0);
201 new_test(1) = _grad_test[_i][_qp](1);
202 new_phi(0) = _grad_phi[_j][_qp](0) + _phi[_j][_qp] / _q_point[_qp](0);
203 new_phi(1) = _grad_phi[_j][_qp](1);
211 if (ivar == 0 && jvar == 0)
212 val += (sum_3x1(0) * test(0) + sum_3x1(2) * test_z(2)) * (
_avg_grad_phi[_j][0] - new_phi(0));
213 else if (ivar == 0 && jvar == 1)
214 val += (sum_3x1(0) * test(0) + sum_3x1(2) * test_z(2)) * (
_avg_grad_phi[_j][1] - new_phi(1));
215 else if (ivar == 1 && jvar == 0)
216 val += sum_3x1(1) * test(1) * (
_avg_grad_phi[_j][0] - new_phi(0));
218 val += sum_3x1(1) * test(1) * (
_avg_grad_phi[_j][1] - new_phi(1));
223 for (
unsigned int i = 0; i < 3; ++i)
229 for (
unsigned int i = 0; i < 3; ++i)
235 return val / 3.0 + first_term;
243 for (_i = 0; _i < _test.size(); ++_i)
247 for (_qp = 0; _qp < _qrule->n_points(); ++_qp)
251 (_grad_test[_i][_qp](
_component) + _test[_i][_qp] / _q_point[_qp](0)) * _JxW[_qp] *
264 for (_i = 0; _i < _phi.size(); ++_i)
270 for (_qp = 0; _qp < _qrule->n_points(); ++_qp)
274 (_grad_phi[_i][_qp](
component) + _phi[_i][_qp] / _q_point[_qp](0)) * _JxW[_qp] *