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 : #include "RadialReturnCreepStressUpdateBase.h" 11 : 12 : template <bool is_ad> 13 : InputParameters 14 2413 : RadialReturnCreepStressUpdateBaseTempl<is_ad>::validParams() 15 : { 16 2413 : InputParameters params = RadialReturnStressUpdateTempl<is_ad>::validParams(); 17 2413 : params.set<std::string>("effective_inelastic_strain_name") = "effective_creep_strain"; 18 2413 : return params; 19 0 : } 20 : 21 : template <bool is_ad> 22 1810 : RadialReturnCreepStressUpdateBaseTempl<is_ad>::RadialReturnCreepStressUpdateBaseTempl( 23 : const InputParameters & parameters) 24 : : RadialReturnStressUpdateTempl<is_ad>(parameters), 25 1810 : _creep_strain(this->template declareGenericProperty<RankTwoTensor, is_ad>(this->_base_name + 26 : "creep_strain")), 27 1810 : _creep_strain_old( 28 3620 : this->template getMaterialPropertyOld<RankTwoTensor>(this->_base_name + "creep_strain")) 29 : { 30 1810 : } 31 : 32 : template <bool is_ad> 33 : void 34 40432 : RadialReturnCreepStressUpdateBaseTempl<is_ad>::initQpStatefulProperties() 35 : { 36 40432 : _creep_strain[_qp].zero(); 37 : 38 14792 : RadialReturnStressUpdateTempl<is_ad>::initQpStatefulProperties(); 39 40432 : } 40 : 41 : template <bool is_ad> 42 : void 43 290520 : RadialReturnCreepStressUpdateBaseTempl<is_ad>::propagateQpStatefulProperties() 44 : { 45 290520 : _creep_strain[_qp] = _creep_strain_old[_qp]; 46 : 47 290520 : propagateQpStatefulPropertiesRadialReturn(); 48 290520 : } 49 : 50 : template <bool is_ad> 51 : Real 52 0 : RadialReturnCreepStressUpdateBaseTempl<is_ad>::computeStressDerivative( 53 : const Real /*effective_trial_stress*/, const Real /*scalar*/) 54 : { 55 0 : mooseError("computeStressDerivative called: no stress derivative computation is needed for AD"); 56 : } 57 : 58 : template <> 59 : Real 60 332082 : RadialReturnCreepStressUpdateBaseTempl<false>::computeStressDerivative( 61 : const Real effective_trial_stress, const Real scalar) 62 : { 63 332082 : return -(computeDerivative(effective_trial_stress, scalar) + 1.0) / this->_three_shear_modulus; 64 : } 65 : 66 : template <bool is_ad> 67 : void 68 3583304 : RadialReturnCreepStressUpdateBaseTempl<is_ad>::computeStressFinalize( 69 : const GenericRankTwoTensor<is_ad> & plastic_strain_increment) 70 : { 71 3583304 : _creep_strain[_qp] = _creep_strain_old[_qp] + plastic_strain_increment; 72 3583304 : } 73 : 74 : template class RadialReturnCreepStressUpdateBaseTempl<false>; 75 : template class RadialReturnCreepStressUpdateBaseTempl<true>;