www.mooseframework.org
CHBulkPFCTrad.C
Go to the documentation of this file.
1 #include "CHBulkPFCTrad.h"
2 
3 template <>
4 InputParameters
6 {
7  InputParameters params = CHBulk<Real>::validParams();
8  params.addClassDescription(
9  "Cahn-Hilliard kernel for a polynomial phase field crystal free energy.");
10  return params;
11 }
12 
13 CHBulkPFCTrad::CHBulkPFCTrad(const InputParameters & parameters)
14  : CHBulk<Real>(parameters),
15  _C0(getMaterialProperty<Real>("C0")),
16  _a(getMaterialProperty<Real>("a")),
17  _b(getMaterialProperty<Real>("b"))
18 {
19 }
20 
21 RealGradient
23 {
24  Real d2fdc2 = 1.0 - _C0[_qp] - _a[_qp] * _u[_qp] + _b[_qp] * _u[_qp] * _u[_qp];
25 
26  switch (type)
27  {
28  case Residual:
29  return d2fdc2 * _grad_u[_qp];
30 
31  case Jacobian:
32  {
33  Real d3fdc3 = -_a[_qp] + 2.0 * _b[_qp] * _u[_qp];
34  return d2fdc2 * _grad_phi[_j][_qp] + d3fdc3 * _grad_u[_qp] * _phi[_j][_qp];
35  }
36  }
37 
38  mooseError("Invalid type passed in");
39 }
This is the Cahn-Hilliard equation base class that implements the bulk or local energy term of the eq...
Definition: CHBulk.h:23
const MaterialProperty< Real > & _a
Definition: CHBulkPFCTrad.h:22
virtual RealGradient computeGradDFDCons(PFFunctionType type)
Definition: CHBulkPFCTrad.C:22
const MaterialProperty< Real > & _b
Definition: CHBulkPFCTrad.h:23
CHBulkPFCTrad(const InputParameters &parameters)
Definition: CHBulkPFCTrad.C:13
static InputParameters validParams()
Definition: CHBulk.h:73
InputParameters validParams< CHBulkPFCTrad >()
Definition: CHBulkPFCTrad.C:5
const MaterialProperty< Real > & _C0
Definition: CHBulkPFCTrad.h:21