www.mooseframework.org
Public Types | 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 Types

typedef DerivativeMaterialPropertyNameInterface::SymbolName SymbolName
 

Public Member Functions

 AllenCahn (const InputParameters &parameters)
 
virtual void initialSetup ()
 
const GenericMaterialProperty< U, is_ad > & getDefaultMaterialProperty (const std::string &name)
 
const GenericMaterialProperty< U, is_ad > & getDefaultMaterialPropertyByName (const std::string &name)
 
void validateDerivativeMaterialPropertyBase (const std::string &base)
 
const MaterialPropertyName derivativePropertyName (const MaterialPropertyName &base, const std::vector< SymbolName > &c) const
 
const MaterialPropertyName derivativePropertyNameFirst (const MaterialPropertyName &base, const SymbolName &c1) const
 
const MaterialPropertyName derivativePropertyNameSecond (const MaterialPropertyName &base, const SymbolName &c1, const SymbolName &c2) const
 
const MaterialPropertyName derivativePropertyNameThird (const MaterialPropertyName &base, const SymbolName &c1, const SymbolName &c2, const SymbolName &c3) const
 
GenericMaterialProperty< U, is_ad > & declarePropertyDerivative (const std::string &base, const std::vector< VariableName > &c)
 
GenericMaterialProperty< U, is_ad > & declarePropertyDerivative (const std::string &base, const std::vector< SymbolName > &c)
 
GenericMaterialProperty< U, is_ad > & declarePropertyDerivative (const std::string &base, const SymbolName &c1, const SymbolName &c2="", const SymbolName &c3="")
 
GenericMaterialProperty< U, is_ad > & declarePropertyDerivative (const std::string &base, const std::vector< VariableName > &c)
 
GenericMaterialProperty< U, is_ad > & declarePropertyDerivative (const std::string &base, const std::vector< SymbolName > &c)
 
GenericMaterialProperty< U, is_ad > & declarePropertyDerivative (const std::string &base, const SymbolName &c1, const SymbolName &c2="", const SymbolName &c3="")
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, const std::vector< VariableName > &c)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, const std::vector< SymbolName > &c)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, const SymbolName &c1, const SymbolName &c2="", const SymbolName &c3="")
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, const SymbolName &c1, unsigned int v2, unsigned int v3=libMesh::invalid_uint)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, unsigned int v1, unsigned int v2=libMesh::invalid_uint, unsigned int v3=libMesh::invalid_uint)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, const std::vector< VariableName > &c)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, const std::vector< SymbolName > &c)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, const SymbolName &c1, const SymbolName &c2="", const SymbolName &c3="")
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, const SymbolName &c1, unsigned int v2, unsigned int v3=libMesh::invalid_uint)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, unsigned int v1, unsigned int v2=libMesh::invalid_uint, unsigned int v3=libMesh::invalid_uint)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivativeByName (const MaterialPropertyName &base, const std::vector< VariableName > &c)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivativeByName (const MaterialPropertyName &base, const std::vector< SymbolName > &c)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivativeByName (const MaterialPropertyName &base, const SymbolName &c1, const SymbolName &c2="", const SymbolName &c3="")
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivativeByName (const MaterialPropertyName &base, const std::vector< VariableName > &c)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivativeByName (const MaterialPropertyName &base, const std::vector< SymbolName > &c)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivativeByName (const MaterialPropertyName &base, const SymbolName &c1, const SymbolName &c2="", const SymbolName &c3="")
 
void validateCoupling (const MaterialPropertyName &base, const std::vector< VariableName > &c, bool validate_aux=true)
 
void validateCoupling (const MaterialPropertyName &base, const VariableName &c1="", const VariableName &c2="", const VariableName &c3="")
 
void validateCoupling (const MaterialPropertyName &base, const std::vector< VariableName > &c, bool validate_aux=true)
 
void validateCoupling (const MaterialPropertyName &base, const VariableName &c1="", const VariableName &c2="", const VariableName &c3="")
 
void validateNonlinearCoupling (const MaterialPropertyName &base, const VariableName &c1="", const VariableName &c2="", const VariableName &c3="")
 
void validateNonlinearCoupling (const MaterialPropertyName &base, const VariableName &c1="", const VariableName &c2="", const VariableName &c3="")
 
const MaterialPropertyName propertyName (const MaterialPropertyName &base, const std::vector< SymbolName > &c) const
 
const MaterialPropertyName propertyName (const MaterialPropertyName &base, const std::vector< SymbolName > &c) const
 
