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 27 of file GrainAdvectionAux.h.

Constructor & Destructor Documentation

◆ GrainAdvectionAux()

GrainAdvectionAux::GrainAdvectionAux ( const InputParameters &  parameters)

Definition at line 35 of file GrainAdvectionAux.C.

36  : AuxKernel(parameters),
37  _grain_tracker(getUserObject<GrainTrackerInterface>("grain_tracker_object")),
38  _grain_volumes(getVectorPostprocessorValue("grain_volumes", "feature_volumes")),
39  _grain_force_torque(getUserObject<GrainForceAndTorqueInterface>("grain_force")),
42  _mt(getParam<Real>("translation_constant")),
43  _mr(getParam<Real>("rotation_constant")),
44  _component(getParam<MooseEnum>("component"))
45 {
46  if (isNodal())
47  mooseError("Advection velocity can be assigned to elemental variables only.");
48 }
const Real _mr
constant value corresponding to grain rotation
const Real _mt
constant value corresponding to grain translation
virtual const std::vector< RealGradient > & getTorqueValues() const =0
const GrainForceAndTorqueInterface & _grain_force_torque
getting userobject for calculating grain forces and torques
virtual const std::vector< RealGradient > & getForceValues() const =0
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
const std::vector< RealGradient > & _grain_forces

Member Function Documentation

◆ computeValue()

Real GrainAdvectionAux::computeValue ( )
protectedvirtual

output the component of advection velocity

Definition at line 72 of file GrainAdvectionAux.C.

73 {
75 }
RealGradient _velocity_advection

◆ precalculateValue()

void GrainAdvectionAux::precalculateValue ( )
protectedvirtual

calculate the advection velocity

Definition at line 51 of file GrainAdvectionAux.C.

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

Member Data Documentation

◆ _component

MooseEnum GrainAdvectionAux::_component
private

Definition at line 57 of file GrainAdvectionAux.h.

Referenced by computeValue().

◆ _grain_force_torque

const GrainForceAndTorqueInterface& GrainAdvectionAux::_grain_force_torque
protected

getting userobject for calculating grain forces and torques

Definition at line 45 of file GrainAdvectionAux.h.

◆ _grain_forces

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

Definition at line 46 of file GrainAdvectionAux.h.

Referenced by precalculateValue().

◆ _grain_torques

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

Definition at line 47 of file GrainAdvectionAux.h.

Referenced by precalculateValue().

◆ _grain_tracker

const GrainTrackerInterface& GrainAdvectionAux::_grain_tracker
protected

getting userobject for calculating grain centers and volumes

Definition at line 39 of file GrainAdvectionAux.h.

Referenced by precalculateValue().

◆ _grain_volumes

const VectorPostprocessorValue& GrainAdvectionAux::_grain_volumes
protected

The grain volumes.

Definition at line 42 of file GrainAdvectionAux.h.

Referenced by precalculateValue().

◆ _mr

const Real GrainAdvectionAux::_mr
private

constant value corresponding to grain rotation

Definition at line 54 of file GrainAdvectionAux.h.

Referenced by precalculateValue().

◆ _mt

const Real GrainAdvectionAux::_mt
private

constant value corresponding to grain translation

Definition at line 51 of file GrainAdvectionAux.h.

Referenced by precalculateValue().

◆ _velocity_advection

RealGradient GrainAdvectionAux::_velocity_advection
private

Definition at line 56 of file GrainAdvectionAux.h.

Referenced by computeValue(), and precalculateValue().


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