LCOV - code coverage report
Current view: top level - src/meshgenerators - SCMQuadSubChannelMeshGenerator.C (source / functions) Hit Total Coverage
Test: idaholab/moose subchannel: #31730 (e8b711) with base e0c998 Lines: 265 274 96.7 %
Date: 2025-10-29 16:55:46 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 "SCMQuadSubChannelMeshGenerator.h"
      11             : #include "QuadSubChannelMesh.h"
      12             : #include "libmesh/edge_edge2.h"
      13             : #include <numeric>
      14             : 
      15             : registerMooseObject("SubChannelApp", SCMQuadSubChannelMeshGenerator);
      16             : registerMooseObjectRenamed("SubChannelApp",
      17             :                            QuadSubChannelMeshGenerator,
      18             :                            "06/30/2025 24:00",
      19             :                            SCMQuadSubChannelMeshGenerator);
      20             : 
      21             : InputParameters
      22         632 : SCMQuadSubChannelMeshGenerator::validParams()
      23             : {
      24         632 :   InputParameters params = MeshGenerator::validParams();
      25         632 :   params.addClassDescription("Creates a mesh of 1D subchannels in a square lattice arrangement");
      26        1264 :   params.addRequiredParam<Real>("pitch", "Pitch [m]");
      27        1264 :   params.addRequiredParam<Real>("pin_diameter", "Rod diameter [m]");
      28        1264 :   params.addParam<Real>("unheated_length_entry", 0.0, "Unheated length at entry [m]");
      29        1264 :   params.addRequiredParam<Real>("heated_length", "Heated length [m]");
      30        1264 :   params.addParam<Real>("unheated_length_exit", 0.0, "Unheated length at exit [m]");
      31        1264 :   params.addParam<std::vector<Real>>(
      32             :       "spacer_z", {}, "Axial location of spacers/vanes/mixing_vanes [m]");
      33        1264 :   params.addParam<std::vector<Real>>(
      34             :       "spacer_k", {}, "K-loss coefficient of spacers/vanes/mixing_vanes [-]");
      35        1264 :   params.addParam<std::vector<Real>>("z_blockage",
      36        1264 :                                      std::vector<Real>({0.0, 0.0}),
      37             :                                      "axial location of blockage (inlet, outlet) [m]");
      38        1264 :   params.addParam<std::vector<unsigned int>>("index_blockage",
      39        1264 :                                              std::vector<unsigned int>({0}),
      40             :                                              "index of subchannels affected by blockage");
      41        1264 :   params.addParam<std::vector<Real>>(
      42             :       "reduction_blockage",
      43        1264 :       std::vector<Real>({1.0}),
      44             :       "Area reduction of subchannels affected by blockage (number to muliply the area)");
      45        1264 :   params.addParam<std::vector<Real>>("k_blockage",
      46        1264 :                                      std::vector<Real>({0.0}),
      47             :                                      "Form loss coefficient of subchannels affected by blockage");
      48             : 
      49        1264 :   params.addParam<Real>("Kij", 0.5, "Lateral form loss coefficient [-]");
      50        1264 :   params.addRequiredParam<unsigned int>("n_cells", "The number of cells in the axial direction");
      51        1264 :   params.addRequiredParam<unsigned int>("nx", "Number of channels in the x direction [-]");
      52        1264 :   params.addRequiredParam<unsigned int>("ny", "Number of channels in the y direction [-]");
      53        1264 :   params.addRequiredParam<Real>(
      54             :       "gap",
      55             :       "The side gap, not to be confused with the gap between pins, this refers to the gap "
      56             :       "next to the duct or else the distance between the subchannel centroid to the duct wall."
      57             :       "distance(edge pin center, duct wall) = pitch / 2 + side_gap [m]");
      58        1264 :   params.deprecateParam("gap", "side_gap", "08/06/2026");
      59        1264 :   params.addParam<unsigned int>("block_id", 0, "Domain Index");
      60         632 :   return params;
      61           0 : }
      62             : 
      63         317 : SCMQuadSubChannelMeshGenerator::SCMQuadSubChannelMeshGenerator(const InputParameters & params)
      64             :   : MeshGenerator(params),
      65         317 :     _unheated_length_entry(getParam<Real>("unheated_length_entry")),
      66         634 :     _heated_length(getParam<Real>("heated_length")),
      67         634 :     _unheated_length_exit(getParam<Real>("unheated_length_exit")),
      68         634 :     _spacer_z(getParam<std::vector<Real>>("spacer_z")),
      69         634 :     _spacer_k(getParam<std::vector<Real>>("spacer_k")),
      70         634 :     _z_blockage(getParam<std::vector<Real>>("z_blockage")),
      71         634 :     _index_blockage(getParam<std::vector<unsigned int>>("index_blockage")),
      72         634 :     _reduction_blockage(getParam<std::vector<Real>>("reduction_blockage")),
      73         634 :     _k_blockage(getParam<std::vector<Real>>("k_blockage")),
      74         634 :     _kij(getParam<Real>("Kij")),
      75         634 :     _pitch(getParam<Real>("pitch")),
      76         634 :     _pin_diameter(getParam<Real>("pin_diameter")),
      77         634 :     _n_cells(getParam<unsigned int>("n_cells")),
      78         634 :     _nx(getParam<unsigned int>("nx")),
      79         634 :     _ny(getParam<unsigned int>("ny")),
      80         317 :     _n_channels(_nx * _ny),
      81         317 :     _n_gaps((_nx - 1) * _ny + (_ny - 1) * _nx),
      82         317 :     _n_pins((_nx - 1) * (_ny - 1)),
      83         634 :     _side_gap(getParam<Real>("side_gap")),
      84         951 :     _block_id(getParam<unsigned int>("block_id"))
      85             : {
      86         317 :   if (_spacer_z.size() != _spacer_k.size())
      87           0 :     mooseError(name(), ": Size of vector spacer_z should be equal to size of vector spacer_k");
      88             : 
      89         317 :   if (_spacer_z.size() &&
      90         281 :       _spacer_z.back() > _unheated_length_entry + _heated_length + _unheated_length_exit)
      91           0 :     mooseError(name(), ": Location of spacers should be less than the total bundle length");
      92             : 
      93         317 :   if (_z_blockage.size() != 2)
      94           0 :     mooseError(name(), ": Size of vector z_blockage must be 2");
      95             : 
      96         317 :   if (*max_element(_index_blockage.begin(), _index_blockage.end()) > (_n_channels - 1))
      97           0 :     mooseError(name(),
      98             :                ": The index of the blocked subchannel cannot be more than the max index of the "
      99             :                "subchannels");
     100             : 
     101         317 :   if (*max_element(_reduction_blockage.begin(), _reduction_blockage.end()) > 1)
     102           0 :     mooseError(name(), ": The area reduction of the blocked subchannels cannot be more than 1");
     103             : 
     104         317 :   if ((_index_blockage.size() > _nx * _ny) || (_reduction_blockage.size() > _nx * _ny) ||
     105             :       (_k_blockage.size() > _nx * _ny))
     106           0 :     mooseError(name(),
     107             :                ": Size of vectors: index_blockage, reduction_blockage, k_blockage, cannot be more "
     108             :                "than the total number of subchannels");
     109             : 
     110         317 :   if ((_index_blockage.size() != _reduction_blockage.size()) ||
     111         634 :       (_index_blockage.size() != _k_blockage.size()) ||
     112             :       (_reduction_blockage.size() != _k_blockage.size()))
     113           0 :     mooseError(name(),
     114             :                ": Size of vectors: index_blockage, reduction_blockage, k_blockage, must be equal "
     115             :                "to eachother");
     116             : 
     117         317 :   if (_nx < 2 && _ny < 2)
     118           2 :     mooseError(name(),
     119             :                ": The number of subchannels cannot be less than 2 in both directions (x and y). "
     120             :                "Smallest assembly allowed is either 2X1 or 1X2. ");
     121             : 
     122         315 :   SubChannelMesh::generateZGrid(
     123         315 :       _unheated_length_entry, _heated_length, _unheated_length_exit, _n_cells, _z_grid);
     124             : 
     125             :   // Defining the total length from 3 axial sections
     126         315 :   Real L = _unheated_length_entry + _heated_length + _unheated_length_exit;
     127             : 
     128             :   // Defining the position of the spacer grid in the numerical solution array
     129             :   std::vector<int> spacer_cell;
     130         939 :   for (const auto & elem : _spacer_z)
     131         624 :     spacer_cell.emplace_back(std::round(elem * _n_cells / L));
     132             : 
     133             :   // Defining the arrays for axial resistances
     134             :   std::vector<Real> kgrid;
     135         315 :   kgrid.resize(_n_cells + 1, 0.0);
     136         315 :   _k_grid.resize(_n_channels, std::vector<Real>(_n_cells + 1));
     137             : 
     138             :   // Summing the spacer resistance to the 1D grid resistance array
     139         939 :   for (unsigned int index = 0; index < spacer_cell.size(); index++)
     140         624 :     kgrid[spacer_cell[index]] += _spacer_k[index];
     141             : 
     142             :   // Creating the 2D grid resistance array
     143        6131 :   for (unsigned int i = 0; i < _n_channels; i++)
     144        5816 :     _k_grid[i] = kgrid;
     145             : 
     146             :   // Add blockage resistance to the 2D grid resistane array
     147         315 :   Real dz = L / _n_cells;
     148        7244 :   for (unsigned int i = 0; i < _n_cells + 1; i++)
     149             :   {
     150        6929 :     if ((dz * i >= _z_blockage.front() && dz * i <= _z_blockage.back()))
     151             :     {
     152             :       unsigned int index(0);
     153         630 :       for (const auto & i_ch : _index_blockage)
     154             :       {
     155         315 :         _k_grid[i_ch][i] += _k_blockage[index];
     156         315 :         index++;
     157             :       }
     158             :     }
     159             :   }
     160             : 
     161             :   // Defining the size of the maps
     162         315 :   _gap_to_chan_map.resize(_n_gaps);
     163         315 :   _gap_to_pin_map.resize(_n_gaps);
     164         315 :   _gapnodes.resize(_n_gaps);
     165         315 :   _chan_to_gap_map.resize(_n_channels);
     166         315 :   _chan_to_pin_map.resize(_n_channels);
     167         315 :   _pin_to_chan_map.resize(_n_pins);
     168         315 :   _sign_id_crossflow_map.resize(_n_channels);
     169         315 :   _gij_map.resize(_n_cells + 1);
     170         315 :   _subchannel_position.resize(_n_channels);
     171             : 
     172        6131 :   for (unsigned int i = 0; i < _n_channels; i++)
     173             :   {
     174        5816 :     _subchannel_position[i].reserve(3);
     175       23264 :     for (unsigned int j = 0; j < 3; j++)
     176             :     {
     177       17448 :       _subchannel_position.at(i).push_back(0.0);
     178             :     }
     179             :   }
     180             : 
     181        7244 :   for (unsigned int iz = 0; iz < _n_cells + 1; iz++)
     182             :   {
     183        6929 :     _gij_map[iz].reserve(_n_gaps);
     184             :   }
     185             : 
     186             :   // Defining the signs for positive and negative flows
     187         315 :   Real positive_flow = 1.0;
     188         315 :   Real negative_flow = -1.0;
     189             : 
     190             :   // Defining the subchannel types
     191         315 :   _subch_type.resize(_n_channels);
     192        1537 :   for (unsigned int iy = 0; iy < _ny; iy++)
     193             :   {
     194        7038 :     for (unsigned int ix = 0; ix < _nx; ix++)
     195             :     {
     196        5816 :       unsigned int i_ch = _nx * iy + ix;
     197        5501 :       bool is_corner = (ix == 0 && iy == 0) || (ix == _nx - 1 && iy == 0) ||
     198       11008 :                        (ix == 0 && iy == _ny - 1) || (ix == _nx - 1 && iy == _ny - 1);
     199        5816 :       bool is_edge = (ix == 0 || iy == 0 || ix == _nx - 1 || iy == _ny - 1);
     200             : 
     201        5816 :       if (_n_channels == 2)
     202             :       {
     203          36 :         _subch_type[i_ch] = EChannelType::CENTER;
     204             :       }
     205        5780 :       else if (_n_channels == 4)
     206             :       {
     207         128 :         _subch_type[i_ch] = EChannelType::CORNER;
     208             :       }
     209             :       else
     210             :       {
     211        5652 :         if (is_corner)
     212        1060 :           _subch_type[i_ch] = EChannelType::CORNER;
     213        4592 :         else if (is_edge)
     214        2560 :           _subch_type[i_ch] = EChannelType::EDGE;
     215             :         else
     216        2032 :           _subch_type[i_ch] = EChannelType::CENTER;
     217             :       }
     218             :     }
     219             :   }
     220             : 
     221             :   // Index the east-west gaps.
     222         315 :   unsigned int i_gap = 0;
     223        1537 :   for (unsigned int iy = 0; iy < _ny; iy++)
     224             :   {
     225        5816 :     for (unsigned int ix = 0; ix < _nx - 1; ix++)
     226             :     {
     227        4594 :       unsigned int i_ch = _nx * iy + ix;
     228        4594 :       unsigned int j_ch = _nx * iy + (ix + 1);
     229        4594 :       _gap_to_chan_map[i_gap] = {i_ch, j_ch};
     230        4594 :       _chan_to_gap_map[i_ch].push_back(i_gap);
     231        4594 :       _chan_to_gap_map[j_ch].push_back(i_gap);
     232        4594 :       _sign_id_crossflow_map[i_ch].push_back(positive_flow);
     233        4594 :       _sign_id_crossflow_map[j_ch].push_back(negative_flow);
     234             : 
     235             :       // make a gap size map
     236        4594 :       if (iy == 0 || iy == _ny - 1)
     237        1958 :         _gij_map[0].push_back((_pitch - _pin_diameter) / 2 + _side_gap);
     238             :       else
     239        2636 :         _gij_map[0].push_back(_pitch - _pin_diameter);
     240        4594 :       ++i_gap;
     241             :     }
     242             :   }
     243             : 
     244             :   // Index the north-south gaps.
     245        1222 :   for (unsigned int iy = 0; iy < _ny - 1; iy++)
     246             :   {
     247        5423 :     for (unsigned int ix = 0; ix < _nx; ix++)
     248             :     {
     249        4516 :       unsigned int i_ch = _nx * iy + ix;
     250        4516 :       unsigned int j_ch = _nx * (iy + 1) + ix;
     251        4516 :       _gap_to_chan_map[i_gap] = {i_ch, j_ch};
     252        4516 :       _chan_to_gap_map[i_ch].push_back(i_gap);
     253        4516 :       _chan_to_gap_map[j_ch].push_back(i_gap);
     254        4516 :       _sign_id_crossflow_map[i_ch].push_back(positive_flow);
     255        4516 :       _sign_id_crossflow_map[j_ch].push_back(negative_flow);
     256             : 
     257             :       // make a gap size map
     258        4516 :       if (ix == 0 || ix == _nx - 1)
     259        1808 :         _gij_map[0].push_back((_pitch - _pin_diameter) / 2 + _side_gap);
     260             :       else
     261        2708 :         _gij_map[0].push_back(_pitch - _pin_diameter);
     262        4516 :       ++i_gap;
     263             :     }
     264             :   }
     265             : 
     266        6929 :   for (unsigned int iz = 1; iz < _n_cells + 1; iz++)
     267             :   {
     268        6614 :     _gij_map[iz] = _gij_map[0];
     269             :   }
     270             : 
     271             :   // Make pin to channel map
     272        1222 :   for (unsigned int iy = 0; iy < _ny - 1; iy++)
     273             :   {
     274        4516 :     for (unsigned int ix = 0; ix < _nx - 1; ix++)
     275             :     {
     276        3609 :       unsigned int i_pin = (_nx - 1) * iy + ix;
     277        3609 :       unsigned int i_chan_1 = _nx * iy + ix;
     278        3609 :       unsigned int i_chan_2 = _nx * (iy + 1) + ix;
     279        3609 :       unsigned int i_chan_3 = _nx * (iy + 1) + (ix + 1);
     280        3609 :       unsigned int i_chan_4 = _nx * iy + (ix + 1);
     281        3609 :       _pin_to_chan_map[i_pin].push_back(i_chan_1);
     282        3609 :       _pin_to_chan_map[i_pin].push_back(i_chan_2);
     283        3609 :       _pin_to_chan_map[i_pin].push_back(i_chan_3);
     284        3609 :       _pin_to_chan_map[i_pin].push_back(i_chan_4);
     285             :     }
     286             :   }
     287             : 
     288             :   // Make channel to pin map
     289        1537 :   for (unsigned int iy = 0; iy < _ny; iy++) // row
     290             :   {
     291        7038 :     for (unsigned int ix = 0; ix < _nx; ix++) // column
     292             :     {
     293        5816 :       unsigned int i_ch = _nx * iy + ix;
     294             :       // Corners contact 1/4 of one pin
     295        5816 :       if (iy == 0 && ix == 0)
     296             :       {
     297         315 :         _chan_to_pin_map[i_ch].push_back((_nx - 1) * iy + ix);
     298             :       }
     299        5501 :       else if (iy == _ny - 1 && ix == 0)
     300             :       {
     301         303 :         _chan_to_pin_map[i_ch].push_back((_nx - 1) * (iy - 1) + ix);
     302             :       }
     303        5198 :       else if (iy == 0 && ix == _nx - 1)
     304             :       {
     305         309 :         _chan_to_pin_map[i_ch].push_back((_nx - 1) * iy + ix - 1);
     306             :       }
     307        4889 :       else if (iy == _ny - 1 && ix == _nx - 1)
     308             :       {
     309         297 :         _chan_to_pin_map[i_ch].push_back((_nx - 1) * (iy - 1) + ix - 1);
     310             :       }
     311             :       // Sides contact 1/4 of two pins
     312        4592 :       else if (iy == 0)
     313             :       {
     314         676 :         _chan_to_pin_map[i_ch].push_back((_nx - 1) * iy + ix);
     315         676 :         _chan_to_pin_map[i_ch].push_back((_nx - 1) * iy + ix - 1);
     316             :       }
     317        3916 :       else if (iy == _ny - 1)
     318             :       {
     319         676 :         _chan_to_pin_map[i_ch].push_back((_nx - 1) * (iy - 1) + ix);
     320         676 :         _chan_to_pin_map[i_ch].push_back((_nx - 1) * (iy - 1) + ix - 1);
     321             :       }
     322        3240 :       else if (ix == 0)
     323             :       {
     324         604 :         _chan_to_pin_map[i_ch].push_back((_nx - 1) * iy + ix);
     325         604 :         _chan_to_pin_map[i_ch].push_back((_nx - 1) * (iy - 1) + ix);
     326             :       }
     327        2636 :       else if (ix == _nx - 1)
     328             :       {
     329         604 :         _chan_to_pin_map[i_ch].push_back((_nx - 1) * iy + ix - 1);
     330         604 :         _chan_to_pin_map[i_ch].push_back((_nx - 1) * (iy - 1) + ix - 1);
     331             :       }
     332             :       // interior contacts 1/4 of 4 pins
     333             :       else
     334             :       {
     335        2032 :         _chan_to_pin_map[i_ch].push_back((_nx - 1) * iy + ix);
     336        2032 :         _chan_to_pin_map[i_ch].push_back((_nx - 1) * iy + ix - 1);
     337        2032 :         _chan_to_pin_map[i_ch].push_back((_nx - 1) * (iy - 1) + ix);
     338        2032 :         _chan_to_pin_map[i_ch].push_back((_nx - 1) * (iy - 1) + ix - 1);
     339             :       }
     340             : 
     341             :       // set the subchannel positions
     342        5816 :       Real offset_x = (_nx - 1) * _pitch / 2.0;
     343        5816 :       Real offset_y = (_ny - 1) * _pitch / 2.0;
     344        5816 :       _subchannel_position[i_ch][0] = _pitch * ix - offset_x;
     345        5816 :       _subchannel_position[i_ch][1] = _pitch * iy - offset_y;
     346             :     }
     347             :   }
     348             : 
     349             :   // Make gap to pin map
     350        9425 :   for (unsigned int i_gap = 0; i_gap < _n_gaps; i_gap++)
     351             :   {
     352        9110 :     auto i_ch = _gap_to_chan_map[i_gap].first;
     353        9110 :     auto j_ch = _gap_to_chan_map[i_gap].second;
     354        9110 :     auto i_pins = _chan_to_pin_map[i_ch];
     355        9110 :     auto j_pins = _chan_to_pin_map[j_ch];
     356             :     _gap_to_pin_map[i_gap] = {10000, 10000}; // Initialize with default values
     357             : 
     358       34252 :     for (unsigned int i : i_pins)
     359             :     {
     360      100552 :       for (unsigned int j : j_pins)
     361             :       {
     362       75410 :         if (i == j)
     363             :         {
     364       14454 :           if (_gap_to_pin_map[i_gap].first == 10000)
     365             :           {
     366        9110 :             _gap_to_pin_map[i_gap].first = i;
     367        9110 :             _gap_to_pin_map[i_gap].second = i;
     368             :           }
     369             :           else
     370             :           {
     371        5344 :             _gap_to_pin_map[i_gap].second = i;
     372             :           }
     373             :         }
     374             :       }
     375             :     }
     376        9110 :   }
     377             : 
     378             :   // Reduce reserved memory in the channel-to-gap map.
     379        6131 :   for (auto & gap : _chan_to_gap_map)
     380             :     gap.shrink_to_fit();
     381             : 
     382             :   // Reduce reserved memory in the channel-to-pin map.
     383        6131 :   for (auto & pin : _chan_to_pin_map)
     384             :     pin.shrink_to_fit();
     385             : 
     386             :   // Reduce reserved memory in the pin-to-channel map.
     387        3924 :   for (auto & pin : _pin_to_chan_map)
     388             :     pin.shrink_to_fit();
     389         315 : }
     390             : 
     391             : std::unique_ptr<MeshBase>
     392         315 : SCMQuadSubChannelMeshGenerator::generate()
     393             : {
     394         315 :   auto mesh_base = buildMeshBaseObject();
     395             :   BoundaryInfo & boundary_info = mesh_base->get_boundary_info();
     396         315 :   mesh_base->set_spatial_dimension(3);
     397         315 :   mesh_base->reserve_elem(_n_cells * _ny * _nx);
     398         315 :   mesh_base->reserve_nodes((_n_cells + 1) * _ny * _nx);
     399         315 :   _nodes.resize(_nx * _ny);
     400             :   // Add the points in the shape of a rectilinear grid.  The grid is regular
     401             :   // on the xy-plane with a spacing of `pitch` between points.  The grid along
     402             :   // z is irregular to account for Pin spacers.  Store pointers in the _nodes
     403             :   // array so we can keep track of which points are in which channels.
     404         315 :   Real offset_x = (_nx - 1) * _pitch / 2.0;
     405         315 :   Real offset_y = (_ny - 1) * _pitch / 2.0;
     406             :   unsigned int node_id = 0;
     407        1537 :   for (unsigned int iy = 0; iy < _ny; iy++)
     408             :   {
     409        7038 :     for (unsigned int ix = 0; ix < _nx; ix++)
     410             :     {
     411        5816 :       int i_ch = _nx * iy + ix;
     412        5816 :       _nodes[i_ch].reserve(_n_cells);
     413      116061 :       for (unsigned int iz = 0; iz < _n_cells + 1; iz++)
     414             :       {
     415      110245 :         _nodes[i_ch].push_back(mesh_base->add_point(
     416      220490 :             Point(_pitch * ix - offset_x, _pitch * iy - offset_y, _z_grid[iz]), node_id++));
     417             :       }
     418             :     }
     419             :   }
     420             : 
     421             :   // Add the elements which in this case are 2-node edges that link each
     422             :   // subchannel's nodes vertically.
     423             :   unsigned int elem_id = 0;
     424        1537 :   for (unsigned int iy = 0; iy < _ny; iy++)
     425             :   {
     426        7038 :     for (unsigned int ix = 0; ix < _nx; ix++)
     427             :     {
     428      110245 :       for (unsigned int iz = 0; iz < _n_cells; iz++)
     429             :       {
     430      104429 :         Elem * elem = new Edge2;
     431      104429 :         elem->subdomain_id() = _block_id;
     432      104429 :         elem->set_id(elem_id++);
     433      104429 :         elem = mesh_base->add_elem(elem);
     434      104429 :         const int indx1 = ((_n_cells + 1) * _nx) * iy + (_n_cells + 1) * ix + iz;
     435      104429 :         const int indx2 = ((_n_cells + 1) * _nx) * iy + (_n_cells + 1) * ix + (iz + 1);
     436      104429 :         elem->set_node(0, mesh_base->node_ptr(indx1));
     437      104429 :         elem->set_node(1, mesh_base->node_ptr(indx2));
     438             : 
     439      104429 :         if (iz == 0)
     440        5816 :           boundary_info.add_side(elem, 0, 0);
     441      104429 :         if (iz == _n_cells - 1)
     442        5816 :           boundary_info.add_side(elem, 1, 1);
     443             :       }
     444             :     }
     445             :   }
     446             : 
     447         315 :   boundary_info.sideset_name(0) = "inlet";
     448         315 :   boundary_info.sideset_name(1) = "outlet";
     449         315 :   boundary_info.nodeset_name(0) = "inlet";
     450         315 :   boundary_info.nodeset_name(1) = "outlet";
     451         315 :   mesh_base->subdomain_name(_block_id) = name();
     452         315 :   mesh_base->prepare_for_use();
     453             : 
     454             :   // move the meta data into QuadSubChannelMesh
     455         315 :   auto & sch_mesh = static_cast<QuadSubChannelMesh &>(*_mesh);
     456         315 :   sch_mesh._unheated_length_entry = _unheated_length_entry;
     457         315 :   sch_mesh._heated_length = _heated_length;
     458         315 :   sch_mesh._unheated_length_exit = _unheated_length_exit;
     459         315 :   sch_mesh._z_grid = _z_grid;
     460         315 :   sch_mesh._k_grid = _k_grid;
     461         315 :   sch_mesh._spacer_z = _spacer_z;
     462         315 :   sch_mesh._spacer_k = _spacer_k;
     463         315 :   sch_mesh._z_blockage = _z_blockage;
     464         315 :   sch_mesh._index_blockage = _index_blockage;
     465         315 :   sch_mesh._reduction_blockage = _reduction_blockage;
     466         315 :   sch_mesh._kij = _kij;
     467         315 :   sch_mesh._pitch = _pitch;
     468         315 :   sch_mesh._pin_diameter = _pin_diameter;
     469         315 :   sch_mesh._n_cells = _n_cells;
     470         315 :   sch_mesh._nx = _nx;
     471         315 :   sch_mesh._ny = _ny;
     472         315 :   sch_mesh._n_channels = _n_channels;
     473         315 :   sch_mesh._n_gaps = _n_gaps;
     474         315 :   sch_mesh._n_pins = _n_pins;
     475         315 :   sch_mesh._side_gap = _side_gap;
     476         315 :   sch_mesh._nodes = _nodes;
     477         315 :   sch_mesh._gapnodes = _gapnodes;
     478         315 :   sch_mesh._gap_to_chan_map = _gap_to_chan_map;
     479         315 :   sch_mesh._gap_to_pin_map = _gap_to_pin_map;
     480         315 :   sch_mesh._chan_to_gap_map = _chan_to_gap_map;
     481         315 :   sch_mesh._chan_to_pin_map = _chan_to_pin_map;
     482         315 :   sch_mesh._pin_to_chan_map = _pin_to_chan_map;
     483         315 :   sch_mesh._sign_id_crossflow_map = _sign_id_crossflow_map;
     484         315 :   sch_mesh._gij_map = _gij_map;
     485         315 :   sch_mesh._subchannel_position = _subchannel_position;
     486         315 :   sch_mesh._subch_type = _subch_type;
     487             : 
     488         315 :   return mesh_base;
     489           0 : }

Generated by: LCOV version 1.14