LCOV - code coverage report
Current view: top level - src/components - HSBoundarySpecifiedTemperature.C (source / functions) Hit Total Coverage
Test: idaholab/moose thermal_hydraulics: #30301 (3b550b) with base 2ad78d Lines: 19 20 95.0 %
Date: 2025-07-30 13:02:48 Functions: 3 3 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 "HSBoundarySpecifiedTemperature.h"
      11             : #include "HeatConductionModel.h"
      12             : 
      13             : registerMooseObject("ThermalHydraulicsApp", HSBoundarySpecifiedTemperature);
      14             : 
      15             : InputParameters
      16         736 : HSBoundarySpecifiedTemperature::validParams()
      17             : {
      18         736 :   InputParameters params = HSBoundary::validParams();
      19             : 
      20        1472 :   params.addRequiredParam<FunctionName>("T", "Prescribed temperature [K]");
      21             : 
      22        1472 :   params.declareControllable("T");
      23             : 
      24         736 :   params.addClassDescription("Applies Dirichlet boundary conditions on a heat structure");
      25             : 
      26         736 :   return params;
      27           0 : }
      28             : 
      29         367 : HSBoundarySpecifiedTemperature::HSBoundarySpecifiedTemperature(const InputParameters & params)
      30             :   : HSBoundary(params),
      31             : 
      32         734 :     _T_func(getParam<FunctionName>("T"))
      33             : {
      34         367 : }
      35             : 
      36             : void
      37         349 : HSBoundarySpecifiedTemperature::addMooseObjects()
      38             : {
      39             :   {
      40         349 :     std::string class_name = "ADFunctionDirichletBC";
      41         349 :     InputParameters pars = _factory.getValidParams(class_name);
      42         698 :     pars.set<NonlinearVariableName>("variable") = HeatConductionModel::TEMPERATURE;
      43         349 :     pars.set<std::vector<BoundaryName>>("boundary") = _boundary;
      44         349 :     pars.set<FunctionName>("function") = _T_func;
      45         698 :     getTHMProblem().addBoundaryCondition(class_name, genName(name(), "bc"), pars);
      46         698 :     makeFunctionControllableIfConstant(_T_func, "T");
      47         349 :   }
      48         349 : }

Generated by: LCOV version 1.14