LCOV - code coverage report
Current view: top level - include/materials - HillCreepStressUpdate.h (source / functions) Hit Total Coverage
Test: idaholab/moose solid_mechanics: f45d79 Lines: 3 3 100.0 %
Date: 2025-07-25 05:00:39 Functions: 4 4 100.0 %
Legend: Lines: hit not hit

          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 "AnisotropicReturnCreepStressUpdateBase.h"
      13             : 
      14             : /**
      15             :  * This class uses the stress update material for an anisotropic creep
      16             :  * model.  This class is one of the basic radial return constitutive models; more complex
      17             :  * constitutive models combine creep and plasticity.
      18             :  *
      19             :  * This class inherits from AnisotropicReturnCreepStressUpdateBase and must be used
      20             :  * in conjunction with ComputeMultipleInelasticStress.  This class calculates
      21             :  * creep based on stress, temperature, and time effects.  This class also
      22             :  * computes the creep strain as a stateful material property.
      23             :  *
      24             :  * This class extends the usage of PowerLawCreep to Hill (i.e. anisotropic)
      25             :  * cases. For more information, consult, e.g. Stewart et al, "An anisotropic tertiary creep
      26             :  * damage constitutive model for anistropic materials", International Journal of Pressure Vessels
      27             :  * and Piping 88 (2011) 356--364.
      28             :  */
      29             : template <bool is_ad>
      30             : class HillCreepStressUpdateTempl : public AnisotropicReturnCreepStressUpdateBaseTempl<is_ad>
      31             : {
      32             : public:
      33             :   static InputParameters validParams();
      34             : 
      35             :   HillCreepStressUpdateTempl(const InputParameters & parameters);
      36             : 
      37             : protected:
      38             :   usingTransientInterfaceMembers;
      39             :   using Material::_current_elem;
      40             :   using Material::_q_point;
      41             :   using Material::_qp;
      42             : 
      43             :   virtual void
      44             :   computeStressInitialize(const GenericDenseVector<is_ad> & stress_dev,
      45             :                           const GenericDenseVector<is_ad> & stress,
      46             :                           const GenericRankFourTensor<is_ad> & elasticity_tensor) override;
      47             :   virtual GenericReal<is_ad>
      48             :   computeResidual(const GenericDenseVector<is_ad> & effective_trial_stress,
      49             :                   const GenericDenseVector<is_ad> & stress_new,
      50             :                   const GenericReal<is_ad> & scalar) override;
      51             : 
      52             :   virtual GenericReal<is_ad>
      53             :   computeDerivative(const GenericDenseVector<is_ad> & effective_trial_stress,
      54             :                     const GenericDenseVector<is_ad> & stress_new,
      55             :                     const GenericReal<is_ad> & scalar) override;
      56             : 
      57             :   virtual Real
      58             :   computeReferenceResidual(const GenericDenseVector<is_ad> & effective_trial_stress,
      59             :                            const GenericDenseVector<is_ad> & stress_new,
      60             :                            const GenericReal<is_ad> & residual,
      61             :                            const GenericReal<is_ad> & scalar_effective_inelastic_strain) override;
      62             : 
      63             :   void computeQsigmaChanged(GenericReal<is_ad> & qsigma_changed,
      64             :                             const GenericDenseVector<is_ad> & stress_new,
      65             :                             const GenericReal<is_ad> & delta_gamma,
      66             :                             GenericRankTwoTensor<is_ad> & stress_changed);
      67             : 
      68             :   /**
      69             :    * Perform any necessary steps to finalize strain increment after return mapping iterations
      70             :    * @param inelasticStrainIncrement Inelastic strain increment
      71             :    * @param stress Cauchy stresss tensor
      72             :    * @param stress_dev Deviatoric partt of the Cauchy stresss tensor
      73             :    * @param delta_gamma Generalized radial return's plastic multiplier
      74             :    */
      75             :   virtual void computeStrainFinalize(GenericRankTwoTensor<is_ad> & inelasticStrainIncrement,
      76             :                                      const GenericRankTwoTensor<is_ad> & stress,
      77             :                                      const GenericDenseVector<is_ad> & stress_dev,
      78             :                                      const GenericReal<is_ad> & delta_gamma) override;
      79             : 
      80             :   /**
      81             :    * Perform any necessary steps to finalize state after return mapping iterations
      82             :    * @param inelasticStrainIncrement Inelastic strain increment
      83             :    * @param delta_gamma Generalized radial return's plastic multiplier
      84             :    * @param stress Cauchy stresss tensor
      85             :    * @param stress_dev Deviatoric partt of the Cauchy stresss tensor
      86             :    */
      87             :   virtual void
      88             :   computeStressFinalize(const GenericRankTwoTensor<is_ad> & inelasticStrainIncrement,
      89             :                         const GenericReal<is_ad> & delta_gamma,
      90             :                         GenericRankTwoTensor<is_ad> & stress,
      91             :                         const GenericDenseVector<is_ad> & stress_dev,
      92             :                         const GenericRankTwoTensor<is_ad> & stress_old,
      93             :                         const GenericRankFourTensor<is_ad> & elasticity_tensor) override;
      94             : 
      95             :   virtual GenericReal<is_ad>
      96             :   initialGuess(const GenericDenseVector<is_ad> & /*stress_dev*/) override;
      97             : 
      98             :   /**
      99             :    * Does the model require the elasticity tensor to be isotropic? Not in principle.
     100             :    * TODO: Take care of rotation of anisotropy parameters
     101             :    */
     102         228 :   bool requiresIsotropicTensor() override { return false; }
     103             : 
     104             :   /**
     105             :    * Compute the limiting value of the time step for this material according to the numerical
     106             :    * integration error
     107             :    * @return Limiting time step
     108             :    */
     109     1714512 :   virtual Real computeIntegrationErrorTimeStep() override
     110             :   {
     111     1714512 :     return this->_max_integration_error_time_step;
     112             :   }
     113             : 
     114             :   /// Flag to determine if temperature is supplied by the user
     115             :   const bool _has_temp;
     116             : 
     117             :   /// Temperature variable value
     118             :   const VariableValue & _temperature;
     119             : 
     120             :   /// Leading coefficient
     121             :   const Real _coefficient;
     122             : 
     123             :   /// Exponent on the effective stress
     124             :   const Real _n_exponent;
     125             : 
     126             :   /// Exponent on time
     127             :   const Real _m_exponent;
     128             : 
     129             :   /// Activation energy for exp term
     130             :   const Real _activation_energy;
     131             : 
     132             :   /// Gas constant for exp term
     133             :   const Real _gas_constant;
     134             : 
     135             :   /// Simulation start time
     136             :   const Real _start_time;
     137             : 
     138             :   /// Exponential calculated from activation, gas constant, and temperature
     139             :   Real _exponential;
     140             : 
     141             :   /// Exponential calculated from current time
     142             :   Real _exp_time;
     143             : 
     144             :   /// Hill constant material
     145             :   const MaterialProperty<std::vector<Real>> & _hill_constants;
     146             : 
     147             :   /// Hill tensor, when global axes do not (somehow) align with those of the material
     148             :   /// Example: Large rotation due to rigid body and/or large deformation kinematics
     149             :   const MaterialProperty<DenseMatrix<Real>> * _hill_tensor;
     150             : 
     151             :   /// 2 * shear modulus
     152             :   GenericReal<is_ad> _two_shear_modulus;
     153             : 
     154             :   /// Matrix form of the elasticity tensor
     155             :   GenericDenseMatrix<is_ad> _C;
     156             : 
     157             :   /// Name of the elasticity tensor material property
     158             :   const std::string _elasticity_tensor_name;
     159             : 
     160             :   /// Anisotropic elasticity tensor material property
     161             :   const GenericMaterialProperty<RankFourTensor, is_ad> & _elasticity_tensor;
     162             : 
     163             :   /// Materials's elasticity tensor is anisotropic or not
     164             :   bool _anisotropic_elasticity;
     165             : 
     166             :   /// Prefactor for scaling creep
     167             :   const Function * const _prefactor_function;
     168             : };
     169             : 
     170             : typedef HillCreepStressUpdateTempl<false> HillCreepStressUpdate;
     171             : typedef HillCreepStressUpdateTempl<true> ADHillCreepStressUpdate;

Generated by: LCOV version 1.14