www.mooseframework.org
CHSplitChemicalPotential.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("Chemical potential kernel in Split Cahn-Hilliard that solves "
15  "chemical potential in a weak form");
16  params.addRequiredParam<MaterialPropertyName>("chemical_potential_prop",
17  "Chemical potential property name");
18  params.addRequiredCoupledVar("c", "Concentration");
19  return params;
20 }
21 
22 CHSplitChemicalPotential::CHSplitChemicalPotential(const InputParameters & parameters)
23  : DerivativeMaterialInterface<Kernel>(parameters),
24  _mu_prop_name(getParam<MaterialPropertyName>("chemical_potential_prop")),
25  _chemical_potential(getMaterialProperty<Real>(_mu_prop_name)),
26  _dchemical_potential_dc(
27  getMaterialPropertyDerivative<Real>(_mu_prop_name, getVar("c", 0)->name())),
28  _c_var(coupled("c"))
29 {
30 }
31 
32 Real
34 {
35  return _test[_i][_qp] * (_u[_qp] - _chemical_potential[_qp]);
36 }
37 
38 Real
40 {
41  return _test[_i][_qp] * _phi[_j][_qp];
42 }
43 
44 Real
46 {
47  if (jvar == _c_var)
48  return -_test[_i][_qp] * _dchemical_potential_dc[_qp] * _phi[_j][_qp];
49  else
50  return 0.0;
51 }
const MaterialProperty< Real > & _dchemical_potential_dc
const MaterialProperty< Real > & _chemical_potential
virtual Real computeQpOffDiagJacobian(unsigned int jvar)
CHSplitChemicalPotential(const InputParameters &parameters)
InputParameters validParams< CHSplitChemicalPotential >()