LCOV - code coverage report
Current view: top level - src/materials - ArrheniusLaw.C (source / functions) Hit Total Coverage
Test: coverage.info Lines: 22 23 95.7 %
Date: 2025-02-21 01:06:12 Functions: 3 3 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 "ArrheniusLaw.h"
       6             : 
       7             : registerMooseObject("raccoonApp", ArrheniusLaw);
       8             : 
       9             : InputParameters
      10         154 : ArrheniusLaw::validParams()
      11             : {
      12         154 :   InputParameters params = Material::validParams();
      13         154 :   params += BaseNameInterface::validParams();
      14         154 :   params.addClassDescription("This class computes the Arrhenius coefficient $\\exp\\left( "
      15             :                              "-\\dfrac{Q}{RT} \\right)$, where $Q$ is the activation energy, $R$ "
      16             :                              "is the ideal gas constant, and $T$ is the temperature.");
      17             : 
      18         308 :   params.addParam<MaterialPropertyName>(
      19             :       "arrhenius_coefficient", "A", "Name of the Arrhenius coefficient material");
      20         308 :   params.addParam<MaterialPropertyName>("activation_energy", "Q", "The activation energy");
      21         308 :   params.addRequiredParam<Real>("ideal_gas_constant", "The ideal gas constant");
      22         308 :   params.addRequiredCoupledVar("temperature", "The temperature");
      23             : 
      24         154 :   return params;
      25           0 : }
      26             : 
      27          12 : ArrheniusLaw::ArrheniusLaw(const InputParameters & parameters)
      28             :   : Material(parameters),
      29             :     BaseNameInterface(parameters),
      30             :     DerivativeMaterialPropertyNameInterface(),
      31          12 :     _arrhenius_coef_name(prependBaseName("arrhenius_coefficient", true)),
      32          12 :     _arrhenius_coef(declareADProperty<Real>(_arrhenius_coef_name)),
      33          12 :     _darrhenius_coef_dT(declareADProperty<Real>(
      34          72 :         derivativePropertyName(_arrhenius_coef_name, {getVar("temperature", 0)->name()}))),
      35          24 :     _Q(getADMaterialProperty<Real>(prependBaseName("activation_energy", true))),
      36          24 :     _R(getParam<Real>("ideal_gas_constant")),
      37          24 :     _T(adCoupledValue("temperature"))
      38             : {
      39          24 : }
      40             : 
      41             : void
      42       33336 : ArrheniusLaw::computeQpProperties()
      43             : {
      44       66672 :   _arrhenius_coef[_qp] = std::exp(-_Q[_qp] / _R / _T[_qp]);
      45       66672 :   _darrhenius_coef_dT[_qp] = _arrhenius_coef[_qp] * _Q[_qp] / _R / _T[_qp] / _T[_qp];
      46       33336 : }

Generated by: LCOV version 1.16