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 19 of file CHInterfaceAniso.h.

Constructor & Destructor Documentation

◆ CHInterfaceAniso()

CHInterfaceAniso::CHInterfaceAniso ( const InputParameters &  parameters)

Definition at line 24 of file CHInterfaceAniso.C.

Member Function Documentation

◆ computeQpJacobian()

Real CHInterfaceBase< RealTensorValue >::computeQpJacobian ( )
protectedvirtualinherited

Definition at line 125 of file CHInterfaceBase.h.

126 {
127  // Set the gradient and gradient derivative values
128  RealGradient grad_M = _dMdc[_qp] * _grad_u[_qp];
129 
130  RealGradient dgrad_Mdc =
131  _d2Mdc2[_qp] * _phi[_j][_qp] * _grad_u[_qp] + _dMdc[_qp] * _grad_phi[_j][_qp];
132 
133  for (unsigned int i = 0; i < _nvar; ++i)
134  {
135  grad_M += (*_dMdarg[i])[_qp] * (*_coupled_grad_vars[i])[_qp];
136  dgrad_Mdc += (*_d2Mdcdarg[i])[_qp] * _phi[_j][_qp] * (*_coupled_grad_vars[i])[_qp];
137  }
138 
139  // Jacobian value using product rule
140  Real value = _kappa[_qp] * _second_phi[_j][_qp].tr() *
141  ((_M[_qp] * _second_test[_i][_qp]).tr() + grad_M * _grad_test[_i][_qp]) +
142  _kappa[_qp] * _second_u[_qp].tr() *
143  ((_dMdc[_qp] * _second_test[_i][_qp]).tr() * _phi[_j][_qp] +
144  dgrad_Mdc * _grad_test[_i][_qp]);
145 
146  return value;
147 }
const VariablePhiSecond & _second_phi
unsigned int _nvar
Number of variables.
std::vector< const VariableGradient *> _coupled_grad_vars
Coupled variables used in mobility.
const MaterialProperty< RealTensorValue > & _d2Mdc2
std::vector< const MaterialProperty< RealTensorValue > *> _dMdarg
const VariableTestSecond & _second_test
const MaterialProperty< RealTensorValue > & _M
const VariableSecond & _second_u
const MaterialProperty< Real > & _kappa
std::vector< const MaterialProperty< RealTensorValue > *> _d2Mdcdarg
const MaterialProperty< RealTensorValue > & _dMdc

◆ computeQpOffDiagJacobian()

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

Definition at line 151 of file CHInterfaceBase.h.

152 {
153  // get the coupled variable jvar is referring to
154  const unsigned int cvar = mapJvarToCvar(jvar);
155 
156  // Set the gradient derivative
157  RealGradient dgrad_Mdarg = (*_d2Mdcdarg[cvar])[_qp] * _phi[_j][_qp] * _grad_u[_qp] +
158  (*_dMdarg[cvar])[_qp] * _grad_phi[_j][_qp];
159 
160  for (unsigned int i = 0; i < _nvar; ++i)
161  dgrad_Mdarg += (*_d2Mdargdarg[cvar][i])[_qp] * _phi[_j][_qp] * (*_coupled_grad_vars[cvar])[_qp];
162 
163  // Jacobian value using product rule
164  Real value = _kappa[_qp] * _second_u[_qp].tr() *
165  (((*_dMdarg[cvar])[_qp] * _second_test[_i][_qp]).tr() * _phi[_j][_qp] +
166  dgrad_Mdarg * _grad_test[_i][_qp]);
167 
168  return value;
169 }
unsigned int _nvar
Number of variables.
std::vector< const VariableGradient *> _coupled_grad_vars
Coupled variables used in mobility.
std::vector< const MaterialProperty< RealTensorValue > *> _dMdarg
const VariableTestSecond & _second_test
const VariableSecond & _second_u
const MaterialProperty< Real > & _kappa
std::vector< const MaterialProperty< RealTensorValue > *> _d2Mdcdarg
std::vector< std::vector< const MaterialProperty< RealTensorValue > *> > _d2Mdargdarg

◆ computeQpResidual()

Real CHInterfaceBase< RealTensorValue >::computeQpResidual ( )
protectedvirtualinherited

Definition at line 113 of file CHInterfaceBase.h.

114 {
115  RealGradient grad_M = _dMdc[_qp] * _grad_u[_qp];
116  for (unsigned int i = 0; i < _nvar; ++i)
117  grad_M += (*_dMdarg[i])[_qp] * (*_coupled_grad_vars[i])[_qp];
118 
119  return _kappa[_qp] * _second_u[_qp].tr() *
120  ((_M[_qp] * _second_test[_i][_qp]).tr() + grad_M * _grad_test[_i][_qp]);
121 }
unsigned int _nvar
Number of variables.
std::vector< const VariableGradient *> _coupled_grad_vars
Coupled variables used in mobility.
std::vector< const MaterialProperty< RealTensorValue > *> _dMdarg
const VariableTestSecond & _second_test
const MaterialProperty< RealTensorValue > & _M
const VariableSecond & _second_u
const MaterialProperty< Real > & _kappa
const MaterialProperty< RealTensorValue > & _dMdc

◆ validParams()

InputParameters CHInterfaceBase< RealTensorValue >::validParams ( )
staticinherited

Definition at line 101 of file CHInterfaceBase.h.

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

Member Data Documentation

◆ _coupled_grad_vars

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

Coupled variables used in mobility.

Definition at line 63 of file CHInterfaceBase.h.

◆ _d2Mdargdarg

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

Definition at line 59 of file CHInterfaceBase.h.

◆ _d2Mdc2

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

Definition at line 42 of file CHInterfaceBase.h.

◆ _d2Mdcdarg

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

Definition at line 58 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 57 of file CHInterfaceBase.h.

◆ _dMdc

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

Definition at line 41 of file CHInterfaceBase.h.

◆ _kappa

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

Definition at line 36 of file CHInterfaceBase.h.

◆ _M

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

Mobility material property value and concentration derivatives

Definition at line 40 of file CHInterfaceBase.h.

◆ _nvar

unsigned int CHInterfaceBase< RealTensorValue >::_nvar
protectedinherited

Number of variables.

Definition at line 53 of file CHInterfaceBase.h.

◆ _second_phi

const VariablePhiSecond& CHInterfaceBase< RealTensorValue >::_second_phi
protectedinherited

Definition at line 49 of file CHInterfaceBase.h.

◆ _second_test

const VariableTestSecond& CHInterfaceBase< RealTensorValue >::_second_test
protectedinherited

Definition at line 48 of file CHInterfaceBase.h.

◆ _second_u

const VariableSecond& CHInterfaceBase< RealTensorValue >::_second_u
protectedinherited

Variables for second order derivatives

Definition at line 47 of file CHInterfaceBase.h.


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