LCOV - code coverage report
Current view: top level - src/components - HSBoundaryExternalAppTemperature.C (source / functions) Hit Total Coverage
Test: idaholab/moose thermal_hydraulics: #32971 (54bef8) with base c6cf66 Lines: 22 23 95.7 %
Date: 2026-05-29 20:41:18 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 "HSBoundaryExternalAppTemperature.h"
      11             : #include "HeatConductionModel.h"
      12             : #include "HeatStructureInterface.h"
      13             : #include "GeometricalComponent.h"
      14             : 
      15             : registerMooseObject("ThermalHydraulicsApp", HSBoundaryExternalAppTemperature);
      16             : 
      17             : InputParameters
      18          16 : HSBoundaryExternalAppTemperature::validParams()
      19             : {
      20          16 :   InputParameters params = HSBoundary::validParams();
      21          32 :   params.addParam<VariableName>(
      22             :       "T_ext",
      23             :       "T_ext",
      24             :       "Name of the variable that will store the values computed by the external application");
      25          16 :   params.addClassDescription("Heat structure boundary condition to set temperature values computed "
      26             :                              "by an external application");
      27          16 :   return params;
      28           0 : }
      29             : 
      30           8 : HSBoundaryExternalAppTemperature::HSBoundaryExternalAppTemperature(const InputParameters & params)
      31          16 :   : HSBoundary(params), _T_ext_var_name(getParam<VariableName>("T_ext"))
      32             : {
      33           8 : }
      34             : 
      35             : void
      36           8 : HSBoundaryExternalAppTemperature::addVariables()
      37             : {
      38          16 :   const HeatStructureInterface & hs = getComponent<HeatStructureInterface>("hs");
      39             :   const std::vector<SubdomainName> & subdomain_names =
      40           8 :       hs.getGeometricalComponent().getSubdomainNames();
      41             : 
      42           8 :   getTHMProblem().addSimVariable(
      43             :       false, _T_ext_var_name, HeatConductionModel::feType(), subdomain_names);
      44           8 : }
      45             : 
      46             : void
      47           8 : HSBoundaryExternalAppTemperature::addMooseObjects()
      48             : {
      49             :   {
      50           8 :     std::string class_name = "ADMatchedValueBC";
      51           8 :     InputParameters pars = _factory.getValidParams(class_name);
      52          16 :     pars.set<NonlinearVariableName>("variable") = HeatConductionModel::TEMPERATURE;
      53           8 :     pars.set<std::vector<BoundaryName>>("boundary") = _boundary;
      54          24 :     pars.set<std::vector<VariableName>>("v") = {_T_ext_var_name};
      55          16 :     getTHMProblem().addBoundaryCondition(class_name, genName(name(), "bc"), pars);
      56           8 :   }
      57          16 : }

Generated by: LCOV version 1.14