https://mooseframework.inl.gov
SimpleCHInterface.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 "SimpleCHInterface.h"
11 
12 registerMooseObject("PhaseFieldApp", SimpleCHInterface);
13 
16 {
18  params.addClassDescription("Gradient energy for Cahn-Hilliard equation with constant Mobility "
19  "and Interfacial parameter");
20  params.addRequiredParam<MaterialPropertyName>(
21  "kappa_name", "The kappa used with the kernel, should be constant value");
22  params.addRequiredParam<MaterialPropertyName>(
23  "mob_name", "The mobility used with the kernel, should be constant value");
24  return params;
25 }
26 
28  : Kernel(parameters),
29  _second_u(second()),
30  _second_test(secondTest()),
31  _second_phi(secondPhi()),
32  _M(getMaterialProperty<Real>("mob_name")),
33  _kappa_c(getMaterialProperty<Real>("kappa_name"))
34 {
35 }
36 
37 Real
39 {
40  return _kappa_c[_qp] * _second_u[_qp].tr() * _M[_qp] * _second_test[_i][_qp].tr();
41 }
42 
43 Real
45 {
46  return _kappa_c[_qp] * _second_phi[_j][_qp].tr() * _M[_qp] * _second_test[_i][_qp].tr();
47 }
const VariableSecond & _second_u
Variables for second order derivatives.
static InputParameters validParams()
const MaterialProperty< Real > & _kappa_c
Interfacial parameter.
virtual Real computeQpJacobian()
static InputParameters validParams()
void addRequiredParam(const std::string &name, const std::string &doc_string)
const VariablePhiSecond & _second_phi
unsigned int _i
Compute the Cahn-Hilliard interface term with constant Mobility and Interfacial parameter.
SimpleCHInterface(const InputParameters &parameters)
unsigned int _j
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const VariableTestSecond & _second_test
const MaterialProperty< Real > & _M
Mobility.
void addClassDescription(const std::string &doc_string)
registerMooseObject("PhaseFieldApp", SimpleCHInterface)
virtual Real computeQpResidual()
unsigned int _qp