19 params.
addRequiredParam<std::vector<Point>>(
"rotation_centers",
"The centers of the rotation");
21 params.
addRequiredParam<std::vector<MooseFunctorName>>(
"rotation_angle_functors",
22 "The rotation angle as functor values");
24 "rotation_angle_offsets",
"Offsets of rotation angles corresponding to rotation centers");
31 "The covering angles in degree of all segments that sum to 360.\n" 32 "Order by starting segment in a counter-clock-wise direction with respect to the rotation " 34 "All rotation centers share the same segment angles.");
37 "segment_material_properties",
38 "Material properties for all the rotation segments corresponding to drum material " 41 "drum_material_properties",
"Material property names for the drums");
43 params.
addClassDescription(
"Evaluate a material property based on the material properties of all " 44 "segments of a rotating drum.");
50 _rotation_centers(parameters.
get<
std::vector<Point>>(
"rotation_centers")),
51 _rotation_axis(parameters.
get<
MooseEnum>(
"rotation_axis")),
52 _plus(_rotation_axis ==
"x" || _rotation_axis ==
"y" || _rotation_axis ==
"z"),
53 _rotation_offsets(isParamValid(
"rotation_angle_offsets")
54 ? parameters.
get<
std::vector<
Real>>(
"rotation_angle_offsets")
55 :
std::vector<
Real>(_rotation_centers.size(), 0.0)),
56 _segment_angles(parameters.
get<
std::vector<
Real>>(
"segment_angles")),
57 _n_segments(_segment_angles.size())
68 "rotation_axis",
_rotation_axis,
" requires mesh spatial dimention to be three.");
70 const auto funcs =
parameters.
get<std::vector<MooseFunctorName>>(
"rotation_angle_functors");
71 for (
const auto & func_name : funcs)
87 "Number of rotation angle functions must agree with " 88 "the size of 'rotation_centers' or be equal to one in case of all " 89 "rotation centers sharing " 94 "Size must be equal to the size of 'rotation_centers' ");
108 "Must have zero coordinate in the rotation direction");
110 const auto drum_props = getParam<std::vector<MaterialPropertyName>>(
"drum_material_properties");
111 for (
const auto & prop_name : drum_props)
114 const auto all_prop_names =
115 getParam<std::vector<std::vector<MaterialPropertyName>>>(
"segment_material_properties");
116 if (all_prop_names.size() != drum_props.size())
118 "segment_material_properties",
119 "Leading size of the 2D array must be equal to the size of 'drum_material_properties'");
120 for (
const auto & prop_names : all_prop_names)
124 "Number of segment materal properties of one drum material property must be equal " 125 "to the number of segments (",
128 std::vector<const MaterialProperty<Real> *> props;
129 for (
const auto & prop_name : prop_names)
130 props.push_back(&getMaterialPropertyByName<Real>(prop_name));
139 unsigned int rotation_id = 0;
140 Real min_dist = std::numeric_limits<Real>::max();
157 Real rotation_angle =
163 const Real vnorm =
v.norm();
168 Real ang = std::acos(
v((
_dir + 1) % 3)) * (180 / M_PI);
169 if (
v((
_dir + 2) % 3) < 0)
173 while (ang < rotation_angle)
175 while (ang - 360 >= rotation_angle)
180 ang -= rotation_angle;
184 if (ang == rotation_angle)
187 ang = rotation_angle + 360 - ang;
191 unsigned int seg_id = 0;
193 while (ang > upper_angle)
196 mooseAssert(seg_id <
_n_segments,
"Internal error: segement id");
const MooseArray< Point > & _q_point
const MooseEnum _rotation_axis
x/y/z/-x/-y/-z
virtual unsigned int spatialDimension() const
ControlDrumMaterial(const InputParameters ¶meters)
const bool _plus
Whether the rotation axis points to the positive direction, i.e. equal to x, y or z...
void paramError(const std::string ¶m, Args... args) const
const std::vector< Real > _rotation_offsets
Rotation offsets of all drums.
unsigned int _dir
Rotation direction (x/y/z - 0/1/2)
const InputParameters & parameters() const
Moose::StateArg determineState() const
const std::vector< Real > _segment_angles
Segment angles (all rotation centers share the same segment angles)
const unsigned int _n_segments
Number of rod segments.
static InputParameters validParams()
const std::vector< Point > _rotation_centers
Rotation center.
Moose::ElemArg makeElemArg(const Elem *elem, bool correct_skewnewss=false) const
virtual void computeQpProperties() override
static InputParameters validParams()
std::vector< const Moose::Functor< Real > * > _rotation_functors
Rotation angle functors of all drums.
registerMooseObject("ReactorApp", ControlDrumMaterial)
std::vector< std::vector< const MaterialProperty< Real > * > > _segment_properties
Material properties of all segments.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
This material evaluate a material property on elements on a rotating control drum from material prope...
auto index_range(const T &sizable)
const Elem & get(const ElemType type_in)
const Elem *const & _current_elem
std::vector< MaterialProperty< Real > * > _drum_properties
The properties this material evaluates.