LCOV - code coverage report
Current view: top level - src/components - HeatStructurePlate.C (source / functions) Hit Total Coverage
Test: idaholab/moose thermal_hydraulics: #32971 (54bef8) with base c6cf66 Lines: 43 45 95.6 %
Date: 2026-05-29 20:41:18 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 "HeatStructurePlate.h"
      11             : 
      12             : registerMooseObject("ThermalHydraulicsApp", HeatStructurePlate);
      13             : 
      14             : InputParameters
      15         422 : HeatStructurePlate::validParams()
      16             : {
      17         422 :   InputParameters params = HeatStructureBase::validParams();
      18             : 
      19         844 :   params.addRequiredParam<std::vector<std::string>>("names", "Name of each transverse region");
      20         844 :   params.addRequiredParam<std::vector<Real>>("widths", "Width of each transverse region [m]");
      21         844 :   params.addRequiredParam<std::vector<unsigned int>>(
      22             :       "n_part_elems", "Number of elements of each transverse region");
      23         844 :   params.addParam<std::vector<UserObjectName>>(
      24             :       "solid_properties", "Solid properties object name for each radial region");
      25         844 :   params.addParam<std::vector<Real>>(
      26             :       "solid_properties_T_ref",
      27             :       {},
      28             :       "Density reference temperatures for each radial region. This is required if "
      29             :       "'solid_properties' is provided. The density in each region will be a constant value "
      30             :       "computed by evaluating the density function at the reference temperature.");
      31         844 :   params.addParam<Real>("num_rods", 1.0, "Number of rods represented by this heat structure");
      32         844 :   params.addRequiredParam<Real>("depth", "Dimension of plate fuel in the third direction [m]");
      33             : 
      34         422 :   params.addClassDescription("Plate heat structure");
      35             : 
      36         422 :   return params;
      37           0 : }
      38             : 
      39         210 : HeatStructurePlate::HeatStructurePlate(const InputParameters & params)
      40         420 :   : HeatStructureBase(params), _depth(getParam<Real>("depth"))
      41             : {
      42         630 :   _names = getParam<std::vector<std::string>>("names");
      43         210 :   _n_regions = _names.size();
      44         482 :   for (unsigned int i = 0; i < _names.size(); i++)
      45         272 :     _name_index[_names[i]] = i;
      46             : 
      47         630 :   _width = getParam<std::vector<Real>>("widths");
      48         210 :   _total_width = std::accumulate(_width.begin(), _width.end(), 0.0);
      49             : 
      50         420 :   _n_part_elems = getParam<std::vector<unsigned int>>("n_part_elems");
      51         482 :   for (unsigned int i = 0; i < _n_part_elems.size(); i++)
      52         272 :     _total_elem_number += _n_part_elems[i];
      53             : 
      54         420 :   _num_rods = getParam<Real>("num_rods");
      55             : 
      56         210 :   if (_width.size() == _n_regions)
      57             :   {
      58         482 :     for (unsigned int i = 0; i < _n_regions; i++)
      59         272 :       _volume.push_back(_num_rods * _width[i] * _depth * _length);
      60             :   }
      61         210 : }
      62             : 
      63             : void
      64         183 : HeatStructurePlate::check() const
      65             : {
      66         183 :   HeatStructureBase::check();
      67             : 
      68         366 :   checkEqualSize<std::string, unsigned int>("names", "n_part_elems");
      69         366 :   checkEqualSize<std::string, Real>("names", "widths");
      70         366 :   if (isParamValid("solid_properties"))
      71             :   {
      72         336 :     checkEqualSize<UserObjectName, std::string>("solid_properties", "names");
      73         336 :     checkEqualSize<UserObjectName, Real>("solid_properties", "solid_properties_T_ref");
      74             :   }
      75         183 : }
      76             : 
      77             : Real
      78         140 : HeatStructurePlate::getUnitPerimeter(const ExternalBoundaryType & side) const
      79             : {
      80         140 :   switch (side)
      81             :   {
      82         140 :     case ExternalBoundaryType::OUTER:
      83             :     case ExternalBoundaryType::INNER:
      84         140 :       return _depth;
      85             : 
      86             :     case ExternalBoundaryType::START:
      87             :     case ExternalBoundaryType::END:
      88             :       return std::numeric_limits<Real>::quiet_NaN();
      89             :   }
      90             : 
      91           0 :   mooseError(name(), ": Unknown value of 'side' parameter.");
      92             : }
      93             : 
      94             : Real
      95         598 : HeatStructurePlate::computeRadialBoundaryArea(const Real & length, const Real & /*y*/) const
      96             : {
      97         598 :   return length * _depth;
      98             : }
      99             : 
     100             : Real
     101         696 : HeatStructurePlate::computeAxialBoundaryArea(const Real & y_min, const Real & y_max) const
     102             : {
     103         696 :   return (y_max - y_min) * _depth;
     104             : }

Generated by: LCOV version 1.14