https://mooseframework.inl.gov
CHBulkPFCTrad.C
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://mooseframework.inl.gov
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 "CHBulkPFCTrad.h"
11 
12 registerMooseObject("PhaseFieldApp", CHBulkPFCTrad);
13 
16 {
18  params.addClassDescription(
19  "Cahn-Hilliard kernel for a polynomial phase field crystal free energy.");
20  return params;
21 }
22 
24  : CHBulk<Real>(parameters),
25  _C0(getMaterialProperty<Real>("C0")),
26  _a(getMaterialProperty<Real>("a")),
27  _b(getMaterialProperty<Real>("b"))
28 {
29 }
30 
33 {
34  Real d2fdc2 = 1.0 - _C0[_qp] - _a[_qp] * _u[_qp] + _b[_qp] * _u[_qp] * _u[_qp];
35 
36  switch (type)
37  {
38  case Residual:
39  return d2fdc2 * _grad_u[_qp];
40 
41  case Jacobian:
42  {
43  Real d3fdc3 = -_a[_qp] + 2.0 * _b[_qp] * _u[_qp];
44  return d2fdc2 * _grad_phi[_j][_qp] + d3fdc3 * _grad_u[_qp] * _phi[_j][_qp];
45  }
46  }
47 
48  mooseError("Invalid type passed in");
49 }
static InputParameters validParams()
Definition: CHBulkPFCTrad.C:15
void mooseError(Args &&... args)
This is the Cahn-Hilliard equation base class that implements the bulk or local energy term of the eq...
Definition: CHBulk.h:25
const MaterialProperty< Real > & _a
Definition: CHBulkPFCTrad.h:26
virtual RealGradient computeGradDFDCons(PFFunctionType type)
Definition: CHBulkPFCTrad.C:32
const MaterialProperty< Real > & _b
Definition: CHBulkPFCTrad.h:27
CHBulkPFCTrad(const InputParameters &parameters)
Definition: CHBulkPFCTrad.C:23
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
void addClassDescription(const std::string &doc_string)
static InputParameters validParams()
Definition: CHBulk.h:75
registerMooseObject("PhaseFieldApp", CHBulkPFCTrad)
const MaterialProperty< Real > & _C0
Definition: CHBulkPFCTrad.h:25