LCOV - code coverage report
Current view: top level - src/bcs - ADConvectionHeatTransferBC.C (source / functions) Hit Total Coverage
Test: idaholab/moose thermal_hydraulics: #30301 (3b550b) with base 2ad78d Lines: 19 20 95.0 %
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 "ADConvectionHeatTransferBC.h"
      11             : 
      12             : registerMooseObject("ThermalHydraulicsApp", ADConvectionHeatTransferBC);
      13             : 
      14             : InputParameters
      15         219 : ADConvectionHeatTransferBC::validParams()
      16             : {
      17         219 :   InputParameters params = ADIntegratedBC::validParams();
      18         438 :   params.addRequiredParam<MooseFunctorName>("T_ambient", "Ambient temperature functor");
      19         438 :   params.addRequiredParam<MooseFunctorName>("htc_ambient",
      20             :                                             "Ambient heat transfer coefficient functor");
      21         438 :   params.addParam<MooseFunctorName>(
      22         438 :       "scale", 1.0, "Functor by which to scale the boundary condition");
      23         219 :   params.addClassDescription("Adds a convective heat flux boundary condition with user-specified "
      24             :                              "ambient temperature and heat transfer coefficient functions");
      25         219 :   return params;
      26           0 : }
      27             : 
      28         119 : ADConvectionHeatTransferBC::ADConvectionHeatTransferBC(const InputParameters & parameters)
      29             :   : ADIntegratedBC(parameters),
      30         119 :     _T_ambient(getFunctor<ADReal>("T_ambient")),
      31         238 :     _htc_ambient(getFunctor<ADReal>("htc_ambient")),
      32         357 :     _scale(getFunctor<ADReal>("scale"))
      33             : {
      34         119 : }
      35             : 
      36             : ADReal
      37      130080 : ADConvectionHeatTransferBC::computeQpResidual()
      38             : {
      39      130080 :   const Moose::ElemSideQpArg space_arg = {_current_elem, _current_side, _qp, _qrule, _q_point[_qp]};
      40      130080 :   const auto scale = _scale(space_arg, Moose::currentState());
      41      130080 :   const auto htc = _htc_ambient(space_arg, Moose::currentState());
      42      130080 :   const auto T_ambient = _T_ambient(space_arg, Moose::currentState());
      43             : 
      44      130080 :   return scale * htc * (_u[_qp] - T_ambient) * _test[_i][_qp];
      45             : }

Generated by: LCOV version 1.14