11 #include "MooseMesh.h"
21 params.addClassDescription(
22 "Compute the radial component of the displacement vector for cylindrical models.");
23 params.addRequiredCoupledVar(
25 "The displacements appropriate for the simulation geometry and coordinate system");
26 params.addParam<RealVectorValue>(
27 "origin",
"Origin of cylinder axis of rotation for 2D and 3D Cartesian models");
28 params.addParam<RealVectorValue>(
29 "axis_vector",
"Vector defining direction of cylindrical axis (3D Cartesian models)");
30 params.set<
bool>(
"use_displaced_mesh") =
false;
36 : AuxKernel(parameters), _ndisp(coupledComponents(
"displacements")), _disp_vals(_ndisp)
38 const std::set<SubdomainID> & subdomains = _mesh.meshSubdomains();
39 const auto & sbd_begin = *subdomains.begin();
40 for (
const auto & sbd : subdomains)
45 mooseError(
"RadialDisplacementCylinderAux requires that all subdomains have the same "
49 for (
unsigned int i = 0; i <
_ndisp; ++i)
50 _disp_vals[i] = &coupledValue(
"displacements", i);
52 if (
_ndisp != _mesh.dimension())
53 mooseError(
"The number of displacement variables supplied must match the mesh dimension.");
56 mooseError(
"RadialDisplacmentCylinderAux is not applicable for 1D Cartesian models");
59 mooseError(
"RadialDisplacementCylinderAux can only be used with Cartesian or axisymmetric "
60 "coordinate systems");
62 if (isParamValid(
"origin"))
65 mooseError(
"The 'origin' parameter is only valid for Cartesian models.");
67 _origin = getParam<RealVectorValue>(
"origin");
70 mooseError(
"Must specify 'origin' for models with Cartesian coordinate systems.");
72 if (isParamValid(
"axis_vector"))
75 mooseError(
"The 'axis_vector' parameter is only valid for 3D Cartesian models.");
79 if (MooseUtils::absoluteFuzzyEqual(vec_len, 0.0))
80 mooseError(
"axis_vector must have nonzero length");
84 mooseError(
"Must specify 'axis_vector' for 3D Cartesian models");
87 mooseError(
"Must run on a nodal variable");
94 Point current_point(*_current_node);
98 case Moose::COORD_XYZ:
100 RealVectorValue rad_vec;
101 const RealVectorValue disp_vec((*
_disp_vals[0])[_qp],
106 rad_vec = current_point -
_origin;
111 const RealVectorValue p1pc(current_point -
_origin);
116 rad_vec = current_point - p;
119 Real rad = rad_vec.norm();
123 rad_disp = rad_vec * disp_vec;
126 rad_disp = disp_vec.norm();
129 case Moose::COORD_RZ:
133 mooseError(
"Unsupported coordinate system");