www.mooseframework.org
SimpleCHInterface.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 "SimpleCHInterface.h"
11 
12 registerMooseObject("PhaseFieldApp", SimpleCHInterface);
13 
14 template <>
15 InputParameters
17 {
18  InputParameters params = validParams<Kernel>();
19  params.addClassDescription("Gradient energy for Cahn-Hilliard equation with constant Mobility "
20  "and Interfacial parameter");
21  params.addRequiredParam<MaterialPropertyName>(
22  "kappa_name", "The kappa used with the kernel, should be constant value");
23  params.addRequiredParam<MaterialPropertyName>(
24  "mob_name", "The mobility used with the kernel, should be constant value");
25  return params;
26 }
27 
28 SimpleCHInterface::SimpleCHInterface(const InputParameters & parameters)
29  : Kernel(parameters),
30  _second_u(second()),
31  _second_test(secondTest()),
32  _second_phi(secondPhi()),
33  _M(getMaterialProperty<Real>("mob_name")),
34  _kappa_c(getMaterialProperty<Real>("kappa_name"))
35 {
36 }
37 
38 Real
40 {
41  return _kappa_c[_qp] * _second_u[_qp].tr() * _M[_qp] * _second_test[_i][_qp].tr();
42 }
43 
44 Real
46 {
47  return _kappa_c[_qp] * _second_phi[_j][_qp].tr() * _M[_qp] * _second_test[_i][_qp].tr();
48 }
SimpleCHInterface::_second_u
const VariableSecond & _second_u
Variables for second order derivatives.
Definition: SimpleCHInterface.h:32
SimpleCHInterface::computeQpJacobian
virtual Real computeQpJacobian()
Definition: SimpleCHInterface.C:45
SimpleCHInterface::_kappa_c
const MaterialProperty< Real > & _kappa_c
Interfacial parameter.
Definition: SimpleCHInterface.h:40
registerMooseObject
registerMooseObject("PhaseFieldApp", SimpleCHInterface)
SimpleCHInterface
Compute the Cahn-Hilliard interface term with constant Mobility and Interfacial parameter.
Definition: SimpleCHInterface.h:22
validParams< SimpleCHInterface >
InputParameters validParams< SimpleCHInterface >()
Definition: SimpleCHInterface.C:16
SimpleCHInterface::_second_test
const VariableTestSecond & _second_test
Definition: SimpleCHInterface.h:33
SimpleCHInterface::_M
const MaterialProperty< Real > & _M
Mobility.
Definition: SimpleCHInterface.h:38
SimpleCHInterface::SimpleCHInterface
SimpleCHInterface(const InputParameters &parameters)
Definition: SimpleCHInterface.C:28
SimpleCHInterface::_second_phi
const VariablePhiSecond & _second_phi
Definition: SimpleCHInterface.h:34
SimpleCHInterface.h
SimpleCHInterface::computeQpResidual
virtual Real computeQpResidual()
Definition: SimpleCHInterface.C:39