https://mooseframework.inl.gov
Loading...
Searching...
No Matches
CHMath.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 "CHMath.h"
11
12registerMooseObject("PhaseFieldApp", CHMath);
13
16{
19 "Simple demonstration Cahn-Hilliard Kernel using an algebraic double-well potential");
20 return params;
21}
22
23CHMath::CHMath(const InputParameters & parameters) : CHBulk<Real>(parameters) {}
24
25RealGradient // Use This an example of the the function should look like
27{
28 switch (type)
29 {
30 case Residual:
31 return 3 * _u[_qp] * _u[_qp] * _grad_u[_qp] - _grad_u[_qp]; // return Residual value
32
33 case Jacobian:
34 return 6 * _u[_qp] * _phi[_j][_qp] * _grad_u[_qp] +
35 3 * _u[_qp] * _u[_qp] * _grad_phi[_j][_qp] -
36 _grad_phi[_j][_qp]; // return Jacobian value
37 }
38
39 mooseError("Invalid type passed in");
40}
registerMooseObject("PhaseFieldApp", CHMath)
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:26
static InputParameters validParams()
Definition CHBulk.h:75
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:22
CHMath(const InputParameters &parameters)
Definition CHMath.C:23
virtual RealGradient computeGradDFDCons(PFFunctionType type)
Definition CHMath.C:26
static InputParameters validParams()
Definition CHMath.C:15
void addClassDescription(const std::string &doc_string)