https://mooseframework.inl.gov
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes | List of all members
CHInterface Class Reference

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

#include <CHInterface.h>

Inheritance diagram for CHInterface:
[legend]

Public Types

typedef DerivativeMaterialPropertyNameInterface::SymbolName SymbolName
 

Public Member Functions

 CHInterface (const InputParameters &parameters)
 
const GenericMaterialProperty< U, is_ad > & getDefaultMaterialProperty (const std::string &name)
 
const GenericMaterialProperty< U, is_ad > & getDefaultMaterialPropertyByName (const std::string &name)
 
void validateDerivativeMaterialPropertyBase (const std::string &base)
 
const MaterialPropertyName derivativePropertyName (const MaterialPropertyName &base, const std::vector< SymbolName > &c) const
 
const MaterialPropertyName derivativePropertyNameFirst (const MaterialPropertyName &base, const SymbolName &c1) const
 
const MaterialPropertyName derivativePropertyNameSecond (const MaterialPropertyName &base, const SymbolName &c1, const SymbolName &c2) const
 
const MaterialPropertyName derivativePropertyNameThird (const MaterialPropertyName &base, const SymbolName &c1, const SymbolName &c2, const SymbolName &c3) const
 
GenericMaterialProperty< U, is_ad > & declarePropertyDerivative (const std::string &base, const std::vector< VariableName > &c)
 
GenericMaterialProperty< U, is_ad > & declarePropertyDerivative (const std::string &base, const std::vector< SymbolName > &c)
 
GenericMaterialProperty< U, is_ad > & declarePropertyDerivative (const std::string &base, const SymbolName &c1, const SymbolName &c2="", const SymbolName &c3="")
 
GenericMaterialProperty< U, is_ad > & declarePropertyDerivative (const std::string &base, const std::vector< VariableName > &c)
 
GenericMaterialProperty< U, is_ad > & declarePropertyDerivative (const std::string &base, const std::vector< SymbolName > &c)
 
GenericMaterialProperty< U, is_ad > & declarePropertyDerivative (const std::string &base, const SymbolName &c1, const SymbolName &c2="", const SymbolName &c3="")
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, const std::vector< VariableName > &c)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, const std::vector< SymbolName > &c)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, const SymbolName &c1, const SymbolName &c2="", const SymbolName &c3="")
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, const SymbolName &c1, unsigned int v2, unsigned int v3=libMesh::invalid_uint)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, unsigned int v1, unsigned int v2=libMesh::invalid_uint, unsigned int v3=libMesh::invalid_uint)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, const std::vector< VariableName > &c)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, const std::vector< SymbolName > &c)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, const SymbolName &c1, const SymbolName &c2="", const SymbolName &c3="")
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, const SymbolName &c1, unsigned int v2, unsigned int v3=libMesh::invalid_uint)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, unsigned int v1, unsigned int v2=libMesh::invalid_uint, unsigned int v3=libMesh::invalid_uint)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivativeByName (const MaterialPropertyName &base, const std::vector< VariableName > &c)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivativeByName (const MaterialPropertyName &base, const std::vector< SymbolName > &c)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivativeByName (const MaterialPropertyName &base, const SymbolName &c1, const SymbolName &c2="", const SymbolName &c3="")
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivativeByName (const MaterialPropertyName &base, const std::vector< VariableName > &c)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivativeByName (const MaterialPropertyName &base, const std::vector< SymbolName > &c)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivativeByName (const MaterialPropertyName &base, const SymbolName &c1, const SymbolName &c2="", const SymbolName &c3="")
 
void validateCoupling (const MaterialPropertyName &base, const std::vector< VariableName > &c, bool validate_aux=true)
 
void validateCoupling (const MaterialPropertyName &base, const VariableName &c1="", const VariableName &c2="", const VariableName &c3="")
 
void validateCoupling (const MaterialPropertyName &base, const std::vector< VariableName > &c, bool validate_aux=true)
 
void validateCoupling (const MaterialPropertyName &base, const VariableName &c1="", const VariableName &c2="", const VariableName &c3="")
 
void validateNonlinearCoupling (const MaterialPropertyName &base, const VariableName &c1="", const VariableName &c2="", const VariableName &c3="")
 
void validateNonlinearCoupling (const MaterialPropertyName &base, const VariableName &c1="", const VariableName &c2="", const VariableName &c3="")
 
const MaterialPropertyName propertyName (const MaterialPropertyName &base, const std::vector< SymbolName > &c) const
 
const MaterialPropertyName propertyName (const MaterialPropertyName &base, const std::vector< SymbolName > &c) const
 
const MaterialPropertyName propertyNameFirst (const MaterialPropertyName &base, const SymbolName &c1) const
 
const MaterialPropertyName propertyNameFirst (const MaterialPropertyName &base, const SymbolName &c1) const
 
const MaterialPropertyName propertyNameSecond (const MaterialPropertyName &base, const SymbolName &c1, const SymbolName &c2) const
 
