www.mooseframework.org
Public Member Functions | Static Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Private Member Functions | List of all members
ACGrGrMulti Class Referenceabstract

This kernel calculates the residual for grain growth for a multi-phase, poly-crystal system. More...

#include <ACGrGrMulti.h>

Inheritance diagram for ACGrGrMulti:
[legend]

Public Member Functions

 ACGrGrMulti (const InputParameters &parameters)
 
virtual void initialSetup ()
 

Static Public Member Functions

static InputParameters validParams ()
 

Protected Types

enum  PFFunctionType
 

Protected Member Functions

virtual Real computeDFDOP (PFFunctionType type)
 
virtual Real computeQpOffDiagJacobian (unsigned int jvar)
 
virtual Real precomputeQpResidual ()
 
virtual Real precomputeQpJacobian ()
 
virtual Real computeDFDOP (PFFunctionType type)=0
 

Protected Attributes

std::vector< MaterialPropertyName > _gamma_names
 Names of gammas for each order parameter. More...
 
unsigned int _num_j
 
std::vector< const MaterialProperty< Real > * > _prop_gammas
 Values of gammas for each order parameter. More...
 
const NonlinearVariableName _uname
 
const MaterialProperty< Real > & _dmudu
 
const std::vector< VariableName > _vname
 
std::vector< const MaterialProperty< Real > * > _dmudEtaj
 
const unsigned int _op_num
 
std::vector< const VariableValue * > _vals
 
std::vector< unsigned int > _vals_var
 
const MaterialProperty< Real > & _mu
 
const MaterialProperty< Real > & _L
 Mobility. More...
 
const MaterialProperty< Real > & _dLdop
 Mobility derivative w.r.t. order parameter. More...
 
std::vector< const MaterialProperty< Real > *> _dLdarg
 Mobility derivative w.r.t coupled variables. More...
 

Private Member Functions

Real computedF0du ()
 

Detailed Description

This kernel calculates the residual for grain growth for a multi-phase, poly-crystal system.

A list of material properties needs to be supplied for the gammas (prefactors of the cross-terms between order parameters).

Definition at line 26 of file ACGrGrMulti.h.

Member Enumeration Documentation

◆ PFFunctionType

enum ACBulk::PFFunctionType
protectedinherited

Definition at line 38 of file ACBulk.h.

Constructor & Destructor Documentation

◆ ACGrGrMulti()

ACGrGrMulti::ACGrGrMulti ( const InputParameters &  parameters)

Definition at line 27 of file ACGrGrMulti.C.

28  : ACGrGrBase(parameters),
29  _gamma_names(getParam<std::vector<MaterialPropertyName>>("gamma_names")),
30  _num_j(_gamma_names.size()),
32  _uname(getParam<NonlinearVariableName>("variable")),
33  _dmudu(getMaterialPropertyDerivative<Real>("mu", _uname)),
34  _vname(getParam<std::vector<VariableName>>("v")),
36 {
37  // check passed in parameter vectors
38  if (_num_j != coupledComponents("v"))
39  paramError("gamma_names",
40  "Need to pass in as many gamma_names as coupled variables in v in ACGrGrMulti");
41 
42  for (unsigned int n = 0; n < _num_j; ++n)
43  {
44  _prop_gammas[n] = &getMaterialPropertyByName<Real>(_gamma_names[n]);
45  _dmudEtaj[n] = &getMaterialPropertyDerivative<Real>("mu", _vname[n]);
46  }
47 }
ACGrGrBase(const InputParameters &parameters)
Definition: ACGrGrBase.C:22
const std::vector< VariableName > _vname
Definition: ACGrGrMulti.h:44
std::vector< MaterialPropertyName > _gamma_names
Names of gammas for each order parameter.
Definition: ACGrGrMulti.h:36
unsigned int _num_j
Definition: ACGrGrMulti.h:37
std::vector< const MaterialProperty< Real > * > _dmudEtaj
Definition: ACGrGrMulti.h:45
const NonlinearVariableName _uname
Definition: ACGrGrMulti.h:42
std::vector< const MaterialProperty< Real > * > _prop_gammas
Values of gammas for each order parameter.
Definition: ACGrGrMulti.h:40
const MaterialProperty< Real > & _dmudu
Definition: ACGrGrMulti.h:43

Member Function Documentation

◆ computedF0du()

Real ACGrGrMulti::computedF0du ( )
private

Definition at line 94 of file ACGrGrMulti.C.

Referenced by computeDFDOP(), and computeQpOffDiagJacobian().

95 {
96  Real SumGammaEtaj = 0.0;
97  for (unsigned int i = 0; i < _op_num; ++i)
98  SumGammaEtaj += (*_prop_gammas[i])[_qp] * (*_vals[i])[_qp] * (*_vals[i])[_qp];
99 
100  return _u[_qp] * _u[_qp] * _u[_qp] - _u[_qp] + 2.0 * _u[_qp] * SumGammaEtaj;
101 }
const unsigned int _op_num
Definition: ACGrGrBase.h:32
std::vector< const MaterialProperty< Real > * > _prop_gammas
Values of gammas for each order parameter.
Definition: ACGrGrMulti.h:40
std::vector< const VariableValue * > _vals
Definition: ACGrGrBase.h:34

◆ computeDFDOP() [1/2]

Real ACGrGrMulti::computeDFDOP ( PFFunctionType  type)
protectedvirtual

Definition at line 50 of file ACGrGrMulti.C.

51 {
52  // Sum all other order parameters
53  Real SumGammaEtaj = 0.0;
54  for (unsigned int i = 0; i < _op_num; ++i)
55  SumGammaEtaj += (*_prop_gammas[i])[_qp] * (*_vals[i])[_qp] * (*_vals[i])[_qp];
56 
57  // Calculate either the residual or Jacobian of the grain growth free energy
58  switch (type)
59  {
60  case Residual:
61  {
62  return _mu[_qp] * computedF0du();
63  }
64 
65  case Jacobian:
66  {
67  Real d2f0du2 = 3.0 * _u[_qp] * _u[_qp] - 1.0 + 2.0 * SumGammaEtaj;
68  return _phi[_j][_qp] * (_mu[_qp] * d2f0du2 + _dmudu[_qp] * computedF0du());
69  }
70 
71  default:
72  mooseError("Invalid type passed in");
73  }
74 }
const unsigned int _op_num
Definition: ACGrGrBase.h:32
Real computedF0du()
Definition: ACGrGrMulti.C:94
const MaterialProperty< Real > & _mu
Definition: ACGrGrBase.h:37
std::vector< const MaterialProperty< Real > * > _prop_gammas
Values of gammas for each order parameter.
Definition: ACGrGrMulti.h:40
std::vector< const VariableValue * > _vals
Definition: ACGrGrBase.h:34
const MaterialProperty< Real > & _dmudu
Definition: ACGrGrMulti.h:43

◆ computeDFDOP() [2/2]

virtual Real ACBulk< Real >::computeDFDOP ( PFFunctionType  type)
protectedpure virtualinherited

◆ computeQpOffDiagJacobian()

Real ACGrGrMulti::computeQpOffDiagJacobian ( unsigned int  jvar)
protectedvirtual

Reimplemented from ACBulk< Real >.

Definition at line 77 of file ACGrGrMulti.C.

78 {
79  for (unsigned int i = 0; i < _op_num; ++i)
80  if (jvar == _vals_var[i])
81  {
82  // Derivative of SumGammaEtaj
83  const Real dSumGammaEtaj = 2.0 * (*_prop_gammas[i])[_qp] * (*_vals[i])[_qp];
84  const Real dDFDOP = _mu[_qp] * 2.0 * _u[_qp] * dSumGammaEtaj;
85 
86  return _L[_qp] * _test[_i][_qp] * _phi[_j][_qp] *
87  (dDFDOP + (*_dmudEtaj[i])[_qp] * computedF0du());
88  }
89 
90  return 0.0;
91 }
const unsigned int _op_num
Definition: ACGrGrBase.h:32
const MaterialProperty< Real > & _L
Mobility.
Definition: ACBulk.h:47
Real computedF0du()
Definition: ACGrGrMulti.C:94
std::vector< unsigned int > _vals_var
Definition: ACGrGrBase.h:35
std::vector< const MaterialProperty< Real > * > _dmudEtaj
Definition: ACGrGrMulti.h:45
const MaterialProperty< Real > & _mu
Definition: ACGrGrBase.h:37
std::vector< const MaterialProperty< Real > * > _prop_gammas
Values of gammas for each order parameter.
Definition: ACGrGrMulti.h:40
std::vector< const VariableValue * > _vals
Definition: ACGrGrBase.h:34

◆ initialSetup()

void ACBulk< Real >::initialSetup ( )
virtualinherited

Reimplemented in KKSMultiACBulkBase, CoupledAllenCahn, KKSACBulkBase, and AllenCahn.

