LCOV - code coverage report
Current view: top level - src/components - HeatTransfer1PhaseBase.C (source / functions) Hit Total Coverage
Test: idaholab/moose thermal_hydraulics: #30301 (3b550b) with base 2ad78d Lines: 33 34 97.1 %
Date: 2025-07-30 13:02:48 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        2042 : HeatTransfer1PhaseBase::validParams()
      18             : {
      19        2042 :   InputParameters params = HeatTransferBase::validParams();
      20        4084 :   params.addParam<FunctionName>("Hw", "Convective heat transfer coefficient [W/(m^2-K)]");
      21        4084 :   params.declareControllable("Hw");
      22        2042 :   return params;
      23           0 : }
      24             : 
      25        1021 : HeatTransfer1PhaseBase::HeatTransfer1PhaseBase(const InputParameters & parameters)
      26        1021 :   : HeatTransferBase(parameters)
      27             : {
      28        1021 : }
      29             : 
      30             : void
      31         970 : HeatTransfer1PhaseBase::init()
      32             : {
      33         970 :   HeatTransferBase::init();
      34         970 : }
      35             : 
      36             : void
      37         970 : HeatTransfer1PhaseBase::initSecondary()
      38             : {
      39         970 :   HeatTransferBase::initSecondary();
      40             : 
      41             :   // determine names of heat transfer variables
      42         970 :   if (hasComponentByName<FlowChannel1PhaseBase>(_flow_channel_name))
      43             :   {
      44             :     const FlowChannel1PhaseBase & flow_channel =
      45             :         getComponentByName<FlowChannel1PhaseBase>(_flow_channel_name);
      46         966 :     const std::string Hw_suffix = flow_channel.getHeatTransferNamesSuffix(name());
      47             : 
      48        1932 :     _Hw_1phase_name = FlowModelSinglePhase::HEAT_TRANSFER_COEFFICIENT_WALL + Hw_suffix;
      49             :   }
      50             :   else
      51           4 :     logError("Coupled component '", _flow_channel_name, "' must be a single phase flow channel.");
      52         970 : }
      53             : 
      54             : void
      55         950 : HeatTransfer1PhaseBase::check() const
      56             : {
      57         950 :   HeatTransferBase::check();
      58             : 
      59        1934 :   for (const auto & closures : _closures_objects)
      60         984 :     if (closures && hasComponentByName<FlowChannel1PhaseBase>(_flow_channel_name))
      61         984 :       closures->checkHeatTransfer(*this,
      62             :                                   getComponentByName<FlowChannel1PhaseBase>(_flow_channel_name));
      63         950 : }
      64             : 
      65             : void
      66         950 : HeatTransfer1PhaseBase::addMooseObjects()
      67             : {
      68         950 :   HeatTransferBase::addMooseObjects();
      69             : 
      70        1938 :   for (const auto & closures : _closures_objects)
      71         988 :     closures->addMooseObjectsHeatTransfer(
      72         988 :         *this, getComponentByName<FlowChannel1PhaseBase>(_flow_channel_name));
      73         950 : }
      74             : 
      75             : const MaterialPropertyName &
      76        1648 : HeatTransfer1PhaseBase::getWallHeatTransferCoefficient1PhaseName() const
      77             : {
      78        1648 :   checkSetupStatus(INITIALIZED_SECONDARY);
      79             : 
      80        1648 :   return _Hw_1phase_name;
      81             : }

Generated by: LCOV version 1.14