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

Generated by: LCOV version 1.14