LCOV - code coverage report
Current view: top level - src/components - HeatStructure2DCoupler.C (source / functions) Hit Total Coverage
Test: idaholab/moose thermal_hydraulics: #30301 (3b550b) with base 2ad78d Lines: 32 33 97.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 "HeatStructure2DCoupler.h"
      11             : #include "HeatStructureCylindricalBase.h"
      12             : 
      13             : registerMooseObject("ThermalHydraulicsApp", HeatStructure2DCoupler);
      14             : 
      15             : InputParameters
      16         212 : HeatStructure2DCoupler::validParams()
      17             : {
      18         212 :   InputParameters params = HeatStructure2DCouplerBase::validParams();
      19             : 
      20         424 :   params.addRequiredParam<FunctionName>("heat_transfer_coefficient",
      21             :                                         "Heat transfer coefficient function [W/(m^2-K)]");
      22             : 
      23         212 :   params.addClassDescription(
      24             :       "Couples boundaries of two 2D heat structures via a heat transfer coefficient");
      25             : 
      26         212 :   return params;
      27           0 : }
      28             : 
      29         106 : HeatStructure2DCoupler::HeatStructure2DCoupler(const InputParameters & parameters)
      30         106 :   : HeatStructure2DCouplerBase(parameters)
      31             : {
      32         106 : }
      33             : 
      34             : void
      35         106 : HeatStructure2DCoupler::check() const
      36             : {
      37         106 :   HeatStructure2DCouplerBase::check();
      38             : 
      39         106 :   if (!_mesh_alignment.meshesAreAligned())
      40           6 :     logError("The primary and secondary boundaries must be aligned.");
      41         106 : }
      42             : 
      43             : void
      44          90 : HeatStructure2DCoupler::addMooseObjects()
      45             : {
      46          90 :   HeatStructure2DCouplerBase::addMooseObjects();
      47             : 
      48         270 :   for (unsigned int i = 0; i < 2; i++)
      49             :   {
      50         180 :     const HeatStructureBase & hs = getComponentByName<HeatStructureBase>(_hs_names[i]);
      51             : 
      52             :     const std::string class_name =
      53         252 :         _is_cylindrical[i] ? "HeatStructure2DCouplerRZBC" : "HeatStructure2DCouplerBC";
      54         180 :     InputParameters params = _factory.getValidParams(class_name);
      55         360 :     params.set<NonlinearVariableName>("variable") = HeatConductionModel::TEMPERATURE;
      56         360 :     params.set<std::string>("coupled_variable") = HeatConductionModel::TEMPERATURE;
      57         540 :     params.set<std::vector<BoundaryName>>("boundary") = {_hs_boundaries[i]};
      58         180 :     params.set<MeshAlignment *>("_mesh_alignment") = &_mesh_alignment;
      59         360 :     params.set<FunctionName>("heat_transfer_coefficient") =
      60         360 :         getParam<FunctionName>("heat_transfer_coefficient");
      61         180 :     params.set<Real>("coupling_area_fraction") = _coupling_area_fractions[i];
      62         180 :     if (_is_cylindrical[i])
      63             :     {
      64         108 :       params.set<Point>("axis_point") = hs.getPosition();
      65         108 :       params.set<RealVectorValue>("axis_dir") = hs.getDirection();
      66             :     }
      67         180 :     getTHMProblem().addBoundaryCondition(class_name, genName(name(), class_name, i), params);
      68         180 :   }
      69          90 : }

Generated by: LCOV version 1.14