Line data Source code
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 : 10 : #pragma once 11 : 12 : #include "MultiParameterPlasticityStressUpdate.h" 13 : #include "SolidMechanicsHardeningModel.h" 14 : 15 : /** 16 : * TensileStressUpdate implements rate-independent associative tensile failure 17 : * ("Rankine" plasticity) with hardening/softening. 18 : */ 19 : class TensileStressUpdate : public MultiParameterPlasticityStressUpdate 20 : { 21 : public: 22 : static InputParameters validParams(); 23 : 24 : TensileStressUpdate(const InputParameters & parameters); 25 : 26 : /** 27 : * Does the model require the elasticity tensor to be isotropic? 28 : */ 29 240 : bool requiresIsotropicTensor() override { return true; } 30 : 31 : protected: 32 : /// Hardening model for tensile strength 33 : const SolidMechanicsHardeningModel & _strength; 34 : 35 : /// Whether to provide an estimate of the returned stress, based on perfect plasticity 36 : const bool _perfect_guess; 37 : 38 : /// Eigenvectors of the trial stress as a RankTwoTensor, in order to rotate the returned stress back to stress space 39 : RankTwoTensor _eigvecs; 40 : 41 : /// tensile strength as a function of residual value, rate, and internal_param 42 : virtual Real tensile_strength(const Real internal_param) const; 43 : 44 : /// d(tensile strength)/d(internal_param) as a function of residual value, rate, and internal_param 45 : virtual Real dtensile_strength(const Real internal_param) const; 46 : 47 : void computeStressParams(const RankTwoTensor & stress, 48 : std::vector<Real> & stress_params) const override; 49 : 50 : void dstressparam_dstress(const RankTwoTensor & stress, 51 : std::vector<RankTwoTensor> & dsp) const override; 52 : 53 : void d2stressparam_dstress(const RankTwoTensor & stress, 54 : std::vector<RankFourTensor> & d2sp) const override; 55 : 56 : virtual void setStressAfterReturnV(const RankTwoTensor & stress_trial, 57 : const std::vector<Real> & stress_params, 58 : Real gaE, 59 : const std::vector<Real> & intnl, 60 : const yieldAndFlow & smoothed_q, 61 : const RankFourTensor & Eijkl, 62 : RankTwoTensor & stress) const override; 63 : 64 : virtual void preReturnMapV(const std::vector<Real> & trial_stress_params, 65 : const RankTwoTensor & stress_trial, 66 : const std::vector<Real> & intnl_old, 67 : const std::vector<Real> & yf, 68 : const RankFourTensor & Eijkl) override; 69 : 70 : void setEffectiveElasticity(const RankFourTensor & Eijkl) override; 71 : 72 : void yieldFunctionValuesV(const std::vector<Real> & stress_params, 73 : const std::vector<Real> & intnl, 74 : std::vector<Real> & yf) const override; 75 : 76 : void computeAllQV(const std::vector<Real> & stress_params, 77 : const std::vector<Real> & intnl, 78 : std::vector<yieldAndFlow> & all_q) const override; 79 : 80 : void initializeVarsV(const std::vector<Real> & trial_stress_params, 81 : const std::vector<Real> & intnl_old, 82 : std::vector<Real> & stress_params, 83 : Real & gaE, 84 : std::vector<Real> & intnl) const override; 85 : 86 : void setIntnlValuesV(const std::vector<Real> & trial_stress_params, 87 : const std::vector<Real> & current_stress_params, 88 : const std::vector<Real> & intnl_old, 89 : std::vector<Real> & intnl) const override; 90 : 91 : void setIntnlDerivativesV(const std::vector<Real> & trial_stress_params, 92 : const std::vector<Real> & current_stress_params, 93 : const std::vector<Real> & intnl, 94 : std::vector<std::vector<Real>> & dintnl) const override; 95 : 96 : virtual void consistentTangentOperatorV(const RankTwoTensor & stress_trial, 97 : const std::vector<Real> & trial_stress_params, 98 : const RankTwoTensor & stress, 99 : const std::vector<Real> & stress_params, 100 : Real gaE, 101 : const yieldAndFlow & smoothed_q, 102 : const RankFourTensor & Eijkl, 103 : bool compute_full_tangent_operator, 104 : const std::vector<std::vector<Real>> & dvar_dtrial, 105 : RankFourTensor & cto) override; 106 : 107 : private: 108 : /** 109 : * this is d(stress_param[:])/d(stress) which is calculated by dstressparam_dstress. Using this 110 : * mutable means repeated allocation/deallocation is unnecessary. 111 : */ 112 : mutable std::vector<RankTwoTensor> _dsp_trial_scratch; 113 : 114 : /** 115 : * eigenvalues of the stress, used in dstressparam_dstress and preReturnMapV. Using this mutable 116 : * means repeated allocation/deallocation is unnecessary. 117 : */ 118 : mutable std::vector<Real> _eigvals_scratch; 119 : };