https://mooseframework.inl.gov
Public Types | Public Member Functions | Static Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | List of all members
KKSACBulkC Class Referenceabstract

KKSACBulkBase child class for the phase concentration difference term \( \frac{dh}{d\eta}\frac{dF_a}{dc_a}(c_a-c_b) \) in the the Allen-Cahn bulk residual. More...

#include <KKSACBulkC.h>

Inheritance diagram for KKSACBulkC:
[legend]

Public Types

typedef DerivativeMaterialPropertyNameInterface::SymbolName SymbolName
 

Public Member Functions

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

std::string _ca_name
 phase a concentration More...
 
unsigned int _ca_var
 
const VariableValue_ca
 
std::string _cb_name
 phase b concentration More...
 
unsigned int _cb_var
 
const VariableValue_cb
 
const MaterialProperty< Real > & _prop_dFadca
 Derivative of the free energy function \( \frac d{dc_a} F_a \). More...
 
const MaterialProperty< Real > & _prop_d2Fadca2
 Second derivative of the free energy function \( \frac {d^2}{dc_a^2} F_a \). More...
 
std::vector< const MaterialProperty< Real > * > _prop_d2Fadcadarg
 Mixed partial derivatives of the free energy function wrt ca and any other coupled variables \( \frac {d^2}{dc_a dq} F_a \). More...
 
VariableName _eta_name
 name of the order parameter (needed to retrieve the derivative material properties) More...
 
std::vector< const MaterialProperty< Real > * > _derivatives_Fa
 Derivatives of \( F_a \) with respect to all coupled variables. More...
 
std::vector< const MaterialProperty< Real > * > _derivatives_Fb
 Derivatives of \( F_b \) with respect to all coupled variables. More...
 
const MaterialProperty< Real > & _prop_Fa
 Value of the free energy function \( F_a \). More...
 
const MaterialProperty< Real > & _prop_dFa
 Derivative of the free energy function \( \frac d{d\eta} F_a \). More...
 
const MaterialProperty< Real > & _prop_dh
 Derivative of the switching function \( \frac d{d\eta} h(\eta) \). More...
 
const MaterialProperty< Real > & _prop_d2h
 Second derivative of the switching function \( \frac {d^2}{d\eta^2} h(\eta) \). More...
 
std::vector< const VariableGradient * > _grad_args
 Gradients for all coupled variables. 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

KKSACBulkBase child class for the phase concentration difference term \( \frac{dh}{d\eta}\frac{dF_a}{dc_a}(c_a-c_b) \) in the the Allen-Cahn bulk residual.

The non-linear variable for this Kernel is the order parameter 'eta'.

Definition at line 23 of file KKSACBulkC.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

◆ KKSACBulkC()

KKSACBulkC::KKSACBulkC ( const InputParameters parameters)

Definition at line 25 of file KKSACBulkC.C.

26  : KKSACBulkBase(parameters),
27  _ca_name(coupledName("ca", 0)),
28  _ca_var(coupled("ca")),
29  _ca(coupledValue("ca")),
30  _cb_name(coupledName("cb", 0)),
31  _cb_var(coupled("cb")),
32  _cb(coupledValue("cb")),
33  _prop_dFadca(getMaterialPropertyDerivative<Real>("fa_name", _ca_name)),
34  _prop_d2Fadca2(getMaterialPropertyDerivative<Real>("fa_name", _ca_name, _ca_name)),
35  _prop_d2Fadcadarg(_n_args)
36 {
37  // get second partial derivatives wrt ca and other coupled variable
38  for (unsigned int i = 0; i < _n_args; ++i)
39  _prop_d2Fadcadarg[i] = &getMaterialPropertyDerivative<Real>("fa_name", _ca_name, i);
40 }
unsigned int _cb_var
Definition: KKSACBulkC.h:41
KKSACBulkBase(const InputParameters &parameters)
Definition: KKSACBulkBase.C:26
const MaterialProperty< Real > & _prop_d2Fadca2
Second derivative of the free energy function .
Definition: KKSACBulkC.h:48
std::string _cb_name
phase b concentration
Definition: KKSACBulkC.h:40
unsigned int _ca_var
Definition: KKSACBulkC.h:36
std::string _ca_name
phase a concentration
Definition: KKSACBulkC.h:35
std::vector< const MaterialProperty< Real > * > _prop_d2Fadcadarg
Mixed partial derivatives of the free energy function wrt ca and any other coupled variables ...
Definition: KKSACBulkC.h:52
const MaterialProperty< Real > & _prop_dFadca
Derivative of the free energy function .
Definition: KKSACBulkC.h:45
const VariableValue & _cb
Definition: KKSACBulkC.h:42
const VariableValue & _ca
Definition: KKSACBulkC.h:37

