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 26 of file ForceDensityMaterial.h.

Constructor & Destructor Documentation

◆ ForceDensityMaterial()

ForceDensityMaterial::ForceDensityMaterial ( const InputParameters &  parameters)

Definition at line 28 of file ForceDensityMaterial.C.

29  : DerivativeMaterialInterface<Material>(parameters),
30  _c(coupledValue("c")),
31  _c_name(getVar("c", 0)->name()),
32  _ceq(getParam<Real>("ceq")),
33  _cgb(getParam<Real>("cgb")),
34  _k(getParam<Real>("k")),
35  _op_num(coupledComponents(
36  "etas")), // determine number of grains from the number of names passed in.
37  _vals(_op_num), // Size variable arrays
42  _dF(declareProperty<std::vector<RealGradient>>("force_density")),
43  _dFdc(declarePropertyDerivative<std::vector<RealGradient>>("force_density", _c_name)),
45 {
46  // Loop through grains and load coupled variables into the arrays
47  for (unsigned int i = 0; i < _op_num; ++i)
48  {
49  _vals[i] = &coupledValue("etas", i);
50  _grad_vals[i] = &coupledGradient("etas", i);
51  _vals_name[i] = getVar("etas", i)->name();
52  _dFdgradeta[i] = &declarePropertyDerivative<std::vector<Real>>("force_density", _vals_name[i]);
53  }
54 }
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

◆ computeQpProperties()

void ForceDensityMaterial::computeQpProperties ( )
protectedvirtual

Definition at line 57 of file ForceDensityMaterial.C.

58 {
59  _dF[_qp].resize(_op_num);
60  _dFdc[_qp].resize(_op_num);
61 
62  for (unsigned int i = 0; i < _op_num; ++i)
63  {
64  _sum_grad_etas[i] = 0.0;
65  for (unsigned int j = 0; j < _op_num; ++j)
66  if (j != i)
67  {
68  _product_etas[i] = (*_vals[i])[_qp] * (*_vals[j])[_qp] >= _cgb ? 1.0 : 0.0;
69  _sum_grad_etas[i] += _product_etas[i] * ((*_grad_vals[i])[_qp] - (*_grad_vals[j])[_qp]);
70  }
71  _dF[_qp][i] = _k * (_c[_qp] - _ceq) * _sum_grad_etas[i];
72  _dFdc[_qp][i] = _k * _sum_grad_etas[i];
73  }
74 
75  for (unsigned int i = 0; i < _op_num; ++i)
76  {
77  (*_dFdgradeta[i])[_qp].resize(_op_num);
78  for (unsigned int j = 0; j < _op_num; ++j)
79  {
80  for (unsigned int k = 0; k < _op_num; ++k)
81  if (k != j)
82  _product_etas[j] = (*_vals[j])[_qp] * (*_vals[k])[_qp] >= _cgb ? 1.0 : 0.0;
83 
84  if (j == i)
85  (*_dFdgradeta[i])[_qp][j] = _k * _product_etas[j] * (_c[_qp] - _ceq);
86  else
87  (*_dFdgradeta[i])[_qp][j] = -_k * _product_etas[j] * (_c[_qp] - _ceq);
88  }
89  }
90 }
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

◆ _base_name

std::string ForceDensityMaterial::_base_name
private

type of force density material

Definition at line 54 of file ForceDensityMaterial.h.

◆ _c

const VariableValue& ForceDensityMaterial::_c
private

concentration field considered to be the density of particles

Definition at line 36 of file ForceDensityMaterial.h.

Referenced by computeQpProperties().

◆ _c_name

VariableName ForceDensityMaterial::_c_name
private

Definition at line 37 of file ForceDensityMaterial.h.

◆ _ceq

Real ForceDensityMaterial::_ceq
private

equilibrium density at the grain boundaries

Definition at line 39 of file ForceDensityMaterial.h.

Referenced by computeQpProperties().

◆ _cgb

Real ForceDensityMaterial::_cgb
private

thresold value for identifying grain boundaries

Definition at line 41 of file ForceDensityMaterial.h.

Referenced by computeQpProperties().

◆ _dF

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

force density material

Definition at line 57 of file ForceDensityMaterial.h.

Referenced by computeQpProperties().

◆ _dFdc

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

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

Definition at line 59 of file ForceDensityMaterial.h.

Referenced by computeQpProperties().

◆ _dFdgradeta

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

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

Definition at line 61 of file ForceDensityMaterial.h.

Referenced by computeQpProperties(), and ForceDensityMaterial().

◆ _grad_vals

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

Definition at line 47 of file ForceDensityMaterial.h.

Referenced by computeQpProperties(), and ForceDensityMaterial().

◆ _k

Real ForceDensityMaterial::_k
private

stiffness constant

Definition at line 43 of file ForceDensityMaterial.h.

Referenced by computeQpProperties().

◆ _op_num

unsigned int ForceDensityMaterial::_op_num
private

Definition at line 45 of file ForceDensityMaterial.h.

Referenced by computeQpProperties(), and ForceDensityMaterial().

◆ _product_etas

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

Definition at line 50 of file ForceDensityMaterial.h.

Referenced by computeQpProperties().

◆ _sum_grad_etas

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

Definition at line 51 of file ForceDensityMaterial.h.

Referenced by computeQpProperties().

◆ _vals

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

Definition at line 46 of file ForceDensityMaterial.h.

Referenced by computeQpProperties(), and ForceDensityMaterial().

◆ _vals_name

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

Definition at line 48 of file ForceDensityMaterial.h.

Referenced by ForceDensityMaterial().


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