LCOV - code coverage report
Current view: top level - src/components - HeatStructurePlate.C (source / functions) Hit Total Coverage
Test: idaholab/moose thermal_hydraulics: #30301 (3b550b) with base 2ad78d Lines: 49 51 96.1 %
Date: 2025-07-30 13:02:48 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         746 : HeatStructurePlate::validParams()
      16             : {
      17         746 :   InputParameters params = HeatStructureBase::validParams();
      18             : 
      19        1492 :   params.addRequiredParam<std::vector<std::string>>("names", "Name of each transverse region");
      20        1492 :   params.addRequiredParam<std::vector<Real>>("widths", "Width of each transverse region [m]");
      21        1492 :   params.addRequiredParam<std::vector<unsigned int>>(
      22             :       "n_part_elems", "Number of elements of each transverse region");
      23        1492 :   params.addDeprecatedParam<std::vector<std::string>>(
      24             :       "materials",
      25             :       "Material name for each transverse region",
      26             :       "HeatStructureMaterials are deprecated. Please make corresponding SolidProperties objects "
      27             :       "and replace the heat structure parameter 'materials' with the parameters 'solid_properties' "
      28             :       "and 'solid_properties_T_ref'. See heat structure documentation for more information.");
      29        1492 :   params.addParam<std::vector<UserObjectName>>(
      30             :       "solid_properties", "Solid properties object name for each radial region");
      31        1492 :   params.addParam<std::vector<Real>>(
      32             :       "solid_properties_T_ref",
      33             :       {},
      34             :       "Density reference temperatures for each radial region. This is required if "
      35             :       "'solid_properties' is provided. The density in each region will be a constant value "
      36             :       "computed by evaluating the density function at the reference temperature.");
      37        1492 :   params.addParam<Real>("num_rods", 1.0, "Number of rods represented by this heat structure");
      38        1492 :   params.addRequiredParam<Real>("depth", "Dimension of plate fuel in the third direction [m]");
      39             : 
      40         746 :   params.addClassDescription("Plate heat structure");
      41             : 
      42         746 :   return params;
      43           0 : }
      44             : 
      45         372 : HeatStructurePlate::HeatStructurePlate(const InputParameters & params)
      46         744 :   : HeatStructureBase(params), _depth(getParam<Real>("depth"))
      47             : {
      48        1116 :   _names = getParam<std::vector<std::string>>("names");
      49         372 :   _n_regions = _names.size();
      50         848 :   for (unsigned int i = 0; i < _names.size(); i++)
      51         476 :     _name_index[_names[i]] = i;
      52             : 
      53        1152 :   _material_names = isParamValid("materials") ? getParam<std::vector<std::string>>("materials")
      54         372 :                                               : std::vector<std::string>{};
      55             : 
      56        1116 :   _width = getParam<std::vector<Real>>("widths");
      57         372 :   _total_width = std::accumulate(_width.begin(), _width.end(), 0.0);
      58             : 
      59         744 :   _n_part_elems = getParam<std::vector<unsigned int>>("n_part_elems");
      60         848 :   for (unsigned int i = 0; i < _n_part_elems.size(); i++)
      61         476 :     _total_elem_number += _n_part_elems[i];
      62             : 
      63         744 :   _num_rods = getParam<Real>("num_rods");
      64             : 
      65         372 :   if (_width.size() == _n_regions)
      66             :   {
      67         848 :     for (unsigned int i = 0; i < _n_regions; i++)
      68         476 :       _volume.push_back(_num_rods * _width[i] * _depth * _length);
      69             :   }
      70         372 : }
      71             : 
      72             : void
      73         335 : HeatStructurePlate::check() const
      74             : {
      75         335 :   HeatStructureBase::check();
      76             : 
      77         670 :   checkEqualSize<std::string, unsigned int>("names", "n_part_elems");
      78         670 :   checkEqualSize<std::string, Real>("names", "widths");
      79         670 :   if (isParamValid("materials"))
      80          36 :     checkEqualSize<std::string, std::string>("names", "materials");
      81         670 :   if (isParamValid("solid_properties"))
      82             :   {
      83         582 :     checkEqualSize<UserObjectName, std::string>("solid_properties", "names");
      84         582 :     checkEqualSize<UserObjectName, Real>("solid_properties", "solid_properties_T_ref");
      85             :   }
      86        1005 :   checkMutuallyExclusiveParameters({"materials", "solid_properties"}, false);
      87         670 : }
      88             : 
      89             : Real
      90         232 : HeatStructurePlate::getUnitPerimeter(const ExternalBoundaryType & side) const
      91             : {
      92         232 :   switch (side)
      93             :   {
      94         232 :     case ExternalBoundaryType::OUTER:
      95             :     case ExternalBoundaryType::INNER:
      96         232 :       return _depth;
      97             : 
      98             :     case ExternalBoundaryType::START:
      99             :     case ExternalBoundaryType::END:
     100             :       return std::numeric_limits<Real>::quiet_NaN();
     101             :   }
     102             : 
     103           0 :   mooseError(name(), ": Unknown value of 'side' parameter.");
     104             : }
     105             : 
     106             : Real
     107        1076 : HeatStructurePlate::computeRadialBoundaryArea(const Real & length, const Real & /*y*/) const
     108             : {
     109        1076 :   return length * _depth;
     110             : }
     111             : 
     112             : Real
     113        1212 : HeatStructurePlate::computeAxialBoundaryArea(const Real & y_min, const Real & y_max) const
     114             : {
     115        1212 :   return (y_max - y_min) * _depth;
     116             : }

Generated by: LCOV version 1.14