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

Generated by: LCOV version 1.14