www.mooseframework.org
SwitchingFunction3PhaseMaterial.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<DerivativeParsedMaterialHelper>();
14  params.addClassDescription("Material for switching function that prevents formation of a third "
15  "phase at a two-phase interface: h_i = eta_i^2/4 * [15 (1-eta_i) [1 + "
16  "eta_i - (eta_k - eta_j)^2] + eta_i * (9eta_i^2 - 5)]");
17  params.addRequiredCoupledVar("eta_i", "Order parameter i");
18  params.addRequiredCoupledVar("eta_j", "Order parameter j");
19  params.addRequiredCoupledVar("eta_k", "Order parameter k");
20  return params;
21 }
22 
24  : DerivativeParsedMaterialHelper(parameters), _eta_i("eta_i"), _eta_j("eta_j"), _eta_k("eta_k")
25 {
26  EBFunction h_i;
27  // Definition of the switching function for the expression builder
28  h_i(_eta_i, _eta_j, _eta_k) =
29  _eta_i * _eta_i / 4.0 *
30  (15.0 * (1.0 - _eta_i) * (1.0 + _eta_i - (_eta_k - _eta_j) * (_eta_k - _eta_j)) +
31  _eta_i * (9.0 * _eta_i * _eta_i - 5.0));
32 
33  // Parse function for automatic differentiation
34  functionParse(h_i);
35 }
Helper class to perform the auto derivative taking.
InputParameters validParams< SwitchingFunction3PhaseMaterial >()
SwitchingFunction3PhaseMaterial(const InputParameters &parameters)
InputParameters validParams< DerivativeParsedMaterialHelper >()
User facing host object for a function. This combines a term with an argument list.
void functionParse(const std::string &function_expression)
EBTerm _eta_i
Coupled variable values for order parameters.