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

ACBulk child class that takes all the necessary data from a KKSBaseMaterial and sets up the Allen-Cahn bulk term. More...

#include <KKSACBulkBase.h>

Inheritance diagram for KKSACBulkBase:
[legend]

Public Types

typedef DerivativeMaterialPropertyNameInterface::SymbolName SymbolName
 

Public Member Functions

 KKSACBulkBase (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 _eta_name
 name of the order parameter (needed to retrieve the derivative material properties)
 
std::vector< const MaterialProperty< Real > * > _derivatives_Fa
 Derivatives of \( F_a \) with respect to all coupled variables.
 
std::vector< const MaterialProperty< Real > * > _derivatives_Fb
 Derivatives of \( F_b \) with respect to all coupled variables.
 
const MaterialProperty< Real > & _prop_Fa
 Value of the free energy function \( F_a \).
 
const MaterialProperty< Real > & _prop_dFa
 Derivative of the free energy function \( \frac d{d\eta} F_a \).
 
const MaterialProperty< Real > & _prop_dh
 Derivative of the switching function \( \frac d{d\eta} h(\eta) \).
 
const MaterialProperty< Real > & _prop_d2h
 Second derivative of the switching function \( \frac {d^2}{d\eta^2} h(\eta) \).
 
std::vector< const VariableGradient * > _grad_args
 Gradients for all coupled variables.
 
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 takes all the necessary data from a KKSBaseMaterial and sets up the Allen-Cahn bulk term.

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

Definition at line 22 of file KKSACBulkBase.h.

Member Enumeration Documentation

◆ PFFunctionType

enum ACBulk::PFFunctionType
protectedinherited

Definition at line 37 of file ACBulk.h.

38 {
41 };

Constructor & Destructor Documentation

◆ KKSACBulkBase()

KKSACBulkBase::KKSACBulkBase ( const InputParameters parameters)

Definition at line 26 of file KKSACBulkBase.C.

27 : ACBulk<Real>(parameters),
28 // number of coupled variables (ca, args_a[])
29 _eta_name(_var.name()),
30 _prop_Fa(getMaterialProperty<Real>("fa_name")),
31 _prop_dFa(getMaterialPropertyDerivative<Real>("fa_name", _eta_name)),
32 _prop_dh(getMaterialPropertyDerivative<Real>("h_name", _eta_name)),
33 _prop_d2h(getMaterialPropertyDerivative<Real>("h_name", _eta_name, _eta_name))
34{
35 // reserve space for derivatives
36 _derivatives_Fa.resize(_n_args);
37 _derivatives_Fb.resize(_n_args);
38 _grad_args.resize(_n_args);
39
40 // Iterate over all coupled variables
41 for (unsigned int i = 0; i < _n_args; ++i)
42 {
43 // get the first derivatives of Fa and Fb material property
44 _derivatives_Fa[i] = &getMaterialPropertyDerivative<Real>("fa_name", i);
45 _derivatives_Fb[i] = &getMaterialPropertyDerivative<Real>("fb_name", i);
46
47 // get the gradient
48 _grad_args[i] = &(_coupled_standard_moose_vars[i]->gradSln());
49 }
50}
This is the Allen-Cahn equation base class that implements the bulk or local energy term of the equat...
Definition ACBulk.h:25
VariableName _eta_name
name of the order parameter (needed to retrieve the derivative material properties)
std::vector< const MaterialProperty< Real > * > _derivatives_Fa
Derivatives of with respect to all coupled variables.
std::vector< const MaterialProperty< Real > * > _derivatives_Fb
Derivatives of with respect to all coupled variables.
const MaterialProperty< Real > & _prop_Fa
Value of the free energy function .
const MaterialProperty< Real > & _prop_d2h
Second derivative of the switching function .
std::vector< const VariableGradient * > _grad_args
Gradients for all coupled variables.
const MaterialProperty< Real > & _prop_dh
Derivative of the switching function .
const MaterialProperty< Real > & _prop_dFa
Derivative of the free energy function .
virtual void resize(const std::size_t size) override final

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 KKSACBulkBase::initialSetup ( )
virtual

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

Definition at line 13 of file KKSACBulkBase.C.

14{
16 params.addClassDescription("KKS model kernel for the Bulk Allen-Cahn. This operates on the order "
17 "parameter 'eta' as the non-linear variable");
18 params.addRequiredParam<MaterialPropertyName>(
19 "fa_name",
20 "Base name of the free energy function F (f_base in the corresponding KKSBaseMaterial)");
21 params.addParam<MaterialPropertyName>(
22 "h_name", "h", "Base name for the switching function h(eta)");
23 return params;
24}
static InputParameters validParams()
Definition ACBulk.h:69
void addRequiredParam(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)

Referenced by KKSACBulkC::validParams(), KKSACBulkF::validParams(), NestedKKSACBulkC::validParams(), and NestedKKSACBulkF::validParams().

Member Data Documentation

◆ _derivatives_Fa

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

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

Definition at line 36 of file KKSACBulkBase.h.

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

◆ _derivatives_Fb

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

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

Definition at line 39 of file KKSACBulkBase.h.

Referenced by KKSACBulkF::computeQpOffDiagJacobian(), and 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
protected

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
protected

Gradients for all coupled variables.

Definition at line 54 of file KKSACBulkBase.h.

Referenced by KKSACBulkBase().

◆ _L

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

Mobility.

Definition at line 46 of file ACBulk.h.

◆ _prop_d2h

const MaterialProperty<Real>& KKSACBulkBase::_prop_d2h
protected

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

Definition at line 51 of file KKSACBulkBase.h.

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

◆ _prop_dFa

const MaterialProperty<Real>& KKSACBulkBase::_prop_dFa
protected

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

Definition at line 45 of file KKSACBulkBase.h.

◆ _prop_dh

const MaterialProperty<Real>& KKSACBulkBase::_prop_dh
protected

◆ _prop_Fa

const MaterialProperty<Real>& KKSACBulkBase::_prop_Fa
protected

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: