LCOV - code coverage report
Current view: top level - include/materials - ADViscoplasticityStressUpdate.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: 1 1 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 "ViscoplasticityStressUpdateBase.h"
      13             : #include "ADSingleVariableReturnMappingSolution.h"
      14             : 
      15             : class ADViscoplasticityStressUpdate : public ADViscoplasticityStressUpdateBase,
      16             :                                       public ADSingleVariableReturnMappingSolution
      17             : {
      18             : public:
      19             :   static InputParameters validParams();
      20             : 
      21             :   ADViscoplasticityStressUpdate(const InputParameters & parameters);
      22             : 
      23             :   using ADViscoplasticityStressUpdateBase::updateState;
      24             : 
      25             :   virtual void updateState(ADRankTwoTensor & strain_increment,
      26             :                            ADRankTwoTensor & inelastic_strain_increment,
      27             :                            const ADRankTwoTensor & rotation_increment,
      28             :                            ADRankTwoTensor & stress_new,
      29             :                            const RankTwoTensor & stress_old,
      30             :                            const ADRankFourTensor & elasticity_tensor,
      31             :                            const RankTwoTensor & elastic_strain_old,
      32             :                            bool compute_full_tangent_operator = false,
      33             :                            RankFourTensor & tangent_operator = _identityTensor) override;
      34             : 
      35             :   virtual ADReal minimumPermissibleValue(const ADReal & effective_trial_stress) const override;
      36             : 
      37             :   virtual ADReal maximumPermissibleValue(const ADReal & effective_trial_stress) const override;
      38             : 
      39             :   virtual Real computeReferenceResidual(const ADReal & effective_trial_stress,
      40             :                                         const ADReal & scalar_effective_inelastic_strain) override;
      41             : 
      42             : protected:
      43             :   /**
      44             :    * Compute an initial guess for the value of the scalar. For some cases, an
      45             :    * intellegent starting point can provide enhanced robustness in the Newton
      46             :    * iterations. This is also an opportunity for classes that derive from this
      47             :    * to perform initialization tasks.
      48             :    * @param effective_trial_stress Effective trial stress
      49             :    */
      50             :   virtual ADReal initialGuess(const ADReal & effective_trial_stress) override;
      51             : 
      52             :   /**
      53             :    * Perform any necessary steps to finalize state after return mapping iterations
      54             :    * @param inelasticStrainIncrement Inelastic strain increment
      55             :    */
      56             :   virtual ADReal computeResidual(const ADReal & effective_trial_stress,
      57             :                                  const ADReal & scalar) override;
      58             : 
      59     3419804 :   virtual ADReal computeDerivative(const ADReal & /*effective_trial_stress*/,
      60             :                                    const ADReal & /*scalar*/) override
      61             :   {
      62     3419804 :     return _derivative;
      63             :   }
      64             : 
      65             :   void outputIterationSummary(std::stringstream * iter_output,
      66             :                               const unsigned int total_it) override;
      67             : 
      68             :   ADReal computeH(const Real n, const ADReal & gauge_stress, const bool derivative = false);
      69             : 
      70             :   ADRankTwoTensor computeDGaugeDSigma(const ADReal & gauge_stress,
      71             :                                       const ADReal & equiv_stress,
      72             :                                       const ADRankTwoTensor & dev_stress,
      73             :                                       const ADRankTwoTensor & stress);
      74             : 
      75             :   void computeInelasticStrainIncrement(ADReal & gauge_stress,
      76             :                                        ADReal & dpsi_dgauge,
      77             :                                        ADRankTwoTensor & creep_strain_increment,
      78             :                                        const ADReal & equiv_stress,
      79             :                                        const ADRankTwoTensor & dev_stress,
      80             :                                        const ADRankTwoTensor & stress);
      81             : 
      82             :   /// Enum to choose which viscoplastic model to use
      83             :   const enum class ViscoplasticityModel { LPS, GTN } _model;
      84             : 
      85             :   /// Enum to choose which pore shape model to use
      86             :   const enum class PoreShapeModel { SPHERICAL, CYLINDRICAL } _pore_shape;
      87             : 
      88             :   /// Pore shape factor depending on pore shape model
      89             :   const Real _pore_shape_factor;
      90             : 
      91             :   /// Exponent on the effective stress
      92             :   const Real _power;
      93             : 
      94             :   /// Power factor used for LPS model
      95             :   const Real _power_factor;
      96             : 
      97             :   /// Leading coefficient
      98             :   const ADMaterialProperty<Real> & _coefficient;
      99             : 
     100             :   /// Gauge stress
     101             :   ADMaterialProperty<Real> & _gauge_stress;
     102             : 
     103             :   /// Maximum ratio between the gauge stress and the equilvalent stress
     104             :   const Real _maximum_gauge_ratio;
     105             : 
     106             :   /// Minimum value of equivalent stress below which viscoplasticiy is not calculated
     107             :   const Real _minimum_equivalent_stress;
     108             : 
     109             :   /// Maximum value of equivalent stress above which an exception is thrown
     110             :   const Real _maximum_equivalent_stress;
     111             : 
     112             :   /// Container for hydrostatic stress
     113             :   ADReal _hydro_stress;
     114             : 
     115             :   /// Rank two identity tensor
     116             :   const RankTwoTensor _identity_two;
     117             : 
     118             :   /// Derivative of hydrostatic stress with respect to the stress tensor
     119             :   const RankTwoTensor _dhydro_stress_dsigma;
     120             : 
     121             :   /// Container for _derivative
     122             :   ADReal _derivative;
     123             : };

Generated by: LCOV version 1.14