www.mooseframework.org
CHSplitConcentration.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 "CHSplitConcentration.h"
8 
9 template <>
10 InputParameters
12 {
13  InputParameters params = validParams<Kernel>();
14  params.addClassDescription(
15  "Concentration kernel in Split Cahn-Hilliard that solves chemical potential in a weak form");
16  params.addRequiredParam<MaterialPropertyName>("mobility", "Mobility property name");
17  params.addRequiredCoupledVar("chemical_potential_var", "Chemical potential variable");
18  return params;
19 }
20 
21 CHSplitConcentration::CHSplitConcentration(const InputParameters & parameters)
22  : DerivativeMaterialInterface<Kernel>(parameters),
23  _mobility_name(getParam<MaterialPropertyName>("mobility")),
24  _mobility(getMaterialProperty<RealTensorValue>(_mobility_name)),
25  _dmobility_dc(getMaterialPropertyDerivative<RealTensorValue>(_mobility_name, name())),
26  _mu_var(coupled("chemical_potential_var")),
27  _grad_mu(coupledGradient("chemical_potential_var"))
28 {
29 }
30 
31 Real
33 {
34  const RealVectorValue a = _mobility[_qp] * _grad_mu[_qp];
35  return _grad_test[_i][_qp] * a;
36 }
37 
38 Real
40 {
41  const RealVectorValue a = _dmobility_dc[_qp] * _grad_mu[_qp];
42  return _grad_test[_i][_qp] * a * _phi[_j][_qp];
43 }
44 
45 Real
47 {
48  if (jvar == _mu_var)
49  {
50  const RealVectorValue a = _mobility[_qp] * _grad_phi[_j][_qp];
51  return _grad_test[_i][_qp] * a;
52  }
53  else
54  return 0.0;
55 }
const MaterialProperty< RealTensorValue > & _mobility
virtual Real computeQpResidual()
InputParameters validParams< CHSplitConcentration >()
const MaterialProperty< RealTensorValue > & _dmobility_dc
const VariableGradient & _grad_mu
CHSplitConcentration(const InputParameters &parameters)
virtual Real computeQpOffDiagJacobian(unsigned int)
const unsigned int _mu_var
Chemical potential variable.
virtual Real computeQpJacobian()