https://mooseframework.inl.gov
Loading...
Searching...
No Matches
ADMultiplePowerLawCreepStressUpdate.C
Go to the documentation of this file.
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
11#include <algorithm>
12
14
17{
20 "This class uses the stress update material in a radial return isotropic power law creep "
21 "model. This class can be used in conjunction with other creep and plasticity materials "
22 "for more complex simulations.");
23
24 // Linear strain hardening parameters
25 params.addCoupledVar("temperature", "Coupled temperature");
26 params.addRequiredParam<std::vector<Real>>("coefficient",
27 "Leading coefficient in power-law equation");
28 params.addRequiredParam<std::vector<Real>>("n_exponent",
29 "Exponent on effective stress in power-law equation");
30 params.addRequiredParam<std::vector<Real>>("m_exponent",
31 "Exponent on time in power-law equation");
32 params.addRequiredParam<std::vector<Real>>("stress_thresholds",
33 "Stress intervals to switch creep behavior");
34 params.addRequiredParam<std::vector<Real>>("activation_energy", "Activation energy");
35 params.addParam<Real>("gas_constant", 8.3143, "Universal gas constant");
36 params.addParam<Real>("start_time", 0.0, "Start time (if not zero)");
37 return params;
38}
39
41 const InputParameters & parameters)
43 _temperature(isParamValid("temperature") ? &adCoupledValue("temperature") : nullptr),
44 _coefficient(getParam<std::vector<Real>>("coefficient")),
45 _n_exponent(getParam<std::vector<Real>>("n_exponent")),
46 _m_exponent(getParam<std::vector<Real>>("m_exponent")),
47 _stress_thresholds(getParam<std::vector<Real>>("stress_thresholds")),
48 _activation_energy(getParam<std::vector<Real>>("activation_energy")),
49 _gas_constant(getParam<Real>("gas_constant")),
50 _start_time(getParam<Real>("start_time")),
51 _exponential(1),
52 _exp_time(0),
53 _stress_index(0),
54 _number_of_models(_m_exponent.size())
55{
56
57 if (!std::is_sorted(_stress_thresholds.begin(), _stress_thresholds.end()))
58 paramError("stress_thresholds",
59 "Stress thresholds input must be provided in increasing ordered");
60
61 if (_coefficient.size() != _n_exponent.size() || _coefficient.size() != _m_exponent.size() ||
62 _coefficient.size() != _activation_energy.size())
64 "n_exponent",
65 "Inputs to ADMultiplePowerLawCreepStressUpdate creep models must have the same size");
66
67 if (_number_of_models != _stress_thresholds.size() - 1)
68 paramError("stress_thresholds",
69 "The number of creep models must be the number of stress thresholds minute. That "
70 "is, one creep model will be valid between two stress thresholds");
71
72 for (unsigned int i = 0; i < _number_of_models; i++)
73 if (_start_time < this->_app.getStartTime() && (std::trunc(_m_exponent[i]) != _m_exponent[i]))
74 paramError("start_time",
75 "Start time must be equal to or greater than the Executioner start_time if a "
76 "non-integer m_exponent is used");
77}
78
79void
81 const ADReal & effective_trial_stress, const ADRankFourTensor & elasticity_tensor)
82{
83 using std::exp;
84
86
87 _stress_index = stressIndex(effective_trial_stress);
88
89 if (_temperature)
91
93}
94
97 const ADReal & scalar)
98{
99 using std::pow;
100
101 const ADReal stress_delta = effective_trial_stress - _three_shear_modulus * scalar;
102 const ADReal creep_rate = _coefficient[_stress_index] *
103 pow(stress_delta, _n_exponent[_stress_index]) * _exponential *
104 _exp_time;
105 return creep_rate * _dt - scalar;
106}
107
108ADReal
110 const ADReal & scalar)
111{
112 using std::pow;
113
114 const ADReal stress_delta = effective_trial_stress - _three_shear_modulus * scalar;
115 const ADReal creep_rate_derivative =
117 pow(stress_delta, _n_exponent[_stress_index] - 1.0) * _exponential * _exp_time;
118 return creep_rate_derivative * _dt - 1.0;
119}
120
121Real
124 const ADMaterialProperty<RankTwoTensor> & strain_rate)
125{
126 if (_n_exponent[_stress_index] <= 1)
127 return 0.0;
128
129 Real creep_factor = _n_exponent[_stress_index] / (_n_exponent[_stress_index] + 1);
130
131 return MetaPhysicL::raw_value(creep_factor * stress[_qp].doubleContraction((strain_rate)[_qp]));
132}
133
134bool
139
140std::size_t
142{
143 // Check the correct model for *this* radial return
144 std::size_t i = 0;
145 while (i < _number_of_models - 1 && effective_trial_stress > _stress_thresholds[i + 1])
146 ++i;
147
148 return i;
149}
registerMooseObject("SolidMechanicsApp", ADMultiplePowerLawCreepStressUpdate)
DualNumber< Real, DNDerivativeType, true > ADReal
ExpressionBuilder::EBTerm pow(const ExpressionBuilder::EBTerm &left, T exponent)
This class uses the stress update material in a radial return isotropic creep model.
Real _exp_time
Exponential calculated from current time.
virtual ADReal computeDerivative(const ADReal &effective_trial_stress, const ADReal &scalar) override
std::size_t stressIndex(const ADReal &effective_trial_stress)
const unsigned int _number_of_models
Total number of models provided by the user.
unsigned int _stress_index
Quadrature-point value pointing to the right power law parameters.
ADMultiplePowerLawCreepStressUpdate(const InputParameters &parameters)
const Real _gas_constant
Gas constant for exp term.
virtual bool substeppingCapabilityEnabled() override
Does the model include the infrastructure for substep decomposition of the elastic strain initially u...
virtual void computeStressInitialize(const ADReal &effective_trial_stress, const ADRankFourTensor &elasticity_tensor) override
const std::vector< Real > _coefficient
Leading coefficient vector.
const std::vector< Real > _activation_energy
Activation energy for exp term vector.
ADReal _exponential
Exponential calculated from activation, gas constant, and temperature.
const std::vector< Real > _m_exponent
Exponent on time vector.
const ADVariableValue *const _temperature
Temperature variable value.
virtual Real computeStrainEnergyRateDensity(const ADMaterialProperty< RankTwoTensor > &stress, const ADMaterialProperty< RankTwoTensor > &strain_rate) override
virtual ADReal computeResidual(const ADReal &effective_trial_stress, const ADReal &scalar) override
const std::vector< Real > _n_exponent
Exponent on the effective stress vector.
const std::vector< Real > _stress_thresholds
Stress thresholds vector.
void addRequiredParam(const std::string &name, const std::string &doc_string)
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
void addClassDescription(const std::string &doc_string)
void addCoupledVar(const std::string &name, const std::string &doc_string)
Real getStartTime() const
void paramError(const std::string &param, Args... args) const
MooseApp & _app
This class provides baseline functionallity for creep models based on the stress update material in a...
SubsteppingType _use_substepping
Whether user has requested the use of substepping technique to improve convergence [make const later]...
virtual void computeStressInitialize(const GenericReal< is_ad > &effective_trial_stress, const GenericRankFourTensor< is_ad > &elasticity_tensor)
Perform any necessary initialization before return mapping iterations.
GenericReal< is_ad > _three_shear_modulus
3 * shear modulus
Real & _t
auto raw_value(const Eigen::Map< T > &in)
Real elasticity_tensor(unsigned int i, unsigned int j, unsigned int k, unsigned int l)