www.mooseframework.org
MixedSwitchingFunctionMaterial.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. MIX234 and MIX246");
21  MooseEnum h_order("MIX234=0 MIX246", "MIX234");
22  params.addParam<MooseEnum>(
23  "h_order", h_order, "Polynomial order of the switching function h(eta)");
24  params.set<std::string>("function_name") = std::string("h");
25 
26  params.addRangeCheckedParam<Real>(
27  "weight", 1.0, "weight <= 1 & weight >= 0", "Weight parameter for MIX type h(eta)");
28 
29  return params;
30 }
31 
33  : OrderParameterFunctionMaterial(parameters),
34  _h_order(getParam<MooseEnum>("h_order")),
35  _weight(getParam<Real>("weight"))
36 {
37 }
38 
39 void
41 {
42  Real n = _eta[_qp];
43  n = n > 1 ? 1 : (n < 0 ? 0 : n);
44 
45  switch (_h_order)
46  {
47  case 0: // MIX234
48  _prop_f[_qp] =
49  n * n * (3.0 * _weight + (4.0 - 6.0 * _weight) * n + (3.0 * _weight - 3.0) * n * n);
50  _prop_df[_qp] =
51  n * (6.0 * _weight + (12.0 - 18.0 * _weight) * n + (12.0 * _weight - 12.0) * n * n);
52  _prop_d2f[_qp] = 6.0 * _weight + ((24.0 - 36.0 * _weight) + (36.0 * _weight - 36.0) * n) * n;
53  break;
54 
55  case 1: // MIX246
56  _prop_f[_qp] =
57  n * n * (2.0 * _weight + n * n * ((3.0 - 4.0 * _weight) + (2.0 * _weight - 2.0) * n * n));
58  _prop_df[_qp] =
59  n * (4.0 * _weight + n * n * ((12.0 - 16.0 * _weight) + (12.0 * _weight - 12.0) * n * n));
60  _prop_d2f[_qp] =
61  4.0 * _weight + n * n * ((36.0 - 48.0 * _weight) + (60.0 * _weight - 60.0) * n * n);
62  break;
63 
64  default:
65  mooseError("Internal error");
66  }
67 }
registerMooseObject
registerMooseObject("PhaseFieldApp", MixedSwitchingFunctionMaterial)
MixedSwitchingFunctionMaterial::_h_order
MooseEnum _h_order
Polynomial order of the switching function .
Definition: MixedSwitchingFunctionMaterial.h:36
OrderParameterFunctionMaterial::_prop_f
MaterialProperty< Real > & _prop_f
Material property to store .
Definition: OrderParameterFunctionMaterial.h:41
validParams< MixedSwitchingFunctionMaterial >
InputParameters validParams< MixedSwitchingFunctionMaterial >()
Definition: MixedSwitchingFunctionMaterial.C:16
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
MixedSwitchingFunctionMaterial::computeQpProperties
virtual void computeQpProperties()
Definition: MixedSwitchingFunctionMaterial.C:40
validParams< OrderParameterFunctionMaterial >
InputParameters validParams< OrderParameterFunctionMaterial >()
Definition: OrderParameterFunctionMaterial.C:14
MixedSwitchingFunctionMaterial::_weight
Real _weight
Weight parameter of mixed-type h(eta)
Definition: MixedSwitchingFunctionMaterial.h:39
MixedSwitchingFunctionMaterial
Material class to provide the switching function for the KKS system.
Definition: MixedSwitchingFunctionMaterial.h:27
OrderParameterFunctionMaterial::_prop_df
MaterialProperty< Real > & _prop_df
Material property to store the derivative .
Definition: OrderParameterFunctionMaterial.h:44
MixedSwitchingFunctionMaterial::MixedSwitchingFunctionMaterial
MixedSwitchingFunctionMaterial(const InputParameters &parameters)
Definition: MixedSwitchingFunctionMaterial.C:32
MixedSwitchingFunctionMaterial.h
OrderParameterFunctionMaterial::_prop_d2f
MaterialProperty< Real > & _prop_d2f
Material property to store the second derivative .
Definition: OrderParameterFunctionMaterial.h:47