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 "InterWrapperMesh.h" 13 : #include "SubChannelEnums.h" 14 : 15 : /** 16 : * Creates the mesh of an inter-wrapper around square assemblies 17 : */ 18 : class QuadInterWrapperMesh : public InterWrapperMesh 19 : { 20 : public: 21 : QuadInterWrapperMesh(const InputParameters & parameters); 22 : QuadInterWrapperMesh(const QuadInterWrapperMesh & other_mesh); 23 : virtual std::unique_ptr<MooseMesh> safeClone() const override; 24 : virtual void buildMesh() override; 25 : 26 47647056 : virtual Node * getChannelNode(unsigned int i_chan, unsigned iz) const override 27 : { 28 47647056 : return _nodes[i_chan][iz]; 29 : } 30 : 31 0 : virtual Node * getPinNode(unsigned int i_pin, unsigned iz) const override 32 : { 33 0 : return _pin_nodes[i_pin][iz]; 34 : } 35 : 36 33 : virtual const unsigned int & getNumOfChannels() const override { return _n_channels; } 37 33 : virtual const unsigned int & getNumOfGapsPerLayer() const override { return _n_gaps; } 38 33 : virtual const unsigned int & getNumOfAssemblies() const override { return _n_assemblies; } 39 17313 : virtual bool pinMeshExist() const override { return false; } 40 0 : virtual bool ductMeshExist() const override { return false; } 41 : virtual const std::pair<unsigned int, unsigned int> & 42 9434880 : getGapChannels(unsigned int i_gap) const override 43 : { 44 9434880 : return _gap_to_chan_map[i_gap]; 45 : } 46 2823984 : virtual const std::vector<unsigned int> & getChannelGaps(unsigned int i_chan) const override 47 : { 48 2823984 : return _chan_to_gap_map[i_chan]; 49 : } 50 0 : virtual const std::vector<unsigned int> & getPinChannels(unsigned int i_pin) const override 51 : { 52 0 : return _pin_to_chan_map[i_pin]; 53 : } 54 17280 : virtual const std::vector<unsigned int> & getChannelPins(unsigned int i_chan) const override 55 : { 56 17280 : return _chan_to_pin_map[i_chan]; 57 : } 58 0 : virtual const std::vector<double> & getGapMap() const override { return _gij_map; } 59 24408 : virtual const Real & getPitch() const override { return _assembly_pitch; } 60 9412416 : virtual const Real & getCrossflowSign(unsigned int i_chan, unsigned int i_local) const override 61 : { 62 9412416 : return _sign_id_crossflow_map[i_chan][i_local]; 63 : } 64 : 65 : /// number of inter-wrapper channels in the -x direction 66 59 : virtual const unsigned int & getNx() const { return _nx; } 67 : /// number of inter-wrapper channels in the -y direction 68 59 : virtual const unsigned int & getNy() const { return _ny; } 69 17280 : Real getGap() const { return _side_bypass_length; } 70 : 71 : unsigned int getSubchannelIndexFromPoint(const Point & p) const override; 72 : virtual unsigned int channelIndex(const Point & point) const override; 73 : 74 : unsigned int getPinIndexFromPoint(const Point & p) const override; 75 : virtual unsigned int pinIndex(const Point & p) const override; 76 : 77 34560 : virtual EChannelType getSubchannelType(unsigned int index) const override 78 : { 79 34560 : return _subch_type[index]; 80 : } 81 : 82 : /// returns the size of the gap in the interface of between assemblies 83 4706640 : virtual Real getGapWidth(unsigned int gap_index) const override { return _gij_map[gap_index]; } 84 : 85 : protected: 86 : /// Number of assemblies in the -x direction 87 : unsigned int _nx; 88 : /// Number of assemblies in the -y direction 89 : unsigned int _ny; 90 : /// Number of subchannels 91 : unsigned int _n_channels; 92 : /// Number of gaps per layer 93 : unsigned int _n_gaps; 94 : /// Number of assemblies 95 : unsigned int _n_assemblies; 96 : Real _side_bypass_length; 97 : /// vector of subchannel nodes 98 : std::vector<std::vector<Node *>> _nodes; 99 : /// vector of fuel assembly nodes 100 : std::vector<std::vector<Node *>> _pin_nodes; 101 : /// vector of gap (interface between pairs of neighboring assemblies) nodes 102 : std::vector<std::vector<Node *>> _gapnodes; 103 : /// map relating gap index to subchannel index 104 : std::vector<std::pair<unsigned int, unsigned int>> _gap_to_chan_map; 105 : /// map relating subchannel index to gap index 106 : std::vector<std::vector<unsigned int>> _chan_to_gap_map; 107 : /// map relating subchannel index to assembly index 108 : std::vector<std::vector<unsigned int>> _chan_to_pin_map; 109 : /// map relating fuel assembly index to subchannel index 110 : std::vector<std::vector<unsigned int>> _pin_to_chan_map; 111 : /// Matrix used to give local sign to crossflow quantities 112 : std::vector<std::vector<double>> _sign_id_crossflow_map; 113 : /// Vector to store gap size 114 : std::vector<double> _gij_map; 115 : /// Subchannel type 116 : std::vector<EChannelType> _subch_type; 117 : /// Flag that informs the solver whether there is a Pin Mesh or not 118 : bool _pin_mesh_exist; 119 : 120 : public: 121 : static InputParameters validParams(); 122 : 123 : /** 124 : * Generate pin centers 125 : * 126 : * @param nx number of channels in x-direction (must be more than 1) 127 : * @param ny number of channels in y-direction (must be more than 1) 128 : * @param elev elevation in z-direction 129 : * @param pin_centers Positions in 3D space of pin centers 130 : */ 131 : static void generatePinCenters( 132 : unsigned int nx, unsigned int ny, Real pitch, Real elev, std::vector<Point> & pin_centers); 133 : 134 : friend class SCMQuadInterWrapperMeshGenerator; 135 : friend class SCMQuadPinMeshGenerator; 136 : };