Loading [MathJax]/extensions/tex2jax.js
https://mooseframework.inl.gov
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends
CHSplitChemicalPotential.C
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://mooseframework.inl.gov
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 
11 
13 
16 {
18  params.addClassDescription("Chemical potential kernel in Split Cahn-Hilliard that solves "
19  "chemical potential in a weak form");
20  params.addRequiredParam<MaterialPropertyName>("chemical_potential_prop",
21  "Chemical potential property name");
22  params.addRequiredCoupledVar("c", "Concentration");
23  return params;
24 }
25 
27  : DerivativeMaterialInterface<Kernel>(parameters),
28  _mu_prop_name(getParam<MaterialPropertyName>("chemical_potential_prop")),
29  _chemical_potential(getMaterialProperty<Real>(_mu_prop_name)),
30  _dchemical_potential_dc(
31  getMaterialPropertyDerivative<Real>(_mu_prop_name, coupledName("c", 0))),
32  _c_var(coupled("c"))
33 {
34 }
35 
36 Real
38 {
39  return _test[_i][_qp] * (_u[_qp] - _chemical_potential[_qp]);
40 }
41 
42 Real
44 {
45  return _test[_i][_qp] * _phi[_j][_qp];
46 }
47 
48 Real
50 {
51  if (jvar == _c_var)
52  return -_test[_i][_qp] * _dchemical_potential_dc[_qp] * _phi[_j][_qp];
53  else
54  return 0.0;
55 }
static InputParameters validParams()
const MaterialProperty< Real > & _dchemical_potential_dc
const MaterialProperty< Real > & _chemical_potential
void addRequiredParam(const std::string &name, const std::string &doc_string)
registerMooseObject("PhaseFieldApp", CHSplitChemicalPotential)
virtual Real computeQpOffDiagJacobian(unsigned int jvar)
CHSplitChemicalPotential(const InputParameters &parameters)
void addRequiredCoupledVar(const std::string &name, const std::string &doc_string)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
void addClassDescription(const std::string &doc_string)
Solves chemical potential in a weak sense (mu-mu_prop=0) Can be coupled to Cahn-Hilliard equation to ...
static InputParameters validParams()