LCOV - code coverage report
Current view: top level - src/materials - ADComputeMultiplePorousInelasticStress.C (source / functions) Hit Total Coverage
Test: idaholab/moose solid_mechanics: f45d79 Lines: 0 25 0.0 %
Date: 2025-07-25 05:00:39 Functions: 0 4 0.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             : #include "ADComputeMultiplePorousInelasticStress.h"
      11             : 
      12             : #include "RankTwoTensor.h"
      13             : 
      14             : registerMooseObjectDeprecated("SolidMechanicsApp",
      15             :                               ADComputeMultiplePorousInelasticStress,
      16             :                               "01/30/2021 24:00");
      17             : 
      18             : InputParameters
      19           0 : ADComputeMultiplePorousInelasticStress::validParams()
      20             : {
      21           0 :   InputParameters params = ADComputeMultipleInelasticStress::validParams();
      22           0 :   params.addClassDescription(
      23             :       "Compute state (stress and internal parameters such as plastic "
      24             :       "strains and internal parameters) using an iterative process. A porosity material property "
      25             :       "is defined and is calculated from the trace of inelastic strain increment.");
      26             : 
      27           0 :   params.addParam<MaterialPropertyName>(
      28             :       "porosity_name", "porosity", "Name of porosity material property");
      29           0 :   params.addRequiredRangeCheckedParam<Real>(
      30             :       "initial_porosity", "initial_porosity>0.0 & initial_porosity<1.0", "Initial porosity");
      31           0 :   return params;
      32           0 : }
      33             : 
      34           0 : ADComputeMultiplePorousInelasticStress::ADComputeMultiplePorousInelasticStress(
      35           0 :     const InputParameters & parameters)
      36             :   : ADComputeMultipleInelasticStress(parameters),
      37           0 :     _porosity(declareADProperty<Real>(getParam<MaterialPropertyName>("porosity_name"))),
      38           0 :     _porosity_old(getMaterialPropertyOld<Real>(getParam<MaterialPropertyName>("porosity_name"))),
      39           0 :     _initial_porosity(getParam<Real>("initial_porosity"))
      40             : {
      41           0 : }
      42             : 
      43             : void
      44           0 : ADComputeMultiplePorousInelasticStress::initQpStatefulProperties()
      45             : {
      46           0 :   ADComputeStressBase::initQpStatefulProperties();
      47             : 
      48           0 :   _porosity[_qp] = _initial_porosity;
      49           0 : }
      50             : 
      51             : void
      52           0 : ADComputeMultiplePorousInelasticStress::computeQpProperties()
      53             : {
      54           0 :   ADComputeStressBase::computeQpProperties();
      55             : 
      56           0 :   _porosity[_qp] =
      57           0 :       (1.0 - _porosity_old[_qp]) * (_inelastic_strain[_qp] - _inelastic_strain_old[_qp]).trace() +
      58           0 :       _porosity_old[_qp];
      59           0 :   if (_porosity[_qp] < 0.0)
      60           0 :     _porosity[_qp] = 0.0;
      61           0 : }

Generated by: LCOV version 1.14