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

Generated by: LCOV version 1.14