const MaterialPropertyName propertyNameFirst (const MaterialPropertyName &base, const SymbolName &c1) const
 
const MaterialPropertyName propertyNameFirst (const MaterialPropertyName &base, const SymbolName &c1) const
 
const MaterialPropertyName propertyNameSecond (const MaterialPropertyName &base, const SymbolName &c1, const SymbolName &c2) const
 
const MaterialPropertyName propertyNameSecond (const MaterialPropertyName &base, const SymbolName &c1, const SymbolName &c2) const
 
const MaterialPropertyName propertyNameThird (const MaterialPropertyName &base, const SymbolName &c1, const SymbolName &c2, const SymbolName &c3) const
 
const MaterialPropertyName propertyNameThird (const MaterialPropertyName &base, const SymbolName &c1, const SymbolName &c2, const SymbolName &c3) const
 

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 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 19 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 24 of file AllenCahn.C.

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

Member Function Documentation

◆ computeDFDOP() [1/2]

Real AllenCahn::computeDFDOP ( PFFunctionType  type)
protectedvirtual

Definition at line 44 of file AllenCahn.C.

45 {
46  switch (type)
47  {
48  case Residual:
49  return _dFdEta[_qp];
50 
51  case Jacobian:
52  return _d2FdEta2[_qp] * _phi[_j][_qp];
53  }
54 
55  mooseError("Internal error");
56 }
void mooseError(Args &&... args)
const MaterialProperty< Real > & _dFdEta
Definition: AllenCahn.h:32
const MaterialProperty< Real > & _d2FdEta2
Definition: AllenCahn.h:33

◆ 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 59 of file AllenCahn.C.

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

◆ initialSetup()

void AllenCahn::initialSetup ( )
virtual

Reimplemented from ACBulk< Real >.

Definition at line 36 of file AllenCahn.C.

37 {
39  validateNonlinearCoupling<Real>("f_name");
40  validateDerivativeMaterialPropertyBase<Real>("f_name");
41 }
virtual void initialSetup()
Definition: ACBulk.h:79

◆ precomputeQpJacobian()

Real ACBulk< Real >::precomputeQpJacobian ( )
protectedvirtualinherited

Definition at line 97 of file ACBulk.h.

98 {
99  // Get free energy derivative and Jacobian
100  Real dFdop = computeDFDOP(Residual);
101 
102  Real JdFdop = computeDFDOP(Jacobian);
103 
104  // Set Jacobian value using product rule
105  return _L[_qp] * JdFdop + _dLdop[_qp] * _phi[_j][_qp] * dFdop;
106 }
const MaterialProperty< Real > & _L
Mobility.
Definition: ACBulk.h:46
virtual Real computeDFDOP(PFFunctionType type)=0
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const MaterialProperty< Real > & _dLdop
Mobility derivative w.r.t. order parameter.
Definition: ACBulk.h:49

◆ precomputeQpResidual()

Real ACBulk< Real >::precomputeQpResidual ( )
protectedvirtualinherited

Definition at line 86 of file ACBulk.h.

87 {
88  // Get free energy derivative from function
89  Real dFdop = computeDFDOP(Residual);
90 
91  // Set residual
92  return _L[_qp] * dFdop;
93 }
const MaterialProperty< Real > & _L
Mobility.
Definition: ACBulk.h:46
virtual Real computeDFDOP(PFFunctionType type)=0
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

◆ validParams()

InputParameters AllenCahn::validParams ( )
static

Definition at line 15 of file AllenCahn.C.

16 {
18  params.addClassDescription("Allen-Cahn Kernel that uses a DerivativeMaterial Free Energy");
19  params.addRequiredParam<MaterialPropertyName>(
20  "f_name", "Base name of the free energy function F defined in a DerivativeParsedMaterial");
21  return params;
22 }
void addRequiredParam(const std::string &name, const std::string &doc_string)
void addClassDescription(const std::string &doc_string)
static InputParameters validParams()
Definition: ACBulk.h:69

Member Data Documentation

◆ _d2FdEta2

const MaterialProperty<Real>& AllenCahn::_d2FdEta2
protected

Definition at line 33 of file AllenCahn.h.

Referenced by computeDFDOP().

◆ _d2FdEtadarg

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

Definition at line 35 of file AllenCahn.h.

Referenced by AllenCahn(), and computeQpOffDiagJacobian().

◆ _dFdEta

const MaterialProperty<Real>& AllenCahn::_dFdEta
protected

Definition at line 32 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

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