LCOV - code coverage report
Current view: top level - src/bcs - ADRadiativeHeatFluxBC.C (source / functions) Hit Total Coverage
Test: idaholab/moose thermal_hydraulics: #32971 (54bef8) with base c6cf66 Lines: 26 27 96.3 %
Date: 2026-05-29 20:41:18 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 "ADRadiativeHeatFluxBC.h"
      11             : 
      12             : registerMooseObject("ThermalHydraulicsApp", ADRadiativeHeatFluxBC);
      13             : 
      14             : InputParameters
      15          47 : ADRadiativeHeatFluxBC::validParams()
      16             : {
      17          47 :   InputParameters params = ADIntegratedBC::validParams();
      18             : 
      19          94 :   params.addRequiredParam<MooseFunctorName>("T_ambient", "Ambient temperature functor");
      20          94 :   params.addRequiredParam<MooseFunctorName>("emissivity", "Emissivity functor");
      21          94 :   params.addParam<MooseFunctorName>("view_factor", 1.0, "View factor functor");
      22          94 :   params.addParam<MooseFunctorName>(
      23          94 :       "scale", 1.0, "Functor by which to scale the boundary condition");
      24          94 :   params.addParam<Real>("stefan_boltzmann_constant", 5.670367e-8, "Stefan-Boltzmann constant");
      25             : 
      26          47 :   params.addClassDescription(
      27             :       "Radiative heat transfer boundary condition for a plate heat structure");
      28             : 
      29          47 :   return params;
      30           0 : }
      31             : 
      32          25 : ADRadiativeHeatFluxBC::ADRadiativeHeatFluxBC(const InputParameters & parameters)
      33             :   : ADIntegratedBC(parameters),
      34          25 :     _T_ambient(getFunctor<ADReal>("T_ambient")),
      35          50 :     _emissivity(getFunctor<ADReal>("emissivity")),
      36          50 :     _view_factor(getFunctor<ADReal>("view_factor")),
      37          50 :     _scale(getFunctor<ADReal>("scale")),
      38          75 :     _sigma(getParam<Real>("stefan_boltzmann_constant"))
      39             : {
      40          25 : }
      41             : 
      42             : ADReal
      43        1312 : ADRadiativeHeatFluxBC::computeQpResidual()
      44             : {
      45        1312 :   const Moose::ElemSideQpArg space_arg = {_current_elem, _current_side, _qp, _qrule, _q_point[_qp]};
      46        1312 :   const auto scale = _scale(space_arg, Moose::currentState());
      47        1312 :   const auto emissivity = _emissivity(space_arg, Moose::currentState());
      48        1312 :   const auto view_factor = _view_factor(space_arg, Moose::currentState());
      49        1312 :   const auto T_ambient = _T_ambient(space_arg, Moose::currentState());
      50             : 
      51        1312 :   const auto T4 = MathUtils::pow(_u[_qp], 4);
      52        1312 :   const auto T4inf = MathUtils::pow(T_ambient, 4);
      53             : 
      54        1312 :   return _test[_i][_qp] * _sigma * scale * emissivity * view_factor * (T4 - T4inf);
      55             : }

Generated by: LCOV version 1.14