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

SplitCHWRes creates the residual of the Cahn-Hilliard equation with a scalar (isotropic) mobility. More...

#include <CahnHilliardAniso.h>

Inheritance diagram for CahnHilliardAniso:
[legend]

Public Types

typedef DerivativeMaterialPropertyNameInterface::SymbolName SymbolName
 

Public Member Functions

 CahnHilliardAniso (const InputParameters &parameters)
 
virtual void initialSetup ()
 
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 Types

typedef CHBulk< RealTensorValue >::PFFunctionType PFFunctionType
 

Protected Member Functions

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

Protected Attributes

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

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

const unsigned int _nvar
 
std::vector< const MaterialProperty< Real > * > _second_derivatives
 
std::vector< const MaterialProperty< Real > * > _third_derivatives
 
std::vector< std::vector< const MaterialProperty< Real > * > > _third_cross_derivatives
 
std::vector< const VariableGradient * > _grad_vars
 
FEProblemBase_dmi_fe_problem
 

Detailed Description

SplitCHWRes creates the residual of the Cahn-Hilliard equation with a scalar (isotropic) mobility.

Definition at line 18 of file CahnHilliardAniso.h.

Member Typedef Documentation

◆ PFFunctionType

typedef CHBulk<RealTensorValue >::PFFunctionType CahnHilliardBase< RealTensorValue >::PFFunctionType
protectedinherited

Definition at line 29 of file CahnHilliardBase.h.

Constructor & Destructor Documentation

◆ CahnHilliardAniso()

CahnHilliardAniso::CahnHilliardAniso ( const InputParameters parameters)

Definition at line 23 of file CahnHilliardAniso.C.

25{
26}
CahnHilliardBase implements the residual of the Cahn-Hilliard equation in a general way that can be t...

Member Function Documentation

◆ computeGradDFDCons()

RealGradient CahnHilliardBase< RealTensorValue >::computeGradDFDCons ( PFFunctionType  type)
protectedvirtualinherited

Implements CHBulk< T >.

Definition at line 30 of file CahnHilliardBase.h.

128{
129 RealGradient res = 0.0;
130
131 switch (type)
132 {
134 for (unsigned int i = 0; i <= _nvar; ++i)
135 res += (*_grad_vars[i])[_qp] * (*_second_derivatives[i])[_qp];
136 return res;
137
139 res = _grad_phi[_j][_qp] * (*_second_derivatives[0])[_qp];
140 for (unsigned int i = 0; i <= _nvar; ++i)
141 res += _phi[_j][_qp] * (*_grad_vars[i])[_qp] * (*_third_derivatives[i])[_qp];
142 return res;
143 }
144
145 mooseError("Internal error");
146}
void mooseError(Args &&... args)
This is the Cahn-Hilliard equation base class that implements the bulk or local energy term of the eq...
Definition CHBulk.h:26
std::vector< const MaterialProperty< Real > * > _third_derivatives
std::vector< const VariableGradient * > _grad_vars
std::vector< const MaterialProperty< Real > * > _second_derivatives
RealVectorValue RealGradient

◆ computeQpOffDiagJacobian()

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

Reimplemented from CHBulk< T >.

Definition at line 31 of file CahnHilliardBase.h.

151{
152 // get the coupled variable jvar is referring to
153 const unsigned int cvar = this->mapJvarToCvar(jvar);
154
155 RealGradient J = _grad_u[_qp] * _phi[_j][_qp] * (*_third_derivatives[cvar + 1])[_qp] +
156 _grad_phi[_j][_qp] * (*_second_derivatives[cvar + 1])[_qp];
157
158 for (unsigned int i = 0; i < _nvar; ++i)
159 J += _phi[_j][_qp] * (*_grad_vars[i + 1])[_qp] * (*_third_cross_derivatives[i][cvar])[_qp];
160
161 return CHBulk<T>::computeQpOffDiagJacobian(jvar) + _M[_qp] * _grad_test[_i][_qp] * J;
162}
virtual Real computeQpOffDiagJacobian(unsigned int jvar)
Definition CHBulk.h:110
const MaterialProperty< T > & _M
Mobility.
Definition CHBulk.h:47
std::vector< std::vector< const MaterialProperty< Real > * > > _third_cross_derivatives

◆ initialSetup()

void CahnHilliardBase< RealTensorValue >::initialSetup ( )
virtualinherited

Check if both the non-linear as well as the auxiliary variables variables are coupled. Derivatives with respect to both types of variables contribute the residual.

Reimplemented from CHBulk< T >.

Definition at line 26 of file CahnHilliardBase.h.

115{
121 this->template validateCoupling<Real>("f_name", _var.name());
122 this->template validateDerivativeMaterialPropertyBase<Real>("f_name");
123}

◆ precomputeQpJacobian()

template<typename T >
RealGradient CHBulk< T >::precomputeQpJacobian ( )
protectedvirtualinherited

Definition at line 100 of file CHBulk.h.

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

◆ precomputeQpResidual()

template<typename T >
RealGradient CHBulk< T >::precomputeQpResidual ( )
protectedvirtualinherited

Definition at line 93 of file CHBulk.h.

94{
95 return _M[_qp] * computeGradDFDCons(Residual);
96}

◆ validParams()

InputParameters CahnHilliardAniso::validParams ( )
static

Definition at line 15 of file CahnHilliardAniso.C.

16{
18 params.addClassDescription("Cahn-Hilliard Kernel that uses a DerivativeMaterial Free Energy and "
19 "a tensor (anisotropic) mobility");
20 return params;
21}
static InputParameters validParams()
void addClassDescription(const std::string &doc_string)

Member Data Documentation

◆ _dMdarg

template<typename T >
std::vector<const MaterialProperty<T> *> CHBulk< T >::_dMdarg
protectedinherited

Mobility derivative w.r.t coupled variables.

Definition at line 53 of file CHBulk.h.

Referenced by CHBulk< T >::CHBulk().

◆ _dMdc

template<typename T >
const MaterialProperty<T>& CHBulk< T >::_dMdc
protectedinherited

Mobility derivative w.r.t. concentration.

Definition at line 50 of file CHBulk.h.

◆ _grad_vars

std::vector<const VariableGradient *> CahnHilliardBase< RealTensorValue >::_grad_vars
privateinherited

Definition at line 53 of file CahnHilliardBase.h.

◆ _M

template<typename T >
const MaterialProperty<T>& CHBulk< T >::_M
protectedinherited

Mobility.

Definition at line 47 of file CHBulk.h.

◆ _nvar

const unsigned int CahnHilliardBase< RealTensorValue >::_nvar
privateinherited

Definition at line 49 of file CahnHilliardBase.h.

◆ _second_derivatives

std::vector<const MaterialProperty<Real> *> CahnHilliardBase< RealTensorValue >::_second_derivatives
privateinherited

Definition at line 50 of file CahnHilliardBase.h.

◆ _third_cross_derivatives

std::vector<std::vector<const MaterialProperty<Real> *> > CahnHilliardBase< RealTensorValue >::_third_cross_derivatives
privateinherited

Definition at line 52 of file CahnHilliardBase.h.

◆ _third_derivatives

std::vector<const MaterialProperty<Real> *> CahnHilliardBase< RealTensorValue >::_third_derivatives
privateinherited

Definition at line 51 of file CahnHilliardBase.h.


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