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

AllenCahn uses the Free Energy function and derivatives provided by a DerivativeParsedMaterial to computer the residual for the bulk part of the Allen-Cahn equation. More...

#include <AllenCahn.h>

Inheritance diagram for AllenCahn:
[legend]

Public Member Functions

 AllenCahn (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

const unsigned int _nvar
 
const MaterialProperty< Real > & _dFdEta
 
const MaterialProperty< Real > & _d2FdEta2
 
std::vector< const MaterialProperty< Real > * > _d2FdEtadarg
 
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...
 

Detailed Description

AllenCahn uses the Free Energy function and derivatives provided by a DerivativeParsedMaterial to computer the residual for the bulk part of the Allen-Cahn equation.

Definition at line 26 of file AllenCahn.h.

Member Enumeration Documentation

◆ PFFunctionType

enum ACBulk::PFFunctionType
protectedinherited

Definition at line 38 of file ACBulk.h.

Constructor & Destructor Documentation

◆ AllenCahn()

AllenCahn::AllenCahn ( const InputParameters &  parameters)

Definition at line 25 of file AllenCahn.C.

26  : ACBulk<Real>(parameters),
27  _nvar(_coupled_moose_vars.size()),
28  _dFdEta(getMaterialPropertyDerivative<Real>("f_name", _var.name())),
29  _d2FdEta2(getMaterialPropertyDerivative<Real>("f_name", _var.name(), _var.name())),
31 {
32  // Iterate over all coupled variables
33  for (unsigned int i = 0; i < _nvar; ++i)
34  _d2FdEtadarg[i] =
35  &getMaterialPropertyDerivative<Real>("f_name", _var.name(), _coupled_moose_vars[i]->name());
36 }
std::vector< const MaterialProperty< Real > * > _d2FdEtadarg
Definition: AllenCahn.h:41
const MaterialProperty< Real > & _dFdEta
Definition: AllenCahn.h:38
const MaterialProperty< Real > & _d2FdEta2
Definition: AllenCahn.h:39
const unsigned int _nvar
Definition: AllenCahn.h:37

Member Function Documentation

◆ computeDFDOP() [1/2]

Real AllenCahn::computeDFDOP ( PFFunctionType  type)
protectedvirtual

Definition at line 47 of file AllenCahn.C.

48 {
49  switch (type)
50  {
51  case Residual:
52  return _dFdEta[_qp];
53 
54  case Jacobian:
55  return _d2FdEta2[_qp] * _phi[_j][_qp];
56  }
57 
58  mooseError("Internal error");
59 }
const MaterialProperty< Real > & _dFdEta
Definition: AllenCahn.h:38
const MaterialProperty< Real > & _d2FdEta2
Definition: AllenCahn.h:39

◆ computeDFDOP() [2/2]

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

◆ computeQpOffDiagJacobian()

Real AllenCahn::computeQpOffDiagJacobian ( unsigned int  jvar)
protectedvirtual

Reimplemented from ACBulk< Real >.

Definition at line 62 of file AllenCahn.C.

63 {
64  // get the coupled variable jvar is referring to
65  const unsigned int cvar = mapJvarToCvar(jvar);
66 
68  _L[_qp] * (*_d2FdEtadarg[cvar])[_qp] * _phi[_j][_qp] * _test[_i][_qp];
69 }
const MaterialProperty< Real > & _L
Mobility.
Definition: ACBulk.h:47
std::vector< const MaterialProperty< Real > * > _d2FdEtadarg
Definition: AllenCahn.h:41
virtual Real computeQpOffDiagJacobian(unsigned int jvar)
Definition: ACBulk.h:117

◆ initialSetup()

void AllenCahn::initialSetup ( )
virtual

Reimplemented from ACBulk< Real >.

Definition at line 39 of file AllenCahn.C.

40 {
42  validateNonlinearCoupling<Real>("f_name");
43  validateDerivativeMaterialPropertyBase<Real>("f_name");
44 }
virtual void initialSetup()
Definition: ACBulk.h:86

◆ 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

◆ _d2FdEta2

const MaterialProperty<Real>& AllenCahn::_d2FdEta2
protected

Definition at line 39 of file AllenCahn.h.

Referenced by computeDFDOP().

◆ _d2FdEtadarg

std::vector<const MaterialProperty<Real> *> AllenCahn::_d2FdEtadarg
protected

Definition at line 41 of file AllenCahn.h.

Referenced by AllenCahn(), and computeQpOffDiagJacobian().

◆ _dFdEta

const MaterialProperty<Real>& AllenCahn::_dFdEta
protected

Definition at line 38 of file AllenCahn.h.

Referenced by computeDFDOP().

◆ _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.

◆ _L

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

◆ _nvar

const unsigned int AllenCahn::_nvar
protected

Definition at line 37 of file AllenCahn.h.

Referenced by AllenCahn().


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