www.mooseframework.org
IsotropicPowerLawHardeningStressUpdate.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 #include "ElasticityTensorTools.h"
12 
15 
16 template <bool is_ad>
19 {
21  params.addClassDescription("This class uses the discrete material in a radial return isotropic "
22  "plasticity power law hardening model, solving for the yield stress "
23  "as the intersection of the power law relation curve and Hooke's law. "
24  " This class can be used in conjunction with other creep and "
25  "plasticity materials for more complex simulations.");
26 
27  // Set and Suppress parameters to enable calculation of the yield stress
28  params.set<Real>("yield_stress") = 1.0;
29  params.set<Real>("hardening_constant") = 1.0;
30  params.suppressParameter<Real>("yield_stress");
31  params.suppressParameter<Real>("hardening_constant");
32 
33  // Power law hardening specific parameters
34  params.addRequiredParam<Real>("strength_coefficient",
35  "The strength coefficient (K) for power law hardening");
37  "strain_hardening_exponent",
38  "strain_hardening_exponent>=0.0 & strain_hardening_exponent <=1.0",
39  "The strain hardening exponent (n) for power law hardening");
40 
41  return params;
42 }
43 
44 template <bool is_ad>
46  const InputParameters & parameters)
47  : IsotropicPlasticityStressUpdateTempl<is_ad>(parameters),
48  _K(parameters.get<Real>("strength_coefficient")),
49  _strain_hardening_exponent(parameters.get<Real>("strain_hardening_exponent"))
50 {
51 }
52 
53 template <bool is_ad>
54 void
56  const GenericReal<is_ad> & effective_trial_stress,
57  const GenericRankFourTensor<is_ad> & elasticity_tensor)
58 {
61 
62  computeYieldStress(elasticity_tensor);
63 
64  _effective_trial_stress = effective_trial_stress;
65  this->_yield_condition =
66  effective_trial_stress - this->_hardening_variable_old[_qp] - this->_yield_stress;
67 
68  this->_hardening_variable[_qp] = this->_hardening_variable_old[_qp];
69  this->_plastic_strain[_qp] = this->_plastic_strain_old[_qp];
70 }
71 
72 template <bool is_ad>
75  const GenericReal<is_ad> & scalar)
76 {
77  const GenericReal<is_ad> stress_delta = _effective_trial_stress - _three_shear_modulus * scalar;
78  GenericReal<is_ad> slope = std::pow(stress_delta, (1.0 / _strain_hardening_exponent - 1.0)) /
79  _strain_hardening_exponent * 1.0 /
80  std::pow(_K, 1.0 / _strain_hardening_exponent);
81  slope -= 1.0 / _youngs_modulus;
82 
83  return 1.0 / slope;
84 }
85 
86 template <bool is_ad>
87 void
89  const GenericRankFourTensor<is_ad> & elasticity_tensor)
90 {
91  // Pull in the Lam\`{e} lambda, and caculate E
92  const GenericReal<is_ad> lambda = getIsotropicLameLambda(elasticity_tensor);
93  const GenericReal<is_ad> shear_modulus = _three_shear_modulus / 3.0;
94 
95  _youngs_modulus = shear_modulus * (3.0 * lambda + 2 * shear_modulus) / (lambda + shear_modulus);
96 
97  // Then solve for yield stress using equation from the header file
98  this->_yield_stress = std::pow(_K / std::pow(_youngs_modulus, _strain_hardening_exponent),
99  1.0 / (1.0 - _strain_hardening_exponent));
100  if (this->_yield_stress <= 0.0)
101  mooseError("The yield stress must be greater than zero, but during the simulation your yield "
102  "stress became less than zero.");
103 }
104 
105 template <bool is_ad>
108  const GenericRankFourTensor<is_ad> & elasticity_tensor)
109 {
110  const GenericReal<is_ad> lame_lambda = elasticity_tensor(0, 0, 1, 1);
111 
112  if (this->_mesh.dimension() == 3 &&
114  mooseError(
115  "Check to ensure that your Elasticity Tensor is truly Isotropic: different lambda values");
116  return lame_lambda;
117 }
118 
typename Moose::GenericType< RankFourTensor, is_ad > GenericRankFourTensor
void addRequiredRangeCheckedParam(const std::string &name, const std::string &parsed_function, const std::string &doc_string)
registerMooseObject("SolidMechanicsApp", IsotropicPowerLawHardeningStressUpdate)
This class uses the Discrete material in a radial return isotropic plasticity model.
virtual GenericReal< is_ad > computeHardeningDerivative(const GenericReal< is_ad > &scalar) override
void mooseError(Args &&... args)
virtual void computeStressInitialize(const GenericReal< is_ad > &effective_trial_stress, const GenericRankFourTensor< is_ad > &elasticity_tensor)
Perform any necessary initialization before return mapping iterations.
T & set(const std::string &name, bool quiet_mode=false)
auto raw_value(const Eigen::Map< T > &in)
virtual void computeYieldStress(const GenericRankFourTensor< is_ad > &elasticity_tensor) override
void addRequiredParam(const std::string &name, const std::string &doc_string)
void suppressParameter(const std::string &name)
Real elasticity_tensor(unsigned int i, unsigned int j, unsigned int k, unsigned int l)
GenericReal< is_ad > getIsotropicLameLambda(const GenericRankFourTensor< is_ad > &elasticity_tensor)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
IsotropicPowerLawHardeningStressUpdateTempl(const InputParameters &parameters)
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.
void addClassDescription(const std::string &doc_string)
typename Moose::GenericType< Real, is_ad > GenericReal
MooseUnits pow(const MooseUnits &, int)
const Elem & get(const ElemType type_in)
This class uses the Discrete material in a radial return isotropic plasticity model.