www.mooseframework.org
SimpleCHInterface.C
Go to the documentation of this file.
1 /****************************************************************/
2 /* MOOSE - Multiphysics Object Oriented Simulation Environment */
3 /* */
4 /* All contents are licensed under LGPL V2.1 */
5 /* See LICENSE for full restrictions */
6 /****************************************************************/
7 #include "SimpleCHInterface.h"
8 
9 template <>
10 InputParameters
12 {
13  InputParameters params = validParams<Kernel>();
14  params.addClassDescription("Gradient energy for Cahn-Hilliard equation with constant Mobility "
15  "and Interfacial parameter");
16  params.addRequiredParam<MaterialPropertyName>(
17  "kappa_name", "The kappa used with the kernel, should be constant value");
18  params.addRequiredParam<MaterialPropertyName>(
19  "mob_name", "The mobility used with the kernel, should be constant value");
20  return params;
21 }
22 
23 SimpleCHInterface::SimpleCHInterface(const InputParameters & parameters)
24  : Kernel(parameters),
25  _second_u(second()),
26  _second_test(secondTest()),
27  _second_phi(secondPhi()),
28  _M(getMaterialProperty<Real>("mob_name")),
29  _kappa_c(getMaterialProperty<Real>("kappa_name"))
30 {
31 }
32 
33 Real
35 {
36  return _kappa_c[_qp] * _second_u[_qp].tr() * _M[_qp] * _second_test[_i][_qp].tr();
37 }
38 
39 Real
41 {
42  return _kappa_c[_qp] * _second_phi[_j][_qp].tr() * _M[_qp] * _second_test[_i][_qp].tr();
43 }
const VariableSecond & _second_u
Variables for second order derivatives.
const MaterialProperty< Real > & _kappa_c
Interfacial parameter.
virtual Real computeQpJacobian()
InputParameters validParams< SimpleCHInterface >()
const VariablePhiSecond & _second_phi
SimpleCHInterface(const InputParameters &parameters)
const VariableTestSecond & _second_test
const MaterialProperty< Real > & _M
Mobility.
virtual Real computeQpResidual()