www.mooseframework.org
ACGBPoly.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 "ACGBPoly.h"
8 #include "Material.h"
9 
10 template <>
11 InputParameters
13 {
14  InputParameters params = ACBulk<Real>::validParams();
15  params.addClassDescription("Grain-Boundary model concentration dependent residual");
16  params.addRequiredCoupledVar("c", "Other species concentration");
17  params.addParam<Real>("en_ratio", 1.0, "Ratio of surface energy to GB energy");
18  return params;
19 }
20 
21 ACGBPoly::ACGBPoly(const InputParameters & parameters)
22  : ACBulk<Real>(parameters),
23  _c(coupledValue("c")),
24  _c_var(coupled("c")),
25  _mu(getMaterialProperty<Real>("mu")),
26  _gamma(getMaterialProperty<Real>("gamma_asymm")),
27  _en_ratio(getParam<Real>("en_ratio"))
28 {
29 }
30 
31 Real
33 {
34  Real mult = 2.0 * _en_ratio * _mu[_qp] * _gamma[_qp];
35 
36  Real c = _c[_qp];
37  if (c < 1.0e-8)
38  c = 0.0;
39  if (c > 1.0)
40  c = 1.0;
41 
42  switch (type)
43  {
44  case Residual:
45  return mult * _u[_qp] * c * c;
46 
47  case Jacobian:
48  return mult * _phi[_j][_qp] * c * c;
49  }
50 
51  mooseError("Invalid type passed in");
52 }
53 
54 Real
56 {
57  Real c = _c[_qp];
58  if (c < 1.0e-8)
59  c = 0.0;
60  if (c > 1.0)
61  c = 1.0;
62 
63  if (jvar == _c_var)
64  {
65  Real mult = 2.0 * _en_ratio * _mu[_qp] * _gamma[_qp];
66  Real dDFDOP = 2.0 * mult * _u[_qp] * c * _phi[_j][_qp];
67 
68  return _L[_qp] * _test[_i][_qp] * dDFDOP;
69  }
70 
71  return 0.0;
72 }
ACGBPoly(const InputParameters &parameters)
Definition: ACGBPoly.C:21
const MaterialProperty< Real > & _L
Mobility.
Definition: ACBulk.h:44
InputParameters validParams< ACGBPoly >()
Definition: ACGBPoly.C:12
virtual Real computeQpOffDiagJacobian(unsigned int jvar)
Definition: ACGBPoly.C:55
virtual Real computeDFDOP(PFFunctionType type)
Definition: ACGBPoly.C:32
This is the Allen-Cahn equation base class that implements the bulk or local energy term of the equat...
Definition: ACBulk.h:22
const MaterialProperty< Real > & _mu
Definition: ACGBPoly.h:30
unsigned int _c_var
Definition: ACGBPoly.h:28
const MaterialProperty< Real > & _gamma
Definition: ACGBPoly.h:31
Real _en_ratio
Definition: ACGBPoly.h:33
const VariableValue & _c
Definition: ACGBPoly.h:27
static InputParameters validParams()
Definition: ACBulk.h:72