LCOV - code coverage report
Current view: top level - include/utils - HeatTransferModels.h (source / functions) Hit Total Coverage
Test: idaholab/moose heat_transfer: #31405 (292dce) with base fef103 Lines: 8 9 88.9 %
Date: 2025-09-04 07:53:51 Functions: 2 8 25.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             : #pragma once
      11             : 
      12             : #include "HeatConductionNames.h"
      13             : 
      14             : namespace HeatTransferModels
      15             : {
      16             : 
      17             : /**
      18             :  * Computes the thermal conductance across a cylindrical medium.
      19             :  *
      20             :  * Note that thermal conductance has the same units as a heat transfer coefficient.
      21             :  *
      22             :  * @param[in] k        Thermal conductivity of the medium
      23             :  * @param[in] r_inner  Inner radius
      24             :  * @param[in] r_outer  Outer radius
      25             :  */
      26             : template <typename T1, typename T2, typename T3>
      27             : auto
      28       18000 : cylindricalThermalConductance(const T1 & k, const T2 & r_inner, const T3 & r_outer)
      29             : {
      30             :   mooseAssert(r_outer > r_inner, "Outer radius must be larger than inner radius.");
      31             : 
      32       18000 :   const auto r_avg = 0.5 * (r_inner + r_outer);
      33       18000 :   return k / (r_avg * std::log(r_outer / r_inner));
      34             : }
      35             : 
      36             : /**
      37             :  * Computes the conduction heat flux across a cylindrical gap.
      38             :  *
      39             :  * The convention is that positive heat fluxes correspond to heat moving from
      40             :  * the inner surface to the outer surface.
      41             :  *
      42             :  * @param[in] k_gap    Gap thermal conductivity
      43             :  * @param[in] r_inner  Inner radius
      44             :  * @param[in] r_outer  Outer radius
      45             :  * @param[in] T_inner  Inner temperature
      46             :  * @param[in] T_outer  Outer temperature
      47             :  */
      48             : template <typename T1, typename T2, typename T3, typename T4, typename T5>
      49             : auto
      50           0 : cylindricalGapConductionHeatFlux(const T1 & k_gap,
      51             :                                  const T2 & r_inner,
      52             :                                  const T3 & r_outer,
      53             :                                  const T4 & T_inner,
      54             :                                  const T5 & T_outer)
      55             : {
      56       18000 :   return cylindricalThermalConductance(k_gap, r_inner, r_outer) * (T_inner - T_outer);
      57             : }
      58             : 
      59             : /**
      60             :  * Computes the radiation heat flux across a cylindrical gap.
      61             :  *
      62             :  * The convention is that positive heat fluxes correspond to heat moving from
      63             :  * the inner surface to the outer surface.
      64             :  *
      65             :  * @param[in] r_inner      Inner radius
      66             :  * @param[in] r_outer      Outer radius
      67             :  * @param[in] emiss_inner  Inner emissivity
      68             :  * @param[in] emiss_outer  Outer emissivity
      69             :  * @param[in] T_inner      Inner temperature
      70             :  * @param[in] T_outer      Outer temperature
      71             :  * @param[in] sigma        The Stefan-Boltzmann constant
      72             :  */
      73             : template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6>
      74             : auto
      75       18000 : cylindricalGapRadiationHeatFlux(const T1 & r_inner,
      76             :                                 const T2 & r_outer,
      77             :                                 const T3 & emiss_inner,
      78             :                                 const T4 & emiss_outer,
      79             :                                 const T5 & T_inner,
      80             :                                 const T6 & T_outer,
      81             :                                 const Real & sigma = HeatConduction::Constants::sigma)
      82             : {
      83             :   mooseAssert(r_outer > r_inner, "Outer radius must be larger than inner radius.");
      84             : 
      85       18000 :   const auto rad_resistance =
      86       18000 :       1.0 / emiss_inner + r_inner / r_outer * (1.0 - emiss_outer) / emiss_outer;
      87       18000 :   return sigma * (std::pow(T_inner, 4) - std::pow(T_outer, 4)) / rad_resistance;
      88             : }
      89             : 
      90             : }

Generated by: LCOV version 1.14