www.mooseframework.org
ADPowerLawCreepStressUpdate.C
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://www.mooseframework.org
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 
13 
15 
16 template <ComputeStage compute_stage>
17 InputParameters
19 {
21  params.addClassDescription(
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.");
25 
26  // Linear strain hardening parameters
27  params.addCoupledVar("temperature", "Coupled temperature");
28  params.addRequiredParam<Real>("coefficient", "Leading coefficient in power-law equation");
29  params.addRequiredParam<Real>("n_exponent", "Exponent on effective stress in power-law equation");
30  params.addParam<Real>("m_exponent", 0.0, "Exponent on time in power-law equation");
31  params.addRequiredParam<Real>("activation_energy", "Activation energy");
32  params.addParam<Real>("gas_constant", 8.3143, "Universal gas constant");
33  params.addParam<Real>("start_time", 0.0, "Start time (if not zero)");
34  return params;
35 }
36 
37 template <ComputeStage compute_stage>
39  const InputParameters & parameters)
40  : ADRadialReturnCreepStressUpdateBase<compute_stage>(parameters),
41  _temperature(isParamValid("temperature") ? &adCoupledValue("temperature") : nullptr),
42  _coefficient(getParam<Real>("coefficient")),
43  _n_exponent(getParam<Real>("n_exponent")),
44  _m_exponent(getParam<Real>("m_exponent")),
45  _activation_energy(getParam<Real>("activation_energy")),
46  _gas_constant(getParam<Real>("gas_constant")),
47  _start_time(getParam<Real>("start_time")),
48  _exponential(1.0)
49 {
50  if (_start_time < this->_app.getStartTime() && (std::trunc(_m_exponent) != _m_exponent))
51  paramError("start_time",
52  "Start time must be equal to or greater than the Executioner start_time if a "
53  "non-integer m_exponent is used");
54 }
55 
56 template <ComputeStage compute_stage>
57 void
59  const ADReal & /*effective_trial_stress*/, const ADRankFourTensor & /*elasticity_tensor*/)
60 {
61  if (_temperature)
62  _exponential = std::exp(-_activation_energy / (_gas_constant * (*_temperature)[_qp]));
63 
64  _exp_time = std::pow(_t - _start_time, _m_exponent);
65 }
66 
67 template <ComputeStage compute_stage>
68 ADReal
70  const ADReal & scalar)
71 {
72  const ADReal stress_delta = effective_trial_stress - _three_shear_modulus * scalar;
73  const ADReal creep_rate =
74  _coefficient * std::pow(stress_delta, _n_exponent) * _exponential * _exp_time;
75  return creep_rate * _dt - scalar;
76 }
77 
78 template <ComputeStage compute_stage>
79 ADReal
81  const ADReal & scalar)
82 {
83  const ADReal stress_delta = effective_trial_stress - _three_shear_modulus * scalar;
84  const ADReal creep_rate_derivative = -_coefficient * _three_shear_modulus * _n_exponent *
85  std::pow(stress_delta, _n_exponent - 1.0) * _exponential *
86  _exp_time;
87  return creep_rate_derivative * _dt - 1.0;
88 }
89 
90 // explicit instantiation is required for AD base classes
ADPowerLawCreepStressUpdate::_m_exponent
const Real _m_exponent
Exponent on time.
Definition: ADPowerLawCreepStressUpdate.h:55
ADRadialReturnCreepStressUpdateBase::validParams
static InputParameters validParams()
Definition: ADRadialReturnCreepStressUpdateBase.C:17
pow
ExpressionBuilder::EBTerm pow(const ExpressionBuilder::EBTerm &left, T exponent)
Definition: ExpressionBuilder.h:673
registerADMooseObject
registerADMooseObject("TensorMechanicsApp", ADPowerLawCreepStressUpdate)
ADPowerLawCreepStressUpdate::computeStressInitialize
virtual void computeStressInitialize(const ADReal &effective_trial_stress, const ADRankFourTensor &elasticity_tensor) override
Perform any necessary initialization before return mapping iterations.
Definition: ADPowerLawCreepStressUpdate.C:58
ADPowerLawCreepStressUpdate::computeDerivative
virtual ADReal computeDerivative(const ADReal &effective_trial_stress, const ADReal &scalar) override
Compute the derivative of the residual as a function of the scalar variable.
Definition: ADPowerLawCreepStressUpdate.C:80
ADPowerLawCreepStressUpdate::validParams
static InputParameters validParams()
Definition: ADPowerLawCreepStressUpdate.C:18
ADPowerLawCreepStressUpdate::computeResidual
virtual ADReal computeResidual(const ADReal &effective_trial_stress, const ADReal &scalar) override
Compute the residual for a predicted value of the scalar.
Definition: ADPowerLawCreepStressUpdate.C:69
defineADLegacyParams
defineADLegacyParams(ADPowerLawCreepStressUpdate)
ADPowerLawCreepStressUpdate
This class uses the stress update material in a radial return isotropic creep model.
Definition: ADPowerLawCreepStressUpdate.h:15
ADRadialReturnCreepStressUpdateBase
This class provides baseline functionallity for creep models based on the stress update material in a...
Definition: ADRadialReturnCreepStressUpdateBase.h:21
adBaseClass
adBaseClass(ADPowerLawCreepStressUpdate)
ADPowerLawCreepStressUpdate.h
ADPowerLawCreepStressUpdate::ADPowerLawCreepStressUpdate
ADPowerLawCreepStressUpdate(const InputParameters &parameters)
Definition: ADPowerLawCreepStressUpdate.C:38