www.mooseframework.org
KKSACBulkF.C
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://www.mooseframework.org
3 //*
4 //* All rights reserved, see COPYRIGHT for full restrictions
5 //* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6 //*
7 //* Licensed under LGPL 2.1, please see LICENSE for details
8 //* https://www.gnu.org/licenses/lgpl-2.1.html
9 
10 #include "KKSACBulkF.h"
11 
12 registerMooseObject("PhaseFieldApp", KKSACBulkF);
13 
16 {
18  params.addClassDescription("KKS model kernel (part 1 of 2) for the Bulk Allen-Cahn. This "
19  "includes all terms NOT dependent on chemical potential.");
20  params.addRequiredParam<Real>("w", "Double well height parameter");
21  params.addParam<MaterialPropertyName>(
22  "g_name", "g", "Base name for the double well function g(eta)");
23  params.addRequiredParam<MaterialPropertyName>(
24  "fb_name",
25  "Base name of the free energy function F (f_base in the corresponding KKSBaseMaterial)");
26  return params;
27 }
28 
30  : KKSACBulkBase(parameters),
31  _w(getParam<Real>("w")),
32  _prop_dg(getMaterialPropertyDerivative<Real>("g_name", _eta_name)),
33  _prop_d2g(getMaterialPropertyDerivative<Real>("g_name", _eta_name, _eta_name)),
34  _prop_Fb(getMaterialProperty<Real>("fb_name")),
35  _prop_dFb(getMaterialPropertyDerivative<Real>("fb_name", _eta_name))
36 {
37 }
38 
39 Real
41 {
42  const Real A1 = _prop_Fa[_qp] - _prop_Fb[_qp];
43  switch (type)
44  {
45  case Residual:
46  return -_prop_dh[_qp] * A1 + _w * _prop_dg[_qp];
47 
48  case Jacobian:
49  return _phi[_j][_qp] * (-_prop_d2h[_qp] * A1 + _w * _prop_d2g[_qp]);
50  }
51 
52  mooseError("Invalid type passed in");
53 }
54 
55 Real
57 {
58  // get the coupled variable jvar is referring to
59  const unsigned int cvar = mapJvarToCvar(jvar);
60 
61  // first get dependence of mobility _L on other variables using parent class
62  // member function
64 
65  return res - _L[_qp] * _prop_dh[_qp] *
66  ((*_derivatives_Fa[cvar])[_qp] - (*_derivatives_Fb[cvar])[_qp]) * _phi[_j][_qp] *
67  _test[_i][_qp];
68 }
KKSACBulkBase child class for the free energy difference term in the the Allen-Cahn bulk residual...
Definition: KKSACBulkF.h:23
const MaterialProperty< Real > & _L
Mobility.
Definition: ACBulk.h:46
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
KKSACBulkF(const InputParameters &parameters)
Definition: KKSACBulkF.C:29
void mooseError(Args &&... args)
const MaterialProperty< Real > & _prop_Fa
Value of the free energy function .
Definition: KKSACBulkBase.h:42
const MaterialProperty< Real > & _prop_Fb
Value of the free energy function .
Definition: KKSACBulkF.h:44
static InputParameters validParams()
Definition: KKSACBulkF.C:15
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
void addRequiredParam(const std::string &name, const std::string &doc_string)
static InputParameters validParams()
Definition: KKSACBulkBase.C:13
virtual Real computeDFDOP(PFFunctionType type)
Definition: KKSACBulkF.C:40
virtual Real computeQpOffDiagJacobian(unsigned int jvar)
Definition: KKSACBulkF.C:56
ACBulk child class that takes all the necessary data from a KKSBaseMaterial and sets up the Allen-Cah...
Definition: KKSACBulkBase.h:22
std::vector< const MaterialProperty< Real > * > _derivatives_Fa
Derivatives of with respect to all coupled variables.
Definition: KKSACBulkBase.h:36
registerMooseObject("PhaseFieldApp", KKSACBulkF)
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
void addClassDescription(const std::string &doc_string)
const MaterialProperty< Real > & _prop_d2g
Second derivative of the double well function .
Definition: KKSACBulkF.h:41
const MaterialProperty< Real > & _prop_d2h
Second derivative of the switching function .
Definition: KKSACBulkBase.h:51
std::vector< const MaterialProperty< Real > * > _derivatives_Fb
Derivatives of with respect to all coupled variables.
Definition: KKSACBulkBase.h:39