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 25 of file AllenCahn.h.

Member Enumeration Documentation

◆ PFFunctionType

enum ACBulk::PFFunctionType
protectedinherited

Definition at line 37 of file ACBulk.h.

38  {
39  Jacobian,
40  Residual
41  };

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 }

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 }

◆ 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 }

◆ 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 }

◆ precomputeQpJacobian()

Real ACBulk< Real >::precomputeQpJacobian ( )
protectedvirtualinherited

Definition at line 103 of file ACBulk.h.

104 {
105  // Get free energy derivative and Jacobian
106  Real dFdop = computeDFDOP(Residual);
107 
108  Real JdFdop = computeDFDOP(Jacobian);
109 
110  // Set Jacobian value using product rule
111  return _L[_qp] * JdFdop + _dLdop[_qp] * _phi[_j][_qp] * dFdop;
112 }

◆ precomputeQpResidual()

Real ACBulk< Real >::precomputeQpResidual ( )
protectedvirtualinherited

Definition at line 92 of file ACBulk.h.

93 {
94  // Get free energy derivative from function
95  Real dFdop = computeDFDOP(Residual);
96 
97  // Set residual
98  return _L[_qp] * dFdop;
99 }

◆ validParams()

InputParameters ACBulk< Real >::validParams ( )
staticinherited

Definition at line 74 of file ACBulk.h.

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

Member Data Documentation

◆ _d2FdEta2

const MaterialProperty<Real>& AllenCahn::_d2FdEta2
protected

Definition at line 38 of file AllenCahn.h.

Referenced by computeDFDOP().

◆ _d2FdEtadarg

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

Definition at line 40 of file AllenCahn.h.

Referenced by AllenCahn(), and computeQpOffDiagJacobian().

◆ _dFdEta

const MaterialProperty<Real>& AllenCahn::_dFdEta
protected

Definition at line 37 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 52 of file ACBulk.h.

◆ _dLdop

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

Mobility derivative w.r.t. order parameter.

Definition at line 49 of file ACBulk.h.

◆ _L

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

Mobility.

Definition at line 46 of file ACBulk.h.

◆ _nvar

const unsigned int AllenCahn::_nvar
protected

Definition at line 36 of file AllenCahn.h.

Referenced by AllenCahn().


The documentation for this class was generated from the following files:
ACBulk< Real >::Residual
Definition: ACBulk.h:40
ACBulk::computeQpOffDiagJacobian
virtual Real computeQpOffDiagJacobian(unsigned int jvar)
Definition: ACBulk.h:116
ACBulk< Real >
AllenCahn::_d2FdEtadarg
std::vector< const MaterialProperty< Real > * > _d2FdEtadarg
Definition: AllenCahn.h:40
AllenCahn::_nvar
const unsigned int _nvar
Definition: AllenCahn.h:36
ACBulk< Real >::_dLdop
const MaterialProperty< Real > & _dLdop
Mobility derivative w.r.t. order parameter.
Definition: ACBulk.h:49
ACBulk< Real >::computeDFDOP
virtual Real computeDFDOP(PFFunctionType type)=0
AllenCahn::_d2FdEta2
const MaterialProperty< Real > & _d2FdEta2
Definition: AllenCahn.h:38
ACBulk::initialSetup
virtual void initialSetup()
Definition: ACBulk.h:85
ACBulk< Real >::Jacobian
Definition: ACBulk.h:39
AllenCahn::_dFdEta
const MaterialProperty< Real > & _dFdEta
Definition: AllenCahn.h:37
ACBulk< Real >::_L
const MaterialProperty< Real > & _L
Mobility.
Definition: ACBulk.h:46