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 17 : */ 18 : class SCMDetailedTriSubChannelMeshGenerator : public MeshGenerator 19 : { 20 : public: 21 : SCMDetailedTriSubChannelMeshGenerator(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 3960 : EChannelType getSubchannelType(unsigned int index) const { return _subch_type[index]; } 27 : Point rotatePoint(Point b, Real theta); 28 : Point translatePoint(Point & b, Point & translation_vector); 29 : /// returns the position of pin given pin index 30 61740 : Point getPinPosition(unsigned int i) { return _pin_position[i]; } 31 : /// returns the position of subchannel given pin index 32 61740 : std::vector<Real> getSubchannelPosition(unsigned int i) { return _subchannel_position[i]; } 33 : /// returns the index of neighboring pins given subchannel index 34 62118 : std::vector<unsigned int> getSubChannelPins(unsigned int i) { return _chan_to_pin_map[i]; } 35 : 36 : /// unheated length of the fuel Pin at the entry of the assembly 37 : const Real _unheated_length_entry; 38 : /// heated length of the fuel Pin 39 : const Real _heated_length; 40 : /// unheated length of the fuel Pin at the exit of the assembly 41 : const Real _unheated_length_exit; 42 : /// axial location of nodes 43 : std::vector<Real> _z_grid; 44 : /// Distance between the neighbor fuel pins, pitch 45 : const Real _pitch; 46 : /// fuel Pin diameter 47 : const Real _pin_diameter; 48 : /// Number of rings in the geometry 49 : const unsigned int _n_rings; 50 : /// Half of gap between adjacent assemblies 51 : const Real _flat_to_flat; 52 : /// Subchannel type 53 : std::vector<EChannelType> _subch_type; 54 : /// x,y coordinates of the fuel pins 55 : std::vector<Point> _pin_position; 56 : /// x,y coordinates of the subchannels 57 : std::vector<std::vector<Real>> _subchannel_position; 58 : /// Subdomain ID used for the mesh block 59 : const unsigned int & _block_id; 60 : /// Number of cells in the axial direction 61 : const unsigned int _n_cells; 62 : /// Number of pins 63 : unsigned int _nrods; 64 : /// fuel pins that are belonging to each ring 65 : std::vector<std::vector<unsigned int>> _pins_in_rings; 66 : /// map inner and outer rings 67 : std::map<unsigned int, Real> _orientation_map; 68 : /// number of subchannels 69 : unsigned int _n_channels; 70 : /// stores the fuel pins belonging to each subchannel 71 : std::vector<std::vector<unsigned int>> _chan_to_pin_map; 72 : /// Flag to print out the detailed mesh assembly and coordinates 73 : const bool _verbose; 74 : 75 : public: 76 : static InputParameters validParams(); 77 : };