www.mooseframework.org
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
CHInterfaceAniso Class Reference

This is the Cahn-Hilliard equation base class that implements the interfacial or gradient energy term of the equation. More...

#include <CHInterfaceAniso.h>

Inheritance diagram for CHInterfaceAniso:
[legend]

Public Member Functions

 CHInterfaceAniso (const InputParameters &parameters)
 

Static Public Member Functions

static InputParameters validParams ()
 

Protected Member Functions

virtual Real computeQpResidual ()
 
virtual Real computeQpJacobian ()
 
virtual Real computeQpOffDiagJacobian (unsigned int jvar)
 

Protected Attributes

const MaterialProperty< Real > & _kappa
 
unsigned int _nvar
 Number of variables. More...
 
std::vector< const VariableGradient * > _coupled_grad_vars
 Coupled variables used in mobility. More...
 
const MaterialProperty< RealTensorValue > & _M
 
const MaterialProperty< RealTensorValue > & _dMdc
 
const MaterialProperty< RealTensorValue > & _d2Mdc2
 
const VariableSecond & _second_u
 
const VariableTestSecond & _second_test
 
const VariablePhiSecond & _second_phi
 
std::vector< const MaterialProperty< RealTensorValue > * > _dMdarg
 
std::vector< const MaterialProperty< RealTensorValue > * > _d2Mdcdarg
 
std::vector< std::vector< const MaterialProperty< RealTensorValue > * > > _d2Mdargdarg
 

Detailed Description

This is the Cahn-Hilliard equation base class that implements the interfacial or gradient energy term of the equation.

With a scalar (isotropic) mobility.

Definition at line 18 of file CHInterfaceAniso.h.

Constructor & Destructor Documentation

◆ CHInterfaceAniso()

CHInterfaceAniso::CHInterfaceAniso ( const InputParameters &  parameters)

Definition at line 24 of file CHInterfaceAniso.C.

26 {
27 }

Member Function Documentation

◆ computeQpJacobian()

Real CHInterfaceBase< RealTensorValue >::computeQpJacobian ( )
protectedvirtualinherited

Definition at line 124 of file CHInterfaceBase.h.

125 {
126  // Set the gradient and gradient derivative values
127  RealGradient grad_M = _dMdc[_qp] * _grad_u[_qp];
128 
129  RealGradient dgrad_Mdc =
130  _d2Mdc2[_qp] * _phi[_j][_qp] * _grad_u[_qp] + _dMdc[_qp] * _grad_phi[_j][_qp];
131 
132  for (unsigned int i = 0; i < _nvar; ++i)
133  {
134  grad_M += (*_dMdarg[i])[_qp] * (*_coupled_grad_vars[i])[_qp];
135  dgrad_Mdc += (*_d2Mdcdarg[i])[_qp] * _phi[_j][_qp] * (*_coupled_grad_vars[i])[_qp];
136  }
137 
138  // Jacobian value using product rule
139  Real value = _kappa[_qp] * _second_phi[_j][_qp].tr() *
140  ((_M[_qp] * _second_test[_i][_qp]).tr() + grad_M * _grad_test[_i][_qp]) +
141  _kappa[_qp] * _second_u[_qp].tr() *
142  ((_dMdc[_qp] * _second_test[_i][_qp]).tr() * _phi[_j][_qp] +
143  dgrad_Mdc * _grad_test[_i][_qp]);
144 
145  return value;
146 }

◆ computeQpOffDiagJacobian()

Real CHInterfaceBase< RealTensorValue >::computeQpOffDiagJacobian ( unsigned int  jvar)
protectedvirtualinherited

Definition at line 150 of file CHInterfaceBase.h.

151 {
152  // get the coupled variable jvar is referring to
153  const unsigned int cvar = mapJvarToCvar(jvar);
154 
155  // Set the gradient derivative
156  RealGradient dgrad_Mdarg = (*_d2Mdcdarg[cvar])[_qp] * _phi[_j][_qp] * _grad_u[_qp] +
157  (*_dMdarg[cvar])[_qp] * _grad_phi[_j][_qp];
158 
159  for (unsigned int i = 0; i < _nvar; ++i)
160  dgrad_Mdarg += (*_d2Mdargdarg[cvar][i])[_qp] * _phi[_j][_qp] * (*_coupled_grad_vars[cvar])[_qp];
161 
162  // Jacobian value using product rule
163  Real value = _kappa[_qp] * _second_u[_qp].tr() *
164  (((*_dMdarg[cvar])[_qp] * _second_test[_i][_qp]).tr() * _phi[_j][_qp] +
165  dgrad_Mdarg * _grad_test[_i][_qp]);
166 
167  return value;
168 }

◆ computeQpResidual()

Real CHInterfaceBase< RealTensorValue >::computeQpResidual ( )
protectedvirtualinherited

Definition at line 112 of file CHInterfaceBase.h.

113 {
114  RealGradient grad_M = _dMdc[_qp] * _grad_u[_qp];
115  for (unsigned int i = 0; i < _nvar; ++i)
116  grad_M += (*_dMdarg[i])[_qp] * (*_coupled_grad_vars[i])[_qp];
117 
118  return _kappa[_qp] * _second_u[_qp].tr() *
119  ((_M[_qp] * _second_test[_i][_qp]).tr() + grad_M * _grad_test[_i][_qp]);
120 }

◆ validParams()

InputParameters CHInterfaceBase< RealTensorValue >::validParams ( )
staticinherited

