www.mooseframework.org
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 Member Functions

 KKSACBulkC (const InputParameters &parameters)
 
virtual void initialSetup ()
 

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_h
 Value of the switching function \( h(\eta) \). More...
 
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...
 
const MaterialProperty< Real > & _prop_d2Fbdcb2
 Second derivative of the free energy function \( \frac {d^2}{dc_b^2} F_b \). 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...
 
unsigned int _nvar
 Number of coupled variables. 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_Fb
 Value of the free energy function \( F_b \). More...
 
const MaterialProperty< Real > & _prop_dFa
 Derivative of the free energy function \( \frac d{d\eta} F_a \). More...
 
const MaterialProperty< Real > & _prop_dFb
 Derivative of the free energy function \( \frac d{d\eta} F_b \). 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 28 of file KKSACBulkC.h.

Member Enumeration Documentation

◆ PFFunctionType

enum ACBulk::PFFunctionType
protectedinherited

Definition at line 38 of file ACBulk.h.

Constructor & Destructor Documentation

◆ KKSACBulkC()

KKSACBulkC::KKSACBulkC ( const InputParameters &  parameters)

Definition at line 26 of file KKSACBulkC.C.

27  : KKSACBulkBase(parameters),
28  _ca_name(getVar("ca", 0)->name()),
29  _ca_var(coupled("ca")),
30  _ca(coupledValue("ca")),
31  _cb_name(getVar("cb", 0)->name()),
32  _cb_var(coupled("cb")),
33  _cb(coupledValue("cb")),
34  _prop_h(getMaterialProperty<Real>("h_name")),
35  _prop_dFadca(getMaterialPropertyDerivative<Real>("fa_name", _ca_name)),
36  _prop_d2Fadca2(getMaterialPropertyDerivative<Real>("fa_name", _ca_name, _ca_name)),
37  _prop_d2Fbdcb2(getMaterialPropertyDerivative<Real>("fb_name", _cb_name, _cb_name))
38 {
39  // Resize to number of coupled variables (_nvar from KKSACBulkBase constructor)
40  _prop_d2Fadcadarg.resize(_nvar);
41 
42  // Iterate over all coupled variables
43  for (unsigned int i = 0; i < _nvar; ++i)
44  {
45  MooseVariableFEBase * cvar = _coupled_moose_vars[i];
46 
47  // get second partial derivatives wrt ca and other coupled variable
48  _prop_d2Fadcadarg[i] = &getMaterialPropertyDerivative<Real>("fa_name", _ca_name, cvar->name());
49  }
50 }
unsigned int _cb_var
Definition: KKSACBulkC.h:44
KKSACBulkBase(const InputParameters &parameters)
Definition: KKSACBulkBase.C:30
const MaterialProperty< Real > & _prop_d2Fadca2
Second derivative of the free energy function .
Definition: KKSACBulkC.h:54
std::string _cb_name
phase b concentration
Definition: KKSACBulkC.h:43
unsigned int _ca_var
Definition: KKSACBulkC.h:39
const MaterialProperty< Real > & _prop_d2Fbdcb2
Second derivative of the free energy function .
Definition: KKSACBulkC.h:57
std::string _ca_name
phase a concentration
Definition: KKSACBulkC.h:38
unsigned int _nvar
Number of coupled variables.
Definition: KKSACBulkBase.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:61
const std::string name
Definition: Setup.h:22
const MaterialProperty< Real > & _prop_h
Value of the switching function .
Definition: KKSACBulkC.h:48
const MaterialProperty< Real > & _prop_dFadca
Derivative of the free energy function .
Definition: KKSACBulkC.h:51
const VariableValue & _cb
Definition: KKSACBulkC.h:45
const VariableValue & _ca
Definition: KKSACBulkC.h:40

Member Function Documentation

◆ computeDFDOP() [1/2]

Real KKSACBulkC::computeDFDOP ( PFFunctionType  type)
protectedvirtual

Definition at line 53 of file KKSACBulkC.C.

