www.mooseframework.org
SwitchingFunctionMaterial.C
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://www.mooseframework.org
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 
14 template <>
15 InputParameters
17 {
18  InputParameters params = validParams<OrderParameterFunctionMaterial>();
19  params.addClassDescription("Helper material to provide h(eta) and its derivative in one of two "
20  "polynomial forms.\nSIMPLE: 3*eta^2-2*eta^3\nHIGH: "
21  "eta^3*(6*eta^2-15*eta+10)");
22  MooseEnum h_order("SIMPLE=0 HIGH", "SIMPLE");
23  params.addParam<MooseEnum>(
24  "h_order", h_order, "Polynomial order of the switching function h(eta)");
25  params.set<std::string>("function_name") = std::string("h");
26  return params;
27 }
28 
29 SwitchingFunctionMaterial::SwitchingFunctionMaterial(const InputParameters & parameters)
30  : OrderParameterFunctionMaterial(parameters), _h_order(getParam<MooseEnum>("h_order"))
31 {
32 }
33 
34 void
36 {
37  Real n = _eta[_qp];
38  n = n > 1 ? 1 : (n < 0 ? 0 : n);
39 
40  switch (_h_order)
41  {
42  case 0: // SIMPLE
43  _prop_f[_qp] = 3.0 * n * n - 2.0 * n * n * n;
44  _prop_df[_qp] = 6.0 * n - 6.0 * n * n;
45  _prop_d2f[_qp] = 6.0 - 12.0 * n;
46  break;
47 
48  case 1: // HIGH
49  _prop_f[_qp] = n * n * n * (6.0 * n * n - 15.0 * n + 10.0);
50  _prop_df[_qp] = 30.0 * n * n * (n * n - 2.0 * n + 1.0);
51  _prop_d2f[_qp] = n * (120.0 * n * n - 180.0 * n + 60.0);
52  break;
53 
54  default:
55  mooseError("Internal error");
56  }
57 }
SwitchingFunctionMaterial::_h_order
MooseEnum _h_order
Polynomial order of the switching function .
Definition: SwitchingFunctionMaterial.h:36
registerMooseObject
registerMooseObject("PhaseFieldApp", SwitchingFunctionMaterial)
SwitchingFunctionMaterial::computeQpProperties
virtual void computeQpProperties()
Definition: SwitchingFunctionMaterial.C:35
SwitchingFunctionMaterial
Material class to provide the switching function for the KKS system.
Definition: SwitchingFunctionMaterial.h:27
SwitchingFunctionMaterial.h
OrderParameterFunctionMaterial::_prop_f
MaterialProperty< Real > & _prop_f
Material property to store .
Definition: OrderParameterFunctionMaterial.h:41
OrderParameterFunctionMaterial
Material base class for materials that provide the switching function or the double well function .
Definition: OrderParameterFunctionMaterial.h:26
OrderParameterFunctionMaterial::_eta
const VariableValue & _eta
Coupled variable value for the order parameter .
Definition: OrderParameterFunctionMaterial.h:33
validParams< OrderParameterFunctionMaterial >
InputParameters validParams< OrderParameterFunctionMaterial >()
Definition: OrderParameterFunctionMaterial.C:14
SwitchingFunctionMaterial::SwitchingFunctionMaterial
SwitchingFunctionMaterial(const InputParameters &parameters)
Definition: SwitchingFunctionMaterial.C:29
OrderParameterFunctionMaterial::_prop_df
MaterialProperty< Real > & _prop_df
Material property to store the derivative .
Definition: OrderParameterFunctionMaterial.h:44
validParams< SwitchingFunctionMaterial >
InputParameters validParams< SwitchingFunctionMaterial >()
Definition: SwitchingFunctionMaterial.C:16
OrderParameterFunctionMaterial::_prop_d2f
MaterialProperty< Real > & _prop_d2f
Material property to store the second derivative .
Definition: OrderParameterFunctionMaterial.h:47