LCOV - code coverage report
Current view: top level - src/functormaterials - ConvectionHeatFluxFunctorMaterial.C (source / functions) Hit Total Coverage
Test: idaholab/moose heat_transfer: #31405 (292dce) with base fef103 Lines: 20 21 95.2 %
Date: 2025-09-04 07:53:51 Functions: 4 22 18.2 %
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 "ConvectionHeatFluxFunctorMaterial.h"
      11             : 
      12             : registerMooseObject("HeatTransferApp", ConvectionHeatFluxFunctorMaterial);
      13             : registerMooseObject("HeatTransferApp", ADConvectionHeatFluxFunctorMaterial);
      14             : 
      15             : template <bool is_ad>
      16             : InputParameters
      17          41 : ConvectionHeatFluxFunctorMaterialTempl<is_ad>::validParams()
      18             : {
      19          41 :   InputParameters params = FunctorMaterial::validParams();
      20          41 :   params.addClassDescription("Computes a convection heat flux from a solid surface to a fluid.");
      21          82 :   params.addRequiredParam<MooseFunctorName>("htc", "Heat transfer coefficient functor");
      22          82 :   params.addRequiredParam<MooseFunctorName>("T_solid", "Solid temperature functor");
      23          82 :   params.addRequiredParam<MooseFunctorName>("T_fluid", "Fluid temperature functor");
      24          82 :   params.addRequiredParam<std::string>("heat_flux_name",
      25             :                                        "Name to give the heat flux functor material property");
      26          41 :   return params;
      27           0 : }
      28             : 
      29             : template <bool is_ad>
      30          22 : ConvectionHeatFluxFunctorMaterialTempl<is_ad>::ConvectionHeatFluxFunctorMaterialTempl(
      31             :     const InputParameters & parameters)
      32             :   : FunctorMaterial(parameters),
      33          22 :     _htc(getFunctor<GenericReal<is_ad>>("htc")),
      34          44 :     _T_solid(getFunctor<GenericReal<is_ad>>("T_solid")),
      35          66 :     _T_fluid(getFunctor<GenericReal<is_ad>>("T_fluid"))
      36             : {
      37          88 :   addFunctorProperty<GenericReal<is_ad>>(
      38          44 :       getParam<std::string>("heat_flux_name"),
      39          18 :       [this](const auto & r, const auto & t) -> GenericReal<is_ad>
      40             :       {
      41          18 :         const auto htc = _htc(r, t);
      42          18 :         const auto T_solid = _T_solid(r, t);
      43          18 :         const auto T_fluid = _T_fluid(r, t);
      44          18 :         return htc * (T_solid - T_fluid);
      45             :       });
      46          44 : }
      47             : 
      48             : template class ConvectionHeatFluxFunctorMaterialTempl<false>;
      49             : template class ConvectionHeatFluxFunctorMaterialTempl<true>;

Generated by: LCOV version 1.14