24 "and plastic strain from user-supplied hardening " 25 "functions. This class can be used in conjunction " 26 "with other creep and plasticity materials for " 27 "more complex simulations");
28 params.
set<
Real>(
"yield_stress") = 1.0;
29 params.
set<
Real>(
"hardening_constant") = 1.0;
37 "hardening_functions",
38 "List of functions of true stress as function of plastic strain at different temperatures");
41 "List of temperatures corresponding to the functions listed in 'hardening_functions'");
50 _hardening_functions_names(
51 this->template getParam<
std::vector<FunctionName>>(
"hardening_functions")),
52 _hf_temperatures(this->template getParam<
std::vector<
Real>>(
"temperatures"))
56 mooseError(
"At least two stress-strain curves must be provided in hardening_functions");
61 mooseError(
"The vector of hardening function temperatures must have the same length as the " 62 "vector of temperature dependent hardening functions.");
65 for (
unsigned int i = 1; i < len_temps; ++i)
67 mooseError(
"The temperature dependent hardening functions and corresponding temperatures " 68 "should be listed in order of increasing temperature.");
70 std::vector<Real> yield_stress_vec;
71 for (
unsigned int i = 0; i < len; ++i)
80 yield_stress_vec.push_back(
f->value(0.0, Point()));
94 initializeHardeningFunctions();
97 this->_yield_condition =
98 effectiveTrialStress - this->_hardening_variable_old[_qp] - this->_yield_stress;
99 this->_hardening_variable[_qp] = this->_hardening_variable_old[_qp];
100 this->_plastic_strain[_qp] = this->_plastic_strain_old[_qp];
103 template <
bool is_ad>
108 if (temp > _hf_temperatures[0] && temp < _hf_temperatures.back())
110 for (
unsigned int i = 0; i < _hf_temperatures.size() - 1; ++i)
112 if (temp >= _hf_temperatures[i] && temp < _hf_temperatures[i + 1])
115 _hf_index_hi = i + 1;
117 (temp - _hf_temperatures[i]) / (_hf_temperatures[i + 1] - _hf_temperatures[i]);
121 else if (temp <= _hf_temperatures[0])
124 _hf_index_hi = _hf_index_lo;
127 else if (temp >= _hf_temperatures.back())
129 _hf_index_lo = _hf_temperatures.size() - 1;
130 _hf_index_hi = _hf_index_lo;
134 if (_hf_fraction < 0.0)
135 mooseError(
"The hardening function fraction cannot be less than zero.");
138 template <
bool is_ad>
145 (1.0 - _hf_fraction) * _hardening_functions[_hf_index_lo]->
value(strain, Point()) +
146 _hf_fraction * _hardening_functions[_hf_index_hi]->
value(strain, Point());
148 return stress - this->_yield_stress;
151 template <
bool is_ad>
156 const Real strain_old = this->_effective_inelastic_strain_old[_qp];
158 return (1.0 - _hf_fraction) *
159 _hardening_functions[_hf_index_lo]->timeDerivative(strain_old, Point()) +
160 _hf_fraction * _hardening_functions[_hf_index_hi]->timeDerivative(strain_old, Point());
163 template <
bool is_ad>
168 this->_yield_stress =
170 if (this->_yield_stress <= 0.0)
171 mooseError(
"The yield stress must be greater than zero, but during the simulation your yield " 172 "stress became less than zero.");
static InputParameters validParams()
virtual GenericReal< is_ad > computeHardeningValue(const GenericReal< is_ad > &scalar) override
MooseSharedPointer< LinearInterpolation > _interp_yield_stress
typename Moose::GenericType< RankFourTensor, is_ad > GenericRankFourTensor
This class uses the Discrete material in a radial return isotropic plasticity model.
std::vector< const PiecewiseLinear * > _hardening_functions
void mooseError(Args &&... args)
std::vector< Real > _hf_temperatures
The temperatures at which each of the hardening functions are defined.
virtual void computeStressInitialize(const GenericReal< is_ad > &effective_trial_stress, const GenericRankFourTensor< is_ad > &elasticity_tensor)
Perform any necessary initialization before return mapping iterations.
virtual void computeStressInitialize(const GenericReal< is_ad > &effectiveTrialStress, const GenericRankFourTensor< is_ad > &elasticity_tensor) override
Perform any necessary initialization before return mapping iterations.
static InputParameters validParams()
virtual const std::string & name() const
virtual void computeYieldStress(const GenericRankFourTensor< is_ad > &elasticity_tensor) override
Real elasticity_tensor(unsigned int i, unsigned int j, unsigned int k, unsigned int l)
This class inherits from IsotropicPlasticityStressUpdate.
Real value(unsigned n, unsigned alpha, unsigned beta, Real x)
Real f(Real x)
Test function for Brents method.
const std::vector< FunctionName > _hardening_functions_names
The function names and expressions for hardening as a function of temperature.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const Function & getFunctionByName(const FunctionName &name) const
virtual GenericReal< is_ad > computeHardeningDerivative(const GenericReal< is_ad > &scalar) override
void mooseError(Args &&... args) const
typename Moose::GenericType< Real, is_ad > GenericReal
void initializeHardeningFunctions()
Determines the section of the piecewise temperature dependent hardening function for the current temp...
registerMooseObject("SolidMechanicsApp", TemperatureDependentHardeningStressUpdate)