LCOV - code coverage report
Current view: top level - src/auxkernels - HeatTransferCoefficientAux.C (source / functions) Hit Total Coverage
Test: neams-th-coe/cardinal: be601f Lines: 19 24 79.2 %
Date: 2025-07-15 20:50:38 Functions: 3 3 100.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /********************************************************************/
       2             : /*                  SOFTWARE COPYRIGHT NOTIFICATION                 */
       3             : /*                             Cardinal                             */
       4             : /*                                                                  */
       5             : /*                  (c) 2021 UChicago Argonne, LLC                  */
       6             : /*                        ALL RIGHTS RESERVED                       */
       7             : /*                                                                  */
       8             : /*                 Prepared by UChicago Argonne, LLC                */
       9             : /*               Under Contract No. DE-AC02-06CH11357               */
      10             : /*                With the U. S. Department of Energy               */
      11             : /*                                                                  */
      12             : /*             Prepared by Battelle Energy Alliance, LLC            */
      13             : /*               Under Contract No. DE-AC07-05ID14517               */
      14             : /*                With the U. S. Department of Energy               */
      15             : /*                                                                  */
      16             : /*                 See LICENSE for full restrictions                */
      17             : /********************************************************************/
      18             : 
      19             : #include "HeatTransferCoefficientAux.h"
      20             : 
      21             : registerMooseObject("CardinalApp", HeatTransferCoefficientAux);
      22             : 
      23             : InputParameters
      24           8 : HeatTransferCoefficientAux::validParams()
      25             : {
      26           8 :   InputParameters params = AuxKernel::validParams();
      27          16 :   params.addRequiredParam<UserObjectName>("heat_flux",
      28             :                                           "User object containing the wall-average heat flux");
      29          16 :   params.addRequiredParam<UserObjectName>("wall_T",
      30             :                                           "User object containing the wall-averaged temperature");
      31          16 :   params.addRequiredParam<UserObjectName>("bulk_T",
      32             :                                           "User object containing the averaged bulk temperature");
      33           8 :   params.addClassDescription("Helper auxiliary kernel to compute a heat transfer coefficient given "
      34             :                              "user objects for heat flux, wall temperature, and bulk temperature.");
      35           8 :   return params;
      36           0 : }
      37             : 
      38           4 : HeatTransferCoefficientAux::HeatTransferCoefficientAux(const InputParameters & parameters)
      39             :   : AuxKernel(parameters),
      40           4 :     _heat_flux(getUserObjectBase("heat_flux")),
      41           4 :     _wall_T(getUserObjectBase("wall_T")),
      42           8 :     _bulk_T(getUserObjectBase("bulk_T"))
      43             : {
      44           4 : }
      45             : 
      46             : Real
      47      480000 : HeatTransferCoefficientAux::computeValue()
      48             : {
      49             :   Real q;
      50             :   Real Tw;
      51             :   Real Tinf;
      52             : 
      53      480000 :   if (isNodal())
      54             :   {
      55      480000 :     auto p = *_current_node;
      56      480000 :     q = _heat_flux.spatialValue(p);
      57      480000 :     Tw = _wall_T.spatialValue(p);
      58      480000 :     Tinf = _bulk_T.spatialValue(p);
      59             :   }
      60             :   else
      61             :   {
      62           0 :     auto p = _current_elem->vertex_average();
      63           0 :     q = _heat_flux.spatialValue(p);
      64           0 :     Tw = _wall_T.spatialValue(p);
      65           0 :     Tinf = _bulk_T.spatialValue(p);
      66             :   }
      67             : 
      68      480000 :   return q / (Tw - Tinf);
      69             : }

Generated by: LCOV version 1.14