Member Function Documentation

◆ computeDFDOP() [1/2]

Real KKSACBulkC::computeDFDOP ( PFFunctionType  type)
protectedvirtual

Definition at line 43 of file KKSACBulkC.C.

44 {
45  const Real A1 = _prop_dFadca[_qp] * (_ca[_qp] - _cb[_qp]);
46  switch (type)
47  {
48  case Residual:
49  return _prop_dh[_qp] * A1;
50 
51  case Jacobian:
52  return _phi[_j][_qp] * _prop_d2h[_qp] * A1;
53  }
54 
55  mooseError("Invalid type passed in");
56 }
void mooseError(Args &&... args)
const MaterialProperty< Real > & _prop_dFadca
Derivative of the free energy function .
Definition: KKSACBulkC.h:45
const MaterialProperty< Real > & _prop_dh
Derivative of the switching function .
Definition: KKSACBulkBase.h:48
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const VariableValue & _cb
Definition: KKSACBulkC.h:42
const VariableValue & _ca
Definition: KKSACBulkC.h:37
const MaterialProperty< Real > & _prop_d2h
Second derivative of the switching function .
Definition: KKSACBulkBase.h:51

◆ computeDFDOP() [2/2]

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

◆ computeQpOffDiagJacobian()

Real KKSACBulkC::computeQpOffDiagJacobian ( unsigned int  jvar)
protectedvirtual

Reimplemented from ACBulk< Real >.

Definition at line 59 of file KKSACBulkC.C.

60 {
61  // first get dependence of mobility _L on other variables using parent class
62  // member function
64 
65  // Then add dependence of KKSACBulkF on other variables
66  // Treat ca and cb specially, as they appear in the residual
67  if (jvar == _ca_var)
68  return res + _L[_qp] * _prop_dh[_qp] *
69  ((_ca[_qp] - _cb[_qp]) * _prop_d2Fadca2[_qp] + _prop_dFadca[_qp]) *
70  _phi[_j][_qp] * _test[_i][_qp];
71 
72  if (jvar == _cb_var)
73  return res - _L[_qp] * _prop_dh[_qp] * _prop_dFadca[_qp] * _phi[_j][_qp] * _test[_i][_qp];
74 
75  // for all other vars get the coupled variable jvar is referring to
76  const unsigned int cvar = mapJvarToCvar(jvar);
77 
78  res += _L[_qp] * _prop_dh[_qp] * (*_prop_d2Fadcadarg[cvar])[_qp] * (_ca[_qp] - _cb[_qp]) *
79  _phi[_j][_qp] * _test[_i][_qp];
80 
81  return res;
82 }
unsigned int _cb_var
Definition: KKSACBulkC.h:41
const MaterialProperty< Real > & _L
Mobility.
Definition: ACBulk.h:46
const MaterialProperty< Real > & _prop_d2Fadca2
Second derivative of the free energy function .
Definition: KKSACBulkC.h:48
unsigned int _ca_var
Definition: KKSACBulkC.h:36
std::vector< const MaterialProperty< Real > * > _prop_d2Fadcadarg
Mixed partial derivatives of the free energy function wrt ca and any other coupled variables ...
Definition: KKSACBulkC.h:52
const MaterialProperty< Real > & _prop_dFadca
Derivative of the free energy function .
Definition: KKSACBulkC.h:45
const MaterialProperty< Real > & _prop_dh
Derivative of the switching function .
Definition: KKSACBulkBase.h:48
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
virtual Real computeQpOffDiagJacobian(unsigned int jvar)
Definition: ACBulk.h:110
const VariableValue & _cb
Definition: KKSACBulkC.h:42
const VariableValue & _ca
Definition: KKSACBulkC.h:37

◆ initialSetup()

void KKSACBulkBase::initialSetup ( )
virtualinherited

Reimplemented from ACBulk< Real >.

Definition at line 53 of file KKSACBulkBase.C.

54 {
56  validateNonlinearCoupling<Real>("fa_name");
57  validateNonlinearCoupling<Real>("fb_name");
58 }
virtual void initialSetup()
Definition: ACBulk.h:79

◆ 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 KKSACBulkC::validParams ( )
static

Definition at line 15 of file KKSACBulkC.C.

16 {
18  params.addClassDescription("KKS model kernel (part 2 of 2) for the Bulk Allen-Cahn. This "
19  "includes all terms dependent on chemical potential.");
20  params.addRequiredCoupledVar("ca", "a-phase concentration");
21  params.addRequiredCoupledVar("cb", "b-phase concentration");
22  return params;
23 }
static InputParameters validParams()
Definition: KKSACBulkBase.C:13
void addRequiredCoupledVar(const std::string &name, const std::string &doc_string)
void addClassDescription(const std::string &doc_string)

