www.mooseframework.org
SimpleCoupledACInterface.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 /****************************************************************/
8 
9 template <>
10 InputParameters
12 {
13  InputParameters params = validParams<Kernel>();
14  params.addClassDescription(
15  "Gradient energy for Allen-Cahn Kernel with constant Mobility and Interfacial parameter");
16  params.addRequiredCoupledVar("v", "Coupled variable that the Laplacian is taken of");
17  params.addParam<MaterialPropertyName>("mob_name", "L", "The mobility used with the kernel");
18  params.addParam<MaterialPropertyName>("kappa_name", "kappa_op", "The kappa used with the kernel");
19  return params;
20 }
21 
22 SimpleCoupledACInterface::SimpleCoupledACInterface(const InputParameters & parameters)
23  : Kernel(parameters),
24  _L(getMaterialProperty<Real>("mob_name")),
25  _kappa(getMaterialProperty<Real>("kappa_name")),
26  _grad_v(coupledGradient("v")),
27  _v_var(coupled("v", 0))
28 {
29 }
30 
31 Real
33 {
34  return _grad_v[_qp] * _kappa[_qp] * _L[_qp] * _grad_test[_i][_qp];
35 }
36 
37 Real
39 {
40  if (jvar == _v_var)
41  return _grad_phi[_j][_qp] * _kappa[_qp] * _L[_qp] * _grad_test[_i][_qp];
42 
43  return 0.0;
44 }
const MaterialProperty< Real > & _L
Mobility.
const VariableGradient & _grad_v
Gradient of the coupled variable.
virtual Real computeQpOffDiagJacobian(unsigned int jvar)
const MaterialProperty< Real > & _kappa
Interfacial parameter.
InputParameters validParams< SimpleCoupledACInterface >()
SimpleCoupledACInterface(const InputParameters &parameters)
unsigned int _v_var
Index of the coupled variable.