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 27 of file CoupledAllenCahn.h.

Member Enumeration Documentation

◆ PFFunctionType

enum ACBulk::PFFunctionType
protectedinherited

Definition at line 38 of file ACBulk.h.

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 }
const MaterialProperty< Real > & _d2FdVdEta
const unsigned int _nvar
const std::string name
Definition: Setup.h:22
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 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 }
const MaterialProperty< Real > & _d2FdVdEta
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 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 }
const MaterialProperty< Real > & _L
Mobility.
Definition: ACBulk.h:47
virtual Real computeQpOffDiagJacobian(unsigned int jvar)
Definition: ACBulk.h:117
std::vector< const MaterialProperty< Real > * > _d2FdVdarg

◆ initialSetup()

void CoupledAllenCahn::initialSetup ( )
virtual

Reimplemented from ACBulk< Real >.

Definition at line 42 of file CoupledAllenCahn.C.

43 {
45  validateNonlinearCoupling<Real>("f_name");
46 }
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

◆ _d2FdVdarg

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

Definition at line 45 of file CoupledAllenCahn.h.

Referenced by computeQpOffDiagJacobian(), and CoupledAllenCahn().

◆ _d2FdVdEta

const MaterialProperty<Real>& CoupledAllenCahn::_d2FdVdEta
protected

Definition at line 43 of file CoupledAllenCahn.h.

Referenced by computeDFDOP().

◆ _dFdV

const MaterialProperty<Real>& CoupledAllenCahn::_dFdV
protected

Definition at line 42 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 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 CoupledAllenCahn::_nvar
protected

Definition at line 41 of file CoupledAllenCahn.h.

Referenced by CoupledAllenCahn().

◆ _v_name

VariableName CoupledAllenCahn::_v_name
protected

Definition at line 39 of file CoupledAllenCahn.h.

Referenced by CoupledAllenCahn().


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