LCOV - code coverage report
Current view: top level - src/components - HeatTransfer1PhaseBase.C (source / functions) Hit Total Coverage
Test: idaholab/moose thermal_hydraulics: #32971 (54bef8) with base c6cf66 Lines: 32 33 97.0 %
Date: 2026-05-29 20:41:18 Functions: 7 7 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 "HeatTransfer1PhaseBase.h"
      11             : #include "FlowModelSinglePhase.h"
      12             : #include "FlowChannel1PhaseBase.h"
      13             : #include "ClosuresBase.h"
      14             : #include "MooseUtils.h"
      15             : 
      16             : InputParameters
      17        1034 : HeatTransfer1PhaseBase::validParams()
      18             : {
      19        1034 :   InputParameters params = HeatTransferBase::validParams();
      20        2068 :   params.addParam<FunctionName>("Hw", "Convective heat transfer coefficient [W/(m^2-K)]");
      21        1034 :   return params;
      22           0 : }
      23             : 
      24         517 : HeatTransfer1PhaseBase::HeatTransfer1PhaseBase(const InputParameters & parameters)
      25         517 :   : HeatTransferBase(parameters)
      26             : {
      27         517 : }
      28             : 
      29             : void
      30         474 : HeatTransfer1PhaseBase::init()
      31             : {
      32         474 :   HeatTransferBase::init();
      33         474 : }
      34             : 
      35             : void
      36         474 : HeatTransfer1PhaseBase::initSecondary()
      37             : {
      38         474 :   HeatTransferBase::initSecondary();
      39             : 
      40             :   // determine names of heat transfer variables
      41         474 :   if (hasComponentByName<FlowChannel1PhaseBase>(_flow_channel_name))
      42             :   {
      43             :     const FlowChannel1PhaseBase & flow_channel =
      44             :         getComponentByName<FlowChannel1PhaseBase>(_flow_channel_name);
      45         470 :     const std::string Hw_suffix = flow_channel.getHeatTransferNamesSuffix(name());
      46             : 
      47         940 :     _Hw_1phase_name = FlowModelSinglePhase::HEAT_TRANSFER_COEFFICIENT_WALL + Hw_suffix;
      48             :   }
      49             :   else
      50           4 :     logError("Coupled component '", _flow_channel_name, "' must be a single phase flow channel.");
      51         474 : }
      52             : 
      53             : void
      54         462 : HeatTransfer1PhaseBase::check() const
      55             : {
      56         462 :   HeatTransferBase::check();
      57             : 
      58         938 :   for (const auto & closures : _closures_objects)
      59         476 :     if (closures && hasComponentByName<FlowChannel1PhaseBase>(_flow_channel_name))
      60         476 :       closures->checkHeatTransfer(*this,
      61             :                                   getComponentByName<FlowChannel1PhaseBase>(_flow_channel_name));
      62         462 : }
      63             : 
      64             : void
      65         454 : HeatTransfer1PhaseBase::addMooseObjects()
      66             : {
      67         454 :   HeatTransferBase::addMooseObjects();
      68             : 
      69         926 :   for (const auto & closures : _closures_objects)
      70         472 :     closures->addMooseObjectsHeatTransfer(
      71         472 :         *this, getComponentByName<FlowChannel1PhaseBase>(_flow_channel_name));
      72         454 : }
      73             : 
      74             : const MaterialPropertyName &
      75         861 : HeatTransfer1PhaseBase::getWallHeatTransferCoefficient1PhaseName() const
      76             : {
      77         861 :   checkSetupStatus(INITIALIZED_SECONDARY);
      78             : 
      79         861 :   return _Hw_1phase_name;
      80             : }

Generated by: LCOV version 1.14