const MaterialPropertyName propertyNameSecond (const MaterialPropertyName &base, const SymbolName &c1, const SymbolName &c2) const
 
const MaterialPropertyName propertyNameThird (const MaterialPropertyName &base, const SymbolName &c1, const SymbolName &c2, const SymbolName &c3) const
 
const MaterialPropertyName propertyNameThird (const MaterialPropertyName &base, const SymbolName &c1, const SymbolName &c2, const SymbolName &c3) const
 

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.
 
std::vector< const VariableGradient * > _coupled_grad_vars
 Coupled variables used in mobility.
 
const MaterialProperty< Real > & _M
 
const MaterialProperty< Real > & _dMdc
 
const MaterialProperty< Real > & _d2Mdc2
 
const VariableSecond_second_u
 
const VariableTestSecond_second_test
 
const VariablePhiSecond_second_phi
 
std::vector< const MaterialProperty< Real > * > _dMdarg
 
std::vector< const MaterialProperty< Real > * > _d2Mdcdarg
 
std::vector< std::vector< const MaterialProperty< Real > * > > _d2Mdargdarg
 

Private Member Functions

bool haveMaterialProperty (const std::string &prop_name)
 
std::vector< VariableName > buildVariableVector (const VariableName &c1, const VariableName &c2, const VariableName &c3)
 
void validateCouplingHelper (const MaterialPropertyName &base, const std::vector< VariableName > &c, const System &system, std::vector< VariableName > &missing)
 
bool isNotObjectVariable (const VariableName &name)
 

Private Attributes

FEProblemBase_dmi_fe_problem
 

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 CHInterface.h.

Constructor & Destructor Documentation

◆ CHInterface()

CHInterface::CHInterface ( const InputParameters parameters)

Definition at line 23 of file CHInterface.C.

23: CHInterfaceBase<Real>(parameters) {}
This is the Cahn-Hilliard equation base class that implements the interfacial or gradient energy term...

Member Function Documentation

◆ computeQpJacobian()

Real CHInterfaceBase< Real >::computeQpJacobian ( )
protectedvirtualinherited

Definition at line 32 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}
unsigned int _nvar
Number of variables.
const VariableSecond & _second_u
std::vector< const MaterialProperty< Real > * > _d2Mdcdarg
const VariableTestSecond & _second_test
const MaterialProperty< Real > & _dMdc
const MaterialProperty< Real > & _kappa
const VariablePhiSecond & _second_phi
const MaterialProperty< Real > & _M
const MaterialProperty< Real > & _d2Mdc2
std::vector< const VariableGradient * > _coupled_grad_vars
Coupled variables used in mobility.
std::vector< const MaterialProperty< Real > * > _dMdarg
Real value(unsigned n, unsigned alpha, unsigned beta, Real x)
RealVectorValue RealGradient
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

◆ computeQpOffDiagJacobian()

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

Definition at line 33 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}
std::vector< std::vector< const MaterialProperty< Real > * > > _d2Mdargdarg

◆ computeQpResidual()

Real CHInterfaceBase< Real >::computeQpResidual ( )
protectedvirtualinherited

Definition at line 31 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 CHInterface::validParams ( )
static

Definition at line 15 of file CHInterface.C.

16{
19 "Gradient energy Cahn-Hilliard Kernel with a scalar (isotropic) mobility");
20 return params;
21}
static InputParameters validParams()
void addClassDescription(const std::string &doc_string)

Member Data Documentation

◆ _coupled_grad_vars

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

Coupled variables used in mobility.

Definition at line 62 of file CHInterfaceBase.h.

◆ _d2Mdargdarg

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

Definition at line 58 of file CHInterfaceBase.h.

◆ _d2Mdc2

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

Definition at line 41 of file CHInterfaceBase.h.

◆ _d2Mdcdarg

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

Definition at line 57 of file CHInterfaceBase.h.

◆ _dMdarg

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

Mobility derivatives w.r.t. its dependent variables

Definition at line 56 of file CHInterfaceBase.h.

◆ _dMdc

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

Definition at line 40 of file CHInterfaceBase.h.

◆ _kappa

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

Definition at line 35 of file CHInterfaceBase.h.

◆ _M

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

Mobility material property value and concentration derivatives

Definition at line 39 of file CHInterfaceBase.h.

◆ _nvar

unsigned int CHInterfaceBase< Real >::_nvar
protectedinherited

Number of variables.

Definition at line 52 of file CHInterfaceBase.h.

◆ _second_phi

const VariablePhiSecond& CHInterfaceBase< Real >::_second_phi
protectedinherited

Definition at line 48 of file CHInterfaceBase.h.

◆ _second_test

const VariableTestSecond& CHInterfaceBase< Real >::_second_test
protectedinherited

Definition at line 47 of file CHInterfaceBase.h.

◆ _second_u

const VariableSecond& CHInterfaceBase< Real >::_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: