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

This Material calculates the force density acting on a particle/grain due to interaction between particles. More...

#include <ForceDensityMaterial.h>

Inheritance diagram for ForceDensityMaterial:
[legend]

Public Member Functions

 ForceDensityMaterial (const InputParameters &parameters)
 

Protected Member Functions

virtual void computeQpProperties ()
 

Private Attributes

const VariableValue & _c
 concentration field considered to be the density of particles More...
 
VariableName _c_name
 
Real _ceq
 equilibrium density at the grain boundaries More...
 
Real _cgb
 thresold value for identifying grain boundaries More...
 
Real _k
 stiffness constant More...
 
unsigned int _op_num
 
std::vector< const VariableValue * > _vals
 
std::vector< const VariableGradient * > _grad_vals
 
std::vector< VariableName > _vals_name
 
std::vector< Real > _product_etas
 
std::vector< RealGradient > _sum_grad_etas
 
std::string _base_name
 type of force density material More...
 
MaterialProperty< std::vector< RealGradient > > & _dF
 force density material More...
 
MaterialProperty< std::vector< RealGradient > > & _dFdc
 first order derivative of force density material w.r.t c More...
 
std::vector< MaterialProperty< std::vector< Real > > * > _dFdgradeta
 first order derivative of force density material w.r.t etas More...
 

Detailed Description

This Material calculates the force density acting on a particle/grain due to interaction between particles.

Definition at line 23 of file ForceDensityMaterial.h.

Constructor & Destructor Documentation

ForceDensityMaterial::ForceDensityMaterial ( const InputParameters &  parameters)

Definition at line 23 of file ForceDensityMaterial.C.

24  : DerivativeMaterialInterface<Material>(parameters),
25  _c(coupledValue("c")),
26  _c_name(getVar("c", 0)->name()),
27  _ceq(getParam<Real>("ceq")),
28  _cgb(getParam<Real>("cgb")),
29  _k(getParam<Real>("k")),
30  _op_num(coupledComponents(
31  "etas")), // determine number of grains from the number of names passed in.
32  _vals(_op_num), // Size variable arrays
37  _dF(declareProperty<std::vector<RealGradient>>("force_density")),
38  _dFdc(declarePropertyDerivative<std::vector<RealGradient>>("force_density", _c_name)),
40 {
41  // Loop through grains and load coupled variables into the arrays
42  for (unsigned int i = 0; i < _op_num; ++i)
43  {
44  _vals[i] = &coupledValue("etas", i);
45  _grad_vals[i] = &coupledGradient("etas", i);
46  _vals_name[i] = getVar("etas", i)->name();
47  _dFdgradeta[i] = &declarePropertyDerivative<std::vector<Real>>("force_density", _vals_name[i]);
48  }
49 }
MaterialProperty< std::vector< RealGradient > > & _dFdc
first order derivative of force density material w.r.t c
std::vector< const VariableGradient * > _grad_vals
std::vector< MaterialProperty< std::vector< Real > > * > _dFdgradeta
first order derivative of force density material w.r.t etas
std::vector< RealGradient > _sum_grad_etas
std::vector< Real > _product_etas
const VariableValue & _c
concentration field considered to be the density of particles
std::vector< const VariableValue * > _vals
Real _k
stiffness constant
MaterialProperty< std::vector< RealGradient > > & _dF
force density material
std::vector< VariableName > _vals_name
Real _ceq
equilibrium density at the grain boundaries
Real _cgb
thresold value for identifying grain boundaries

Member Function Documentation

void ForceDensityMaterial::computeQpProperties ( )
protectedvirtual

Definition at line 52 of file ForceDensityMaterial.C.

