LCOV - code coverage report
Current view: top level - include/materials - HillElastoPlasticityStressUpdate.h (source / functions) Hit Total Coverage
Test: idaholab/moose solid_mechanics: f45d79 Lines: 1 1 100.0 %
Date: 2025-07-25 05:00:39 Functions: 1 2 50.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 "AnisotropicReturnPlasticityStressUpdateBase.h"
      13             : 
      14             : /**
      15             :  * This class uses the stress update material in an anisotropic return mapping.
      16             :  * This class is one of the generalized radial return constitutive models based on Hill's criterion;
      17             :  * it assumes and anisotropic elasticity tensor and an anisotropic plastic yield surface.
      18             :  * Constitutive models that combine creep and plasticity can be used.
      19             :  */
      20             : 
      21             : template <bool is_ad>
      22             : class HillElastoPlasticityStressUpdateTempl
      23             :   : public AnisotropicReturnPlasticityStressUpdateBaseTempl<is_ad>
      24             : {
      25             : public:
      26             :   static InputParameters validParams();
      27             : 
      28             :   HillElastoPlasticityStressUpdateTempl(const InputParameters & parameters);
      29             : 
      30             :   virtual Real computeStrainEnergyRateDensity(
      31             :       const GenericMaterialProperty<RankTwoTensor, is_ad> & stress,
      32             :       const GenericMaterialProperty<RankTwoTensor, is_ad> & strain_rate) override;
      33             : 
      34             : protected:
      35             :   usingTransientInterfaceMembers;
      36             :   using AnisotropicReturnPlasticityStressUpdateBaseTempl<is_ad>::_effective_inelastic_strain;
      37             :   using AnisotropicReturnPlasticityStressUpdateBaseTempl<is_ad>::_effective_inelastic_strain_old;
      38             :   using AnisotropicReturnPlasticityStressUpdateBaseTempl<is_ad>::_plasticity_strain;
      39             :   using AnisotropicReturnPlasticityStressUpdateBaseTempl<is_ad>::_plasticity_strain_old;
      40             :   using AnisotropicReturnPlasticityStressUpdateBaseTempl<is_ad>::isBlockDiagonal;
      41             :   using Material::_current_elem;
      42             :   using Material::_q_point;
      43             :   using Material::_qp;
      44             :   using Material::paramError;
      45             : 
      46             :   virtual void initQpStatefulProperties() override;
      47             : 
      48             :   virtual void
      49             :   computeStressInitialize(const GenericDenseVector<is_ad> & stress_dev,
      50             :                           const GenericDenseVector<is_ad> & stress,
      51             :                           const GenericRankFourTensor<is_ad> & elasticity_tensor) override;
      52             : 
      53             :   /**
      54             :    * Compute eigendecomposition of element-wise elasticity tensor
      55             :    */
      56             :   void computeElasticityTensorEigenDecomposition();
      57             : 
      58             :   virtual GenericReal<is_ad>
      59             :   computeResidual(const GenericDenseVector<is_ad> & effective_trial_stress,
      60             :                   const GenericDenseVector<is_ad> & stress_new,
      61             :                   const GenericReal<is_ad> & scalar) override;
      62             :   virtual GenericReal<is_ad>
      63             :   computeDerivative(const GenericDenseVector<is_ad> & effective_trial_stress,
      64             :                     const GenericDenseVector<is_ad> & stress_new,
      65             :                     const GenericReal<is_ad> & scalar) override;
      66             : 
      67             :   virtual Real
      68             :   computeReferenceResidual(const GenericDenseVector<is_ad> & effective_trial_stress,
      69             :                            const GenericDenseVector<is_ad> & stress_new,
      70             :                            const GenericReal<is_ad> & residual,
      71             :                            const GenericReal<is_ad> & scalar_effective_inelastic_strain) override;
      72             :   virtual void propagateQpStatefulProperties() override;
      73             :   /**
      74             :    * Does the model require the elasticity tensor to be isotropic? No, this class does
      75             :    * anisotropic *elasto-plasticity*
      76             :    */
      77          72 :   bool requiresIsotropicTensor() override { return false; }
      78             : 
      79             :   Real computeHardeningDerivative();
      80             :   GenericReal<is_ad> computeHardeningValue(const GenericReal<is_ad> & scalar,
      81             :                                            const GenericReal<is_ad> & omega);
      82             :   /**
      83             :    * Compute eigendecomposition of Hill's tensor for anisotropic plasticity
      84             :    * @param hill_tensor 6x6 matrix representing fourth order Hill's tensor describing anisotropy
      85             :    */
      86             :   void computeHillTensorEigenDecomposition(const DenseMatrix<GenericReal<is_ad>> & hill_tensor);
      87             : 
      88             :   /**
      89             :    * Perform any necessary steps to finalize strain increment after return mapping iterations
      90             :    * @param inelasticStrainIncrement Inelastic strain increment
      91             :    * @param stress Cauchy stresss tensor
      92             :    * @param stress_dev Deviatoric partt of the Cauchy stresss tensor
      93             :    * @param delta_gamma Generalized radial return's plastic multiplier
      94             :    */
      95             :   virtual void computeStrainFinalize(GenericRankTwoTensor<is_ad> & inelasticStrainIncrement,
      96             :                                      const GenericRankTwoTensor<is_ad> & stress,
      97             :                                      const GenericDenseVector<is_ad> & stress_dev,
      98             :                                      const GenericReal<is_ad> & delta_gamma) override;
      99             : 
     100             :   /**
     101             :    * Perform any necessary steps to finalize state after return mapping iterations
     102             :    * @param inelasticStrainIncrement Inelastic strain increment
     103             :    * @param delta_gamma Generalized radial return's plastic multiplier
     104             :    * @param stress Cauchy stresss tensor
     105             :    * @param stress_dev Deviatoric partt of the Cauchy stresss tensor
     106             :    */
     107             :   virtual void
     108             :   computeStressFinalize(const GenericRankTwoTensor<is_ad> & inelasticStrainIncrement,
     109             :                         const GenericReal<is_ad> & delta_gamma,
     110             :                         GenericRankTwoTensor<is_ad> & stress,
     111             :                         const GenericDenseVector<is_ad> & stress_dev,
     112             :                         const GenericRankTwoTensor<is_ad> & stress_old,
     113             :                         const GenericRankFourTensor<is_ad> & elasticity_tensor) override;
     114             : 
     115             :   GenericReal<is_ad> computeOmega(const GenericReal<is_ad> & delta_gamma,
     116             :                                   const GenericDenseVector<is_ad> & stress_trial);
     117             : 
     118             :   void computeDeltaDerivatives(const GenericReal<is_ad> & delta_gamma,
     119             :                                const GenericDenseVector<is_ad> & stress_trial,
     120             :                                const GenericReal<is_ad> & sy_alpha,
     121             :                                GenericReal<is_ad> & omega,
     122             :                                GenericReal<is_ad> & omega_gamma,
     123             :                                GenericReal<is_ad> & sy_gamma);
     124             : 
     125             :   /// Square of the q function for orthotropy
     126             :   GenericReal<is_ad> _qsigma;
     127             : 
     128             :   GenericDenseVector<is_ad> _eigenvalues_hill;
     129             :   GenericDenseMatrix<is_ad> _eigenvectors_hill;
     130             :   GenericDenseMatrix<is_ad> _anisotropic_elastic_tensor;
     131             : 
     132             :   /// Name of the elasticity tensor material property
     133             :   const std::string _elasticity_tensor_name;
     134             :   /// Anisotropic elasticity tensor material property
     135             :   const GenericMaterialProperty<RankFourTensor, is_ad> & _elasticity_tensor;
     136             : 
     137             :   const Real _hardening_constant;
     138             :   const Real _hardening_exponent;
     139             : 
     140             :   GenericMaterialProperty<Real, is_ad> & _hardening_variable;
     141             :   const MaterialProperty<Real> & _hardening_variable_old;
     142             : 
     143             :   GenericMaterialProperty<DenseMatrix<Real>, is_ad> & _elasticity_eigenvectors;
     144             :   GenericMaterialProperty<DenseVector<Real>, is_ad> & _elasticity_eigenvalues;
     145             : 
     146             :   GenericMaterialProperty<DenseMatrix<Real>, is_ad> & _b_eigenvectors;
     147             :   GenericMaterialProperty<DenseVector<Real>, is_ad> & _b_eigenvalues;
     148             : 
     149             :   GenericMaterialProperty<DenseMatrix<Real>, is_ad> & _alpha_matrix;
     150             :   GenericMaterialProperty<DenseVector<Real>, is_ad> & _sigma_tilde;
     151             :   GenericMaterialProperty<DenseVector<Real>, is_ad> & _sigma_tilde_rotated;
     152             : 
     153             :   GenericReal<is_ad> _hardening_derivative;
     154             :   GenericReal<is_ad> _yield_condition;
     155             :   GenericReal<is_ad> _yield_stress;
     156             : 
     157             :   /// Hill tensor, when global axes do not (somehow) align with those of the material
     158             :   /// Example: Large rotation due to rigid body and/or large deformation kinematics
     159             :   const MaterialProperty<DenseMatrix<Real>> & _hill_tensor;
     160             : 
     161             :   MaterialProperty<RankTwoTensor> & _rotation_matrix;
     162             :   MaterialProperty<RankTwoTensor> & _rotation_matrix_transpose;
     163             :   const MaterialProperty<RankTwoTensor> & _rotation_matrix_old;
     164             :   const MaterialProperty<RankTwoTensor> & _rotation_matrix_transpose_old;
     165             :   const bool _local_cylindrical_csys;
     166             :   const enum class Axis { X, Y, Z } _axis;
     167             : };
     168             : 
     169             : typedef HillElastoPlasticityStressUpdateTempl<false> HillElastoPlasticityStressUpdate;
     170             : typedef HillElastoPlasticityStressUpdateTempl<true> ADHillElastoPlasticityStressUpdate;

Generated by: LCOV version 1.14