LCOV - code coverage report
Current view: top level - include/meshgenerators - SCMDetailedTriAssemblyMeshGenerator.h (source / functions) Hit Total Coverage
Test: idaholab/moose subchannel: #33187 (5aa0b2) with base d7c4bd Lines: 4 4 100.0 %
Date: 2026-06-30 12:24:57 Functions: 0 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             : #pragma once
      11             : 
      12             : #include "MeshGenerator.h"
      13             : #include "SubChannelEnums.h"
      14             : 
      15             : /**
      16             :  * Mesh generator that builds a 3D mesh representing triangular subchannels and pins
      17             :  */
      18             : class SCMDetailedTriAssemblyMeshGenerator : public MeshGenerator
      19             : {
      20             : public:
      21             :   SCMDetailedTriAssemblyMeshGenerator(const InputParameters & parameters);
      22             :   virtual std::unique_ptr<MeshBase> generate() override;
      23             : 
      24             : protected:
      25             :   /// returns the type of the subchannel given the index
      26        3204 :   EChannelType getSubchannelType(unsigned int index) const { return _subch_type[index]; }
      27             :   /// rotate a point by theta radians about the origin
      28             :   Point rotatePoint(Point b, Real theta);
      29             :   /// Generate one detailed fuel pin volume centered at the supplied point.
      30             :   void generatePin(std::unique_ptr<MeshBase> & mesh_base, const Point & center);
      31             :   /// returns the position of pin given pin index
      32       56322 :   Point getPinPosition(unsigned int i) { return _pin_position[i]; }
      33             :   /// returns the position of subchannel given pin index
      34       56322 :   std::vector<Real> getSubchannelPosition(unsigned int i) { return _subchannel_position[i]; }
      35             :   /// returns the index of neighboring pins given subchannel index
      36       56616 :   std::vector<unsigned int> getSubChannelPins(unsigned int i) { return _chan_to_pin_map[i]; }
      37             : 
      38             :   /// unheated length of the fuel Pin at the entry of the assembly
      39             :   const Real _unheated_length_entry;
      40             :   /// heated length of the fuel Pin
      41             :   const Real _heated_length;
      42             :   /// unheated length of the fuel Pin at the exit of the assembly
      43             :   const Real _unheated_length_exit;
      44             :   /// axial location of nodes
      45             :   std::vector<Real> _z_grid;
      46             :   /// Distance between the neighbor fuel pins, pitch
      47             :   const Real _pitch;
      48             :   /// fuel Pin diameter
      49             :   const Real _pin_diameter;
      50             :   /// Number of rings in the geometry
      51             :   const unsigned int _n_rings;
      52             :   /// Half of gap between adjacent assemblies
      53             :   const Real _flat_to_flat;
      54             :   /// Number of azimuthal sectors used to discretize each circular pin cross section
      55             :   const unsigned int _num_sectors;
      56             :   /// Subchannel type
      57             :   std::vector<EChannelType> _subch_type;
      58             :   /// x,y coordinates of the fuel pins
      59             :   std::vector<Point> _pin_position;
      60             :   /// x,y coordinates of the subchannels
      61             :   std::vector<std::vector<Real>> _subchannel_position;
      62             :   /// Subchannel subdomain ID
      63             :   const unsigned int _subchannel_block_id;
      64             :   /// Pin subdomain ID
      65             :   const unsigned int _pin_block_id;
      66             :   /// Number of cells in the axial direction
      67             :   const unsigned int _n_cells;
      68             :   /// Number of pins
      69             :   unsigned int _nrods;
      70             :   /// fuel pins that are belonging to each ring
      71             :   std::vector<std::vector<unsigned int>> _pins_in_rings;
      72             :   /// map inner and outer rings
      73             :   std::map<unsigned int, Real> _orientation_map;
      74             :   /// number of subchannels
      75             :   unsigned int _n_channels;
      76             :   /// stores the fuel pins belonging to each subchannel
      77             :   std::vector<std::vector<unsigned int>> _chan_to_pin_map;
      78             :   /// Flag to print out the detailed mesh assembly and coordinates
      79             :   const bool _verbose;
      80             :   /// counter for element numbering
      81             :   dof_id_type _elem_id;
      82             : 
      83             : public:
      84             :   static InputParameters validParams();
      85             : };

Generated by: LCOV version 1.14