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

Compute the Allen-Cahn interface term with the weak form residual \( \left(\nabla (L \psi), 1/2 {\partial \kappa} \over {\partial \nabla \eta_{\alpha i}} \sum \{(\nabla \eta_{\beta j})^2 \} \right) \). More...

#include <ACInterface2DMultiPhase1.h>

Inheritance diagram for ACInterface2DMultiPhase1:
[legend]

Public Types

typedef DerivativeMaterialPropertyNameInterface::SymbolName SymbolName
 

Public Member Functions

 ACInterface2DMultiPhase1 (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)
 
Real sumSquareGradEta ()
 
RealGradient gradL ()
 
RealGradient gradKappa ()
 
RealGradient nablaLPsi ()
 the \( \nabla(L\psi) \) term
 
RealGradient kappaNablaLPsi ()
 the \( \kappa\nabla(L\psi) \) term
 

Protected Attributes

const MaterialProperty< RealGradient > & _dkappadgrad_etaa
 Interfacial parameter.
 
const MaterialProperty< RealTensorValue > & _d2kappadgrad_etaa
 
unsigned int _num_etas
 Order parameters.
 
std::vector< const VariableValue * > _eta
 
std::vector< const VariableGradient * > _grad_eta
 
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(\nabla (L \psi), 1/2 {\partial \kappa} \over {\partial \nabla \eta_{\alpha i}} \sum \{(\nabla \eta_{\beta j})^2 \} \right) \).

Definition at line 22 of file ACInterface2DMultiPhase1.h.

Constructor & Destructor Documentation

◆ ACInterface2DMultiPhase1()

ACInterface2DMultiPhase1::ACInterface2DMultiPhase1 ( const InputParameters parameters)

Definition at line 33 of file ACInterface2DMultiPhase1.C.

34 : ACInterface(parameters),
35 _dkappadgrad_etaa(getMaterialProperty<RealGradient>("dkappadgrad_etaa_name")),
36 _d2kappadgrad_etaa(getMaterialProperty<RealTensorValue>("d2kappadgrad_etaa_name")),
37 _num_etas(coupledComponents("etas")),
40{
41}
unsigned int _num_etas
Order parameters.
const MaterialProperty< RealTensorValue > & _d2kappadgrad_etaa
std::vector< const VariableValue * > _eta
std::vector< const VariableGradient * > _grad_eta
const MaterialProperty< RealGradient > & _dkappadgrad_etaa
Interfacial parameter.
Compute the Allen-Cahn interface term with the weak form residual .
Definition ACInterface.h:21

Member Function Documentation

◆ computeQpJacobian()

Real ACInterface2DMultiPhase1::computeQpJacobian ( )
protectedvirtual

Reimplemented from ACInterface.

Definition at line 63 of file ACInterface2DMultiPhase1.C.

64{
65 // dsum is the derivative \f$ \frac\partial{\partial \eta} \left( \nabla (L\psi) \right) \f$
66 RealGradient dsum = _dLdop[_qp] * _phi[_j][_qp] * _grad_test[_i][_qp];
67
68 // compute the derivative of the gradient of the mobility
69 if (_variable_L)
70 {
71 RealGradient dgradL =
72 _grad_phi[_j][_qp] * _dLdop[_qp] + _grad_u[_qp] * _phi[_j][_qp] * _d2Ldop2[_qp];
73
74 for (unsigned int i = 0; i < _n_args; ++i)
75 dgradL += (*_gradarg[i])[_qp] * _phi[_j][_qp] * (*_d2Ldargdop[i])[_qp];
76
77 dsum += dgradL * _test[_i][_qp];
78 }
79 Real jac1 = 0.5 * dsum * _dkappadgrad_etaa[_qp] * sumSquareGradEta();
80 Real jac2 =
81 0.5 * nablaLPsi() * (_d2kappadgrad_etaa[_qp] * _grad_phi[_j][_qp]) * sumSquareGradEta();
82 Real jac3 = nablaLPsi() * _dkappadgrad_etaa[_qp] * _grad_u[_qp] * _grad_phi[_j][_qp];
83 return jac1 + jac2 + jac3;
84}
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 > * > _d2Ldargdop
Definition ACInterface.h:60
RealGradient nablaLPsi()
the term
Definition ACInterface.C:82
RealVectorValue RealGradient
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

