https://mooseframework.inl.gov
Loading...
Searching...
No Matches
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
13
16{
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
31RealGradient
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}
registerMooseObject("PhaseFieldApp", CHBulkPFCTrad)
void mooseError(Args &&... args)
const MaterialProperty< Real > & _C0
virtual RealGradient computeGradDFDCons(PFFunctionType type)
static InputParameters validParams()
const MaterialProperty< Real > & _a
CHBulkPFCTrad(const InputParameters &parameters)
const MaterialProperty< Real > & _b
This is the Cahn-Hilliard equation base class that implements the bulk or local energy term of the eq...
Definition CHBulk.h:26
static InputParameters validParams()
Definition CHBulk.h:75
void addClassDescription(const std::string &doc_string)