53 {
54  _dF[_qp].resize(_op_num);
55  _dFdc[_qp].resize(_op_num);
56 
57  for (unsigned int i = 0; i < _op_num; ++i)
58  {
59  _sum_grad_etas[i] = 0.0;
60  for (unsigned int j = 0; j < _op_num; ++j)
61  if (j != i)
62  {
63  _product_etas[i] = (*_vals[i])[_qp] * (*_vals[j])[_qp] >= _cgb ? 1.0 : 0.0;
64  _sum_grad_etas[i] += _product_etas[i] * ((*_grad_vals[i])[_qp] - (*_grad_vals[j])[_qp]);
65  }
66  _dF[_qp][i] = _k * (_c[_qp] - _ceq) * _sum_grad_etas[i];
67  _dFdc[_qp][i] = _k * _sum_grad_etas[i];
68  }
69 
70  for (unsigned int i = 0; i < _op_num; ++i)
71  {
72  (*_dFdgradeta[i])[_qp].resize(_op_num);
73  for (unsigned int j = 0; j < _op_num; ++j)
74  {
75  for (unsigned int k = 0; k < _op_num; ++k)
76  if (k != j)
77  _product_etas[j] = (*_vals[j])[_qp] * (*_vals[k])[_qp] >= _cgb ? 1.0 : 0.0;
78 
79  if (j == i)
80  (*_dFdgradeta[i])[_qp][j] = _k * _product_etas[j] * (_c[_qp] - _ceq);
81  else
82  (*_dFdgradeta[i])[_qp][j] = -_k * _product_etas[j] * (_c[_qp] - _ceq);
83  }
84  }
85 }
MaterialProperty< std::vector< RealGradient > > & _dFdc
first order derivative of force density material w.r.t c
std::vector< const VariableGradient * > _grad_vals
std::vector< MaterialProperty< std::vector< Real > > * > _dFdgradeta
first order derivative of force density material w.r.t etas
std::vector< RealGradient > _sum_grad_etas
std::vector< Real > _product_etas
const VariableValue & _c
concentration field considered to be the density of particles
std::vector< const VariableValue * > _vals
Real _k
stiffness constant
MaterialProperty< std::vector< RealGradient > > & _dF
force density material
Real _ceq
equilibrium density at the grain boundaries
Real _cgb
thresold value for identifying grain boundaries

Member Data Documentation

std::string ForceDensityMaterial::_base_name
private

type of force density material

Definition at line 51 of file ForceDensityMaterial.h.

const VariableValue& ForceDensityMaterial::_c
private

concentration field considered to be the density of particles

Definition at line 33 of file ForceDensityMaterial.h.

Referenced by computeQpProperties().

VariableName ForceDensityMaterial::_c_name
private

Definition at line 34 of file ForceDensityMaterial.h.

Real ForceDensityMaterial::_ceq
private

equilibrium density at the grain boundaries

Definition at line 36 of file ForceDensityMaterial.h.

Referenced by computeQpProperties().

Real ForceDensityMaterial::_cgb
private

thresold value for identifying grain boundaries

Definition at line 38 of file ForceDensityMaterial.h.

Referenced by computeQpProperties().

MaterialProperty<std::vector<RealGradient> >& ForceDensityMaterial::_dF
private

force density material

Definition at line 54 of file ForceDensityMaterial.h.

Referenced by computeQpProperties().

MaterialProperty<std::vector<RealGradient> >& ForceDensityMaterial::_dFdc
private

first order derivative of force density material w.r.t c

Definition at line 56 of file ForceDensityMaterial.h.

Referenced by computeQpProperties().

std::vector<MaterialProperty<std::vector<Real> > *> ForceDensityMaterial::_dFdgradeta
private

first order derivative of force density material w.r.t etas

Definition at line 58 of file ForceDensityMaterial.h.

Referenced by computeQpProperties(), and ForceDensityMaterial().

std::vector<const VariableGradient *> ForceDensityMaterial::_grad_vals
private

Definition at line 44 of file ForceDensityMaterial.h.

Referenced by computeQpProperties(), and ForceDensityMaterial().

Real ForceDensityMaterial::_k
private

stiffness constant

Definition at line 40 of file ForceDensityMaterial.h.

Referenced by computeQpProperties().

unsigned int ForceDensityMaterial::_op_num
private

Definition at line 42 of file ForceDensityMaterial.h.

Referenced by computeQpProperties(), and ForceDensityMaterial().

std::vector<Real> ForceDensityMaterial::_product_etas
private

Definition at line 47 of file ForceDensityMaterial.h.

Referenced by computeQpProperties().

std::vector<RealGradient> ForceDensityMaterial::_sum_grad_etas
private

Definition at line 48 of file ForceDensityMaterial.h.

Referenced by computeQpProperties().

std::vector<const VariableValue *> ForceDensityMaterial::_vals
private

Definition at line 43 of file ForceDensityMaterial.h.

Referenced by computeQpProperties(), and ForceDensityMaterial().

std::vector<VariableName> ForceDensityMaterial::_vals_name
private

Definition at line 45 of file ForceDensityMaterial.h.

Referenced by ForceDensityMaterial().


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