LCOV - code coverage report
Current view: top level - src/components - HeatTransferFromExternalAppTemperature1Phase.C (source / functions) Hit Total Coverage
Test: idaholab/moose thermal_hydraulics: #32971 (54bef8) with base c6cf66 Lines: 31 33 93.9 %
Date: 2026-05-29 20:41:18 Functions: 6 6 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 "HeatTransferFromExternalAppTemperature1Phase.h"
      11             : 
      12             : registerMooseObject("ThermalHydraulicsApp", HeatTransferFromExternalAppTemperature1Phase);
      13             : 
      14             : InputParameters
      15         132 : HeatTransferFromExternalAppTemperature1Phase::validParams()
      16             : {
      17         132 :   InputParameters params = HeatTransferFromTemperature1Phase::validParams();
      18         264 :   params.addParam<FunctionName>("initial_T_wall", "Initial condition for wall temperature [K]");
      19         264 :   params.addParam<VariableName>("T_ext", "Name of the wall temperature variable");
      20         132 :   params.addClassDescription("Heat transfer into 1-phase flow channel from temperature provided by "
      21             :                              "an external application");
      22         132 :   return params;
      23           0 : }
      24             : 
      25          66 : HeatTransferFromExternalAppTemperature1Phase::HeatTransferFromExternalAppTemperature1Phase(
      26          66 :     const InputParameters & parameters)
      27          66 :   : HeatTransferFromTemperature1Phase(parameters)
      28             : {
      29          66 : }
      30             : 
      31             : void
      32          66 : HeatTransferFromExternalAppTemperature1Phase::initSecondary()
      33             : {
      34          66 :   HeatTransferFromTemperature1Phase::initSecondary();
      35             : 
      36         132 :   if (isParamValid("T_ext"))
      37          16 :     _T_wall_name = getParam<VariableName>("T_ext");
      38          66 : }
      39             : 
      40             : void
      41          66 : HeatTransferFromExternalAppTemperature1Phase::check() const
      42             : {
      43          66 :   HeatTransferFromTemperature1Phase::check();
      44             : 
      45         132 :   if (!isParamValid("T_ext"))
      46         174 :     if (!isParamValid("initial_T_wall") && !_app.isRestarting())
      47           0 :       logError("Missing initial condition for wall temperature.");
      48          66 : }
      49             : 
      50             : void
      51          66 : HeatTransferFromExternalAppTemperature1Phase::addVariables()
      52             : {
      53          66 :   HeatTransferFromTemperature1Phase::addVariables();
      54             : 
      55         132 :   if (!isParamValid("T_ext"))
      56         116 :     if (isParamValid("initial_T_wall"))
      57          52 :       getTHMProblem().addFunctionIC(
      58         156 :           _T_wall_name, getParam<FunctionName>("initial_T_wall"), _flow_channel_subdomains);
      59          66 : }
      60             : 
      61             : void
      62          66 : HeatTransferFromExternalAppTemperature1Phase::addMooseObjects()
      63             : {
      64          66 :   HeatTransferFromTemperature1Phase::addMooseObjects();
      65             : 
      66          66 :   addHeatTransferKernels();
      67          66 : }

Generated by: LCOV version 1.14