LCOV - code coverage report
Current view: top level - src/components - HeatSourceVolumetric1Phase.C (source / functions) Hit Total Coverage
Test: idaholab/moose thermal_hydraulics: #30301 (3b550b) with base 2ad78d Lines: 24 25 96.0 %
Date: 2025-07-30 13:02:48 Functions: 4 4 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 "HeatSourceVolumetric1Phase.h"
      11             : #include "FlowChannel1Phase.h"
      12             : #include "FlowModelSinglePhase.h"
      13             : 
      14             : registerMooseObject("ThermalHydraulicsApp", HeatSourceVolumetric1Phase);
      15             : 
      16             : InputParameters
      17          24 : HeatSourceVolumetric1Phase::validParams()
      18             : {
      19          24 :   InputParameters params = Component::validParams();
      20          48 :   params.addRequiredParam<std::string>("flow_channel",
      21             :                                        "Flow channel name in which to apply heat source");
      22          48 :   params.addRequiredParam<MooseFunctorName>("q", "Volumetric heat source functor [W/m^3]");
      23          24 :   params.addClassDescription("Volumetric heat source applied on a flow channel");
      24          24 :   return params;
      25           0 : }
      26             : 
      27          12 : HeatSourceVolumetric1Phase::HeatSourceVolumetric1Phase(const InputParameters & parameters)
      28          12 :   : Component(parameters)
      29             : {
      30          12 : }
      31             : 
      32             : void
      33          12 : HeatSourceVolumetric1Phase::check() const
      34             : {
      35          12 :   Component::check();
      36             : 
      37          12 :   checkComponentOfTypeExists<FlowChannel1Phase>("flow_channel");
      38          12 : }
      39             : 
      40             : void
      41           8 : HeatSourceVolumetric1Phase::addMooseObjects()
      42             : {
      43           8 :   const FlowChannelBase & fch = getComponent<FlowChannel1Phase>("flow_channel");
      44             : 
      45             :   {
      46           8 :     std::string class_name = "ADOneD3EqnEnergyHeatSource";
      47           8 :     InputParameters pars = _factory.getValidParams(class_name);
      48          16 :     pars.set<NonlinearVariableName>("variable") = FlowModelSinglePhase::RHOEA;
      49           8 :     pars.set<std::vector<SubdomainName>>("block") = fch.getSubdomainNames();
      50          24 :     pars.set<MooseFunctorName>("q") = getParam<MooseFunctorName>("q");
      51          24 :     pars.set<std::vector<VariableName>>("A") = {FlowModel::AREA};
      52          16 :     getTHMProblem().addKernel(class_name, genName(name(), "rhoE_heat_source"), pars);
      53           8 :   }
      54           8 : }

Generated by: LCOV version 1.14