Definition at line 100 of file CHInterfaceBase.h.

101 {
102  InputParameters params = ::validParams<Kernel>();
103  params.addClassDescription("Gradient energy Cahn-Hilliard base Kernel");
104  params.addRequiredParam<MaterialPropertyName>("kappa_name", "The kappa used with the kernel");
105  params.addRequiredParam<MaterialPropertyName>("mob_name", "The mobility used with the kernel");
106  params.addCoupledVar("args", "Vector of arguments of the mobility");
107  return params;
108 }

Member Data Documentation

◆ _coupled_grad_vars

std::vector<const VariableGradient *> CHInterfaceBase< RealTensorValue >::_coupled_grad_vars
protectedinherited

Coupled variables used in mobility.

Definition at line 62 of file CHInterfaceBase.h.

◆ _d2Mdargdarg

std::vector<std::vector<const MaterialProperty<RealTensorValue > *> > CHInterfaceBase< RealTensorValue >::_d2Mdargdarg
protectedinherited

Definition at line 58 of file CHInterfaceBase.h.

◆ _d2Mdc2

const MaterialProperty<RealTensorValue >& CHInterfaceBase< RealTensorValue >::_d2Mdc2
protectedinherited

Definition at line 41 of file CHInterfaceBase.h.

◆ _d2Mdcdarg

std::vector<const MaterialProperty<RealTensorValue > *> CHInterfaceBase< RealTensorValue >::_d2Mdcdarg
protectedinherited

Definition at line 57 of file CHInterfaceBase.h.

◆ _dMdarg

std::vector<const MaterialProperty<RealTensorValue > *> CHInterfaceBase< RealTensorValue >::_dMdarg
protectedinherited

Mobility derivatives w.r.t. its dependent variables

Definition at line 56 of file CHInterfaceBase.h.

◆ _dMdc

const MaterialProperty<RealTensorValue >& CHInterfaceBase< RealTensorValue >::_dMdc
protectedinherited

Definition at line 40 of file CHInterfaceBase.h.

◆ _kappa

const MaterialProperty<Real>& CHInterfaceBase< RealTensorValue >::_kappa
protectedinherited

Definition at line 35 of file CHInterfaceBase.h.

◆ _M

const MaterialProperty<RealTensorValue >& CHInterfaceBase< RealTensorValue >::_M
protectedinherited

Mobility material property value and concentration derivatives

Definition at line 39 of file CHInterfaceBase.h.

◆ _nvar

unsigned int CHInterfaceBase< RealTensorValue >::_nvar
protectedinherited

Number of variables.

Definition at line 52 of file CHInterfaceBase.h.

◆ _second_phi

const VariablePhiSecond& CHInterfaceBase< RealTensorValue >::_second_phi
protectedinherited

Definition at line 48 of file CHInterfaceBase.h.

◆ _second_test

const VariableTestSecond& CHInterfaceBase< RealTensorValue >::_second_test
protectedinherited

Definition at line 47 of file CHInterfaceBase.h.

◆ _second_u

const VariableSecond& CHInterfaceBase< RealTensorValue >::_second_u
protectedinherited

Variables for second order derivatives

Definition at line 46 of file CHInterfaceBase.h.


The documentation for this class was generated from the following files:
CHInterfaceBase< RealTensorValue >::_d2Mdcdarg
std::vector< const MaterialProperty< RealTensorValue > * > _d2Mdcdarg
Definition: CHInterfaceBase.h:57
CHInterfaceBase< RealTensorValue >::_dMdc
const MaterialProperty< RealTensorValue > & _dMdc
Definition: CHInterfaceBase.h:40
libMesh::RealGradient
VectorValue< Real > RealGradient
Definition: GrainForceAndTorqueInterface.h:17
CHInterfaceBase< RealTensorValue >::_dMdarg
std::vector< const MaterialProperty< RealTensorValue > * > _dMdarg
Definition: CHInterfaceBase.h:56
CHInterfaceBase< RealTensorValue >
CHInterfaceBase< RealTensorValue >::_second_phi
const VariablePhiSecond & _second_phi
Definition: CHInterfaceBase.h:48
CHInterfaceBase< RealTensorValue >::_d2Mdargdarg
std::vector< std::vector< const MaterialProperty< RealTensorValue > * > > _d2Mdargdarg
Definition: CHInterfaceBase.h:58
CHInterfaceBase< RealTensorValue >::_nvar
unsigned int _nvar
Number of variables.
Definition: CHInterfaceBase.h:52
CHInterfaceBase< RealTensorValue >::_d2Mdc2
const MaterialProperty< RealTensorValue > & _d2Mdc2
Definition: CHInterfaceBase.h:41
CHInterfaceBase< RealTensorValue >::_coupled_grad_vars
std::vector< const VariableGradient * > _coupled_grad_vars
Coupled variables used in mobility.
Definition: CHInterfaceBase.h:62
CHInterfaceBase< RealTensorValue >::_second_test
const VariableTestSecond & _second_test
Definition: CHInterfaceBase.h:47
CHInterfaceBase< RealTensorValue >::_second_u
const VariableSecond & _second_u
Definition: CHInterfaceBase.h:46
CHInterfaceBase< RealTensorValue >::_kappa
const MaterialProperty< Real > & _kappa
Definition: CHInterfaceBase.h:35
CHInterfaceBase< RealTensorValue >::_M
const MaterialProperty< RealTensorValue > & _M
Definition: CHInterfaceBase.h:39