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

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

#include <ExternalForceDensityMaterial.h>

Inheritance diagram for ExternalForceDensityMaterial:
[legend]

Public Member Functions

 ExternalForceDensityMaterial (const InputParameters &parameters)
 

Protected Member Functions

virtual void computeQpProperties ()
 

Private Attributes

Function & _force_x
 
Function & _force_y
 
Function & _force_z
 
const VariableValue & _c
 concentration field considered to be the density of particles More...
 
VariableName _c_name
 
const Real _k
 stiffness constant More...
 
unsigned int _op_num
 
std::vector< const VariableValue * > _vals
 
std::vector< VariableName > _vals_name
 
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< RealGradient > > * > _dFdeta
 

Detailed Description

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

Definition at line 24 of file ExternalForceDensityMaterial.h.

Constructor & Destructor Documentation

ExternalForceDensityMaterial::ExternalForceDensityMaterial ( const InputParameters &  parameters)

Definition at line 26 of file ExternalForceDensityMaterial.C.

27  : DerivativeMaterialInterface<Material>(parameters),
28  _force_x(getFunction("force_x")),
29  _force_y(getFunction("force_y")),
30  _force_z(getFunction("force_z")),
31  _c(coupledValue("c")),
32  _c_name(getVar("c", 0)->name()),
33  _k(getParam<Real>("k")),
34  _op_num(coupledComponents(
35  "etas")), // determine number of grains from the number of names passed in.
36  _vals(_op_num), // Size variable arrays
38  _dF(declareProperty<std::vector<RealGradient>>("force_density_ext")),
39  _dFdc(declarePropertyDerivative<std::vector<RealGradient>>("force_density_ext", _c_name)),
41 {
42  // Loop through grains and load coupled variables into the arrays
43  for (unsigned int i = 0; i < _op_num; ++i)
44  {
45  _vals[i] = &coupledValue("etas", i);
46  _vals_name[i] = getVar("etas", i)->name();
47  _dFdeta[i] =
48  &declarePropertyDerivative<std::vector<RealGradient>>("force_density_ext", _vals_name[i]);
49  }
50 }
MaterialProperty< std::vector< RealGradient > > & _dFdc
first order derivative of force density material w.r.t c
std::vector< VariableName > _vals_name
const VariableValue & _c
concentration field considered to be the density of particles
const Real _k
stiffness constant
std::vector< MaterialProperty< std::vector< RealGradient > > * > _dFdeta
MaterialProperty< std::vector< RealGradient > > & _dF
force density material
std::vector< const VariableValue * > _vals

Member Function Documentation

void ExternalForceDensityMaterial::computeQpProperties ( )
protectedvirtual

Definition at line 53 of file ExternalForceDensityMaterial.C.

54 {
55  _dF[_qp].resize(_op_num);
56  _dFdc[_qp].resize(_op_num);
57 
58  for (unsigned int i = 0; i < _op_num; ++i)
59  {
60  _dF[_qp][i](0) = _k * _c[_qp] * _force_x.value(_t, _q_point[_qp]) * (*_vals[i])[_qp];
61  _dF[_qp][i](1) = _k * _c[_qp] * _force_y.value(_t, _q_point[_qp]) * (*_vals[i])[_qp];
62  _dF[_qp][i](2) = _k * _c[_qp] * _force_z.value(_t, _q_point[_qp]) * (*_vals[i])[_qp];
63 
64  _dFdc[_qp][i](0) = _k * _force_x.value(_t, _q_point[_qp]) * (*_vals[i])[_qp];
65  _dFdc[_qp][i](1) = _k * _force_y.value(_t, _q_point[_qp]) * (*_vals[i])[_qp];
66  _dFdc[_qp][i](2) = _k * _force_z.value(_t, _q_point[_qp]) * (*_vals[i])[_qp];
67  }
68 
69  for (unsigned int i = 0; i < _op_num; ++i)
70  {
71  (*_dFdeta[i])[_qp].resize(_op_num);
72  for (unsigned int j = 0; j < _op_num; ++j)
73  {
74  (*_dFdeta[i])[_qp][j](0) = _k * _c[_qp] * _force_x.value(_t, _q_point[_qp]);
75  (*_dFdeta[i])[_qp][j](1) = _k * _c[_qp] * _force_y.value(_t, _q_point[_qp]);
76  (*_dFdeta[i])[_qp][j](2) = _k * _c[_qp] * _force_z.value(_t, _q_point[_qp]);
77  }
78  }
79 }
MaterialProperty< std::vector< RealGradient > > & _dFdc
first order derivative of force density material w.r.t c
const VariableValue & _c
concentration field considered to be the density of particles
const Real _k
stiffness constant
std::vector< MaterialProperty< std::vector< RealGradient > > * > _dFdeta
MaterialProperty< std::vector< RealGradient > > & _dF
force density material
std::vector< const VariableValue * > _vals

Member Data Documentation

const VariableValue& ExternalForceDensityMaterial::_c
private

concentration field considered to be the density of particles

Definition at line 38 of file ExternalForceDensityMaterial.h.

Referenced by computeQpProperties().

VariableName ExternalForceDensityMaterial::_c_name
private

Definition at line 39 of file ExternalForceDensityMaterial.h.

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

force density material

Definition at line 48 of file ExternalForceDensityMaterial.h.

Referenced by computeQpProperties().

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

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

Definition at line 50 of file ExternalForceDensityMaterial.h.

Referenced by computeQpProperties().

std::vector<MaterialProperty<std::vector<RealGradient> > *> ExternalForceDensityMaterial::_dFdeta
private
Function& ExternalForceDensityMaterial::_force_x
private

Definition at line 33 of file ExternalForceDensityMaterial.h.

Referenced by computeQpProperties().

Function& ExternalForceDensityMaterial::_force_y
private

Definition at line 34 of file ExternalForceDensityMaterial.h.

Referenced by computeQpProperties().

Function& ExternalForceDensityMaterial::_force_z
private

Definition at line 35 of file ExternalForceDensityMaterial.h.

Referenced by computeQpProperties().

const Real ExternalForceDensityMaterial::_k
private

stiffness constant

Definition at line 41 of file ExternalForceDensityMaterial.h.

Referenced by computeQpProperties().

unsigned int ExternalForceDensityMaterial::_op_num
private
std::vector<const VariableValue *> ExternalForceDensityMaterial::_vals
private
std::vector<VariableName> ExternalForceDensityMaterial::_vals_name
private

Definition at line 45 of file ExternalForceDensityMaterial.h.

Referenced by ExternalForceDensityMaterial().


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