54 {
55  Real res = 0.0;
56  Real A1 = _prop_dFadca[_qp] * (_ca[_qp] - _cb[_qp]);
57 
58  switch (type)
59  {
60  case Residual:
61  return _prop_dh[_qp] * A1;
62 
63  case Jacobian:
64  res = _prop_d2h[_qp] * A1;
65 
66  return _phi[_j][_qp] * res;
67  }
68 
69  mooseError("Invalid type passed in");
70 }
const MaterialProperty< Real > & _prop_dFadca
Derivative of the free energy function .
Definition: KKSACBulkC.h:51
const MaterialProperty< Real > & _prop_dh
Derivative of the switching function .
Definition: KKSACBulkBase.h:60
const VariableValue & _cb
Definition: KKSACBulkC.h:45
const VariableValue & _ca
Definition: KKSACBulkC.h:40
const MaterialProperty< Real > & _prop_d2h
Second derivative of the switching function .
Definition: KKSACBulkBase.h:63

◆ 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 73 of file KKSACBulkC.C.

74 {
75  // first get dependence of mobility _L on other variables using parent class
76  // member function
78  // Then add dependence of KKSACBulkF on other variables
79  // Treat ca and cb specially, as they appear in the residual
80  if (jvar == _ca_var)
81  {
82  res += _L[_qp] * _prop_dh[_qp] *
83  ((_ca[_qp] - _cb[_qp]) * _prop_d2Fadca2[_qp] + _prop_dFadca[_qp]) * _phi[_j][_qp] *
84  _test[_i][_qp];
85 
86  return res;
87  }
88 
89  if (jvar == _cb_var)
90  {
91  res -= _L[_qp] * _prop_dh[_qp] * _prop_dFadca[_qp] * _phi[_j][_qp] * _test[_i][_qp];
92 
93  return res;
94  }
95 
96  // for all other vars get the coupled variable jvar is referring to
97  const unsigned int cvar = mapJvarToCvar(jvar);
98 
99  res += _L[_qp] * _prop_dh[_qp] * (*_prop_d2Fadcadarg[cvar])[_qp] * (_ca[_qp] - _cb[_qp]) *
100  _phi[_j][_qp] * _test[_i][_qp];
101 
102  return res;
103 }
unsigned int _cb_var
Definition: KKSACBulkC.h:44
const MaterialProperty< Real > & _L
Mobility.
Definition: ACBulk.h:47
const MaterialProperty< Real > & _prop_d2Fadca2
Second derivative of the free energy function .
Definition: KKSACBulkC.h:54
unsigned int _ca_var
Definition: KKSACBulkC.h:39
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:61
const MaterialProperty< Real > & _prop_dFadca
Derivative of the free energy function .
Definition: KKSACBulkC.h:51
const MaterialProperty< Real > & _prop_dh
Derivative of the switching function .
Definition: KKSACBulkBase.h:60
virtual Real computeQpOffDiagJacobian(unsigned int jvar)
Definition: ACBulk.h:117
const VariableValue & _cb
Definition: KKSACBulkC.h:45
const VariableValue & _ca
Definition: KKSACBulkC.h:40

◆ initialSetup()

void KKSACBulkBase::initialSetup ( )
virtualinherited

Reimplemented from ACBulk< Real >.

Definition at line 62 of file KKSACBulkBase.C.

63 {
65  validateNonlinearCoupling<Real>("fa_name");
66  validateNonlinearCoupling<Real>("fb_name");
67 }
virtual void initialSetup()
Definition: ACBulk.h:86

◆ precomputeQpJacobian()

Real ACBulk< Real >::precomputeQpJacobian ( )
protectedvirtualinherited

Definition at line 104 of file ACBulk.h.

105 {
106  // Get free energy derivative and Jacobian
107  Real dFdop = computeDFDOP(Residual);
108 
109  Real JdFdop = computeDFDOP(Jacobian);
110 
111  // Set Jacobian value using product rule
112  return _L[_qp] * JdFdop + _dLdop[_qp] * _phi[_j][_qp] * dFdop;
113 }
const MaterialProperty< Real > & _L
Mobility.
Definition: ACBulk.h:47
virtual Real computeDFDOP(PFFunctionType type)=0
const MaterialProperty< Real > & _dLdop
Mobility derivative w.r.t. order parameter.
Definition: ACBulk.h:50

◆ precomputeQpResidual()

Real ACBulk< Real >::precomputeQpResidual ( )
protectedvirtualinherited

Definition at line 93 of file ACBulk.h.

