https://mooseframework.inl.gov
Loading...
Searching...
No Matches
CompositePowerLawCreepStressUpdate.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 <cmath>
12
15
16template <bool is_ad>
19{
22 "This class uses the stress update material in a radial return isotropic power law creep "
23 "model. This class can be used in conjunction with other creep and plasticity materials "
24 "for more complex simulations. This class is an extension to include multi-phase "
25 "capability.");
26
27 // Linear strain hardening parameters
28 params.addRequiredCoupledVar("temperature", "Coupled temperature");
29 params.addRequiredParam<std::vector<Real>>(
30 "coefficient",
31 "a vector of leading coefficient / Dorn Constant in power-law equation for each material.");
32 params.addRequiredParam<std::vector<Real>>(
33 "n_exponent",
34 "a vector of Exponent on effective stress in power-law equation for each material");
35 params.addParam<Real>("m_exponent", 0.0, "Exponent on time in power-law equation");
36 params.addRequiredParam<std::vector<Real>>("activation_energy",
37 "a vector of Activation energy for Arrhenius-type "
38 "equation of the Dorn Constant for each material");
39 params.addParam<Real>("gas_constant", 8.3143, "Universal gas constant");
40 params.addParam<Real>("start_time", 0.0, "Start time (if not zero)");
41 params.addRequiredParam<std::vector<MaterialPropertyName>>(
42 "switching_functions", "a vector of switching functions for each material");
43 return params;
44}
45
46template <bool is_ad>
48 const InputParameters & parameters)
49 : RadialReturnCreepStressUpdateBaseTempl<is_ad>(parameters),
50 _temperature(this->isParamValid("temperature")
51 ? &this->template coupledGenericValue<is_ad>("temperature")
52 : nullptr),
53 _coefficient(this->template getParam<std::vector<Real>>("coefficient")),
54 _n_exponent(this->template getParam<std::vector<Real>>("n_exponent")),
55 _m_exponent(this->template getParam<Real>("m_exponent")),
56 _activation_energy(this->template getParam<std::vector<Real>>("activation_energy")),
57 _gas_constant(this->template getParam<Real>("gas_constant")),
58 _start_time(this->template getParam<Real>("start_time")),
59 _switching_func_names(
60 this->template getParam<std::vector<MaterialPropertyName>>("switching_functions"))
61
62{
64 if (_n_exponent.size() != _num_materials)
65 this->paramError("n_exponent", "n exponent must be equal to the number of switching functions");
66
67 if (_coefficient.size() != _num_materials)
68 this->paramError("coefficient",
69 "number of Dorn constant must be equal to the number of switching functions");
70
72 this->paramError("activation_energy",
73 "activation energy must be equal to the number of swithing functions");
74
75 if (_start_time < this->_app.getStartTime() && (std::trunc(_m_exponent) != _m_exponent))
76 this->paramError("start_time",
77 "Start time must be equal to or greater than the Executioner start_time if a "
78 "non-integer m_exponent is used");
80 // set switching functions material properties for each phase
81 for (unsigned int i = 0; i < _num_materials; ++i)
82 {
84 &this->template getGenericMaterialProperty<Real, is_ad>(_switching_func_names[i]);
85 }
86}
87
88template <bool is_ad>
89void
91 const GenericReal<is_ad> & effective_trial_stress,
92 const GenericRankFourTensor<is_ad> & elasticity_tensor)
93{
94 using std::pow;
95
98 _exp_time = pow(_t - _start_time, _m_exponent);
99}
100
101template <bool is_ad>
102template <typename ScalarType>
103ScalarType
105 const GenericReal<is_ad> & effective_trial_stress, const ScalarType & scalar)
106{
107 using std::pow, std::exp;
108
109 const ScalarType stress_delta = effective_trial_stress - _three_shear_modulus * scalar;
110 ScalarType creep_rate = 0.0;
111 for (const auto n : make_range(_num_materials))
112 {
113 creep_rate += _coefficient[n] * pow(stress_delta, _n_exponent[n]) * (*_switchingFunc[n])[_qp] *
114 exp(-_activation_energy[n] / (_gas_constant * (*_temperature)[_qp])) * _exp_time;
115 }
116 return creep_rate * _dt - scalar;
117}
118
119template <bool is_ad>
122 const GenericReal<is_ad> & effective_trial_stress, const GenericReal<is_ad> & scalar)
123{
124 using std::pow, std::exp;
125
126 const GenericReal<is_ad> stress_delta = effective_trial_stress - _three_shear_modulus * scalar;
127 GenericReal<is_ad> creep_rate_derivative = 0.0;
128 for (const auto n : make_range(_num_materials))
129 {
130 creep_rate_derivative += -_coefficient[n] * _three_shear_modulus * _n_exponent[n] *
131 pow(stress_delta, _n_exponent[n] - 1.0) * (*_switchingFunc[n])[_qp] *
132 exp(-_activation_energy[n] / (_gas_constant * (*_temperature)[_qp])) *
133 _exp_time;
134 }
135 return creep_rate_derivative * _dt - 1.0;
136}
137
138template <bool is_ad>
139Real
143{
144 GenericReal<is_ad> interpolated_exponent = 0.0;
145 for (unsigned int n = 0; n < _num_materials; ++n)
146 {
147 interpolated_exponent += (_n_exponent[n] / (_n_exponent[n] + 1)) * (*_switchingFunc[n])[_qp];
148 }
149 return MetaPhysicL::raw_value(interpolated_exponent *
150 stress[_qp].doubleContraction((strain_rate)[_qp]));
151}
152
153template <bool is_ad>
154void
156 const GenericRankTwoTensor<is_ad> & plastic_strain_increment)
157{
158 _creep_strain[_qp] += plastic_strain_increment;
159}
160
161template <bool is_ad>
162void
164{
165 _creep_strain[_qp] = _creep_strain_old[_qp];
166}
167
168template <bool is_ad>
169bool
174
177template Real
179 const Real &);
180template ADReal
182 const ADReal &);
183template ChainedReal
185 const Real &, const ChainedReal &);
186template ChainedADReal
188 const ADReal &, const ChainedADReal &);
DualNumber< Real, DNDerivativeType, true > ADReal
DualNumber< ADReal, ADReal > ChainedADReal
DualNumber< Real, Real > ChainedReal
registerMooseObject("SolidMechanicsApp", CompositePowerLawCreepStressUpdate)
ExpressionBuilder::EBTerm pow(const ExpressionBuilder::EBTerm &left, T exponent)
typename GenericMaterialPropertyStruct< T, is_ad >::type GenericMaterialProperty
Moose::GenericType< RankFourTensor, is_ad > GenericRankFourTensor
Moose::GenericType< Real, is_ad > GenericReal
Moose::GenericType< RankTwoTensor, is_ad > GenericRankTwoTensor
This class uses the stress update material in a radial return isotropic creep model.
ScalarType computeResidualInternal(const GenericReal< is_ad > &effective_trial_stress, const ScalarType &scalar)
virtual void resetIncrementalMaterialProperties() override
Reset material properties.
virtual GenericReal< is_ad > computeDerivative(const GenericReal< is_ad > &effective_trial_stress, const GenericReal< is_ad > &scalar) override
Compute the derivative of the residual as a function of the scalar variable.
const std::vector< MaterialPropertyName > _switching_func_names
vector to keep the material property name for switching function material
virtual void computeStressInitialize(const GenericReal< is_ad > &effective_trial_stress, const GenericRankFourTensor< is_ad > &elasticity_tensor) override
Perform any necessary initialization before return mapping iterations.
virtual bool substeppingCapabilityEnabled() override
Does the model include the infrastructure for substep decomposition of the elastic strain initially u...
std::vector< const GenericMaterialProperty< Real, is_ad > * > _switchingFunc
switching functions for each phase
std::vector< Real > _activation_energy
Activation energy for exp term.
std::vector< Real > _coefficient
Leading coefficient.
CompositePowerLawCreepStressUpdateTempl(const InputParameters &parameters)
virtual Real computeStrainEnergyRateDensity(const GenericMaterialProperty< RankTwoTensor, is_ad > &stress, const GenericMaterialProperty< RankTwoTensor, is_ad > &strain_rate) override
Compute the strain energy rate density for this inelastic model for the current step.
virtual void computeStressFinalize(const GenericRankTwoTensor< is_ad > &plastic_strain_increment) override
Perform any necessary steps to finalize state after return mapping iterations.
std::vector< Real > _n_exponent
Exponent on the effective stress.
void addRequiredCoupledVar(const std::string &name, const std::string &doc_string)
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)
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...
RadialReturnStressUpdate computes the radial return stress increment for an isotropic elastic-viscopl...
virtual void computeStressInitialize(const GenericReal< is_ad > &effective_trial_stress, const GenericRankFourTensor< is_ad > &elasticity_tensor)
Perform any necessary initialization before return mapping iterations.
auto raw_value(const Eigen::Map< T > &in)
Real elasticity_tensor(unsigned int i, unsigned int j, unsigned int k, unsigned int l)