19 "Calculates the advection velocity of grain due to rigid body translation and rotation");
21 "translation_constant", 1.0,
"constant value characterizing grain translation");
22 params.
addParam<Real>(
"rotation_constant", 1.0,
"constant value characterizing grain rotation");
23 params.
addParam<UserObjectName>(
"grain_tracker_object",
24 "userobject for getting volume and center of mass of grains");
25 params.
addParam<VectorPostprocessorName>(
"grain_volumes",
26 "The feature volume VectorPostprocessorValue.");
27 params.
addParam<UserObjectName>(
"grain_force",
28 "userobject for getting force and torque acting on grains");
30 params.
addParam<
MooseEnum>(
"component", component,
"The gradient component to compute");
37 _grain_volumes(getVectorPostprocessorValue(
"grain_volumes",
"feature_volumes")),
39 _grain_forces(_grain_force_torque.getForceValues()),
40 _grain_torques(_grain_force_torque.getTorqueValues()),
41 _mt(getParam<Real>(
"translation_constant")),
42 _mr(getParam<Real>(
"rotation_constant")),
43 _component(getParam<
MooseEnum>(
"component"))
46 mooseError(
"Advection velocity can be assigned to elemental variables only.");
57 mooseAssert(grain_id <
_grain_volumes.size(),
"grain index is out of bounds");
61 const RealGradient velocity_translation =
_mt / volume *
_grain_forces[grain_id];
62 const RealGradient velocity_rotation =
registerMooseObject("PhaseFieldApp", GrainAdvectionAux)
const Elem *const & _current_elem
static InputParameters validParams()
Calculates the advection velocity of grain due to rigid body motion Reports the components of the vel...
GrainAdvectionAux(const InputParameters ¶meters)
static InputParameters validParams()
const std::vector< RealGradient > & _grain_forces
const Real _mr
constant value corresponding to grain rotation
virtual Real computeValue()
output the component of advection velocity
const VectorPostprocessorValue & _grain_volumes
The grain volumes.
const Real _mt
constant value corresponding to grain translation
RealGradient _velocity_advection
const std::vector< RealGradient > & _grain_torques
const GrainTrackerInterface & _grain_tracker
getting userobject for calculating grain centers and volumes
virtual void precalculateValue()
calculate the advection velocity
This class provides interface for extracting the forces and torques computed in other UserObjects.
This class defines the interface for the GrainTracking objects.
virtual Point getGrainCentroid(unsigned int grain_id) const =0
Returns the centroid for the given grain number.
virtual Real getEntityValue(dof_id_type entity_id, FeatureFloodCount::FieldType, std::size_t var_index=0) const =0
Accessor for retrieving either nodal or elemental information (unique grains or variable indicies)
void mooseError(Args &&... args) const