LCOV - code coverage report
Current view: top level - src/bcs - RadiativeHeatFluxBCBase.C (source / functions) Hit Total Coverage
Test: idaholab/moose heat_transfer: #31405 (292dce) with base fef103 Lines: 16 19 84.2 %
Date: 2025-09-04 07:53:51 Functions: 7 8 87.5 %
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 "RadiativeHeatFluxBCBase.h"
      11             : #include "Function.h"
      12             : #include "MathUtils.h"
      13             : 
      14             : template <bool is_ad>
      15             : InputParameters
      16         197 : RadiativeHeatFluxBCBaseTempl<is_ad>::validParams()
      17             : {
      18             :   InputParameters params = GenericIntegratedBC<is_ad>::validParams();
      19         394 :   params.addParam<Real>("stefan_boltzmann_constant", 5.670367e-8, "The Stefan-Boltzmann constant.");
      20         394 :   params.addRequiredParam<FunctionName>("Tinfinity",
      21             :                                         "Temperature of the body in radiative heat transfer.");
      22         197 :   params.addClassDescription("Boundary condition for radiative heat flux where temperature and the"
      23             :                              "temperature of a body in radiative heat transfer are specified.");
      24         197 :   return params;
      25           0 : }
      26             : 
      27             : template <bool is_ad>
      28         106 : RadiativeHeatFluxBCBaseTempl<is_ad>::RadiativeHeatFluxBCBaseTempl(
      29             :     const InputParameters & parameters)
      30             :   : GenericIntegratedBC<is_ad>(parameters),
      31         106 :     _sigma_stefan_boltzmann(this->template getParam<Real>("stefan_boltzmann_constant")),
      32         212 :     _tinf(getFunction("Tinfinity"))
      33             : {
      34         106 : }
      35             : 
      36             : template <bool is_ad>
      37             : GenericReal<is_ad>
      38      218032 : RadiativeHeatFluxBCBaseTempl<is_ad>::computeQpResidual()
      39             : {
      40      218032 :   GenericReal<is_ad> T4 = MathUtils::pow(_u[_qp], 4);
      41      218032 :   GenericReal<is_ad> T4inf = MathUtils::pow(_tinf.value(_t, _q_point[_qp]), 4);
      42      218032 :   return _test[_i][_qp] * _sigma_stefan_boltzmann * coefficient() * (T4 - T4inf);
      43             : }
      44             : 
      45             : template <>
      46             : Real
      47       97024 : RadiativeHeatFluxBCBaseTempl<false>::computeQpJacobian()
      48             : {
      49       97024 :   Real T3 = MathUtils::pow(_u[_qp], 3);
      50       97024 :   return 4 * _sigma_stefan_boltzmann * _test[_i][_qp] * coefficient() * T3 * _phi[_j][_qp];
      51             : }
      52             : 
      53             : template <>
      54             : Real
      55           0 : RadiativeHeatFluxBCBaseTempl<true>::computeQpJacobian()
      56             : {
      57           0 :   return 0;
      58             : }
      59             : 
      60             : template class RadiativeHeatFluxBCBaseTempl<false>;
      61             : template class RadiativeHeatFluxBCBaseTempl<true>;

Generated by: LCOV version 1.14