LCOV - code coverage report
Current view: top level - include/materials - CappedDruckerPragerStressUpdate.h (source / functions) Hit Total Coverage
Test: idaholab/moose solid_mechanics: f45d79 Lines: 2 2 100.0 %
Date: 2025-07-25 05:00:39 Functions: 2 2 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 "TwoParameterPlasticityStressUpdate.h"
      13             : #include "SolidMechanicsHardeningModel.h"
      14             : #include "SolidMechanicsPlasticDruckerPrager.h"
      15             : 
      16             : /**
      17             :  * CappedDruckerPragerStressUpdate performs the return-map
      18             :  * algorithm and associated stress updates for plastic
      19             :  * models that describe capped Drucker-Prager plasticity.
      20             :  *
      21             :  * This plastic model is ideally suited to a material (eg rock)
      22             :  * that has different compressive, tensile and shear
      23             :  * strengths.  Any of these strengths may be set large to
      24             :  * accommodate special situations.  For instance, setting
      25             :  * the compressive strength large is appropriate if there
      26             :  * is no chance of compressive failure in a model.
      27             :  *
      28             :  * This plastic model has two internal parameters:
      29             :  *  - a "shear" internal parameter which parameterises the
      30             :  *    amount of shear plastic strain.  The cohesion, friction
      31             :  *    angle, and dilation angle are assumed to be functions
      32             :  *    of this internal parameter.
      33             :  *  - a "tensile" internal parameter which parameterises the
      34             :  *    amount of tensile plastic strain.  The tensile strength
      35             :  *    and compressive strength are assumed to be functions of
      36             :  *    this internal parameter.  This means, for instance, that
      37             :  *    failure in tension can cause the compressive strenght
      38             :  *    to soften, as would be expected in rock-mechanics
      39             :  *    scenarios.
      40             :  *
      41             :  * This plasticity model assumes the elasticity tensor obeys:
      42             :  * E_ijkl s_kl = 2 E_0101 * s_ij, for any traceless tensor, s_ij.
      43             :  * (This expression defines the scalar quantity, Eqq,
      44             :  *  which is just the shear modulus in the isotropic situation.)
      45             :  *
      46             :  * As of Feb2017, small tests suggest that this Material model
      47             :  * is marginally more efficient than ComputeMultiPlasticityStress
      48             :  * with a DruckerPragerHyperbolic user object, if the compressive
      49             :  * and tensile strengths are set large.  Adding compressive or
      50             :  * tensile failure adds about 40% more computation time (on
      51             :  * average) which again appears to be better than
      52             :  * ComputeMultiPlasticityStress with DruckerPrager and MeanCap(s)
      53             :  * user objects.
      54             :  */
      55             : class CappedDruckerPragerStressUpdate : public TwoParameterPlasticityStressUpdate
      56             : {
      57             : public:
      58             :   static InputParameters validParams();
      59             : 
      60             :   CappedDruckerPragerStressUpdate(const InputParameters & parameters);
      61             : 
      62             :   /**
      63             :    * Does the model require the elasticity tensor to be isotropic?
      64             :    */
      65         324 :   bool requiresIsotropicTensor() override { return true; }
      66             : 
      67         414 :   bool isIsotropic() override { return true; };
      68             : 
      69             : protected:
      70             :   /// Hardening model for cohesion, friction and dilation angles
      71             :   const SolidMechanicsPlasticDruckerPrager & _dp;
      72             : 
      73             :   /// Hardening model for tensile strength
      74             :   const SolidMechanicsHardeningModel & _tstrength;
      75             : 
      76             :   /// Hardening model for compressive strength
      77             :   const SolidMechanicsHardeningModel & _cstrength;
      78             : 
      79             :   /// The cone vertex is smoothed by this amount
      80             :   const Real _small_smoother2;
      81             : 
      82             :   /// Initialize the NR proceedure from a guess coming from perfect plasticity
      83             :   const bool _perfect_guess;
      84             : 
      85             :   /**
      86             :    * This allows some simplification in the return-map process.
      87             :    * If the tensile yield function yf[1] >= 0 at the trial stress then
      88             :    * clearly the quadpoint is not going to fail in compression, so
      89             :    * _stress_return_type is set to no_compression, and every time
      90             :    * the compressive yield function is evaluated it is set -(very large).
      91             :    * If the compressive yield function yf[2] >= 0 at the trial stress
      92             :    * then clearly the quadpoint is not going to fail in tension, so
      93             :    * _stress_return_type is set to no_tension, and every time the
      94             :    * tensile yield function is evaluated it is set -(very large).
      95             :    * Otherwise (and at the very end after return-map) _stress_return_type
      96             :    * is set to nothing_special.
      97             :    */
      98             :   enum class StressReturnType
      99             :   {
     100             :     nothing_special,
     101             :     no_compression,
     102             :     no_tension
     103             :   } _stress_return_type;
     104             : 
     105             :   /**
     106             :    * If true, and if the trial stress exceeds the tensile strength,
     107             :    * then the user gaurantees that the returned stress will be
     108             :    * independent of the compressive strength.
     109             :    */
     110             :   const bool _small_dilation;
     111             : 
     112             :   /// trial value of q
     113             :   Real _in_q_trial;
     114             : 
     115             :   virtual void yieldFunctionValues(Real p,
     116             :                                    Real q,
     117             :                                    const std::vector<Real> & intnl,
     118             :                                    std::vector<Real> & yf) const override;
     119             : 
     120             :   virtual void computeAllQ(Real p,
     121             :                            Real q,
     122             :                            const std::vector<Real> & intnl,
     123             :                            std::vector<yieldAndFlow> & all_q) const override;
     124             : 
     125             :   virtual void preReturnMap(Real p_trial,
     126             :                             Real q_trial,
     127             :                             const RankTwoTensor & stress_trial,
     128             :                             const std::vector<Real> & intnl_old,
     129             :                             const std::vector<Real> & yf,
     130             :                             const RankFourTensor & Eijkl) override;
     131             : 
     132             :   virtual void initializeVars(Real p_trial,
     133             :                               Real q_trial,
     134             :                               const std::vector<Real> & intnl_old,
     135             :                               Real & p,
     136             :                               Real & q,
     137             :                               Real & gaE,
     138             :                               std::vector<Real> & intnl) const override;
     139             : 
     140             :   virtual void setIntnlValues(Real p_trial,
     141             :                               Real q_trial,
     142             :                               Real p,
     143             :                               Real q,
     144             :                               const std::vector<Real> & intnl_old,
     145             :                               std::vector<Real> & intnl) const override;
     146             : 
     147             :   virtual void setIntnlDerivatives(Real p_trial,
     148             :                                    Real q_trial,
     149             :                                    Real p,
     150             :                                    Real q,
     151             :                                    const std::vector<Real> & intnl,
     152             :                                    std::vector<std::vector<Real>> & dintnl) const override;
     153             : 
     154             :   virtual void computePQ(const RankTwoTensor & stress, Real & p, Real & q) const override;
     155             : 
     156             :   virtual void initializeReturnProcess() override;
     157             : 
     158             :   virtual void finalizeReturnProcess(const RankTwoTensor & rotation_increment) override;
     159             : 
     160             :   virtual void setEppEqq(const RankFourTensor & Eijkl, Real & Epp, Real & Eqq) const override;
     161             : 
     162             :   virtual void setStressAfterReturn(const RankTwoTensor & stress_trial,
     163             :                                     Real p_ok,
     164             :                                     Real q_ok,
     165             :                                     Real gaE,
     166             :                                     const std::vector<Real> & intnl,
     167             :                                     const yieldAndFlow & smoothed_q,
     168             :                                     const RankFourTensor & Eijkl,
     169             :                                     RankTwoTensor & stress) const override;
     170             : 
     171             :   virtual void consistentTangentOperator(const RankTwoTensor & stress_trial,
     172             :                                          Real p_trial,
     173             :                                          Real q_trial,
     174             :                                          const RankTwoTensor & stress,
     175             :                                          Real p,
     176             :                                          Real q,
     177             :                                          Real gaE,
     178             :                                          const yieldAndFlow & smoothed_q,
     179             :                                          const RankFourTensor & Eijkl,
     180             :                                          bool compute_full_tangent_operator,
     181             :                                          RankFourTensor & cto) const override;
     182             : 
     183             :   virtual RankTwoTensor dpdstress(const RankTwoTensor & stress) const override;
     184             : 
     185             :   virtual RankFourTensor d2pdstress2(const RankTwoTensor & stress) const override;
     186             : 
     187             :   virtual RankTwoTensor dqdstress(const RankTwoTensor & stress) const override;
     188             : 
     189             :   virtual RankFourTensor d2qdstress2(const RankTwoTensor & stress) const override;
     190             : };

Generated by: LCOV version 1.14