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

CoupledAllenCahn uses the Free Energy function and derivatives provided by a DerivativeParsedMaterial to compute the residual for the bulk part of the Allen-Cahn equation, where the variational free energy derivative is taken w.r.t. More...

#include <CoupledAllenCahn.h>

Inheritance diagram for CoupledAllenCahn:
[legend]

Public Types

typedef DerivativeMaterialPropertyNameInterface::SymbolName SymbolName
 

Public Member Functions

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

VariableName _v_name
 
const MaterialProperty< Real > & _dFdV
 
const MaterialProperty< Real > & _d2FdVdEta
 
std::vector< const MaterialProperty< Real > * > _d2FdVdarg
 
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

CoupledAllenCahn uses the Free Energy function and derivatives provided by a DerivativeParsedMaterial to compute the residual for the bulk part of the Allen-Cahn equation, where the variational free energy derivative is taken w.r.t.

a coupled variable.

Definition at line 20 of file CoupledAllenCahn.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

◆ CoupledAllenCahn()

CoupledAllenCahn::CoupledAllenCahn ( const InputParameters parameters)

Definition at line 26 of file CoupledAllenCahn.C.

27  : ACBulk<Real>(parameters),
28  _v_name(coupledName("v", 0)),
29  _dFdV(getMaterialPropertyDerivative<Real>("f_name", _v_name)),
30  _d2FdVdEta(getMaterialPropertyDerivative<Real>("f_name", _v_name, _var.name())),
31  _d2FdVdarg(_n_args)
32 {
33  // Iterate over all coupled variables
34  for (unsigned int i = 0; i < _n_args; ++i)
35  _d2FdVdarg[i] = &getMaterialPropertyDerivative<Real>("f_name", _v_name, i);
36 }
const MaterialProperty< Real > & _d2FdVdEta
VariableName _v_name
const MaterialProperty< Real > & _dFdV
std::vector< const MaterialProperty< Real > * > _d2FdVdarg

Member Function Documentation

◆ computeDFDOP() [1/2]

Real CoupledAllenCahn::computeDFDOP ( PFFunctionType  type)
protectedvirtual

Definition at line 46 of file CoupledAllenCahn.C.

47 {
48  switch (type)
49  {
50  case Residual:
51  return _dFdV[_qp];
52 
53  case Jacobian:
54  return _d2FdVdEta[_qp] * _phi[_j][_qp];
55  }
56 
57  mooseError("Internal error");
58 }
const MaterialProperty< Real > & _d2FdVdEta
void mooseError(Args &&... args)
const MaterialProperty< Real > & _dFdV

◆ computeDFDOP() [2/2]

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

◆ computeQpOffDiagJacobian()

Real CoupledAllenCahn::computeQpOffDiagJacobian ( unsigned int  jvar)
protectedvirtual

Reimplemented from ACBulk< Real >.

Definition at line 61 of file CoupledAllenCahn.C.

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

◆ initialSetup()

void CoupledAllenCahn::initialSetup ( )
virtual

Reimplemented from ACBulk< Real >.

Definition at line 39 of file CoupledAllenCahn.C.

40 {
42  validateNonlinearCoupling<Real>("f_name");
43 }
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 CoupledAllenCahn::validParams ( )
static

Definition at line 15 of file CoupledAllenCahn.C.

16 {
18  params.addClassDescription(
19  "Coupled Allen-Cahn Kernel that uses a DerivativeMaterial Free Energy");
20  params.addRequiredCoupledVar("v", "Coupled variable");
21  params.addRequiredParam<MaterialPropertyName>(
22  "f_name", "Base name of the free energy function F defined in a DerivativeParsedMaterial");
23  return params;
24 }
void addRequiredParam(const std::string &name, const std::string &doc_string)
void addRequiredCoupledVar(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

◆ _d2FdVdarg

std::vector<const MaterialProperty<Real> *> CoupledAllenCahn::_d2FdVdarg
protected

Definition at line 39 of file CoupledAllenCahn.h.

Referenced by computeQpOffDiagJacobian(), and CoupledAllenCahn().

◆ _d2FdVdEta

const MaterialProperty<Real>& CoupledAllenCahn::_d2FdVdEta
protected

Definition at line 37 of file CoupledAllenCahn.h.

Referenced by computeDFDOP().

◆ _dFdV

const MaterialProperty<Real>& CoupledAllenCahn::_dFdV
protected

Definition at line 36 of file CoupledAllenCahn.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

◆ _v_name

VariableName CoupledAllenCahn::_v_name
protected

Definition at line 34 of file CoupledAllenCahn.h.

Referenced by CoupledAllenCahn().


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