13 #include "libmesh/quadrature.h" 22 "Calculate stress divergence for an axisymmetric problem in cylindrical coordinates.");
26 "An integer corresponding to the direction the variable this kernel acts in. (0 " 27 "refers to the radial and 1 to the axial displacement.)");
28 params.
set<
bool>(
"use_displaced_mesh") =
true;
41 for (
auto eigenstrain_name : getParam<std::vector<MaterialPropertyName>>(
"eigenstrain_names"))
42 validateNonlinearCoupling<RankTwoTensor>(eigenstrain_name);
45 mooseError(
"The coordinate system in the Problem block must be set to RZ for axisymmetric " 48 if (getBlockCoordSystem() ==
Moose::COORD_RZ && _fe_problem.getAxisymmetricRadialCoord() != 0)
49 mooseError(
"rz_coord_axis=Y is the only supported option for StressDivergenceRZTensors");
58 div = _grad_test[_i][_qp](0) *
_stress[_qp](0, 0) +
59 +(_test[_i][_qp] / _q_point[_qp](0)) *
_stress[_qp](2, 2) +
60 +_grad_test[_i][_qp](1) *
_stress[_qp](0, 1);
64 div += (
_avg_grad_test[_i][0] - _grad_test[_i][_qp](0) - _test[_i][_qp] / _q_point[_qp](0)) *
69 div = _grad_test[_i][_qp](1) *
_stress[_qp](1, 1) +
70 +_grad_test[_i][_qp](0) *
_stress[_qp](1, 0);
77 mooseError(
"Invalid component for this AxisymmetricRZ problem.");
91 for (
unsigned int i = 0; i <
_ndisp; ++i)
103 total_deigenstrain += (*deigenstrain_darg)[_qp];
108 for (
unsigned k = 0;
k < LIBMESH_DIM; ++
k)
109 for (
unsigned l = 0; l < LIBMESH_DIM; ++l)
113 total_deigenstrain(
k, l);
114 return jac * _phi[_j][_qp];
118 for (
unsigned k = 0;
k < LIBMESH_DIM; ++
k)
119 for (
unsigned l = 0; l < LIBMESH_DIM; ++l)
122 total_deigenstrain(
k, l);
123 return jac * _phi[_j][_qp];
134 Real first_term = 0.0;
138 test(0) = _grad_test[_i][_qp](0);
139 test(1) = _grad_test[_i][_qp](1);
140 test_z(2) = _test[_i][_qp] / _q_point[_qp](0);
144 test(0) = _grad_test[_i][_qp](0);
145 test(1) = _grad_test[_i][_qp](1);
150 phi(0) = _grad_phi[_j][_qp](0);
151 phi(1) = _grad_phi[_j][_qp](1);
152 phi_z(2) = _phi[_j][_qp] / _q_point[_qp](0);
156 phi(0) = _grad_phi[_j][_qp](0);
157 phi(1) = _grad_phi[_j][_qp](1);
172 first_term = first_sum + second_sum + mixed_sum1 + mixed_sum2;
174 else if (ivar == 0 && jvar == 1)
181 first_term = first_sum + mixed_sum2;
183 else if (ivar == 1 && jvar == 0)
190 first_term = second_sum + mixed_sum1;
192 else if (ivar == 1 && jvar == 1)
196 mooseError(
"Invalid component in Jacobian Calculation");
207 new_test(0) = _grad_test[_i][_qp](0) + _test[_i][_qp] / _q_point[_qp](0);
208 new_test(1) = _grad_test[_i][_qp](1);
209 new_phi(0) = _grad_phi[_j][_qp](0) + _phi[_j][_qp] / _q_point[_qp](0);
210 new_phi(1) = _grad_phi[_j][_qp](1);
218 if (ivar == 0 && jvar == 0)
219 val += (sum_3x1(0) * test(0) + sum_3x1(2) * test_z(2)) * (
_avg_grad_phi[_j][0] - new_phi(0));
220 else if (ivar == 0 && jvar == 1)
221 val += (sum_3x1(0) * test(0) + sum_3x1(2) * test_z(2)) * (
_avg_grad_phi[_j][1] - new_phi(1));
222 else if (ivar == 1 && jvar == 0)
223 val += sum_3x1(1) * test(1) * (
_avg_grad_phi[_j][0] - new_phi(0));
225 val += sum_3x1(1) * test(1) * (
_avg_grad_phi[_j][1] - new_phi(1));
230 for (
unsigned int i = 0; i < 3; ++i)
236 for (
unsigned int i = 0; i < 3; ++i)
242 return val / 3.0 + first_term;
250 for (_i = 0; _i < _test.size(); ++_i)
254 for (_qp = 0; _qp < _qrule->n_points(); ++_qp)
258 (_grad_test[_i][_qp](
_component) + _test[_i][_qp] / _q_point[_qp](0)) * _JxW[_qp] *
271 for (_i = 0; _i < _phi.size(); ++_i)
277 for (_qp = 0; _qp < _qrule->n_points(); ++_qp)
281 (_grad_phi[_i][_qp](
component) + _phi[_i][_qp] / _q_point[_qp](0)) * _JxW[_qp] *
std::vector< std::vector< Real > > _avg_grad_phi
Gradient of phi function averaged over the element. Used in volumetric locking correction calculation...
bool _volumetric_locking_correction
Flag for volumetric locking correction.
void mooseError(Args &&... args)
unsigned int _ndisp
Coupled displacement variables.
std::vector< std::vector< Real > > _avg_grad_test
Gradient of test function averaged over the element. Used in volumetric locking correction calculatio...
registerMooseObject("SolidMechanicsApp", StressDivergenceRZTensors)
static const std::string component
virtual void initialSetup() override
const unsigned int _component
An integer corresponding to the direction this kernel acts in.
StressDivergenceRZTensors(const InputParameters ¶meters)
std::vector< unsigned int > _disp_var
Displacement variables IDs.
static InputParameters validParams()
StressDivergenceRZTensors is a modification of StressDivergenceTensors to accommodate the Axisymmetri...
virtual Real computeQpResidual() override
const JvarMap & getJvarMap()
std::vector< std::vector< const MaterialProperty< RankTwoTensor > * > > _deigenstrain_dargs
eigen strain derivatives wrt coupled variables
virtual Real computeQpJacobian() override
unsigned int mapJvarToCvar(unsigned int jvar)
const MaterialProperty< RankFourTensor > & _Jacobian_mult
Real calculateJacobian(unsigned int ivar, unsigned int jvar)
virtual void computeAverageGradientTest() override
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
virtual void computeAverageGradientPhi() override
static InputParameters validParams()
virtual Real computeQpOffDiagJacobian(unsigned int jvar) override
static const std::string k
const MaterialProperty< RankTwoTensor > & _stress
The stress tensor that the divergence operator operates on.
StressDivergenceTensors mostly copies from StressDivergence.