Definition at line 86 of file ACBulk.h.

87 {
88  validateNonlinearCoupling<Real>("mob_name");
89 }

◆ precomputeQpJacobian()

Real ACBulk< Real >::precomputeQpJacobian ( )
protectedvirtualinherited

Definition at line 104 of file ACBulk.h.

105 {
106  // Get free energy derivative and Jacobian
107  Real dFdop = computeDFDOP(Residual);
108 
109  Real JdFdop = computeDFDOP(Jacobian);
110 
111  // Set Jacobian value using product rule
112  return _L[_qp] * JdFdop + _dLdop[_qp] * _phi[_j][_qp] * dFdop;
113 }
const MaterialProperty< Real > & _L
Mobility.
Definition: ACBulk.h:47
virtual Real computeDFDOP(PFFunctionType type)=0
const MaterialProperty< Real > & _dLdop
Mobility derivative w.r.t. order parameter.
Definition: ACBulk.h:50

◆ precomputeQpResidual()

Real ACBulk< Real >::precomputeQpResidual ( )
protectedvirtualinherited

Definition at line 93 of file ACBulk.h.

94 {
95  // Get free energy derivative from function
96  Real dFdop = computeDFDOP(Residual);
97 
98  // Set residual
99  return _L[_qp] * dFdop;
100 }
const MaterialProperty< Real > & _L
Mobility.
Definition: ACBulk.h:47
virtual Real computeDFDOP(PFFunctionType type)=0

◆ validParams()

InputParameters ACBulk< Real >::validParams ( )
staticinherited

Definition at line 75 of file ACBulk.h.

76 {
77  InputParameters params = ::validParams<KernelValue>();
78  params.addClassDescription("Allen-Cahn base Kernel");
79  params.addParam<MaterialPropertyName>("mob_name", "L", "The mobility used with the kernel");
80  params.addCoupledVar("args", "Vector of arguments of the mobility");
81  return params;
82 }

Member Data Documentation

◆ _dLdarg

std::vector<const MaterialProperty<Real > *> ACBulk< Real >::_dLdarg
protectedinherited

Mobility derivative w.r.t coupled variables.

Definition at line 53 of file ACBulk.h.

◆ _dLdop

const MaterialProperty<Real >& ACBulk< Real >::_dLdop
protectedinherited

Mobility derivative w.r.t. order parameter.

Definition at line 50 of file ACBulk.h.

◆ _dmudEtaj

std::vector<const MaterialProperty<Real> *> ACGrGrMulti::_dmudEtaj
protected

Definition at line 45 of file ACGrGrMulti.h.

Referenced by ACGrGrMulti(), and computeQpOffDiagJacobian().

◆ _dmudu

const MaterialProperty<Real>& ACGrGrMulti::_dmudu
protected

Definition at line 43 of file ACGrGrMulti.h.

Referenced by computeDFDOP().

◆ _gamma_names

std::vector<MaterialPropertyName> ACGrGrMulti::_gamma_names
protected

Names of gammas for each order parameter.

Definition at line 36 of file ACGrGrMulti.h.

Referenced by ACGrGrMulti().

◆ _L

const MaterialProperty<Real >& ACBulk< Real >::_L
protectedinherited

◆ _mu

const MaterialProperty<Real>& ACGrGrBase::_mu
protectedinherited

◆ _num_j

unsigned int ACGrGrMulti::_num_j
protected

Definition at line 37 of file ACGrGrMulti.h.

Referenced by ACGrGrMulti().

◆ _op_num

const unsigned int ACGrGrBase::_op_num
protectedinherited

◆ _prop_gammas

std::vector<const MaterialProperty<Real> *> ACGrGrMulti::_prop_gammas
protected

Values of gammas for each order parameter.

Definition at line 40 of file ACGrGrMulti.h.

Referenced by ACGrGrMulti(), computedF0du(), computeDFDOP(), and computeQpOffDiagJacobian().

◆ _uname

const NonlinearVariableName ACGrGrMulti::_uname
protected

Definition at line 42 of file ACGrGrMulti.h.

◆ _vals

std::vector<const VariableValue *> ACGrGrBase::_vals
protectedinherited

◆ _vals_var

std::vector<unsigned int> ACGrGrBase::_vals_var
protectedinherited

◆ _vname

const std::vector<VariableName> ACGrGrMulti::_vname
protected

Definition at line 44 of file ACGrGrMulti.h.

Referenced by ACGrGrMulti().


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