LCOV - code coverage report
Current view: top level - include/materials - DamagePlasticityStressUpdate.h (source / functions) Hit Total Coverage
Test: idaholab/blackbear: 276f95 Lines: 1 1 100.0 %
Date: 2025-10-28 03:10:25 Functions: 1 1 100.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /****************************************************************/
       2             : /*               DO NOT MODIFY THIS HEADER                      */
       3             : /*                       BlackBear                              */
       4             : /*                                                              */
       5             : /*           (c) 2017 Battelle Energy Alliance, LLC             */
       6             : /*                   ALL RIGHTS RESERVED                        */
       7             : /*                                                              */
       8             : /*          Prepared by Battelle Energy Alliance, LLC           */
       9             : /*            Under Contract No. DE-AC07-05ID14517              */
      10             : /*            With the U. S. Department of Energy               */
      11             : /*                                                              */
      12             : /*            See COPYRIGHT for full restrictions               */
      13             : /****************************************************************/
      14             : 
      15             : #pragma once
      16             : 
      17             : #include "MultiParameterPlasticityStressUpdate.h"
      18             : 
      19             : class DamagePlasticityStressUpdate : public MultiParameterPlasticityStressUpdate
      20             : {
      21             : public:
      22             :   static InputParameters validParams();
      23             :   DamagePlasticityStressUpdate(const InputParameters & parameters);
      24             : 
      25         171 :   bool requiresIsotropicTensor() override { return true; }
      26             : 
      27             : protected:
      28             :   virtual void initQpStatefulProperties() override;
      29             :   virtual void finalizeReturnProcess(const RankTwoTensor & rotation_increment) override;
      30             : 
      31             : private:
      32             :   ///Yield function tolerance (user parameter)
      33             :   const Real _f_tol;
      34             :   ///dimensionless parameter involving biaxial & uniaxial compressive strengths (user parameter)
      35             :   const Real _alfa;
      36             :   ///dilatancy factor (user parameter)
      37             :   const Real _alfa_p;
      38             :   ///stiffness recovery factor (user parameter)
      39             :   const Real _s0;
      40             :   ///ft_ep_slope_factor_at_zero_ep (user parameter)
      41             :   const Real _Chi;
      42             :   ///tensile damage at half tensile strength (user parameter)
      43             :   const Real _Dt;
      44             :   ///yield strength in tension (user parameter)
      45             :   const Real _ft;
      46             :   ///fracture_energy in tension (user parameter)
      47             :   const Real _FEt;
      48             :   ///yield strength in compression (user parameter)
      49             :   const Real _fyc;
      50             :   ///compressive damage at maximum compressive strength (user parameter)
      51             :   const Real _Dc;
      52             :   ///maximum strength in compression (user parameter)
      53             :   const Real _fc;
      54             :   ///fracture energy in compression (user parameter)
      55             :   const Real _FEc;
      56             :   /// Maximum stress in tension without damage
      57             :   const Real _ft0;
      58             :   /// Maximum stress in compression without damage
      59             :   const Real _fc0;
      60             : 
      61             :   ///@{
      62             :   /** The following variables are intermediate and are calculated based on the user parameters given
      63             :    * above */
      64             :   const Real _at;
      65             :   const Real _ac;
      66             :   const Real _zt;
      67             :   const Real _zc;
      68             :   const Real _dt_bt;
      69             :   const Real _dc_bc;
      70             : 
      71             :   ///@}
      72             : 
      73             :   /// Square root of 3
      74             :   const Real _sqrt3;
      75             : 
      76             :   /// Eigenvectors of the trial stress as a RankTwoTensor, in order to rotate the returned stress back to stress space
      77             :   RankTwoTensor _eigvecs;
      78             :   ///damage state in tension
      79             :   MaterialProperty<Real> & _intnl0;
      80             :   ///damage state in compression
      81             :   MaterialProperty<Real> & _intnl1;
      82             :   ///element length
      83             :   MaterialProperty<Real> & _ele_len;
      84             :   ///fracture energy in tension
      85             :   MaterialProperty<Real> & _gt;
      86             :   ///fracture energy in compression
      87             :   MaterialProperty<Real> & _gc;
      88             :   ///tensile damage
      89             :   MaterialProperty<Real> & _tD;
      90             :   ///compression damage
      91             :   MaterialProperty<Real> & _cD;
      92             :   ///damage variable
      93             :   MaterialProperty<Real> & _D;
      94             :   ///minimum Eigen value of plastic strain
      95             :   MaterialProperty<Real> & _min_ep;
      96             :   ///middle Eigen value of plastic strain
      97             :   MaterialProperty<Real> & _mid_ep;
      98             :   ///maximum Eigen value of plastic strain
      99             :   MaterialProperty<Real> & _max_ep;
     100             :   ///damaged minimum principal stress
     101             :   MaterialProperty<Real> & _sigma0;
     102             :   ///damaged mid value of principal stress
     103             :   MaterialProperty<Real> & _sigma1;
     104             :   ///damaged maximum principal stress
     105             :   MaterialProperty<Real> & _sigma2;
     106             :   /**
     107             :    * Obtain the undamaged strength
     108             :    * @param intnl (Array containing damage states in tension and compression, respectively)
     109             :    * @return value of ft (tensile strength)
     110             :    */
     111             :   Real fbar(const Real & f0, const Real & a, const Real & exponent, const Real & kappa) const;
     112             :   // Real ftbar(const std::vector<Real> & intnl) const;
     113             :   /**
     114             :    * Obtain the partial derivative of the undamaged tensile strength to the damage state
     115             :    * @param intnl (Array containing damage states in tension and compression, respectively)
     116             :    * @return value of dft (partial derivative of the tensile strength to the damage state)
     117             :    */
     118             :   Real
     119             :   dfbar_dkappa(const Real & f0, const Real & a, const Real & exponent, const Real & kappa) const;
     120             : 
     121             :   //  * Obtain the damaged tensile strength
     122             :   //  * @param intnl (Array containing damage states in tension and compression, respectively)
     123             :   //  * @return value of ft (tensile strength)
     124             :   //  */
     125             :   Real f(const Real & f0, const Real & a, const Real & kappa) const;
     126             : 
     127             :   /**
     128             :    * Obtain the partial derivative of the undamaged  strength to the damage state
     129             :    * @param intnl (Array containing damage states in tension and compression, respectively)
     130             :    * @return value of dft (partial derivative of the tensile strength to the damage state)
     131             :    */
     132             :   Real df_dkappa(const Real & f0, const Real & a, const Real & kappa) const;
     133             :   /**
     134             :    * beta is a dimensionless constant, which is a component of the yield function
     135             :    * It is defined in terms of tensile strength, compressive strength, and another
     136             :    * dimensionless constant alpha (See Eqn. 37 in Lee (1998))
     137             :    * @param intnl (Array containing damage states in tension and compression, respectively)
     138             :    * @return value of beta
     139             :    */
     140             :   Real beta(const std::vector<Real> & intnl) const;
     141             : 
     142             :   /**
     143             :    * dbeta0 is a derivative of beta wrt. tensile strength (ft)
     144             :    * @param intnl (Array containing damage states in tension and compression, respectively)
     145             :    * @return value of dbeta0
     146             :    */
     147             :   Real dbeta0(const std::vector<Real> & intnl) const;
     148             : 
     149             :   /**
     150             :    * dbeta1 is a derivative of beta wrt. compressive strength (fc)
     151             :    * @param intnl (Array containing damage states in tension and compression, respectively)
     152             :    * @return value of dbeta1
     153             :    */
     154             :   Real dbeta1(const std::vector<Real> & intnl) const;
     155             : 
     156             :   /**
     157             :    * weighfac is the weight factor, defined interms of the ratio of sum of  principal stresses
     158             :    * to the sum of absolute value of the principal stresses
     159             :    * @param stress_params is the array of principal stresses
     160             :    * @return wf
     161             :    */
     162             :   void weighfac(const std::vector<Real> & stress_params, Real & wf) const;
     163             : 
     164             :   /**
     165             :    * dweighfac is the derivative of the weight factor
     166             :    * @param stress_params is the array of principal stresses
     167             :    * @param wf is the weight factor
     168             :    * @return dwf
     169             :    */
     170             :   void dweighfac(const std::vector<Real> & stress_params, Real & wf, std::vector<Real> & dwf) const;
     171             : 
     172             :   /**
     173             :    * damageVar is the  degradation damage variable as defined in Eqn. 43 in Lee (1998)
     174             :    * @param stress_params is the array of principal stresses
     175             :    * @param intnl (Array containing damage states in tension and compression, respectively)
     176             :    * @return value of damageVar
     177             :    */
     178             :   Real damageVar(const std::vector<Real> & stress_params, const std::vector<Real> & intnl) const;
     179             : 
     180             :   void computeStressParams(const RankTwoTensor & stress,
     181             :                            std::vector<Real> & stress_params) const override;
     182             : 
     183             :   std::vector<RankTwoTensor> dstress_param_dstress(const RankTwoTensor & stress) const override;
     184             : 
     185             :   std::vector<RankFourTensor> d2stress_param_dstress(const RankTwoTensor & stress) const override;
     186             : 
     187             :   void setEffectiveElasticity(const RankFourTensor & Eijkl) override;
     188             : 
     189             :   virtual void preReturnMapV(const std::vector<Real> & trial_stress_params,
     190             :                              const RankTwoTensor & stress_trial,
     191             :                              const std::vector<Real> & intnl_old,
     192             :                              const std::vector<Real> & yf,
     193             :                              const RankFourTensor & Eijkl) override;
     194             : 
     195             :   virtual void setStressAfterReturnV(const RankTwoTensor & stress_trial,
     196             :                                      const std::vector<Real> & stress_params,
     197             :                                      Real gaE,
     198             :                                      const std::vector<Real> & intnl,
     199             :                                      const yieldAndFlow & smoothed_q,
     200             :                                      const RankFourTensor & Eijkl,
     201             :                                      RankTwoTensor & stress) const override;
     202             : 
     203             :   void yieldFunctionValuesV(const std::vector<Real> & stress_params,
     204             :                             const std::vector<Real> & intnl,
     205             :                             std::vector<Real> & yf) const override;
     206             : 
     207             :   void computeAllQV(const std::vector<Real> & stress_params,
     208             :                     const std::vector<Real> & intnl,
     209             :                     std::vector<yieldAndFlow> & all_q) const override;
     210             : 
     211             :   /**
     212             :    * This function calculates the flow potential
     213             :    * @param stress_params is the array of principal stresses
     214             :    * @param intnl (Array containing damage states in tension and compression, respectively)
     215             :    * @return r (flowpotential)
     216             :    */
     217             :   virtual void flowPotential(const std::vector<Real> & stress_params,
     218             :                              const std::vector<Real> & intnl,
     219             :                              std::vector<Real> & r) const;
     220             : 
     221             :   /**
     222             :    * This function calculates the derivative of the flow potential with the stress
     223             :    * @param stress_params is the array of principal stresses
     224             :    * @param intnl (Array containing damage states in tension and compression, respectively)
     225             :    * @return dr_dstress (dflowpotential_dstress)
     226             :    */
     227             :   virtual void dflowPotential_dstress(const std::vector<Real> & stress_params,
     228             :                                       std::vector<std::vector<Real>> & dr_dstress) const;
     229             :   /**
     230             :    * This function calculates the derivative of the flow potential with the damage states
     231             :    * @param stress_params is the array of principal stresses
     232             :    * @param intnl (Array containing damage states in tension and compression, respectively)
     233             :    * @return dr_dintnl (dflowPotential_dintnl)
     234             :    */
     235             :   virtual void dflowPotential_dintnl(const std::vector<Real> & stress_params,
     236             :                                      const std::vector<Real> & intnl,
     237             :                                      std::vector<std::vector<Real>> & dr_dintnl) const;
     238             :   /**
     239             :    * This function calculates the hardening potential
     240             :    * @param stress_params is the array of principal stresses
     241             :    * @param intnl (Array containing damage states in tension and compression, respectively)
     242             :    * @return h (hardening Potential)
     243             :    */
     244             :   virtual void hardPotential(const std::vector<Real> & stress_params,
     245             :                              const std::vector<Real> & intnl,
     246             :                              std::vector<Real> & h) const;
     247             :   /**
     248             :    * This function calculates the derivative of the hardening potential with the stress
     249             :    * @param stress_params is the array of principal stresses
     250             :    * @param intnl (Array containing damage states in tension and compression, respectively)
     251             :    * @return dh_dsig (dhardPotential_dstress)
     252             :    */
     253             :   virtual void dhardPotential_dstress(const std::vector<Real> & stress_params,
     254             :                                       const std::vector<Real> & intnl,
     255             :                                       std::vector<std::vector<Real>> & dh_dsig) const;
     256             :   /**
     257             :    * This function calculates the derivative of the hardening potential with the damage states
     258             :    * @param stress_params is the array of principal stresses
     259             :    * @param intnl (Array containing damage states in tension and compression, respectively)
     260             :    * @return dh_dintnl (dhardPotential_dintnl)
     261             :    */
     262             :   virtual void dhardPotential_dintnl(const std::vector<Real> & stress_params,
     263             :                                      const std::vector<Real> & intnl,
     264             :                                      std::vector<std::vector<Real>> & dh_dintnl) const;
     265             :   /**
     266             :    * This function updates the damage states
     267             :    * @param stress_params is the array of principal stresses
     268             :    * @param trial_stress_params is the trial values of the principal stresses
     269             :    * @param intnl_old (Array containing previous step's damage states in tension and compression,
     270             :    * respectively)
     271             :    * @return no particular return values, updates internal variables
     272             :    */
     273             :   void initialiseVarsV(const std::vector<Real> & trial_stress_params,
     274             :                        const std::vector<Real> & intnl_old,
     275             :                        std::vector<Real> & stress_params,
     276             :                        Real & gaE,
     277             :                        std::vector<Real> & intnl) const;
     278             : 
     279             :   void setIntnlValuesV(const std::vector<Real> & trial_stress_params,
     280             :                        const std::vector<Real> & current_stress_params,
     281             :                        const std::vector<Real> & intnl_old,
     282             :                        std::vector<Real> & intnl) const override;
     283             : 
     284             :   void setIntnlDerivativesV(const std::vector<Real> & trial_stress_params,
     285             :                             const std::vector<Real> & current_stress_params,
     286             :                             const std::vector<Real> & intnl,
     287             :                             std::vector<std::vector<Real>> & dintnl) const override;
     288             : 
     289             :   virtual void consistentTangentOperatorV(const RankTwoTensor & stress_trial,
     290             :                                           const std::vector<Real> & trial_stress_params,
     291             :                                           const RankTwoTensor & stress,
     292             :                                           const std::vector<Real> & stress_params,
     293             :                                           Real gaE,
     294             :                                           const yieldAndFlow & smoothed_q,
     295             :                                           const RankFourTensor & Eijkl,
     296             :                                           bool compute_full_tangent_operator,
     297             :                                           const std::vector<std::vector<Real>> & dvar_dtrial,
     298             :                                           RankFourTensor & cto) override;
     299             : };

Generated by: LCOV version 1.14