LCOV - code coverage report
Current view: top level - src/materials - ConcreteLogarithmicCreepModel.C (source / functions) Hit Total Coverage
Test: idaholab/blackbear: b15b36 Lines: 75 78 96.2 %
Date: 2025-07-18 16:15:14 Functions: 3 3 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             : #include "ConcreteLogarithmicCreepModel.h"
      16             : 
      17             : registerMooseObject("BlackBearApp", ConcreteLogarithmicCreepModel);
      18             : 
      19             : InputParameters
      20         913 : ConcreteLogarithmicCreepModel::validParams()
      21             : {
      22         913 :   InputParameters params = GeneralizedKelvinVoigtBase::validParams();
      23        1826 :   params.addRequiredParam<Real>("youngs_modulus", "Initial elastic modulus of the material");
      24        1826 :   params.addRequiredParam<Real>("poissons_ratio", "Initial poisson ratio of the material");
      25        1826 :   params.addParam<Real>("recoverable_youngs_modulus",
      26             :                         "Modulus corresponding to the recoverable part of the deformation");
      27        1826 :   params.addParam<Real>("recoverable_poissons_ratio",
      28             :                         "Poisson coefficient of the recoverable part of the deformation");
      29        1826 :   params.addRangeCheckedParam<Real>(
      30             :       "recoverable_viscosity",
      31             :       "recoverable_viscosity > 0",
      32             :       "Viscosity corresponding to the recoverable part of the deformation");
      33        1826 :   params.addRequiredRangeCheckedParam<Real>(
      34             :       "long_term_viscosity",
      35             :       "long_term_viscosity > 0",
      36             :       "Viscosity corresponding to the long-term part of the deformation");
      37        1826 :   params.addRangeCheckedParam<Real>("long_term_characteristic_time",
      38             :                                     1,
      39             :                                     "long_term_characteristic_time > 0",
      40             :                                     "Rate at which the long_term viscosity increases");
      41        1826 :   params.addCoupledVar("temperature", "Temperature variable [in Celsius]");
      42        1826 :   params.addRangeCheckedParam<Real>("activation_temperature",
      43             :                                     "activation_temperature >= 0",
      44             :                                     "Activation temperature for the creep [in Kelvin]");
      45        1826 :   params.addParam<Real>("reference_temperature", 20, "Reference temperature [in Celsius]");
      46        1826 :   params.addCoupledVar("humidity", "Humidity variable");
      47        1826 :   params.addRangeCheckedParam<Real>("drying_creep_viscosity",
      48             :                                     "drying_creep_viscosity > 0",
      49             :                                     "Viscosity corresponding to the drying creep");
      50        1826 :   params.addParam<bool>("use_recovery", true, "Enables or disables creep recovery");
      51         913 :   params.addClassDescription("Logarithmic viscoelastic model for cementitious materials.");
      52         913 :   return params;
      53           0 : }
      54             : 
      55         702 : ConcreteLogarithmicCreepModel::ConcreteLogarithmicCreepModel(const InputParameters & parameters)
      56             :   : GeneralizedKelvinVoigtBase(parameters),
      57        1404 :     _has_recoverable_deformation(getParam<bool>("use_recovery")),
      58         702 :     _recoverable_dashpot_viscosity(isParamValid("recoverable_viscosity")
      59        2106 :                                        ? getParam<Real>("recoverable_viscosity")
      60         786 :                                        : getParam<Real>("long_term_characteristic_time")),
      61        1404 :     _long_term_dashpot_viscosity(getParam<Real>("long_term_viscosity")),
      62        1404 :     _long_term_dashpot_characteristic_time(getParam<Real>("long_term_characteristic_time")),
      63         702 :     _has_temp(isCoupled("temperature")),
      64        1236 :     _temperature_reference(_has_temp ? getParam<Real>("reference_temperature") : 20),
      65        1236 :     _creep_activation_temperature(_has_temp ? getParam<Real>("activation_temperature") : 0),
      66         702 :     _temperature(_has_temp ? coupledValue("temperature") : _zero),
      67         702 :     _temperature_old(_has_temp ? coupledValueOld("temperature") : _zero),
      68         702 :     _has_humidity(isCoupled("humidity")),
      69         702 :     _humidity(_has_humidity ? coupledValue("humidity") : _zero),
      70         702 :     _humidity_old(_has_humidity ? coupledValueOld("humidity") : _zero),
      71        1278 :     _has_drying_creep(_has_humidity && isParamValid("drying_creep_viscosity")),
      72        2148 :     _drying_creep_viscosity(_has_drying_creep ? getParam<Real>("drying_creep_viscosity") : 0)
      73             : {
      74        1404 :   Real youngs_modulus = getParam<Real>("youngs_modulus");
      75        1404 :   Real poissons_ratio = getParam<Real>("poissons_ratio");
      76         702 :   _C0.fillFromInputVector({youngs_modulus, poissons_ratio},
      77             :                           RankFourTensor::symmetric_isotropic_E_nu);
      78             : 
      79         702 :   if (_has_recoverable_deformation)
      80             :   {
      81         660 :     Real recoverable_youngs_modulus = isParamValid("recoverable_youngs_modulus")
      82        1980 :                                           ? getParam<Real>("recoverable_youngs_modulus")
      83             :                                           : youngs_modulus;
      84         660 :     Real recoverable_poissons_ratio = isParamValid("recoverable_poissons_ratio")
      85         660 :                                           ? getParam<Real>("recoverable_poissons_ratio")
      86             :                                           : poissons_ratio;
      87        1320 :     _Cr.fillFromInputVector({recoverable_youngs_modulus, recoverable_poissons_ratio},
      88             :                             RankFourTensor::symmetric_isotropic_E_nu);
      89             :   }
      90             : 
      91        2304 :   if (_has_temp && !isParamValid("activation_temperature"))
      92           0 :     mooseError("missing parameter for ConcreteLogarithmicCreepModel: activation_temperature");
      93             : 
      94         954 :   if (!_has_humidity && isParamValid("drying_creep_viscosity"))
      95           0 :     mooseError("missing coupled variable for ConcreteLogarithmicCreepModel: humidity");
      96             : 
      97         702 :   _components = (_has_recoverable_deformation ? 2 : 1);
      98         702 :   _has_longterm_dashpot = true;
      99             : 
     100         702 :   issueGuarantee(_elasticity_tensor_name, Guarantee::ISOTROPIC);
     101         702 :   declareViscoelasticProperties();
     102         702 : }
     103             : 
     104             : void
     105        8680 : ConcreteLogarithmicCreepModel::computeQpViscoelasticProperties()
     106             : {
     107        8680 :   _first_elasticity_tensor[_qp] = _C0;
     108             : 
     109             :   // temperature correction if need be
     110             :   Real temperature_coeff = 1.;
     111        8680 :   if (_has_temp)
     112             :     temperature_coeff =
     113        1736 :         std::exp(_creep_activation_temperature *
     114        1736 :                  (1. / (273.15 + (_temperature[_qp] + _temperature_old[_qp]) * 0.5) -
     115        1736 :                   1. / (273.15 + _temperature_reference)));
     116             : 
     117             :   // recoverable deformation if need be
     118        8680 :   if (_has_recoverable_deformation)
     119             :   {
     120        6944 :     (*_springs_elasticity_tensors[0])[_qp] = _Cr;
     121        6944 :     (*_dashpot_viscosities[0])[_qp] = _recoverable_dashpot_viscosity * temperature_coeff;
     122             :   }
     123             : 
     124             :   // basic long-term creep
     125        8680 :   (*_dashpot_viscosities.back())[_qp] =
     126       17360 :       _long_term_dashpot_viscosity *
     127        8680 :       (1. + std::max(_t - _dt * 0.5, 0.) / _long_term_dashpot_characteristic_time);
     128             : 
     129        8680 :   if (_has_humidity)
     130             :   {
     131        3472 :     Real humidity_coef = 1. / std::max((_humidity[_qp] + _humidity_old[_qp]) * 0.5, 1e-6);
     132        3472 :     (*_dashpot_viscosities.back())[_qp] *= humidity_coef;
     133        3472 :     if (_has_recoverable_deformation)
     134        3472 :       (*_springs_elasticity_tensors[0])[_qp] *= humidity_coef;
     135             : 
     136             :     // basic and drying long-term creep are assembled in series
     137             :     // (equivalent viscosity is the geometric mean of the viscosities)
     138        3472 :     if (_has_drying_creep)
     139             :     {
     140        1736 :       Real dh_dt = (_humidity[_qp] - _humidity_old[_qp]) / _dt;
     141        1736 :       if (!MooseUtils::absoluteFuzzyEqual(dh_dt, 0.0))
     142             :       {
     143        1736 :         Real dc_visc = _drying_creep_viscosity / std::abs(dh_dt);
     144        1736 :         Real bc_visc = (*_dashpot_viscosities.back())[_qp];
     145             : 
     146        1736 :         (*_dashpot_viscosities.back())[_qp] = 1. / (1. / bc_visc + 1. / dc_visc);
     147             :       }
     148             :     }
     149             :   }
     150             : 
     151        8680 :   (*_dashpot_viscosities.back())[_qp] *= temperature_coeff;
     152        8680 : }

Generated by: LCOV version 1.14