Member Data Documentation

◆ _ca

const VariableValue& KKSACBulkC::_ca
protected

Definition at line 37 of file KKSACBulkC.h.

Referenced by computeDFDOP(), and computeQpOffDiagJacobian().

◆ _ca_name

std::string KKSACBulkC::_ca_name
protected

phase a concentration

Definition at line 35 of file KKSACBulkC.h.

Referenced by KKSACBulkC().

◆ _ca_var

unsigned int KKSACBulkC::_ca_var
protected

Definition at line 36 of file KKSACBulkC.h.

Referenced by computeQpOffDiagJacobian().

◆ _cb

const VariableValue& KKSACBulkC::_cb
protected

Definition at line 42 of file KKSACBulkC.h.

Referenced by computeDFDOP(), and computeQpOffDiagJacobian().

◆ _cb_name

std::string KKSACBulkC::_cb_name
protected

phase b concentration

Definition at line 40 of file KKSACBulkC.h.

◆ _cb_var

unsigned int KKSACBulkC::_cb_var
protected

Definition at line 41 of file KKSACBulkC.h.

Referenced by computeQpOffDiagJacobian().

◆ _derivatives_Fa

std::vector<const MaterialProperty<Real> *> KKSACBulkBase::_derivatives_Fa
protectedinherited

Derivatives of \( F_a \) with respect to all coupled variables.

Definition at line 36 of file KKSACBulkBase.h.

Referenced by KKSACBulkF::computeQpOffDiagJacobian(), and KKSACBulkBase::KKSACBulkBase().

◆ _derivatives_Fb

std::vector<const MaterialProperty<Real> *> KKSACBulkBase::_derivatives_Fb
protectedinherited

Derivatives of \( F_b \) with respect to all coupled variables.

Definition at line 39 of file KKSACBulkBase.h.

Referenced by KKSACBulkF::computeQpOffDiagJacobian(), and KKSACBulkBase::KKSACBulkBase().

◆ _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.

◆ _eta_name

VariableName KKSACBulkBase::_eta_name
protectedinherited

name of the order parameter (needed to retrieve the derivative material properties)

Definition at line 33 of file KKSACBulkBase.h.

◆ _grad_args

std::vector<const VariableGradient *> KKSACBulkBase::_grad_args
protectedinherited

Gradients for all coupled variables.

Definition at line 54 of file KKSACBulkBase.h.

Referenced by KKSACBulkBase::KKSACBulkBase().

◆ _L

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

◆ _prop_d2Fadca2

const MaterialProperty<Real>& KKSACBulkC::_prop_d2Fadca2
protected

Second derivative of the free energy function \( \frac {d^2}{dc_a^2} F_a \).

Definition at line 48 of file KKSACBulkC.h.

Referenced by computeQpOffDiagJacobian().

◆ _prop_d2Fadcadarg

std::vector<const MaterialProperty<Real> *> KKSACBulkC::_prop_d2Fadcadarg
protected

Mixed partial derivatives of the free energy function wrt ca and any other coupled variables \( \frac {d^2}{dc_a dq} F_a \).

Definition at line 52 of file KKSACBulkC.h.

Referenced by computeQpOffDiagJacobian(), and KKSACBulkC().

◆ _prop_d2h

const MaterialProperty<Real>& KKSACBulkBase::_prop_d2h
protectedinherited

Second derivative of the switching function \( \frac {d^2}{d\eta^2} h(\eta) \).

Definition at line 51 of file KKSACBulkBase.h.

Referenced by NestedKKSACBulkC::computeDFDOP(), NestedKKSACBulkF::computeDFDOP(), computeDFDOP(), and KKSACBulkF::computeDFDOP().

◆ _prop_dFa

const MaterialProperty<Real>& KKSACBulkBase::_prop_dFa
protectedinherited

Derivative of the free energy function \( \frac d{d\eta} F_a \).

Definition at line 45 of file KKSACBulkBase.h.

◆ _prop_dFadca

const MaterialProperty<Real>& KKSACBulkC::_prop_dFadca
protected

Derivative of the free energy function \( \frac d{dc_a} F_a \).

Definition at line 45 of file KKSACBulkC.h.

Referenced by computeDFDOP(), and computeQpOffDiagJacobian().

◆ _prop_dh

const MaterialProperty<Real>& KKSACBulkBase::_prop_dh
protectedinherited

◆ _prop_Fa

const MaterialProperty<Real>& KKSACBulkBase::_prop_Fa
protectedinherited

Value of the free energy function \( F_a \).

Definition at line 42 of file KKSACBulkBase.h.

Referenced by KKSACBulkF::computeDFDOP().


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