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
ACInterface Class Reference

Compute the Allen-Cahn interface term with the weak form residual \( \left( \kappa_i \nabla\eta_i, \nabla (L_i \psi) \right) \). More...

#include <ACInterface.h>

Inheritance diagram for ACInterface:
[legend]

Public Types

typedef DerivativeMaterialPropertyNameInterface::SymbolName SymbolName
 

Public Member Functions

 ACInterface (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 Member Functions

virtual Real computeQpResidual ()
 
virtual Real computeQpJacobian ()
 
virtual Real computeQpOffDiagJacobian (unsigned int jvar)
 
RealGradient gradL ()
 
RealGradient gradKappa ()
 
RealGradient nablaLPsi ()
 the \( \nabla(L\psi) \) term
 
RealGradient kappaNablaLPsi ()
 the \( \kappa\nabla(L\psi) \) term
 

Protected Attributes

const MaterialProperty< Real > & _L
 Mobility.
 
const MaterialProperty< Real > & _kappa
 Interfacial parameter.
 
const bool _variable_L
 flag set if L is a function of non-linear variables in args
 
const MaterialProperty< Real > & _dkappadop
 kappa derivative w.r.t. order parameter
 
std::vector< const MaterialProperty< Real > * > _dkappadarg
 kappa derivative w.r.t. other coupled variables
 
std::vector< const VariableGradient * > _gradarg
 Gradients for all coupled variables.
 
const MaterialProperty< Real > & _dLdop
 Mobility derivatives w.r.t. order parameter.
 
const MaterialProperty< Real > & _d2Ldop2
 
std::vector< const MaterialProperty< Real > * > _dLdarg
 Mobility derivative w.r.t. other coupled variables.
 
std::vector< const MaterialProperty< Real > * > _d2Ldargdop
 
std::vector< std::vector< const MaterialProperty< Real > * > > _d2Ldarg2
 

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

Compute the Allen-Cahn interface term with the weak form residual \( \left( \kappa_i \nabla\eta_i, \nabla (L_i \psi) \right) \).

Definition at line 20 of file ACInterface.h.

Constructor & Destructor Documentation

◆ ACInterface()

ACInterface::ACInterface ( const InputParameters parameters)

Definition at line 29 of file ACInterface.C.

31 _L(getMaterialProperty<Real>("mob_name")),
32 _kappa(getMaterialProperty<Real>("kappa_name")),
33 _variable_L(getParam<bool>("variable_L")),
34 _dLdop(getMaterialPropertyDerivative<Real>("mob_name", _var.name())),
35 _d2Ldop2(getMaterialPropertyDerivative<Real>("mob_name", _var.name(), _var.name())),
36 _dkappadop(getMaterialPropertyDerivative<Real>("kappa_name", _var.name())),
37 _dLdarg(_n_args),
38 _d2Ldargdop(_n_args),
39 _d2Ldarg2(_n_args),
40 _dkappadarg(_n_args),
41 _gradarg(_n_args)
42{
43 // Get mobility and kappa derivatives and coupled variable gradients
44 for (unsigned int i = 0; i < _n_args; ++i)
45 {
46 MooseVariable * ivar = _coupled_standard_moose_vars[i];
47 const VariableName iname = ivar->name();
48 if (iname == _var.name())
49 paramError("coupled_variables",
50 "The kernel variable should not be specified in the coupled `coupled_variables` "
51 "parameter.");
52
53 _dLdarg[i] = &getMaterialPropertyDerivative<Real>("mob_name", i);
54 _dkappadarg[i] = &getMaterialPropertyDerivative<Real>("kappa_name", i);
55 _d2Ldargdop[i] = &getMaterialPropertyDerivative<Real>("mob_name", iname, _var.name());
56
57 _gradarg[i] = &(ivar->gradSln());
58
59 _d2Ldarg2[i].resize(_n_args);
60 for (unsigned int j = 0; j < _n_args; ++j)
61 _d2Ldarg2[i][j] = &getMaterialPropertyDerivative<Real>("mob_name", i, j);
62 }
63}
const bool _variable_L
flag set if L is a function of non-linear variables in args
Definition ACInterface.h:48
std::vector< const VariableGradient * > _gradarg
Gradients for all coupled variables.
Definition ACInterface.h:68
const MaterialProperty< Real > & _dLdop
Mobility derivatives w.r.t. order parameter.
Definition ACInterface.h:51
const MaterialProperty< Real > & _d2Ldop2
Definition ACInterface.h:52
std::vector< const MaterialProperty< Real > * > _dkappadarg
kappa derivative w.r.t. other coupled variables
Definition ACInterface.h:65
std::vector< const MaterialProperty< Real > * > _dLdarg
Mobility derivative w.r.t. other coupled variables.
Definition ACInterface.h:59
const MaterialProperty< Real > & _L
Mobility.
Definition ACInterface.h:43
std::vector< const MaterialProperty< Real > * > _d2Ldargdop
Definition ACInterface.h:60
std::vector< std::vector< const MaterialProperty< Real > * > > _d2Ldarg2
Definition ACInterface.h:61
const MaterialProperty< Real > & _dkappadop
kappa derivative w.r.t. order parameter
Definition ACInterface.h:56
const MaterialProperty< Real > & _kappa
Interfacial parameter.
Definition ACInterface.h:45
const std::string & name() const
const FieldVariableGradient & gradSln() const override

Member Function Documentation

◆ computeQpJacobian()

Real ACInterface::computeQpJacobian ( )
protectedvirtual

Reimplemented in ACInterface2DMultiPhase1, ACInterface2DMultiPhase2, ACInterfaceChangedVariable, and ACInterfaceCleavageFracture.

Definition at line 106 of file ACInterface.C.

107{
108 // dsum is the derivative \f$ \frac\partial{\partial \eta} \left( \nabla (L\psi) \right) \f$
109 RealGradient dsum =
110 (_dkappadop[_qp] * _L[_qp] + _kappa[_qp] * _dLdop[_qp]) * _phi[_j][_qp] * _grad_test[_i][_qp];
111
112 // compute the derivative of the gradient of the mobility
113 if (_variable_L)
114 {
115 RealGradient dgradL =
116 _grad_phi[_j][_qp] * _dLdop[_qp] + _grad_u[_qp] * _phi[_j][_qp] * _d2Ldop2[_qp];
117
118 for (unsigned int i = 0; i < _n_args; ++i)
119 dgradL += (*_gradarg[i])[_qp] * _phi[_j][_qp] * (*_d2Ldargdop[i])[_qp];
120
121 dsum += (_kappa[_qp] * dgradL + _dkappadop[_qp] * _phi[_j][_qp] * gradL()) * _test[_i][_qp];
122 }
123
124 return _grad_phi[_j][_qp] * kappaNablaLPsi() + _grad_u[_qp] * dsum;
125}
RealGradient kappaNablaLPsi()
the term
Definition ACInterface.C:94
RealGradient gradL()
Definition ACInterface.C:73
RealVectorValue RealGradient

Referenced by ACInterfaceChangedVariable::computeQpJacobian().

◆ computeQpOffDiagJacobian()

Real ACInterface::computeQpOffDiagJacobian ( unsigned int  jvar)
protectedvirtual

Reimplemented in ACInterface2DMultiPhase1, and ACInterface2DMultiPhase2.

Definition at line 128 of file ACInterface.C.

129{
130 // get the coupled variable jvar is referring to
131 const unsigned int cvar = mapJvarToCvar(jvar);
132
133 // dsum is the derivative \f$ \frac\partial{\partial \eta} \left( \nabla (L\psi) \right) \f$
134 RealGradient dsum = ((*_dkappadarg[cvar])[_qp] * _L[_qp] + _kappa[_qp] * (*_dLdarg[cvar])[_qp]) *
135 _phi[_j][_qp] * _grad_test[_i][_qp];
136
137 // compute the derivative of the gradient of the mobility
138 if (_variable_L)
139 {
140 RealGradient dgradL = _grad_phi[_j][_qp] * (*_dLdarg[cvar])[_qp] +
141 _grad_u[_qp] * _phi[_j][_qp] * (*_d2Ldargdop[cvar])[_qp];
142
143 for (unsigned int i = 0; i < _n_args; ++i)
144 dgradL += (*_gradarg[i])[_qp] * _phi[_j][_qp] * (*_d2Ldarg2[cvar][i])[_qp];
145
146 dsum += (_kappa[_qp] * dgradL + _dkappadop[_qp] * _phi[_j][_qp] * gradL()) * _test[_i][_qp];
147 }
148
149 return _grad_u[_qp] * dsum;
150}

◆ computeQpResidual()

Real ACInterface::computeQpResidual ( )
protectedvirtual

◆ gradKappa()

RealGradient ACInterface::gradKappa ( )
protected

◆ gradL()

RealGradient ACInterface::gradL ( )
protected

Definition at line 73 of file ACInterface.C.

74{
75 RealGradient g = _grad_u[_qp] * _dLdop[_qp];
76 for (unsigned int i = 0; i < _n_args; ++i)
77 g += (*_gradarg[i])[_qp] * (*_dLdarg[i])[_qp];
78 return g;
79}

Referenced by computeQpJacobian(), ACInterfaceCleavageFracture::computeQpJacobian(), computeQpOffDiagJacobian(), and nablaLPsi().

◆ initialSetup()

void ACInterface::initialSetup ( )
virtual

Reimplemented in ACInterfaceChangedVariable.

Definition at line 66 of file ACInterface.C.

67{
68 validateCoupling<Real>("mob_name");
69 validateCoupling<Real>("kappa_name");
70}

◆ kappaNablaLPsi()

RealGradient ACInterface::kappaNablaLPsi ( )
protected

the \( \kappa\nabla(L\psi) \) term

Definition at line 94 of file ACInterface.C.

95{
96 return _kappa[_qp] * nablaLPsi();
97}
RealGradient nablaLPsi()
the term
Definition ACInterface.C:82

Referenced by computeQpJacobian(), ACInterfaceCleavageFracture::computeQpJacobian(), computeQpResidual(), and ACInterfaceCleavageFracture::computeQpResidual().

◆ nablaLPsi()

RealGradient ACInterface::nablaLPsi ( )
protected

the \( \nabla(L\psi) \) term

Definition at line 82 of file ACInterface.C.

83{
84 // sum is the product rule gradient \f$ \nabla (L\psi) \f$
85 RealGradient sum = _L[_qp] * _grad_test[_i][_qp];
86
87 if (_variable_L)
88 sum += gradL() * _test[_i][_qp];
89
90 return sum;
91}

Referenced by ACInterface2DMultiPhase1::computeQpJacobian(), ACInterface2DMultiPhase2::computeQpJacobian(), ACInterface2DMultiPhase1::computeQpOffDiagJacobian(), ACInterface2DMultiPhase2::computeQpOffDiagJacobian(), ACInterface2DMultiPhase1::computeQpResidual(), and kappaNablaLPsi().

◆ validParams()

InputParameters ACInterface::validParams ( )
static

Definition at line 15 of file ACInterface.C.

16{
18 params.addClassDescription("Gradient energy Allen-Cahn Kernel");
19 params.addParam<MaterialPropertyName>("mob_name", "L", "The mobility used with the kernel");
20 params.addParam<MaterialPropertyName>("kappa_name", "kappa_op", "The kappa used with the kernel");
21 params.addParam<bool>("variable_L",
22 true,
23 "The mobility is a function of any MOOSE variable (if "
24 "this is set to false L must be constant over the "
25 "entire domain!)");
26 return params;
27}
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
void addClassDescription(const std::string &doc_string)
static InputParameters validParams()

Referenced by ACInterface2DMultiPhase1::validParams(), ACInterface2DMultiPhase2::validParams(), ACInterfaceChangedVariable::validParams(), and ACInterfaceCleavageFracture::validParams().

Member Data Documentation

◆ _d2Ldarg2

std::vector<std::vector<const MaterialProperty<Real> *> > ACInterface::_d2Ldarg2
protected

◆ _d2Ldargdop

std::vector<const MaterialProperty<Real> *> ACInterface::_d2Ldargdop
protected

◆ _d2Ldop2

const MaterialProperty<Real>& ACInterface::_d2Ldop2
protected

◆ _dkappadarg

std::vector<const MaterialProperty<Real> *> ACInterface::_dkappadarg
protected

kappa derivative w.r.t. other coupled variables

Definition at line 65 of file ACInterface.h.

Referenced by ACInterface(), and computeQpOffDiagJacobian().

◆ _dkappadop

const MaterialProperty<Real>& ACInterface::_dkappadop
protected

kappa derivative w.r.t. order parameter

Definition at line 56 of file ACInterface.h.

Referenced by computeQpJacobian(), ACInterfaceCleavageFracture::computeQpJacobian(), and computeQpOffDiagJacobian().

◆ _dLdarg

std::vector<const MaterialProperty<Real> *> ACInterface::_dLdarg
protected

Mobility derivative w.r.t. other coupled variables.

Definition at line 59 of file ACInterface.h.

Referenced by ACInterface(), computeQpOffDiagJacobian(), ACInterface2DMultiPhase1::computeQpOffDiagJacobian(), ACInterface2DMultiPhase2::computeQpOffDiagJacobian(), and gradL().

◆ _dLdop

const MaterialProperty<Real>& ACInterface::_dLdop
protected

◆ _gradarg

std::vector<const VariableGradient *> ACInterface::_gradarg
protected

◆ _kappa

const MaterialProperty<Real>& ACInterface::_kappa
protected

◆ _L

const MaterialProperty<Real>& ACInterface::_L
protected

◆ _variable_L

const bool ACInterface::_variable_L
protected

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