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

Cahn-Hilliard Kernel implementing the free energy f = 1/4(1-c^2)^2, such that grad df/dc = (3 c^2 -1) grad_c. More...

#include <CHMath.h>

Inheritance diagram for CHMath:
[legend]

Public Member Functions

 CHMath (const InputParameters &parameters)
 
virtual void initialSetup ()
 

Static Public Member Functions

static InputParameters validParams ()
 

Protected Types

enum  PFFunctionType
 

Protected Member Functions

virtual RealGradient computeGradDFDCons (PFFunctionType type)
 
virtual RealGradient precomputeQpResidual ()
 
virtual RealGradient precomputeQpJacobian ()
 
virtual Real computeQpOffDiagJacobian (unsigned int jvar)
 
virtual RealGradient computeGradDFDCons (PFFunctionType type)=0
 

Protected Attributes

const MaterialProperty< Real > & _M
 Mobility. More...
 
const MaterialProperty< Real > & _dMdc
 Mobility derivative w.r.t. concentration. More...
 
std::vector< const MaterialProperty< Real > *> _dMdarg
 Mobility derivative w.r.t coupled variables. More...
 

Detailed Description

Cahn-Hilliard Kernel implementing the free energy f = 1/4(1-c^2)^2, such that grad df/dc = (3 c^2 -1) grad_c.

Most of the Cahn-Hilliard equation is implemented in CHBulk and CHInterface. This kernel inherents from CHBulk and implements a simple polynomial double well to model spinodal decomposition. See M.R. Tonks et al. / Computational Materials Science 51 (2012) 20-29, Eqs 11 and 12.

Definition at line 28 of file CHMath.h.

Member Enumeration Documentation

◆ PFFunctionType

enum CHBulk::PFFunctionType
protectedinherited

Definition at line 39 of file CHBulk.h.

Constructor & Destructor Documentation

◆ CHMath()

CHMath::CHMath ( const InputParameters &  parameters)

Definition at line 24 of file CHMath.C.

24 : CHBulk<Real>(parameters) {}

Member Function Documentation

◆ computeGradDFDCons() [1/2]

RealGradient CHMath::computeGradDFDCons ( PFFunctionType  type)
protectedvirtual

Definition at line 27 of file CHMath.C.

28 {
29  switch (type)
30  {
31  case Residual:
32  return 3 * _u[_qp] * _u[_qp] * _grad_u[_qp] - _grad_u[_qp]; // return Residual value
33 
34  case Jacobian:
35  return 6 * _u[_qp] * _phi[_j][_qp] * _grad_u[_qp] +
36  3 * _u[_qp] * _u[_qp] * _grad_phi[_j][_qp] -
37  _grad_phi[_j][_qp]; // return Jacobian value
38  }
39 
40  mooseError("Invalid type passed in");
41 }

◆ computeGradDFDCons() [2/2]

virtual RealGradient CHBulk< Real >::computeGradDFDCons ( PFFunctionType  type)
protectedpure virtualinherited

Implemented in CahnHilliardBase< Real >.

◆ computeQpOffDiagJacobian()

Real CHBulk< Real >::computeQpOffDiagJacobian ( unsigned int  jvar)
protectedvirtualinherited

Reimplemented in KKSCHBulk, and CahnHilliardBase< Real >.

Definition at line 111 of file CHBulk.h.

112 {
113  // get the coupled variable jvar is referring to
114  const unsigned int cvar = mapJvarToCvar(jvar);
115 
116  return (*_dMdarg[cvar])[_qp] * _phi[_j][_qp] * computeGradDFDCons(Residual) * _grad_test[_i][_qp];
117 }
virtual RealGradient computeGradDFDCons(PFFunctionType type)=0
std::vector< const MaterialProperty< Real > *> _dMdarg
Mobility derivative w.r.t coupled variables.
Definition: CHBulk.h:54

◆ initialSetup()

void CHBulk< Real >::initialSetup ( )
virtualinherited

Reimplemented in CahnHilliardBase< Real >.

Definition at line 87 of file CHBulk.h.

88 {
89  validateNonlinearCoupling<Real>("mob_name");
90 }

◆ precomputeQpJacobian()

RealGradient CHBulk< Real >::precomputeQpJacobian ( )
protectedvirtualinherited

Definition at line 101 of file CHBulk.h.

102 {
103  RealGradient grad_value = _M[_qp] * computeGradDFDCons(Jacobian) +
104  _dMdc[_qp] * _phi[_j][_qp] * computeGradDFDCons(Residual);
105 
106  return grad_value;
107 }
virtual RealGradient computeGradDFDCons(PFFunctionType type)=0
const MaterialProperty< Real > & _M
Mobility.
Definition: CHBulk.h:48
const MaterialProperty< Real > & _dMdc
Mobility derivative w.r.t. concentration.
Definition: CHBulk.h:51

◆ precomputeQpResidual()

RealGradient CHBulk< Real >::precomputeQpResidual ( )
protectedvirtualinherited

Definition at line 94 of file CHBulk.h.

95 {
96  return _M[_qp] * computeGradDFDCons(Residual);
97 }
virtual RealGradient computeGradDFDCons(PFFunctionType type)=0
const MaterialProperty< Real > & _M
Mobility.
Definition: CHBulk.h:48

◆ validParams()

InputParameters CHBulk< Real >::validParams ( )
staticinherited

Definition at line 76 of file CHBulk.h.

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

Member Data Documentation

◆ _dMdarg

std::vector<const MaterialProperty<Real > *> CHBulk< Real >::_dMdarg
protectedinherited

Mobility derivative w.r.t coupled variables.

Definition at line 54 of file CHBulk.h.

◆ _dMdc

const MaterialProperty<Real >& CHBulk< Real >::_dMdc
protectedinherited

Mobility derivative w.r.t. concentration.

Definition at line 51 of file CHBulk.h.

◆ _M

const MaterialProperty<Real >& CHBulk< Real >::_M
protectedinherited

Mobility.

Definition at line 48 of file CHBulk.h.


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