https://mooseframework.inl.gov
Loading...
Searching...
No Matches
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
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
36Real
38{
39 return _test[_i][_qp] * (_u[_qp] - _chemical_potential[_qp]);
40}
41
42Real
44{
45 return _test[_i][_qp] * _phi[_j][_qp];
46}
47
48Real
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}
registerMooseObject("PhaseFieldApp", CHSplitChemicalPotential)
Solves chemical potential in a weak sense (mu-mu_prop=0) Can be coupled to Cahn-Hilliard equation to ...
CHSplitChemicalPotential(const InputParameters &parameters)
const MaterialProperty< Real > & _dchemical_potential_dc
const MaterialProperty< Real > & _chemical_potential
static InputParameters validParams()
virtual Real computeQpOffDiagJacobian(unsigned int jvar)
void addRequiredCoupledVar(const std::string &name, const std::string &doc_string)
void addRequiredParam(const std::string &name, const std::string &doc_string)
void addClassDescription(const std::string &doc_string)
static InputParameters validParams()