◆ computeQpOffDiagJacobian()

Real ACInterface2DMultiPhase1::computeQpOffDiagJacobian ( unsigned int  jvar)
protectedvirtual

Reimplemented from ACInterface.

Definition at line 87 of file ACInterface2DMultiPhase1.C.

88{
89 // get the coupled variable jvar is referring to
90 const unsigned int cvar = mapJvarToCvar(jvar);
91
92 // dsum is the derivative \f$ \frac\partial{\partial \eta} \left( \nabla (L\psi) \right) \f$
93 RealGradient dsum = (*_dLdarg[cvar])[_qp] * _phi[_j][_qp] * _grad_test[_i][_qp];
94
95 // compute the derivative of the gradient of the mobility
96 if (_variable_L)
97 {
98 RealGradient dgradL = _grad_phi[_j][_qp] * (*_dLdarg[cvar])[_qp] +
99 _grad_u[_qp] * _phi[_j][_qp] * (*_d2Ldargdop[cvar])[_qp];
100
101 for (unsigned int i = 0; i < _n_args; ++i)
102 dgradL += (*_gradarg[i])[_qp] * _phi[_j][_qp] * (*_d2Ldarg2[cvar][i])[_qp];
103
104 dsum += dgradL * _test[_i][_qp];
105 }
106
107 // the gradient of coupled variable etab
108 _grad_eta[0] = &coupledGradient("etas", 0);
109
110 Real jac1 = 0.5 * dsum * _dkappadgrad_etaa[_qp] * sumSquareGradEta();
111 Real jac2 =
112 -0.5 * nablaLPsi() * (_d2kappadgrad_etaa[_qp] * _grad_phi[_j][_qp]) * sumSquareGradEta();
113 Real jac3 = nablaLPsi() * _dkappadgrad_etaa[_qp] * (*_grad_eta[0])[_qp] * _grad_phi[_j][_qp];
114 return jac1 + jac2 + jac3;
115}
std::vector< const MaterialProperty< Real > * > _dLdarg
Mobility derivative w.r.t. other coupled variables.
Definition ACInterface.h:59
std::vector< std::vector< const MaterialProperty< Real > * > > _d2Ldarg2
Definition ACInterface.h:61

◆ computeQpResidual()

Real ACInterface2DMultiPhase1::computeQpResidual ( )
protectedvirtual

Reimplemented from ACInterface.

Definition at line 57 of file ACInterface2DMultiPhase1.C.

58{
59 return 0.5 * nablaLPsi() * _dkappadgrad_etaa[_qp] * sumSquareGradEta();
60}

◆ gradKappa()

RealGradient ACInterface::gradKappa ( )
protectedinherited

◆ gradL()

RealGradient ACInterface::gradL ( )
protectedinherited

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 ACInterface::computeQpJacobian(), ACInterfaceCleavageFracture::computeQpJacobian(), ACInterface::computeQpOffDiagJacobian(), and ACInterface::nablaLPsi().

◆ initialSetup()

void ACInterface::initialSetup ( )
virtualinherited

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 ( )
protectedinherited

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

Definition at line 94 of file ACInterface.C.

95{
96 return _kappa[_qp] * nablaLPsi();
97}
const MaterialProperty< Real > & _kappa
Interfacial parameter.
Definition ACInterface.h:45

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

◆ nablaLPsi()

RealGradient ACInterface::nablaLPsi ( )
protectedinherited

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}
RealGradient gradL()
Definition ACInterface.C:73
const MaterialProperty< Real > & _L
Mobility.
Definition ACInterface.h:43

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

◆ sumSquareGradEta()

Real ACInterface2DMultiPhase1::sumSquareGradEta ( )
protected

