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

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

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 25 of file KKSACBulkC.h.

Member Enumeration Documentation

enum ACBulk::PFFunctionType
protectedinherited

Definition at line 35 of file ACBulk.h.

Constructor & Destructor Documentation

KKSACBulkC::KKSACBulkC ( const InputParameters &  parameters)

Definition at line 21 of file KKSACBulkC.C.

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

Member Function Documentation

Real KKSACBulkC::computeDFDOP ( PFFunctionType  type)
protectedvirtual

Implements ACBulk< Real >.

Definition at line 48 of file KKSACBulkC.C.

49 {
50  Real res = 0.0;
51  Real A1 = _prop_dFadca[_qp] * (_ca[_qp] - _cb[_qp]);
52 
53  switch (type)
54  {
55  case Residual:
56  return _prop_dh[_qp] * A1;
57 
58  case Jacobian:
59  res = _prop_d2h[_qp] * A1;
60 
61  return _phi[_j][_qp] * res;
62  }
63 
64  mooseError("Invalid type passed in");
65 }
const MaterialProperty< Real > & _prop_dFadca
Derivative of the free energy function .
Definition: KKSACBulkC.h:48
const MaterialProperty< Real > & _prop_dh
Derivative of the switching function .
Definition: KKSACBulkBase.h:57
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:60
Real KKSACBulkC::computeQpOffDiagJacobian ( unsigned int  jvar)
protectedvirtual

Reimplemented from ACBulk< Real >.

Definition at line 68 of file KKSACBulkC.C.

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

Reimplemented from ACBulk< Real >.

Definition at line 59 of file KKSACBulkBase.C.

60 {
62  validateNonlinearCoupling<Real>("fa_name");
63  validateNonlinearCoupling<Real>("fb_name");
64 }
virtual void initialSetup()
Definition: ACBulk.h:83
virtual Real ACBulk< Real >::precomputeQpJacobian ( )
protectedvirtualinherited
virtual Real ACBulk< Real >::precomputeQpResidual ( )
protectedvirtualinherited
static InputParameters ACBulk< Real >::validParams ( )
staticinherited

Member Data Documentation

const VariableValue& KKSACBulkC::_ca
protected

Definition at line 37 of file KKSACBulkC.h.

Referenced by computeDFDOP(), and computeQpOffDiagJacobian().

std::string KKSACBulkC::_ca_name
protected

phase a concentration

Definition at line 35 of file KKSACBulkC.h.

Referenced by KKSACBulkC().

unsigned int KKSACBulkC::_ca_var
protected

Definition at line 36 of file KKSACBulkC.h.

Referenced by computeQpOffDiagJacobian().

const VariableValue& KKSACBulkC::_cb
protected

Definition at line 42 of file KKSACBulkC.h.

Referenced by computeDFDOP(), and computeQpOffDiagJacobian().

std::string KKSACBulkC::_cb_name
protected

phase b concentration

Definition at line 40 of file KKSACBulkC.h.

unsigned int KKSACBulkC::_cb_var
protected

Definition at line 41 of file KKSACBulkC.h.

Referenced by computeQpOffDiagJacobian().

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

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

Definition at line 39 of file KKSACBulkBase.h.

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

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

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

Definition at line 42 of file KKSACBulkBase.h.

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

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

Mobility derivative w.r.t coupled variables.

Definition at line 50 of file ACBulk.h.

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

Mobility derivative w.r.t. order parameter.

Definition at line 47 of file ACBulk.h.

VariableName KKSACBulkBase::_eta_name
protectedinherited

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

Definition at line 36 of file KKSACBulkBase.h.

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

Gradients for all coupled variables.

Definition at line 63 of file KKSACBulkBase.h.

Referenced by KKSACBulkBase::KKSACBulkBase().

const MaterialProperty<Real >& ACBulk< Real >::_L
protectedinherited
unsigned int KKSACBulkBase::_nvar
protectedinherited

Number of coupled variables.

Definition at line 33 of file KKSACBulkBase.h.

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

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

Referenced by computeQpOffDiagJacobian().

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 58 of file KKSACBulkC.h.

Referenced by computeQpOffDiagJacobian(), and KKSACBulkC().

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

const MaterialProperty<Real>& KKSACBulkBase::_prop_d2h
protectedinherited

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

Definition at line 60 of file KKSACBulkBase.h.

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

const MaterialProperty<Real>& KKSACBulkBase::_prop_dFa
protectedinherited

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

Definition at line 51 of file KKSACBulkBase.h.

const MaterialProperty<Real>& KKSACBulkC::_prop_dFadca
protected

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

Definition at line 48 of file KKSACBulkC.h.

Referenced by computeDFDOP(), and computeQpOffDiagJacobian().

const MaterialProperty<Real>& KKSACBulkBase::_prop_dFb
protectedinherited

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

Definition at line 54 of file KKSACBulkBase.h.

const MaterialProperty<Real>& KKSACBulkBase::_prop_dh
protectedinherited

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

Definition at line 57 of file KKSACBulkBase.h.

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

const MaterialProperty<Real>& KKSACBulkBase::_prop_Fa
protectedinherited

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

Definition at line 45 of file KKSACBulkBase.h.

Referenced by KKSACBulkF::computeDFDOP().

const MaterialProperty<Real>& KKSACBulkBase::_prop_Fb
protectedinherited

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

Definition at line 48 of file KKSACBulkBase.h.

Referenced by KKSACBulkF::computeDFDOP().

const MaterialProperty<Real>& KKSACBulkC::_prop_h
protected

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

Definition at line 45 of file KKSACBulkC.h.


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