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

This Material calculates the advection velocity, it's divergence and derivatives acting on a particle/grain. More...

#include <GrainAdvectionVelocity.h>

Inheritance diagram for GrainAdvectionVelocity:
[legend]

Public Member Functions

 GrainAdvectionVelocity (const InputParameters &parameters)
 

Protected Member Functions

virtual void computeQpProperties ()
 

Protected Attributes

const GrainTrackerInterface_grain_tracker
 getting userobject for calculating grain centers and volumes More...
 
const GrainForceAndTorqueInterface_grain_force_torque
 getting userobject for calculating grain forces and torques More...
 
const VectorPostprocessorValue & _grain_volumes
 The grain volumes. 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...
 
const unsigned int _op_num
 
std::string _base_name
 type of force density material More...
 
MaterialProperty< std::vector< RealGradient > > & _velocity_advection
 Material storing advection velocities of grains. More...
 

Detailed Description

This Material calculates the advection velocity, it's divergence and derivatives acting on a particle/grain.

Definition at line 25 of file GrainAdvectionVelocity.h.

Constructor & Destructor Documentation

GrainAdvectionVelocity::GrainAdvectionVelocity ( const InputParameters &  parameters)

Definition at line 34 of file GrainAdvectionVelocity.C.

35  : DerivativeMaterialInterface<Material>(parameters),
36  _grain_tracker(getUserObject<GrainTrackerInterface>("grain_data")),
37  _grain_force_torque(getUserObject<GrainForceAndTorqueInterface>("grain_force")),
38  _grain_volumes(getVectorPostprocessorValue("grain_volumes", "feature_volumes")),
41  _mt(getParam<Real>("translation_constant")),
42  _mr(getParam<Real>("rotation_constant")),
43  _op_num(coupledComponents("etas")),
44  _base_name(isParamValid("base_name") ? getParam<std::string>("base_name") + "_" : ""),
46  declareProperty<std::vector<RealGradient>>(_base_name + "advection_velocity"))
47 {
48  mooseDeprecated("Use GrainAdvectionAux for visualizing advection velocities.");
49 }
std::string _base_name
type of force density material
const Real _mt
constant value corresponding to grain translation
const VectorPostprocessorValue & _grain_volumes
The grain volumes.
MaterialProperty< std::vector< RealGradient > > & _velocity_advection
Material storing advection velocities of grains.
virtual const std::vector< RealGradient > & getTorqueValues() const =0
const std::vector< RealGradient > & _grain_forces
const GrainTrackerInterface & _grain_tracker
getting userobject for calculating grain centers and volumes
virtual const std::vector< RealGradient > & getForceValues() const =0
const Real _mr
constant value corresponding to grain rotation
const std::vector< RealGradient > & _grain_torques
const GrainForceAndTorqueInterface & _grain_force_torque
getting userobject for calculating grain forces and torques

Member Function Documentation

void GrainAdvectionVelocity::computeQpProperties ( )
protectedvirtual

Definition at line 52 of file GrainAdvectionVelocity.C.

53 {
54  auto grain_num = _grain_tracker.getTotalFeatureCount();
55  const auto & op_to_grains = _grain_tracker.getVarToFeatureVector(_current_elem->id());
56 
57  _velocity_advection[_qp].resize(grain_num);
58 
59  for (unsigned int i = 0; i < _grain_volumes.size(); ++i)
60  {
61  mooseAssert(i < _grain_volumes.size(), "grain index is out of bounds");
62  const auto volume = _grain_volumes[i];
63  const auto centroid = _grain_tracker.getGrainCentroid(i);
64 
65  for (unsigned int j = 0; j < _op_num; ++j)
66  if (i == op_to_grains[j])
67  {
68  const RealGradient velocity_translation = _mt / volume * _grain_forces[i];
69  const RealGradient velocity_rotation =
70  _mr / volume * (_grain_torques[i].cross(_current_elem->centroid() - centroid));
71 
72  _velocity_advection[_qp][i] = velocity_translation + velocity_rotation;
73  }
74  }
75 }
virtual Point getGrainCentroid(unsigned int grain_id) const =0
Returns the centroid for the given grain number.
virtual std::size_t getTotalFeatureCount() const =0
Returns a number large enough to contain the largest ID for all grains in use.
const Real _mt
constant value corresponding to grain translation
const VectorPostprocessorValue & _grain_volumes
The grain volumes.
virtual const std::vector< unsigned int > & getVarToFeatureVector(dof_id_type elem_id) const =0
Returns a list of active unique feature ids for a particular element.
MaterialProperty< std::vector< RealGradient > > & _velocity_advection
Material storing advection velocities of grains.
const std::vector< RealGradient > & _grain_forces
const GrainTrackerInterface & _grain_tracker
getting userobject for calculating grain centers and volumes
const Real _mr
constant value corresponding to grain rotation
const std::vector< RealGradient > & _grain_torques

Member Data Documentation

std::string GrainAdvectionVelocity::_base_name
private

type of force density material

Definition at line 54 of file GrainAdvectionVelocity.h.

const GrainForceAndTorqueInterface& GrainAdvectionVelocity::_grain_force_torque
protected

getting userobject for calculating grain forces and torques

Definition at line 37 of file GrainAdvectionVelocity.h.

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

Definition at line 42 of file GrainAdvectionVelocity.h.

Referenced by computeQpProperties().

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

Definition at line 43 of file GrainAdvectionVelocity.h.

Referenced by computeQpProperties().

const GrainTrackerInterface& GrainAdvectionVelocity::_grain_tracker
protected

getting userobject for calculating grain centers and volumes

Definition at line 34 of file GrainAdvectionVelocity.h.

Referenced by computeQpProperties().

const VectorPostprocessorValue& GrainAdvectionVelocity::_grain_volumes
protected

The grain volumes.

Definition at line 40 of file GrainAdvectionVelocity.h.

Referenced by computeQpProperties().

const Real GrainAdvectionVelocity::_mr
private

constant value corresponding to grain rotation

Definition at line 49 of file GrainAdvectionVelocity.h.

Referenced by computeQpProperties().

const Real GrainAdvectionVelocity::_mt
private

constant value corresponding to grain translation

Definition at line 47 of file GrainAdvectionVelocity.h.

Referenced by computeQpProperties().

const unsigned int GrainAdvectionVelocity::_op_num
private

Definition at line 51 of file GrainAdvectionVelocity.h.

Referenced by computeQpProperties().

MaterialProperty<std::vector<RealGradient> >& GrainAdvectionVelocity::_velocity_advection
private

Material storing advection velocities of grains.

Definition at line 57 of file GrainAdvectionVelocity.h.

Referenced by computeQpProperties().


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