Definition at line 44 of file ACInterface2DMultiPhase1.C.

45{
46 // get the sum of square of gradients of all order parameters
47 Real SumSquareGradOp = _grad_u[_qp] * _grad_u[_qp];
48 for (unsigned int i = 0; i < _num_etas; ++i)
49 {
50 _grad_eta[i] = &coupledGradient("etas", i);
51 SumSquareGradOp += (*_grad_eta[i])[_qp] * (*_grad_eta[i])[_qp];
52 }
53 return SumSquareGradOp;
54}

Referenced by computeQpJacobian(), computeQpOffDiagJacobian(), and computeQpResidual().

◆ validParams()

InputParameters ACInterface2DMultiPhase1::validParams ( )
static

Definition at line 15 of file ACInterface2DMultiPhase1.C.

16{
19 "Gradient energy Allen-Cahn Kernel where the derivative of interface parameter kappa "
20 "wrt the gradient of order parameter is considered.");
21 params.addParam<MaterialPropertyName>("dkappadgrad_etaa_name",
22 "dkappadgrad_etaa",
23 "The derivative of the kappa with respect to grad_etaa");
24 params.addParam<MaterialPropertyName>(
25 "d2kappadgrad_etaa_name",
26 "d2kappadgrad_etaa",
27 "The second derivative of the kappa with respect to grad_etaa");
29 "etas", "All other coupled order parameters eta_i of the multiphase problem");
30 return params;
31}
static InputParameters validParams()
Definition ACInterface.C:15
void addRequiredCoupledVar(const std::string &name, const std::string &doc_string)
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)

Member Data Documentation

◆ _d2kappadgrad_etaa

const MaterialProperty<RealTensorValue>& ACInterface2DMultiPhase1::_d2kappadgrad_etaa
protected

Definition at line 38 of file ACInterface2DMultiPhase1.h.

Referenced by computeQpJacobian(), and computeQpOffDiagJacobian().

◆ _d2Ldarg2

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

◆ _d2Ldargdop

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

◆ _d2Ldop2

const MaterialProperty<Real>& ACInterface::_d2Ldop2
protectedinherited

◆ _dkappadarg

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

kappa derivative w.r.t. other coupled variables

Definition at line 65 of file ACInterface.h.

Referenced by ACInterface::ACInterface(), and ACInterface::computeQpOffDiagJacobian().

◆ _dkappadgrad_etaa

const MaterialProperty<RealGradient>& ACInterface2DMultiPhase1::_dkappadgrad_etaa
protected

Interfacial parameter.

Definition at line 37 of file ACInterface2DMultiPhase1.h.

Referenced by computeQpJacobian(), computeQpOffDiagJacobian(), and computeQpResidual().

◆ _dkappadop

const MaterialProperty<Real>& ACInterface::_dkappadop
protectedinherited

kappa derivative w.r.t. order parameter

Definition at line 56 of file ACInterface.h.

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

◆ _dLdarg

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

◆ _dLdop

const MaterialProperty<Real>& ACInterface::_dLdop
protectedinherited

◆ _eta

std::vector<const VariableValue *> ACInterface2DMultiPhase1::_eta
protected

Definition at line 42 of file ACInterface2DMultiPhase1.h.

◆ _grad_eta

std::vector<const VariableGradient *> ACInterface2DMultiPhase1::_grad_eta
protected

Definition at line 43 of file ACInterface2DMultiPhase1.h.

Referenced by computeQpOffDiagJacobian(), and sumSquareGradEta().

◆ _gradarg

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

◆ _kappa

const MaterialProperty<Real>& ACInterface::_kappa
protectedinherited

◆ _L

const MaterialProperty<Real>& ACInterface::_L
protectedinherited

◆ _num_etas

unsigned int ACInterface2DMultiPhase1::_num_etas
protected

Order parameters.

Definition at line 41 of file ACInterface2DMultiPhase1.h.

Referenced by sumSquareGradEta().

◆ _variable_L

const bool ACInterface::_variable_L
protectedinherited

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