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
KKSMultiACBulkBase Class Referenceabstract

ACBulk child class that sets up necessary variables and materials for calculation of residual contribution \( \frac{\partial f}{\partial \eta_i} \) by child classes KKSMultiACBulkF and KKSMultiACBulkC. More...

#include <KKSMultiACBulkBase.h>

Inheritance diagram for KKSMultiACBulkBase:
[legend]

Public Types

typedef DerivativeMaterialPropertyNameInterface::SymbolName SymbolName
 

Public Member Functions

 KKSMultiACBulkBase (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

enum  PFFunctionType
 

Protected Member Functions

virtual Real precomputeQpResidual ()
 
virtual Real precomputeQpJacobian ()
 
virtual Real computeQpOffDiagJacobian (unsigned int jvar)
 
virtual Real computeDFDOP (PFFunctionType type)=0
 

Protected Attributes

VariableName _etai_name
 name of order parameter that derivatives are taken wrt (needed to retrieve the derivative material properties)
 
unsigned int _etai_var
 index of order parameter that derivatives are taken wrt
 
std::vector< MaterialPropertyName > _Fj_names
 Names of free energy functions for each phase \( F_j \).
 
unsigned int _num_j
 
std::vector< const MaterialProperty< Real > * > _prop_Fj
 Values of the free energy functions for each phase \( F_j \).
 
std::vector< std::vector< const MaterialProperty< Real > * > > _prop_dFjdarg
 Derivatives of the free energy functions (needed for off-diagonal Jacobians)
 
std::vector< MaterialPropertyName > _hj_names
 switching function names
 
std::vector< const MaterialProperty< Real > * > _prop_hj
 Values of the switching functions for each phase \( h_j \).
 
std::vector< const MaterialProperty< Real > * > _prop_dhjdetai
 Derivatives of the switching functions wrt the order parameter for this kernel.
 
std::vector< const MaterialProperty< Real > * > _prop_d2hjdetai2
 Second derivatives of the switching functions wrt the order parameter for this kernel.
 
std::vector< std::vector< const MaterialProperty< Real > * > > _prop_d2hjdetaidarg
 Second derivatives of the switching functions (needed for off-diagonal Jacobians)
 
const MaterialProperty< Real > & _L
 Mobility.
 
const MaterialProperty< Real > & _dLdop
 Mobility derivative w.r.t. order parameter.
 
std::vector< const MaterialProperty< Real > * > _dLdarg
 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

FEProblemBase_dmi_fe_problem
 

Detailed Description

ACBulk child class that sets up necessary variables and materials for calculation of residual contribution \( \frac{\partial f}{\partial \eta_i} \) by child classes KKSMultiACBulkF and KKSMultiACBulkC.

The non-linear variable for this Kernel is the order parameter \( \eta_i \).

Definition at line 23 of file KKSMultiACBulkBase.h.

Member Enumeration Documentation

◆ PFFunctionType

enum ACBulk::PFFunctionType
protectedinherited

Definition at line 37 of file ACBulk.h.

38 {
41 };

Constructor & Destructor Documentation

◆ KKSMultiACBulkBase()

KKSMultiACBulkBase::KKSMultiACBulkBase ( const InputParameters parameters)

Definition at line 28 of file KKSMultiACBulkBase.C.

29 : ACBulk<Real>(parameters),
30 _etai_name(coupledName("eta_i", 0)),
31 _etai_var(coupled("eta_i", 0)),
32 _Fj_names(getParam<std::vector<MaterialPropertyName>>("Fj_names")),
33 _num_j(_Fj_names.size()),
36 _hj_names(getParam<std::vector<MaterialPropertyName>>("hj_names")),
41{
42 // check passed in parameter vectors
43 if (_num_j != _hj_names.size())
44 paramError("hj_names", "Need to pass in as many hj_names as Fj_names");
45
46 // reserve space and set phase material properties
47 for (unsigned int n = 0; n < _num_j; ++n)
48 {
49 // get phase free energy
50 _prop_Fj[n] = &getMaterialPropertyByName<Real>(_Fj_names[n]);
51 _prop_dFjdarg[n].resize(_n_args);
52
53 // get switching function and derivatives wrt eta_i, the nonlinear variable
54 _prop_hj[n] = &getMaterialPropertyByName<Real>(_hj_names[n]);
55 _prop_dhjdetai[n] = &getMaterialPropertyDerivative<Real>(_hj_names[n], _etai_name);
57 &getMaterialPropertyDerivative<Real>(_hj_names[n], _etai_name, _etai_name);
58 _prop_d2hjdetaidarg[n].resize(_n_args);
59
60 for (unsigned int i = 0; i < _n_args; ++i)
61 {
62 // Get derivatives of all Fj wrt all coupled variables
63 _prop_dFjdarg[n][i] = &getMaterialPropertyDerivative<Real>(_Fj_names[n], i);
64
65 // Get second derivatives of all hj wrt eta_i and all coupled variables
66 _prop_d2hjdetaidarg[n][i] = &getMaterialPropertyDerivative<Real>(_hj_names[n], _etai_name, i);
67 }
68 }
69}
This is the Allen-Cahn equation base class that implements the bulk or local energy term of the equat...
Definition ACBulk.h:25
std::vector< std::vector< const MaterialProperty< Real > * > > _prop_dFjdarg
Derivatives of the free energy functions (needed for off-diagonal Jacobians)
std::vector< MaterialPropertyName > _Fj_names
Names of free energy functions for each phase .
std::vector< const MaterialProperty< Real > * > _prop_hj
Values of the switching functions for each phase .
unsigned int _etai_var
index of order parameter that derivatives are taken wrt
std::vector< const MaterialProperty< Real > * > _prop_dhjdetai
Derivatives of the switching functions wrt the order parameter for this kernel.
std::vector< std::vector< const MaterialProperty< Real > * > > _prop_d2hjdetaidarg
Second derivatives of the switching functions (needed for off-diagonal Jacobians)
std::vector< const MaterialProperty< Real > * > _prop_Fj
Values of the free energy functions for each phase .
VariableName _etai_name
name of order parameter that derivatives are taken wrt (needed to retrieve the derivative material pr...
std::vector< MaterialPropertyName > _hj_names
switching function names
std::vector< const MaterialProperty< Real > * > _prop_d2hjdetai2
Second derivatives of the switching functions wrt the order parameter for this kernel.

Member Function Documentation

◆ computeDFDOP()

virtual Real ACBulk< Real >::computeDFDOP ( PFFunctionType  type)
protectedpure virtualinherited

◆ computeQpOffDiagJacobian()

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

Reimplemented in ACGBPoly, ACGrGrPoly, ACGrGrPolyLinearizedInterface, AllenCahn, CoupledAllenCahn, KKSACBulkC, KKSACBulkF, KKSMultiACBulkC, KKSMultiACBulkF, NestedKKSACBulkC, NestedKKSACBulkF, NestedKKSMultiACBulkC, and NestedKKSMultiACBulkF.

Definition at line 35 of file ACBulk.h.

111{
112 // Get the coupled variable jvar is referring to
113 const unsigned int cvar = mapJvarToCvar(jvar);
114
115 // Set off-diagonal Jacobian term from mobility derivatives
116 return (*_dLdarg[cvar])[_qp] * _phi[_j][_qp] * computeDFDOP(Residual) * _test[_i][_qp];
117}
virtual Real computeDFDOP(PFFunctionType type)=0
std::vector< const MaterialProperty< Real > * > _dLdarg
Mobility derivative w.r.t coupled variables.
Definition ACBulk.h:52

◆ initialSetup()

void KKSMultiACBulkBase::initialSetup ( )
virtual

Reimplemented from ACBulk< Real >.

Definition at line 72 of file KKSMultiACBulkBase.C.

73{
75
76 for (unsigned int n = 0; n < _num_j; ++n)
77 {
78 validateNonlinearCoupling<Real>(_Fj_names[n]);
79 validateNonlinearCoupling<Real>(_hj_names[n]);
80 }
81}
virtual void initialSetup()
Definition ACBulk.h:79

◆ precomputeQpJacobian()

Real ACBulk< Real >::precomputeQpJacobian ( )
protectedvirtualinherited

Definition at line 34 of file ACBulk.h.

98{
99 // Get free energy derivative and Jacobian
100 Real dFdop = computeDFDOP(Residual);
101
102 Real JdFdop = computeDFDOP(Jacobian);
103
104 // Set Jacobian value using product rule
105 return _L[_qp] * JdFdop + _dLdop[_qp] * _phi[_j][_qp] * dFdop;
106}
const MaterialProperty< Real > & _L
Mobility.
Definition ACBulk.h:46
const MaterialProperty< Real > & _dLdop
Mobility derivative w.r.t. order parameter.
Definition ACBulk.h:49
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

◆ precomputeQpResidual()

Real ACBulk< Real >::precomputeQpResidual ( )
protectedvirtualinherited

Definition at line 33 of file ACBulk.h.

87{
88 // Get free energy derivative from function
89 Real dFdop = computeDFDOP(Residual);
90
91 // Set residual
92 return _L[_qp] * dFdop;
93}

◆ validParams()

InputParameters KKSMultiACBulkBase::validParams ( )
static

Definition at line 13 of file KKSMultiACBulkBase.C.

14{
16 params.addClassDescription("Multi-order parameter KKS model kernel for the Bulk Allen-Cahn. This "
17 "operates on one of the order parameters 'eta_i' as the non-linear "
18 "variable");
19 params.addRequiredParam<std::vector<MaterialPropertyName>>(
20 "Fj_names", "List of free energies for each phase. Place in same order as hj_names!");
21 params.addRequiredParam<std::vector<MaterialPropertyName>>(
22 "hj_names", "Switching Function Materials that provide h. Place in same order as Fj_names!");
23 params.addRequiredCoupledVar("eta_i",
24 "Order parameter that derivatives are taken with respect to");
25 return params;
26}
static InputParameters validParams()
Definition ACBulk.h:69
void addRequiredCoupledVar(const std::string &name, const std::string &doc_string)
void addRequiredParam(const std::string &name, const std::string &doc_string)
void addClassDescription(const std::string &doc_string)

Referenced by KKSMultiACBulkC::validParams(), KKSMultiACBulkF::validParams(), NestedKKSMultiACBulkC::validParams(), and NestedKKSMultiACBulkF::validParams().

Member Data Documentation

◆ _dLdarg

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

Mobility derivative w.r.t coupled variables.

Definition at line 52 of file ACBulk.h.

◆ _dLdop

const MaterialProperty<Real >& ACBulk< Real >::_dLdop
protectedinherited

Mobility derivative w.r.t. order parameter.

Definition at line 49 of file ACBulk.h.

◆ _etai_name

VariableName KKSMultiACBulkBase::_etai_name
protected

name of order parameter that derivatives are taken wrt (needed to retrieve the derivative material properties)

Definition at line 34 of file KKSMultiACBulkBase.h.

Referenced by KKSMultiACBulkBase().

◆ _etai_var

unsigned int KKSMultiACBulkBase::_etai_var
protected

◆ _Fj_names

std::vector<MaterialPropertyName> KKSMultiACBulkBase::_Fj_names
protected

◆ _hj_names

std::vector<MaterialPropertyName> KKSMultiACBulkBase::_hj_names
protected

◆ _L

const MaterialProperty<Real >& ACBulk< Real >::_L
protectedinherited

Mobility.

Definition at line 46 of file ACBulk.h.

◆ _num_j

unsigned int KKSMultiACBulkBase::_num_j
protected

◆ _prop_d2hjdetai2

std::vector<const MaterialProperty<Real> *> KKSMultiACBulkBase::_prop_d2hjdetai2
protected

Second derivatives of the switching functions wrt the order parameter for this kernel.

Definition at line 59 of file KKSMultiACBulkBase.h.

Referenced by KKSMultiACBulkC::computeDFDOP(), KKSMultiACBulkF::computeDFDOP(), and KKSMultiACBulkBase().

◆ _prop_d2hjdetaidarg

std::vector<std::vector<const MaterialProperty<Real> *> > KKSMultiACBulkBase::_prop_d2hjdetaidarg
protected

Second derivatives of the switching functions (needed for off-diagonal Jacobians)

Definition at line 62 of file KKSMultiACBulkBase.h.

Referenced by KKSMultiACBulkC::computeQpOffDiagJacobian(), KKSMultiACBulkF::computeQpOffDiagJacobian(), and KKSMultiACBulkBase().

◆ _prop_dFjdarg

std::vector<std::vector<const MaterialProperty<Real> *> > KKSMultiACBulkBase::_prop_dFjdarg
protected

Derivatives of the free energy functions (needed for off-diagonal Jacobians)

Definition at line 47 of file KKSMultiACBulkBase.h.

Referenced by KKSMultiACBulkF::computeQpOffDiagJacobian(), and KKSMultiACBulkBase().

◆ _prop_dhjdetai

std::vector<const MaterialProperty<Real> *> KKSMultiACBulkBase::_prop_dhjdetai
protected

◆ _prop_Fj

std::vector<const MaterialProperty<Real> *> KKSMultiACBulkBase::_prop_Fj
protected

◆ _prop_hj

std::vector<const MaterialProperty<Real> *> KKSMultiACBulkBase::_prop_hj
protected

Values of the switching functions for each phase \( h_j \).

Definition at line 53 of file KKSMultiACBulkBase.h.

Referenced by KKSMultiACBulkBase().


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