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 28 of file GrainAdvectionVelocity.h.

Constructor & Destructor Documentation

◆ GrainAdvectionVelocity()

GrainAdvectionVelocity::GrainAdvectionVelocity ( const InputParameters &  parameters)

Definition at line 39 of file GrainAdvectionVelocity.C.

40  : DerivativeMaterialInterface<Material>(parameters),
41  _grain_tracker(getUserObject<GrainTrackerInterface>("grain_data")),
42  _grain_force_torque(getUserObject<GrainForceAndTorqueInterface>("grain_force")),
43  _grain_volumes(getVectorPostprocessorValue("grain_volumes", "feature_volumes")),
46  _mt(getParam<Real>("translation_constant")),
47  _mr(getParam<Real>("rotation_constant")),
48  _op_num(coupledComponents("etas")),
49  _base_name(isParamValid("base_name") ? getParam<std::string>("base_name") + "_" : ""),
51  declareProperty<std::vector<RealGradient>>(_base_name + "advection_velocity"))
52 {
53  mooseDeprecated("Use GrainAdvectionAux for visualizing advection velocities.");
54 }
virtual const std::vector< RealGradient > & getTorqueValues() const =0
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.
virtual const std::vector< RealGradient > & getForceValues() const =0
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
const GrainForceAndTorqueInterface & _grain_force_torque
getting userobject for calculating grain forces and torques

Member Function Documentation

◆ computeQpProperties()

void GrainAdvectionVelocity::computeQpProperties ( )
protectedvirtual

Definition at line 57 of file GrainAdvectionVelocity.C.

58 {
59  auto grain_num = _grain_tracker.getTotalFeatureCount();
60  const auto & op_to_grains = _grain_tracker.getVarToFeatureVector(_current_elem->id());
61 
62  _velocity_advection[_qp].resize(grain_num);
63 
64  for (unsigned int i = 0; i < _grain_volumes.size(); ++i)
65  {
66  mooseAssert(i < _grain_volumes.size(), "grain index is out of bounds");
67  const auto volume = _grain_volumes[i];
68  const auto centroid = _grain_tracker.getGrainCentroid(i);
69 
70  for (unsigned int j = 0; j < _op_num; ++j)
71  if (i == op_to_grains[j])
72  {
73  const RealGradient velocity_translation = _mt / volume * _grain_forces[i];
74  const RealGradient velocity_rotation =
75  _mr / volume * (_grain_torques[i].cross(_current_elem->centroid() - centroid));
76 
77  _velocity_advection[_qp][i] = velocity_translation + velocity_rotation;
78  }
79  }
80 }
virtual std::size_t getTotalFeatureCount() const =0
Returns a number large enough to contain the largest ID for all grains in use.
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.
const Real _mt
constant value corresponding to grain translation
const VectorPostprocessorValue & _grain_volumes
The grain volumes.
virtual Point getGrainCentroid(unsigned int grain_id) const =0
Returns the centroid for the given grain number.
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

◆ _base_name

std::string GrainAdvectionVelocity::_base_name
private

type of force density material

Definition at line 57 of file GrainAdvectionVelocity.h.

◆ _grain_force_torque

const GrainForceAndTorqueInterface& GrainAdvectionVelocity::_grain_force_torque
protected

getting userobject for calculating grain forces and torques

Definition at line 40 of file GrainAdvectionVelocity.h.

◆ _grain_forces

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

Definition at line 45 of file GrainAdvectionVelocity.h.

Referenced by computeQpProperties().

◆ _grain_torques

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

Definition at line 46 of file GrainAdvectionVelocity.h.

Referenced by computeQpProperties().

◆ _grain_tracker

const GrainTrackerInterface& GrainAdvectionVelocity::_grain_tracker
protected

getting userobject for calculating grain centers and volumes

Definition at line 37 of file GrainAdvectionVelocity.h.

Referenced by computeQpProperties().

◆ _grain_volumes

const VectorPostprocessorValue& GrainAdvectionVelocity::_grain_volumes
protected

The grain volumes.

Definition at line 43 of file GrainAdvectionVelocity.h.

Referenced by computeQpProperties().

◆ _mr

const Real GrainAdvectionVelocity::_mr
private

constant value corresponding to grain rotation

Definition at line 52 of file GrainAdvectionVelocity.h.

Referenced by computeQpProperties().

◆ _mt

const Real GrainAdvectionVelocity::_mt
private

constant value corresponding to grain translation

Definition at line 50 of file GrainAdvectionVelocity.h.

Referenced by computeQpProperties().

◆ _op_num

const unsigned int GrainAdvectionVelocity::_op_num
private

Definition at line 54 of file GrainAdvectionVelocity.h.

Referenced by computeQpProperties().

◆ _velocity_advection

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

Material storing advection velocities of grains.

Definition at line 60 of file GrainAdvectionVelocity.h.

Referenced by computeQpProperties().


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