LCOV - code coverage report
Current view: top level - include/materials - CompositePowerLawCreepStressUpdate.h (source / functions) Hit Total Coverage
Test: idaholab/moose solid_mechanics: f45d79 Lines: 2 4 50.0 %
Date: 2025-07-25 05:00:39 Functions: 1 4 25.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 "RadialReturnCreepStressUpdateBase.h"
      13             : 
      14             : /**
      15             :  * This class uses the stress update material in a radial return isotropic 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 RadialReturnCreepStressUpdateBase 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. This class extends
      23             :  * from PowerLawCreepStressUpdate to include multiple different phases.
      24             :  */
      25             : template <bool is_ad>
      26             : class CompositePowerLawCreepStressUpdateTempl : public RadialReturnCreepStressUpdateBaseTempl<is_ad>
      27             : {
      28             : public:
      29             :   static InputParameters validParams();
      30             : 
      31             :   CompositePowerLawCreepStressUpdateTempl(const InputParameters & parameters);
      32             : 
      33             :   virtual Real computeStrainEnergyRateDensity(
      34             :       const GenericMaterialProperty<RankTwoTensor, is_ad> & stress,
      35             :       const GenericMaterialProperty<RankTwoTensor, is_ad> & strain_rate) override;
      36             : 
      37             :   virtual bool substeppingCapabilityEnabled() override;
      38             : 
      39             :   virtual void resetIncrementalMaterialProperties() override;
      40             : 
      41             :   virtual void
      42             :   computeStressInitialize(const GenericReal<is_ad> & effective_trial_stress,
      43             :                           const GenericRankFourTensor<is_ad> & elasticity_tensor) override;
      44    24006024 :   virtual GenericReal<is_ad> computeResidual(const GenericReal<is_ad> & effective_trial_stress,
      45             :                                              const GenericReal<is_ad> & scalar) override
      46             :   {
      47    24006024 :     return computeResidualInternal<GenericReal<is_ad>>(effective_trial_stress, scalar);
      48             :   }
      49             :   virtual GenericReal<is_ad> computeDerivative(const GenericReal<is_ad> & effective_trial_stress,
      50             :                                                const GenericReal<is_ad> & scalar) override;
      51             :   virtual void
      52             :   computeStressFinalize(const GenericRankTwoTensor<is_ad> & plastic_strain_increment) override;
      53             : 
      54             : protected:
      55             :   virtual GenericChainedReal<is_ad>
      56           0 :   computeResidualAndDerivative(const GenericReal<is_ad> & effective_trial_stress,
      57             :                                const GenericChainedReal<is_ad> & scalar) override
      58             :   {
      59           0 :     return computeResidualInternal<GenericChainedReal<is_ad>>(effective_trial_stress, scalar);
      60             :   }
      61             : 
      62             :   /// Temperature variable value
      63             :   const GenericVariableValue<is_ad> * const _temperature;
      64             : 
      65             :   /// Leading coefficient
      66             :   std::vector<Real> _coefficient;
      67             : 
      68             :   /// Exponent on the effective stress
      69             :   std::vector<Real> _n_exponent;
      70             : 
      71             :   /// Exponent on time
      72             :   const Real _m_exponent;
      73             : 
      74             :   /// Activation energy for exp term
      75             :   std::vector<Real> _activation_energy;
      76             : 
      77             :   /// Gas constant for exp term
      78             :   const Real _gas_constant;
      79             : 
      80             :   /// Simulation start time
      81             :   const Real _start_time;
      82             : 
      83             :   /// Exponential calculated from current time
      84             :   Real _exp_time;
      85             : 
      86             :   /// vector to keep the material property name for switching function material
      87             :   const std::vector<MaterialPropertyName> _switching_func_names;
      88             :   unsigned int _num_materials;
      89             : 
      90             :   /// switching functions for each phase
      91             :   std::vector<const GenericMaterialProperty<Real, is_ad> *> _switchingFunc;
      92             : 
      93             :   usingTransientInterfaceMembers;
      94             :   using RadialReturnCreepStressUpdateBaseTempl<is_ad>::_qp;
      95             :   using RadialReturnCreepStressUpdateBaseTempl<is_ad>::_three_shear_modulus;
      96             :   using RadialReturnCreepStressUpdateBaseTempl<is_ad>::_creep_strain;
      97             :   using RadialReturnCreepStressUpdateBaseTempl<is_ad>::_creep_strain_old;
      98             : 
      99             : private:
     100             :   template <typename ScalarType>
     101             :   ScalarType computeResidualInternal(const GenericReal<is_ad> & effective_trial_stress,
     102             :                                      const ScalarType & scalar);
     103             : };
     104             : 
     105             : typedef CompositePowerLawCreepStressUpdateTempl<false> CompositePowerLawCreepStressUpdate;
     106             : typedef CompositePowerLawCreepStressUpdateTempl<true> ADCompositePowerLawCreepStressUpdate;

Generated by: LCOV version 1.14