www.mooseframework.org
Public Member Functions | Protected Member Functions | Protected Attributes | Private Attributes | List of all members
GrainAdvectionAux Class Reference

Calculates the advection velocity of grain due to rigid body motion Reports the components of the velocity on each element. More...

#include <GrainAdvectionAux.h>

Inheritance diagram for GrainAdvectionAux:
[legend]

Public Member Functions

 GrainAdvectionAux (const InputParameters &parameters)
 

Protected Member Functions

virtual void precalculateValue ()
 calculate the advection velocity More...
 
virtual Real computeValue ()
 output the component of advection velocity More...
 

Protected Attributes

const GrainTrackerInterface_grain_tracker
 getting userobject for calculating grain centers and volumes More...
 
const VectorPostprocessorValue & _grain_volumes
 The grain volumes. More...
 
const GrainForceAndTorqueInterface_grain_force_torque
 getting userobject for calculating grain forces and torques More...
 
const std::vector< RealGradient > & _grain_forces
 
const std::vector< RealGradient > & _grain_torques
 

Private Attributes

const Real _mt
 constant value corresponding to grain translation More...
 
const Real _mr
 constant value corresponding to grain rotation More...
 
RealGradient _velocity_advection
 
MooseEnum _component
 

Detailed Description

Calculates the advection velocity of grain due to rigid body motion Reports the components of the velocity on each element.

Definition at line 24 of file GrainAdvectionAux.h.

Constructor & Destructor Documentation

GrainAdvectionAux::GrainAdvectionAux ( const InputParameters &  parameters)

Definition at line 30 of file GrainAdvectionAux.C.

31  : AuxKernel(parameters),
32  _grain_tracker(getUserObject<GrainTrackerInterface>("grain_tracker_object")),
33  _grain_volumes(getVectorPostprocessorValue("grain_volumes", "feature_volumes")),
34  _grain_force_torque(getUserObject<GrainForceAndTorqueInterface>("grain_force")),
37  _mt(getParam<Real>("translation_constant")),
38  _mr(getParam<Real>("rotation_constant")),
39  _component(getParam<MooseEnum>("component"))
40 {
41  if (isNodal())
42  mooseError("Advection velocity can be assigned to elemental variables only.");
43 }
const Real _mr
constant value corresponding to grain rotation
const Real _mt
constant value corresponding to grain translation
const GrainForceAndTorqueInterface & _grain_force_torque
getting userobject for calculating grain forces and torques
const VectorPostprocessorValue & _grain_volumes
The grain volumes.
const GrainTrackerInterface & _grain_tracker
getting userobject for calculating grain centers and volumes
virtual const std::vector< RealGradient > & getTorqueValues() const =0
const std::vector< RealGradient > & _grain_torques
const std::vector< RealGradient > & _grain_forces
virtual const std::vector< RealGradient > & getForceValues() const =0

Member Function Documentation

Real GrainAdvectionAux::computeValue ( )
protectedvirtual

output the component of advection velocity

Definition at line 67 of file GrainAdvectionAux.C.

68 {
70 }
RealGradient _velocity_advection
void GrainAdvectionAux::precalculateValue ( )
protectedvirtual

calculate the advection velocity

Definition at line 46 of file GrainAdvectionAux.C.

47 {
48  // ID of unique grain at current point
49  const auto grain_id = _grain_tracker.getEntityValue(
50  _current_elem->id(), FeatureFloodCount::FieldType::UNIQUE_REGION, 0);
51  if (grain_id >= 0)
52  {
53  mooseAssert(grain_id < _grain_volumes.size(), "grain index is out of bounds");
54  const auto volume = _grain_volumes[grain_id];
55  const auto centroid = _grain_tracker.getGrainCentroid(grain_id);
56 
57  const RealGradient velocity_translation = _mt / volume * _grain_forces[grain_id];
58  const RealGradient velocity_rotation =
59  _mr / volume * (_grain_torques[grain_id].cross(_current_elem->centroid() - centroid));
60  _velocity_advection = velocity_translation + velocity_rotation;
61  }
62  else
63  _velocity_advection.zero();
64 }
virtual Point getGrainCentroid(unsigned int grain_id) const =0
Returns the centroid for the given grain number.
const Real _mr
constant value corresponding to grain rotation
const Real _mt
constant value corresponding to grain translation
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) ...
const VectorPostprocessorValue & _grain_volumes
The grain volumes.
const GrainTrackerInterface & _grain_tracker
getting userobject for calculating grain centers and volumes
const std::vector< RealGradient > & _grain_torques
RealGradient _velocity_advection
const std::vector< RealGradient > & _grain_forces

Member Data Documentation

MooseEnum GrainAdvectionAux::_component
private

Definition at line 54 of file GrainAdvectionAux.h.

Referenced by computeValue().

const GrainForceAndTorqueInterface& GrainAdvectionAux::_grain_force_torque
protected

getting userobject for calculating grain forces and torques

Definition at line 42 of file GrainAdvectionAux.h.

const std::vector<RealGradient>& GrainAdvectionAux::_grain_forces
protected

Definition at line 43 of file GrainAdvectionAux.h.

Referenced by precalculateValue().

const std::vector<RealGradient>& GrainAdvectionAux::_grain_torques
protected

Definition at line 44 of file GrainAdvectionAux.h.

Referenced by precalculateValue().

const GrainTrackerInterface& GrainAdvectionAux::_grain_tracker
protected

getting userobject for calculating grain centers and volumes

Definition at line 36 of file GrainAdvectionAux.h.

Referenced by precalculateValue().

const VectorPostprocessorValue& GrainAdvectionAux::_grain_volumes
protected

The grain volumes.

Definition at line 39 of file GrainAdvectionAux.h.

Referenced by precalculateValue().

const Real GrainAdvectionAux::_mr
private

constant value corresponding to grain rotation

Definition at line 51 of file GrainAdvectionAux.h.

Referenced by precalculateValue().

const Real GrainAdvectionAux::_mt
private

constant value corresponding to grain translation

Definition at line 48 of file GrainAdvectionAux.h.

Referenced by precalculateValue().

RealGradient GrainAdvectionAux::_velocity_advection
private

Definition at line 53 of file GrainAdvectionAux.h.

Referenced by computeValue(), and precalculateValue().


The documentation for this class was generated from the following files: