www.mooseframework.org
Public Types | Public Member Functions | Static Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | List of all members
KKSMultiACBulkF Class Referenceabstract

KKSMultiACBulkBase child class for the free energy term \( \sum_j \frac{\partial h_j}{\partial \eta_i} F_j + w_i \frac{dg}{d\eta_i} \) in the the Allen-Cahn bulk residual. More...

#include <KKSMultiACBulkF.h>

Inheritance diagram for KKSMultiACBulkF:
[legend]

Public Types

typedef DerivativeMaterialPropertyNameInterface::SymbolName SymbolName
 

Public Member Functions

 KKSMultiACBulkF (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 computeDFDOP (PFFunctionType type)
 
virtual Real computeQpOffDiagJacobian (unsigned int jvar)
 
virtual Real precomputeQpResidual ()
 
virtual Real precomputeQpJacobian ()
 
virtual Real computeDFDOP (PFFunctionType type)=0
 

Protected Attributes

Real _wi
 double well height parameter More...
 
const MaterialProperty< Real > & _prop_dgi
 Derivative of the double well function \( \frac d{d\eta} g(\eta) \). More...
 
const MaterialProperty< Real > & _prop_d2gi
 Second derivative of the double well function \( \frac {d^2}{d\eta^2} g(\eta) \). More...
 
VariableName _etai_name
 name of order parameter that derivatives are taken wrt (needed to retrieve the derivative material properties) More...
 
unsigned int _etai_var
 index of order parameter that derivatives are taken wrt More...
 
std::vector< MaterialPropertyName > _Fj_names
 Names of free energy functions for each phase \( F_j \). More...
 
unsigned int _num_j
 
std::vector< const MaterialProperty< Real > * > _prop_Fj
 Values of the free energy functions for each phase \( F_j \). More...
 
std::vector< std::vector< const MaterialProperty< Real > * > > _prop_dFjdarg
 Derivatives of the free energy functions (needed for off-diagonal Jacobians) More...
 
std::vector< MaterialPropertyName > _hj_names
 switching function names More...
 
std::vector< const MaterialProperty< Real > * > _prop_hj
 Values of the switching functions for each phase \( h_j \). More...
 
std::vector< const MaterialProperty< Real > * > _prop_dhjdetai
 Derivatives of the switching functions wrt the order parameter for this kernel. More...
 
std::vector< const MaterialProperty< Real > * > _prop_d2hjdetai2
 Second derivatives of the switching functions wrt the order parameter for this kernel. More...
 
std::vector< std::vector< const MaterialProperty< Real > * > > _prop_d2hjdetaidarg
 Second derivatives of the switching functions (needed for off-diagonal Jacobians) More...
 
const MaterialProperty< Real > & _L
 Mobility. More...
 
const MaterialProperty< Real > & _dLdop
 Mobility derivative w.r.t. order parameter. More...
 
std::vector< const MaterialProperty< Real > *> _dLdarg
 Mobility derivative w.r.t coupled variables. More...
 

Detailed Description

KKSMultiACBulkBase child class for the free energy term \( \sum_j \frac{\partial h_j}{\partial \eta_i} F_j + w_i \frac{dg}{d\eta_i} \) in the the Allen-Cahn bulk residual.

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

Definition at line 23 of file KKSMultiACBulkF.h.

Member Enumeration Documentation

◆ PFFunctionType

enum ACBulk::PFFunctionType
protectedinherited

Definition at line 37 of file ACBulk.h.

38  {
39  Jacobian,
40  Residual
41  };

Constructor & Destructor Documentation

◆ KKSMultiACBulkF()

KKSMultiACBulkF::KKSMultiACBulkF ( const InputParameters parameters)

Definition at line 26 of file KKSMultiACBulkF.C.

27  : KKSMultiACBulkBase(parameters),
28  _wi(getParam<Real>("wi")),
29  _prop_dgi(getMaterialPropertyDerivative<Real>("gi_name", _etai_name)),
30  _prop_d2gi(getMaterialPropertyDerivative<Real>("gi_name", _etai_name, _etai_name))
31 {
32 }
const MaterialProperty< Real > & _prop_dgi
Derivative of the double well function .
const MaterialProperty< Real > & _prop_d2gi
Second derivative of the double well function .
Real _wi
double well height parameter
VariableName _etai_name
name of order parameter that derivatives are taken wrt (needed to retrieve the derivative material pr...
KKSMultiACBulkBase(const InputParameters &parameters)

Member Function Documentation

◆ computeDFDOP() [1/2]

Real KKSMultiACBulkF::computeDFDOP ( PFFunctionType  type)
protectedvirtual

Definition at line 35 of file KKSMultiACBulkF.C.

36 {
37  Real sum = 0.0;
38 
39  switch (type)
40  {
41  case Residual:
42  for (unsigned int n = 0; n < _num_j; ++n)
43  sum += (*_prop_dhjdetai[n])[_qp] * (*_prop_Fj[n])[_qp];
44 
45  return sum + _wi * _prop_dgi[_qp];
46 
47  case Jacobian:
48  // For when this kernel is used in the Lagrange multiplier equation
49  // In that case the Lagrange multiplier is the nonlinear variable
50  if (_etai_var != _var.number())
51  return 0.0;
52 
53  // For when eta_i is the nonlinear variable
54  for (unsigned int n = 0; n < _num_j; ++n)
55  sum += (*_prop_d2hjdetai2[n])[_qp] * (*_prop_Fj[n])[_qp];
56 
57  return _phi[_j][_qp] * (sum + _wi * _prop_d2gi[_qp]);
58  }
59 
60  mooseError("Invalid type passed in");
61 }
const MaterialProperty< Real > & _prop_dgi
Derivative of the double well function .
const MaterialProperty< Real > & _prop_d2gi
Second derivative of the double well function .
void mooseError(Args &&... args)
Real _wi
double well height parameter
std::vector< const MaterialProperty< Real > * > _prop_dhjdetai
Derivatives of the switching functions wrt the order parameter for this kernel.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
std::vector< const MaterialProperty< Real > * > _prop_Fj
Values of the free energy functions for each phase .
std::vector< const MaterialProperty< Real > * > _prop_d2hjdetai2
Second derivatives of the switching functions wrt the order parameter for this kernel.
unsigned int _etai_var
index of order parameter that derivatives are taken wrt

◆ computeDFDOP() [2/2]

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

◆ computeQpOffDiagJacobian()

Real KKSMultiACBulkF::computeQpOffDiagJacobian ( unsigned int  jvar)
protectedvirtual

Reimplemented from ACBulk< Real >.

Definition at line 64 of file KKSMultiACBulkF.C.

65 {
66  // get the coupled variable jvar is referring to
67  const unsigned int cvar = mapJvarToCvar(jvar);
68 
69  // first get dependence of mobility _L on other variables using parent class
70  // member function
72 
73  // Then add dependence of KKSMultiACBulkF on other variables
74  Real sum = 0.0;
75  for (unsigned int n = 0; n < _num_j; ++n)
76  sum += (*_prop_d2hjdetaidarg[n][cvar])[_qp] * (*_prop_Fj[n])[_qp] +
77  (*_prop_dhjdetai[n])[_qp] * (*_prop_dFjdarg[n][cvar])[_qp];
78 
79  // Handle the case when this kernel is used in the Lagrange multiplier equation
80  // In this case the second derivative of the barrier function contributes
81  // to the off-diagonal Jacobian
82  if (jvar == _etai_var)
83  sum += _wi * _prop_d2gi[_qp];
84 
85  res += _L[_qp] * sum * _phi[_j][_qp] * _test[_i][_qp];
86 
87  return res;
88 }
const MaterialProperty< Real > & _prop_d2gi
Second derivative of the double well function .
const MaterialProperty< Real > & _L
Mobility.
Definition: ACBulk.h:46
Real _wi
double well height parameter
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_dhjdetai
Derivatives of the switching functions wrt the order parameter for this kernel.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
std::vector< const MaterialProperty< Real > * > _prop_Fj
Values of the free energy functions for each phase .
virtual Real computeQpOffDiagJacobian(unsigned int jvar)
Definition: ACBulk.h:110
unsigned int _etai_var
index of order parameter that derivatives are taken wrt
std::vector< std::vector< const MaterialProperty< Real > * > > _prop_dFjdarg
Derivatives of the free energy functions (needed for off-diagonal Jacobians)

◆ initialSetup()

void KKSMultiACBulkBase::initialSetup ( )
virtualinherited

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
std::vector< MaterialPropertyName > _Fj_names
Names of free energy functions for each phase .
std::vector< MaterialPropertyName > _hj_names
switching function names

◆ precomputeQpJacobian()

Real ACBulk< Real >::precomputeQpJacobian ( )
protectedvirtualinherited

Definition at line 97 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
virtual Real computeDFDOP(PFFunctionType type)=0
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const MaterialProperty< Real > & _dLdop
Mobility derivative w.r.t. order parameter.
Definition: ACBulk.h:49

◆ precomputeQpResidual()

Real ACBulk< Real >::precomputeQpResidual ( )
protectedvirtualinherited

Definition at line 86 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 }
const MaterialProperty< Real > & _L
Mobility.
Definition: ACBulk.h:46
virtual Real computeDFDOP(PFFunctionType type)=0
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

◆ validParams()

InputParameters KKSMultiACBulkF::validParams ( )
static

Definition at line 15 of file KKSMultiACBulkF.C.

16 {
18  params.addClassDescription("KKS model kernel (part 1 of 2) for the Bulk Allen-Cahn. This "
19  "includes all terms NOT dependent on chemical potential.");
20  params.addRequiredParam<Real>("wi", "Double well height parameter");
21  params.addRequiredParam<MaterialPropertyName>(
22  "gi_name", "Base name for the double well function g_i(eta_i)");
23  return params;
24 }
void addRequiredParam(const std::string &name, const std::string &doc_string)
static InputParameters validParams()
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
void addClassDescription(const std::string &doc_string)

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
protectedinherited

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::KKSMultiACBulkBase().

◆ _etai_var

unsigned int KKSMultiACBulkBase::_etai_var
protectedinherited

index of order parameter that derivatives are taken wrt

Definition at line 37 of file KKSMultiACBulkBase.h.

Referenced by KKSMultiACBulkC::computeDFDOP(), computeDFDOP(), and computeQpOffDiagJacobian().

◆ _Fj_names

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

Names of free energy functions for each phase \( F_j \).

Definition at line 40 of file KKSMultiACBulkBase.h.

Referenced by KKSMultiACBulkBase::initialSetup(), KKSMultiACBulkBase::KKSMultiACBulkBase(), and KKSMultiACBulkC::KKSMultiACBulkC().

◆ _hj_names

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

switching function names

Definition at line 50 of file KKSMultiACBulkBase.h.

Referenced by KKSMultiACBulkBase::initialSetup(), and KKSMultiACBulkBase::KKSMultiACBulkBase().

◆ _L

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

◆ _num_j

unsigned int KKSMultiACBulkBase::_num_j
protectedinherited

◆ _prop_d2gi

const MaterialProperty<Real>& KKSMultiACBulkF::_prop_d2gi
protected

Second derivative of the double well function \( \frac {d^2}{d\eta^2} g(\eta) \).

Definition at line 41 of file KKSMultiACBulkF.h.

Referenced by computeDFDOP(), and computeQpOffDiagJacobian().

◆ _prop_d2hjdetai2

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

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(), computeDFDOP(), and KKSMultiACBulkBase::KKSMultiACBulkBase().

◆ _prop_d2hjdetaidarg

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

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

Definition at line 62 of file KKSMultiACBulkBase.h.

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

◆ _prop_dFjdarg

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

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

Definition at line 47 of file KKSMultiACBulkBase.h.

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

◆ _prop_dgi

const MaterialProperty<Real>& KKSMultiACBulkF::_prop_dgi
protected

Derivative of the double well function \( \frac d{d\eta} g(\eta) \).

Definition at line 38 of file KKSMultiACBulkF.h.

Referenced by computeDFDOP().

◆ _prop_dhjdetai

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

Derivatives of the switching functions wrt the order parameter for this kernel.

Definition at line 56 of file KKSMultiACBulkBase.h.

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

◆ _prop_Fj

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

Values of the free energy functions for each phase \( F_j \).

Definition at line 44 of file KKSMultiACBulkBase.h.

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

◆ _prop_hj

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

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

Definition at line 53 of file KKSMultiACBulkBase.h.

Referenced by KKSMultiACBulkBase::KKSMultiACBulkBase().

◆ _wi

Real KKSMultiACBulkF::_wi
protected

double well height parameter

Definition at line 35 of file KKSMultiACBulkF.h.

Referenced by computeDFDOP(), and computeQpOffDiagJacobian().


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