www.mooseframework.org
TensorMechanicsHardeningCubic.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 #include "libmesh/utility.h"
9 
10 template <>
11 InputParameters
13 {
14  InputParameters params = validParams<TensorMechanicsHardeningModel>();
15  params.addRequiredParam<Real>(
16  "value_0", "The value of the parameter for all internal_parameter <= internal_0");
17  params.addParam<Real>("value_residual",
18  "The value of the parameter for internal_parameter >= "
19  "internal_limit. Default = value_0, ie perfect "
20  "plasticity");
21  params.addParam<Real>(
22  "internal_0", 0.0, "The value of the internal_parameter when hardening begins");
23  params.addParam<Real>("internal_limit",
24  1.0,
25  "The value of the internal_parameter when hardening "
26  "ends. This hardening forms a cubic between "
27  "(internal_0, value_0) and (internal_limit, "
28  "value_residual) that is smooth at internal_0 and "
29  "internal_limit");
30  params.addClassDescription("Hardening is Cubic");
31  return params;
32 }
33 
35  : TensorMechanicsHardeningModel(parameters),
36  _val_0(getParam<Real>("value_0")),
37  _val_res(parameters.isParamValid("value_residual") ? getParam<Real>("value_residual") : _val_0),
38  _intnl_0(getParam<Real>("internal_0")),
39  _intnl_limit(getParam<Real>("internal_limit")),
40  _half_intnl_limit(0.5 * (_intnl_limit - _intnl_0)),
41  _alpha((_val_0 - _val_res) / (4.0 * Utility::pow<3>(_half_intnl_limit))),
42  _beta(-3.0 * _alpha * Utility::pow<2>(_half_intnl_limit))
43 {
44  if (_intnl_limit <= _intnl_0)
45  mooseError("internal_limit must be greater than internal_0 in Cubic Hardening");
46 }
47 
48 Real
50 {
51  const Real x = intnl - _intnl_0;
52  if (x <= 0.0)
53  return _val_0;
54  else if (intnl >= _intnl_limit)
55  return _val_res;
56  else
57  return _alpha * Utility::pow<3>(x - _half_intnl_limit) + _beta * (x - _half_intnl_limit) +
58  0.5 * (_val_0 + _val_res);
59 }
60 
61 Real
63 {
64  const Real x = intnl - _intnl_0;
65  if (x <= 0.0)
66  return 0.0;
67  else if (intnl >= _intnl_limit)
68  return 0.0;
69  else
70  return 3.0 * _alpha * Utility::pow<2>(x - _half_intnl_limit) + _beta;
71 }
72 
73 std::string
75 {
76  return "Cubic";
77 }
Real _val_0
value is cubic between _val_0 at internal_parameter=_intnl_0, at _val_res at internal_parameter=_intn...
Real _alpha
convenience parameter for cubic
InputParameters validParams< TensorMechanicsHardeningModel >()
virtual Real derivative(Real intnl) const override
virtual std::string modelName() const override
TensorMechanicsHardeningCubic(const InputParameters &parameters)
Real _val_res
value is cubic between _val_0 at internal_parameter=_intnl_0, at _val_res at internal_parameter=_intn...
Real _intnl_limit
value is cubic between _val_0 at internal_parameter=_intnl_0, at _val_res at internal_parameter=_intn...
virtual Real value(Real intnl) const override
InputParameters validParams< TensorMechanicsHardeningCubic >()
ExpressionBuilder::EBTerm pow(const ExpressionBuilder::EBTerm &left, T exponent)
Real _beta
convenience parameter for cubic
Real _half_intnl_limit
convenience parameter for cubic
Real _intnl_0
value is cubic between _val_0 at internal_parameter=_intnl_0, at _val_res at internal_parameter=_intn...