LCOV - code coverage report
Current view: top level - src/postprocessors - HeatRateRadiation.C (source / functions) Hit Total Coverage
Test: idaholab/moose thermal_hydraulics: #30301 (3b550b) with base 2ad78d Lines: 27 28 96.4 %
Date: 2025-07-30 13:02:48 Functions: 3 3 100.0 %
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 "HeatRateRadiation.h"
      11             : 
      12             : registerMooseObject("ThermalHydraulicsApp", HeatRateRadiation);
      13             : 
      14             : InputParameters
      15          99 : HeatRateRadiation::validParams()
      16             : {
      17          99 :   InputParameters params = SideIntegralPostprocessor::validParams();
      18             : 
      19         198 :   params.addRequiredCoupledVar("T", "Temperature");
      20         198 :   params.addRequiredParam<MooseFunctorName>("T_ambient", "Ambient temperature functor");
      21         198 :   params.addRequiredParam<MooseFunctorName>("emissivity", "Emissivity functor");
      22         198 :   params.addParam<MooseFunctorName>("view_factor", 1.0, "View factor functor");
      23         198 :   params.addParam<Real>("stefan_boltzmann_constant", 5.670367e-8, "Stefan-Boltzmann constant");
      24         198 :   params.addParam<MooseFunctorName>("scale", 1.0, "Functor by which to scale the heat flux");
      25             : 
      26          99 :   params.addClassDescription("Integrates a radiative heat flux over a boundary.");
      27             : 
      28          99 :   return params;
      29           0 : }
      30             : 
      31          45 : HeatRateRadiation::HeatRateRadiation(const InputParameters & parameters)
      32             :   : SideIntegralPostprocessor(parameters),
      33             : 
      34          45 :     _T(coupledValue("T")),
      35          90 :     _T_ambient(getFunctor<Real>("T_ambient")),
      36          90 :     _emissivity(getFunctor<Real>("emissivity")),
      37          90 :     _view_factor(getFunctor<Real>("view_factor")),
      38          90 :     _sigma_stefan_boltzmann(getParam<Real>("stefan_boltzmann_constant")),
      39         135 :     _scale(getFunctor<Real>("scale"))
      40             : {
      41          45 : }
      42             : 
      43             : Real
      44        1520 : HeatRateRadiation::computeQpIntegral()
      45             : {
      46        1520 :   const Moose::ElemSideQpArg space_arg = {_current_elem, _current_side, _qp, _qrule, _q_point[_qp]};
      47        1520 :   const auto scale = _scale(space_arg, Moose::currentState());
      48        1520 :   const auto emissivity = _emissivity(space_arg, Moose::currentState());
      49        1520 :   const auto view_factor = _view_factor(space_arg, Moose::currentState());
      50        1520 :   const auto T_ambient = _T_ambient(space_arg, Moose::currentState());
      51             : 
      52        1520 :   const Real T4 = MathUtils::pow(_T[_qp], 4);
      53        1520 :   const Real T4inf = MathUtils::pow(T_ambient, 4);
      54             : 
      55        1520 :   return scale * _sigma_stefan_boltzmann * emissivity * view_factor * (T4inf - T4);
      56             : }

Generated by: LCOV version 1.14