LCOV - code coverage report
Current view: top level - src/materials/hardening_models - ArrheniusLawHardening.C (source / functions) Hit Total Coverage
Test: coverage.info Lines: 51 54 94.4 %
Date: 2025-02-21 01:06:12 Functions: 5 5 100.0 %

          Line data    Source code
       1             : //* This file is part of the RACCOON application
       2             : //* being developed at Dolbow lab at Duke University
       3             : //* http://dolbow.pratt.duke.edu
       4             : 
       5             : #include "ArrheniusLawHardening.h"
       6             : 
       7             : registerMooseObject("raccoonApp", ArrheniusLawHardening);
       8             : 
       9             : InputParameters
      10         154 : ArrheniusLawHardening::validParams()
      11             : {
      12         154 :   InputParameters params = PlasticHardeningModel::validParams();
      13         154 :   params.addClassDescription("Plastic hardening following a temperature dependent Arrhenius law.");
      14             : 
      15         308 :   params.addRequiredParam<MaterialPropertyName>("reference_stress",
      16             :                                                 "The reference stress $\\sigma_0$");
      17         308 :   params.addRequiredParam<MaterialPropertyName>("arrhenius_coefficient",
      18             :                                                 "The arrhenius coefficient");
      19         308 :   params.addRequiredParam<Real>(
      20             :       "eps", "A small number to help this perfect plasticity model to converge.");
      21             : 
      22         308 :   params.addRequiredCoupledVar("phase_field", "Name of the phase-field (damage) variable");
      23         308 :   params.addParam<MaterialPropertyName>(
      24             :       "plastic_energy_density",
      25             :       "psip",
      26             :       "Name of the plastic energy density computed by this material model");
      27         308 :   params.addParam<MaterialPropertyName>("degradation_function", "gp", "The degradation function");
      28         308 :   params.addRangeCheckedParam<Real>(
      29             :       "taylor_quinney_factor",
      30             :       1,
      31             :       "taylor_quinney_factor<=1 & taylor_quinney_factor>=0",
      32             :       "The Taylor-Quinney factor. 1 (default) for purely dissipative, 0 for purely energetic.");
      33             : 
      34         308 :   params.addRequiredCoupledVar("temperature",
      35             :                                "Couples with temperature to compute heat generation/loss due to "
      36             :                                "hardening/softening.");
      37             : 
      38         154 :   return params;
      39           0 : }
      40             : 
      41          12 : ArrheniusLawHardening::ArrheniusLawHardening(const InputParameters & parameters)
      42             :   : PlasticHardeningModel(parameters),
      43             :     DerivativeMaterialPropertyNameInterface(),
      44          24 :     _sigma_0(getADMaterialProperty<Real>(prependBaseName("reference_stress", true))),
      45          24 :     _arrhenius_coef_name(prependBaseName("arrhenius_coefficient", true)),
      46          12 :     _arrhenius_coef(getADMaterialProperty<Real>(_arrhenius_coef_name)),
      47          12 :     _darrhenius_coef_dT(getADMaterialProperty<Real>(
      48          60 :         derivativePropertyName(_arrhenius_coef_name, {getVar("temperature", 0)->name()}))),
      49          24 :     _eps(getParam<Real>("eps")),
      50             : 
      51          24 :     _d_name(getVar("phase_field", 0)->name()),
      52             : 
      53             :     // The plastic energy density and its derivatives
      54          12 :     _psip_name(prependBaseName("plastic_energy_density", true)),
      55          12 :     _psip(declareADProperty<Real>(_psip_name)),
      56          12 :     _psip_active(declareADProperty<Real>(_psip_name + "_active")),
      57          24 :     _dpsip_dd(declareADProperty<Real>(derivativePropertyName(_psip_name, {_d_name}))),
      58             : 
      59             :     // The degradation function and its derivatives
      60          12 :     _gp_name(prependBaseName("degradation_function", true)),
      61          12 :     _gp(getADMaterialProperty<Real>(_gp_name)),
      62          36 :     _dgp_dd(getADMaterialProperty<Real>(derivativePropertyName(_gp_name, {_d_name}))),
      63             : 
      64             :     // TQF
      65          24 :     _tqf(getParam<Real>("taylor_quinney_factor")),
      66             : 
      67             :     // Temperature
      68          24 :     _temp(adCoupledValue("temperature"))
      69             : {
      70          48 : }
      71             : 
      72             : ADReal
      73      169070 : ArrheniusLawHardening::plasticEnergy(const ADReal & ep, const unsigned int derivative)
      74             : {
      75      169070 :   if (derivative == 0)
      76             :   {
      77       33336 :     _psip_active[_qp] =
      78      100008 :         (1 - _tqf) * _sigma_0[_qp] / _arrhenius_coef[_qp] * ep + 0.5 * _eps * ep * ep;
      79       66672 :     _psip[_qp] = _gp[_qp] * _psip_active[_qp];
      80       66672 :     _dpsip_dd[_qp] = _dgp_dd[_qp] * _psip_active[_qp];
      81       33336 :     return _psip[_qp];
      82             :   }
      83             : 
      84      135734 :   if (derivative == 1)
      85      349340 :     return (1 - _tqf) * _gp[_qp] * (_sigma_0[_qp] / _arrhenius_coef[_qp] + _eps * ep);
      86             : 
      87       48399 :   if (derivative == 2)
      88       96798 :     return (1 - _tqf) * _gp[_qp] * _eps;
      89             : 
      90           0 :   mooseError(name(), "internal error: unsupported derivative order.");
      91             :   return 0;
      92             : }
      93             : 
      94             : ADReal
      95      202358 : ArrheniusLawHardening::plasticDissipation(const ADReal & delta_ep,
      96             :                                           const ADReal & ep,
      97             :                                           const unsigned int derivative)
      98             : {
      99      202358 :   if (derivative == 0)
     100             :   {
     101      133344 :     return _tqf * _gp[_qp] * (_sigma_0[_qp] / _arrhenius_coef[_qp] + _eps * ep) * delta_ep;
     102             :   }
     103             : 
     104      169022 :   if (derivative == 1)
     105      482492 :     return _tqf * _gp[_qp] * (_sigma_0[_qp] / _arrhenius_coef[_qp] + _eps * ep);
     106             : 
     107       48399 :   if (derivative == 2)
     108       96798 :     return _tqf * _gp[_qp] * _eps;
     109             : 
     110           0 :   mooseError(name(), "internal error: unsupported derivative order.");
     111             :   return 0;
     112             : }
     113             : 
     114             : ADReal
     115       33288 : ArrheniusLawHardening::thermalConjugate(const ADReal & /*ep*/)
     116             : {
     117       33288 :   return -_temp[_qp] * (1 - _tqf) * _gp[_qp] * _sigma_0[_qp] / _arrhenius_coef[_qp] /
     118       66576 :          _arrhenius_coef[_qp] * _darrhenius_coef_dT[_qp];
     119             : }

Generated by: LCOV version 1.16