Line data Source code
1 : //* This file is part of the MOOSE framework 2 : //* https://mooseframework.inl.gov 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 : 10 : #include "SolidMechanicsHardeningCutExponential.h" 11 : 12 : registerMooseObject("SolidMechanicsApp", SolidMechanicsHardeningCutExponential); 13 : registerMooseObjectRenamed("SolidMechanicsApp", 14 : TensorMechanicsHardeningCutExponential, 15 : "01/01/2025 00:00", 16 : SolidMechanicsHardeningCutExponential); 17 : 18 : InputParameters 19 0 : SolidMechanicsHardeningCutExponential::validParams() 20 : { 21 0 : InputParameters params = SolidMechanicsHardeningModel::validParams(); 22 0 : params.addRequiredParam<Real>( 23 : "value_0", "The value of the parameter for all internal_parameter <= internal_0"); 24 0 : params.addParam<Real>("value_residual", 25 : "The value of the parameter for internal_parameter = " 26 : "infinity. Default = value_0, ie perfect plasticity"); 27 0 : params.addParam<Real>("internal_0", 0, "The cutoff of internal parameter"); 28 0 : params.addParam<Real>("rate", 29 0 : 0, 30 : "Let p = internal_parameter. Then value = value_0 for " 31 : "p<internal_0, and otherwise, value = value_residual + (value_0 " 32 : "- value_residual)*exp(-rate*(p - internal_0)"); 33 0 : params.addClassDescription("Hardening is Cut-exponential"); 34 0 : return params; 35 0 : } 36 : 37 0 : SolidMechanicsHardeningCutExponential::SolidMechanicsHardeningCutExponential( 38 0 : const InputParameters & parameters) 39 : : SolidMechanicsHardeningModel(parameters), 40 0 : _val_0(getParam<Real>("value_0")), 41 0 : _val_res(parameters.isParamValid("value_residual") ? getParam<Real>("value_residual") : _val_0), 42 0 : _intnl_0(getParam<Real>("internal_0")), 43 0 : _rate(getParam<Real>("rate")) 44 : { 45 0 : } 46 : 47 : Real 48 0 : SolidMechanicsHardeningCutExponential::value(Real intnl) const 49 : { 50 0 : Real x = intnl - _intnl_0; 51 0 : if (x <= 0) 52 0 : return _val_0; 53 : else 54 0 : return _val_res + (_val_0 - _val_res) * std::exp(-_rate * x); 55 : } 56 : 57 : Real 58 0 : SolidMechanicsHardeningCutExponential::derivative(Real intnl) const 59 : { 60 0 : Real x = intnl - _intnl_0; 61 0 : if (x <= 0) 62 : return 0; 63 : else 64 0 : return -_rate * (_val_0 - _val_res) * std::exp(-_rate * x); 65 : } 66 : 67 : std::string 68 0 : SolidMechanicsHardeningCutExponential::modelName() const 69 : { 70 0 : return "CutExponential"; 71 : }