www.mooseframework.org
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 Member Functions

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

VariableName _v_name
 
const unsigned int _nvar
 
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 26 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 27 of file CoupledAllenCahn.C.

28  : ACBulk<Real>(parameters),
29  _v_name(getVar("v", 0)->name()),
30  _nvar(_coupled_moose_vars.size()),
31  _dFdV(getMaterialPropertyDerivative<Real>("f_name", _v_name)),
32  _d2FdVdEta(getMaterialPropertyDerivative<Real>("f_name", _v_name, _var.name())),
34 {
35  // Iterate over all coupled variables
36  for (unsigned int i = 0; i < _nvar; ++i)
37  _d2FdVdarg[i] =
38  &getMaterialPropertyDerivative<Real>("f_name", _v_name, _coupled_moose_vars[i]->name());
39 }

Member Function Documentation

◆ computeDFDOP() [1/2]

Real CoupledAllenCahn::computeDFDOP ( PFFunctionType  type)
protectedvirtual

Definition at line 49 of file CoupledAllenCahn.C.

50 {
51  switch (type)
52  {
53  case Residual:
54  return _dFdV[_qp];
55 
56  case Jacobian:
57  return _d2FdVdEta[_qp] * _phi[_j][_qp];
58  }
59 
60  mooseError("Internal error");
61 }

◆ 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 64 of file CoupledAllenCahn.C.

65 {
66  // get the coupled variable jvar is referring to
67  const unsigned int cvar = mapJvarToCvar(jvar);
68 
70  _L[_qp] * (*_d2FdVdarg[cvar])[_qp] * _phi[_j][_qp] * _test[_i][_qp];
71 }

◆ initialSetup()

void CoupledAllenCahn::initialSetup ( )
virtual

Reimplemented from ACBulk< Real >.

Definition at line 42 of file CoupledAllenCahn.C.

43 {
45  validateNonlinearCoupling<Real>("f_name");
46 }

◆ 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

◆ _d2FdVdarg

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

Definition at line 44 of file CoupledAllenCahn.h.

Referenced by computeQpOffDiagJacobian(), and CoupledAllenCahn().

◆ _d2FdVdEta

const MaterialProperty<Real>& CoupledAllenCahn::_d2FdVdEta
protected

Definition at line 42 of file CoupledAllenCahn.h.

Referenced by computeDFDOP().

◆ _dFdV

const MaterialProperty<Real>& CoupledAllenCahn::_dFdV
protected

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

Mobility.

Definition at line 46 of file ACBulk.h.

◆ _nvar

const unsigned int CoupledAllenCahn::_nvar
protected

Definition at line 40 of file CoupledAllenCahn.h.

Referenced by CoupledAllenCahn().

◆ _v_name

VariableName CoupledAllenCahn::_v_name
protected

Definition at line 38 of file CoupledAllenCahn.h.

Referenced by CoupledAllenCahn().


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
CoupledAllenCahn::_d2FdVdEta
const MaterialProperty< Real > & _d2FdVdEta
Definition: CoupledAllenCahn.h:42
ACBulk< Real >
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
CoupledAllenCahn::_nvar
const unsigned int _nvar
Definition: CoupledAllenCahn.h:40
name
const std::string name
Definition: Setup.h:21
ACBulk::initialSetup
virtual void initialSetup()
Definition: ACBulk.h:85
ACBulk< Real >::Jacobian
Definition: ACBulk.h:39
CoupledAllenCahn::_v_name
VariableName _v_name
Definition: CoupledAllenCahn.h:38
CoupledAllenCahn::_d2FdVdarg
std::vector< const MaterialProperty< Real > * > _d2FdVdarg
Definition: CoupledAllenCahn.h:44
CoupledAllenCahn::_dFdV
const MaterialProperty< Real > & _dFdV
Definition: CoupledAllenCahn.h:41
ACBulk< Real >::_L
const MaterialProperty< Real > & _L
Mobility.
Definition: ACBulk.h:46