www.mooseframework.org
SwitchingFunctionConstraintEta.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("Lagrange multiplier kernel to constrain the sum of all switching "
15  "functions in a multiphase system. This kernel acts on a "
16  "non-conserved order parameter eta_i.");
17  params.addParam<MaterialPropertyName>("h_name",
18  "Switching Function Materials that provides h(eta_i)");
19  params.addRequiredCoupledVar("lambda", "Lagrange multiplier");
20  return params;
21 }
22 
24  : DerivativeMaterialInterface<Kernel>(parameters),
25  _eta_name(_var.name()),
26  _dh(getMaterialPropertyDerivative<Real>("h_name", _eta_name)),
27  _d2h(getMaterialPropertyDerivative<Real>("h_name", _eta_name, _eta_name)),
28  _lambda(coupledValue("lambda")),
29  _lambda_var(coupled("lambda"))
30 {
31 }
32 
33 Real
35 {
36  return _lambda[_qp] * _dh[_qp] * _test[_i][_qp];
37 }
38 
39 Real
41 {
42  return _lambda[_qp] * _d2h[_qp] * _phi[_j][_qp] * _test[_i][_qp];
43 }
44 
45 Real
47 {
48  if (j_var == _lambda_var)
49  return _phi[_j][_qp] * _dh[_qp] * _test[_i][_qp];
50  else
51  return 0.0;
52 }
SwitchingFunctionConstraintEta(const InputParameters &parameters)
const MaterialProperty< Real > & _dh
Switching function drivatives.
InputParameters validParams< SwitchingFunctionConstraintEta >()
const MaterialProperty< Real > & _d2h
virtual Real computeQpOffDiagJacobian(unsigned int)
const VariableValue & _lambda
Lagrange multiplier.