www.mooseframework.org
CHMath.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 "CHMath.h"
11 
12 registerMooseObject("PhaseFieldApp", CHMath);
13 
14 template <>
15 InputParameters
17 {
18  InputParameters params = CHBulk<Real>::validParams();
19  params.addClassDescription(
20  "Simple demonstration Cahn-Hilliard Kernel using an algebraic double-well potential");
21  return params;
22 }
23 
24 CHMath::CHMath(const InputParameters & parameters) : CHBulk<Real>(parameters) {}
25 
26 RealGradient // Use This an example of the the function should look like
27  CHMath::computeGradDFDCons(PFFunctionType type)
28 {
29  switch (type)
30  {
31  case Residual:
32  return 3 * _u[_qp] * _u[_qp] * _grad_u[_qp] - _grad_u[_qp]; // return Residual value
33 
34  case Jacobian:
35  return 6 * _u[_qp] * _phi[_j][_qp] * _grad_u[_qp] +
36  3 * _u[_qp] * _u[_qp] * _grad_phi[_j][_qp] -
37  _grad_phi[_j][_qp]; // return Jacobian value
38  }
39 
40  mooseError("Invalid type passed in");
41 }
CHMath::CHMath
CHMath(const InputParameters &parameters)
Definition: CHMath.C:24
registerMooseObject
registerMooseObject("PhaseFieldApp", CHMath)
libMesh::RealGradient
VectorValue< Real > RealGradient
Definition: GrainForceAndTorqueInterface.h:17
validParams< CHMath >
InputParameters validParams< CHMath >()
Definition: CHMath.C:16
CHBulk< Real >::Jacobian
Definition: CHBulk.h:40
CHBulk< Real >::Residual
Definition: CHBulk.h:41
CHMath
Cahn-Hilliard Kernel implementing the free energy f = 1/4(1-c^2)^2, such that grad df/dc = (3 c^2 -1)...
Definition: CHMath.h:27
CHMath::computeGradDFDCons
virtual RealGradient computeGradDFDCons(PFFunctionType type)
Definition: CHMath.C:27
CHBulk::validParams
static InputParameters validParams()
Definition: CHBulk.h:75
CHMath.h
CHBulk
This is the Cahn-Hilliard equation base class that implements the bulk or local energy term of the eq...
Definition: CHBulk.h:25