94 {
95  // Get free energy derivative from function
96  Real dFdop = computeDFDOP(Residual);
97 
98  // Set residual
99  return _L[_qp] * dFdop;
100 }
const MaterialProperty< Real > & _L
Mobility.
Definition: ACBulk.h:47
virtual Real computeDFDOP(PFFunctionType type)=0

◆ validParams()

InputParameters ACBulk< Real >::validParams ( )
staticinherited

Definition at line 75 of file ACBulk.h.

76 {
77  InputParameters params = ::validParams<KernelValue>();
78  params.addClassDescription("Allen-Cahn base Kernel");
79  params.addParam<MaterialPropertyName>("mob_name", "L", "The mobility used with the kernel");
80  params.addCoupledVar("args", "Vector of arguments of the mobility");
81  return params;
82 }

Member Data Documentation

◆ _ca

const VariableValue& KKSACBulkC::_ca
protected

Definition at line 40 of file KKSACBulkC.h.

Referenced by computeDFDOP(), and computeQpOffDiagJacobian().

◆ _ca_name

std::string KKSACBulkC::_ca_name
protected

phase a concentration

Definition at line 38 of file KKSACBulkC.h.

Referenced by KKSACBulkC().

◆ _ca_var

unsigned int KKSACBulkC::_ca_var
protected

Definition at line 39 of file KKSACBulkC.h.

Referenced by computeQpOffDiagJacobian().

◆ _cb

const VariableValue& KKSACBulkC::_cb
protected

Definition at line 45 of file KKSACBulkC.h.

Referenced by computeDFDOP(), and computeQpOffDiagJacobian().

◆ _cb_name

std::string KKSACBulkC::_cb_name
protected

phase b concentration

Definition at line 43 of file KKSACBulkC.h.

◆ _cb_var

unsigned int KKSACBulkC::_cb_var
protected

Definition at line 44 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 42 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 45 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 53 of file ACBulk.h.

◆ _dLdop

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

Mobility derivative w.r.t. order parameter.

Definition at line 50 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 39 of file KKSACBulkBase.h.

◆ _grad_args

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

Gradients for all coupled variables.

Definition at line 66 of file KKSACBulkBase.h.

Referenced by KKSACBulkBase::KKSACBulkBase().

◆ _L

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

◆ _nvar

unsigned int KKSACBulkBase::_nvar
protectedinherited

Number of coupled variables.

Definition at line 36 of file KKSACBulkBase.h.

Referenced by KKSACBulkBase::KKSACBulkBase(), and KKSACBulkC().

◆ _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 54 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 61 of file KKSACBulkC.h.

Referenced by computeQpOffDiagJacobian(), and KKSACBulkC().

◆ _prop_d2Fbdcb2

const MaterialProperty<Real>& KKSACBulkC::_prop_d2Fbdcb2
protected

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

Definition at line 57 of file KKSACBulkC.h.

◆ _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 63 of file KKSACBulkBase.h.

Referenced by 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 54 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 51 of file KKSACBulkC.h.

Referenced by computeDFDOP(), and computeQpOffDiagJacobian().

◆ _prop_dFb

const MaterialProperty<Real>& KKSACBulkBase::_prop_dFb
protectedinherited

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

Definition at line 57 of file KKSACBulkBase.h.

◆ _prop_dh

const MaterialProperty<Real>& KKSACBulkBase::_prop_dh
protectedinherited

Derivative of the switching function \( \frac d{d\eta} h(\eta) \).

Definition at line 60 of file KKSACBulkBase.h.

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

◆ _prop_Fa

const MaterialProperty<Real>& KKSACBulkBase::_prop_Fa
protectedinherited

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

Definition at line 48 of file KKSACBulkBase.h.

Referenced by KKSACBulkF::computeDFDOP().

◆ _prop_Fb

const MaterialProperty<Real>& KKSACBulkBase::_prop_Fb
protectedinherited

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

Definition at line 51 of file KKSACBulkBase.h.

Referenced by KKSACBulkF::computeDFDOP().

◆ _prop_h

const MaterialProperty<Real>& KKSACBulkC::_prop_h
protected

Value of the switching function \( h(\eta) \).

Definition at line 48 of file KKSACBulkC.h.


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