www.mooseframework.org
KKSACBulkF.C
Go to the documentation of this file.
1 /****************************************************************/
2 /* MOOSE - Multiphysics Object Oriented Simulation Environment */
3 /* */
4 /* All contents are licensed under LGPL V2.1 */
5 /* See LICENSE for full restrictions */
6 /****************************************************************/
7 #include "KKSACBulkF.h"
8 
9 template <>
10 InputParameters
12 {
13  InputParameters params = validParams<KKSACBulkBase>();
14  params.addClassDescription("KKS model kernel (part 1 of 2) for the Bulk Allen-Cahn. This "
15  "includes all terms NOT dependent on chemical potential.");
16  params.addRequiredParam<Real>("w", "Double well height parameter");
17  params.addParam<MaterialPropertyName>(
18  "g_name", "g", "Base name for the double well function g(eta)");
19  return params;
20 }
21 
22 KKSACBulkF::KKSACBulkF(const InputParameters & parameters)
23  : KKSACBulkBase(parameters),
24  _w(getParam<Real>("w")),
25  _prop_dg(getMaterialPropertyDerivative<Real>("g_name", _eta_name)),
26  _prop_d2g(getMaterialPropertyDerivative<Real>("g_name", _eta_name, _eta_name))
27 {
28 }
29 
30 Real
32 {
33  Real res = 0.0;
34  Real A1 = _prop_Fa[_qp] - _prop_Fb[_qp];
35 
36  switch (type)
37  {
38  case Residual:
39  return -_prop_dh[_qp] * A1 + _w * _prop_dg[_qp];
40 
41  case Jacobian:
42  {
43  res = -_prop_d2h[_qp] * A1 + _w * _prop_d2g[_qp];
44 
45  return _phi[_j][_qp] * res;
46  }
47  }
48 
49  mooseError("Invalid type passed in");
50 }
51 
52 Real
54 {
55  // get the coupled variable jvar is referring to
56  const unsigned int cvar = mapJvarToCvar(jvar);
57 
58  // first get dependence of mobility _L on other variables using parent class
59  // member function
61 
62  // Then add dependence of KKSACBulkF on other variables
63  res -= _L[_qp] * _prop_dh[_qp] * ((*_derivatives_Fa[cvar])[_qp] - (*_derivatives_Fb[cvar])[_qp]) *
64  _phi[_j][_qp] * _test[_i][_qp];
65 
66  return res;
67 }
const MaterialProperty< Real > & _L
Mobility.
Definition: ACBulk.h:44
KKSACBulkF(const InputParameters &parameters)
Definition: KKSACBulkF.C:22
const MaterialProperty< Real > & _prop_Fa
Value of the free energy function .
Definition: KKSACBulkBase.h:45
Real _w
double well height parameter
Definition: KKSACBulkF.h:35
const MaterialProperty< Real > & _prop_dg
Derivative of the double well function .
Definition: KKSACBulkF.h:38
const MaterialProperty< Real > & _prop_Fb
Value of the free energy function .
Definition: KKSACBulkBase.h:48
virtual Real computeDFDOP(PFFunctionType type)
Definition: KKSACBulkF.C:31
virtual Real computeQpOffDiagJacobian(unsigned int jvar)
Definition: KKSACBulkF.C:53
ACBulk child class that takes all the necessary data from a KKSBaseMaterial and sets up the Allen-Cah...
Definition: KKSACBulkBase.h:24
std::vector< const MaterialProperty< Real > * > _derivatives_Fa
Derivatives of with respect to all coupled variables.
Definition: KKSACBulkBase.h:39
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 MaterialProperty< Real > & _prop_d2g
Second derivative of the double well function .
Definition: KKSACBulkF.h:41
InputParameters validParams< KKSACBulkF >()
Definition: KKSACBulkF.C:11
const MaterialProperty< Real > & _prop_d2h
Second derivative of the switching function .
Definition: KKSACBulkBase.h:60
std::vector< const MaterialProperty< Real > * > _derivatives_Fb
Derivatives of with respect to all coupled variables.
Definition: KKSACBulkBase.h:42
InputParameters validParams< KKSACBulkBase >()
Definition: KKSACBulkBase.C:11