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 <vector> 13 : #include "MooseMesh.h" 14 : #include "SubChannelEnums.h" 15 : 16 : /** 17 : * Base class for inter-wrapper meshes 18 : */ 19 : class InterWrapperMesh : public MooseMesh 20 : { 21 : public: 22 : InterWrapperMesh(const InputParameters & parameters); 23 : InterWrapperMesh(const InterWrapperMesh & other_mesh); 24 : 25 : /** 26 : * Get axial location of layers 27 : */ 28 12126 : virtual const std::vector<Real> & getZGrid() const { return _z_grid; } 29 : 30 : /** 31 : * Get axial index of point 32 : */ 33 : virtual unsigned int getZIndex(const Point & point) const; 34 : 35 : /** 36 : * Get axial cell location and value of loss coefficient 37 : */ 38 51042 : virtual const std::vector<std::vector<Real>> & getKGrid() const { return _k_grid; } 39 : 40 : /** 41 : * Return lateral loss coefficient 42 : */ 43 72 : virtual const Real & getKij() const { return _kij; } 44 : 45 : /** 46 : * Return the number of axial cells 47 : */ 48 126 : virtual const unsigned int & getNumOfAxialCells() const { return _n_cells; } 49 : 50 : /** 51 : * Get the inter-wrapper mesh node for a given channel index and elevation index 52 : */ 53 : virtual Node * getChannelNode(unsigned int i_chan, unsigned iz) const = 0; 54 : 55 : /** 56 : * Get the pin mesh node for a given pin index and elevation index 57 : */ 58 : virtual Node * getPinNode(unsigned int i_pin, unsigned iz) const = 0; 59 : 60 : /** 61 : * Return the number of channels per layer 62 : */ 63 : virtual const unsigned int & getNumOfChannels() const = 0; 64 : 65 : /** 66 : * Return if Pin Mesh exists or not 67 : */ 68 : virtual bool pinMeshExist() const = 0; 69 : 70 : /** 71 : * Return if duct Mesh exists or not 72 : */ 73 : virtual bool ductMeshExist() const = 0; 74 : 75 : /** 76 : * Return the number of gaps per layer 77 : */ 78 : virtual const unsigned int & getNumOfGapsPerLayer() const = 0; 79 : 80 : /** 81 : * Return the number of assemblies 82 : */ 83 : virtual const unsigned int & getNumOfAssemblies() const = 0; 84 : 85 : /** 86 : * Return a pair of inter-wrapper indices for a given gap index 87 : */ 88 : virtual const std::pair<unsigned int, unsigned int> & 89 : getGapChannels(unsigned int i_gap) const = 0; 90 : 91 : /** 92 : * Return a vector of gap indices for a given channel index 93 : */ 94 : virtual const std::vector<unsigned int> & getChannelGaps(unsigned int i_chan) const = 0; 95 : 96 : /** 97 : * Return a vector of channel indices for a given Pin index 98 : */ 99 : virtual const std::vector<unsigned int> & getPinChannels(unsigned int i_pin) const = 0; 100 : 101 : /** 102 : * Return a vector of pin indices for a given channel index 103 : */ 104 : virtual const std::vector<unsigned int> & getChannelPins(unsigned int i_chan) const = 0; 105 : 106 : /** 107 : * Return a map with gap sizes 108 : */ 109 : virtual const std::vector<double> & getGapMap() const = 0; 110 : 111 : /** 112 : * Return the pitch between 2 inter-wrappers 113 : */ 114 26694 : virtual const Real & getPitch() const { return _assembly_pitch; } 115 : 116 : /** 117 : * Return side lengths of the assembly 118 : */ 119 84960 : virtual const Real & getSideX() const { return _assembly_side_x; } 120 34560 : virtual const Real & getSideY() const { return _assembly_side_y; } 121 : 122 : /** 123 : * Return a signs for the cross flow given a inter-wrapper index and local neighbor index 124 : */ 125 : virtual const Real & getCrossflowSign(unsigned int i_chan, unsigned int i_local) const = 0; 126 : 127 : /** 128 : * Return unheated length at entry 129 : */ 130 42534 : virtual const Real & getHeatedLengthEntry() const { return _unheated_length_entry; } 131 : 132 : /** 133 : * Return heated length 134 : */ 135 42610 : virtual const Real & getHeatedLength() const { return _heated_length; } 136 : 137 : /** 138 : * Return unheated length at exit 139 : */ 140 0 : virtual const Real & getHeatedLengthExit() const { return _unheated_length_exit; } 141 : 142 : /** 143 : * Return a inter-wrapper index for a given physical point `p` 144 : */ 145 : virtual unsigned int getSubchannelIndexFromPoint(const Point & p) const = 0; 146 : 147 : virtual unsigned int channelIndex(const Point & point) const = 0; 148 : 149 : /** 150 : * Return a pin index for a given physical point `p` 151 : */ 152 : virtual unsigned int getPinIndexFromPoint(const Point & p) const = 0; 153 : 154 : virtual unsigned int pinIndex(const Point & p) const = 0; 155 : 156 : /** 157 : * Return the type of the inter-wrapper for given inter-wrapper index 158 : */ 159 : virtual EChannelType getSubchannelType(unsigned int index) const = 0; 160 : 161 : /** 162 : * Return gap width for a given gap index 163 : */ 164 : virtual Real getGapWidth(unsigned int gap_index) const = 0; 165 : 166 : protected: 167 : /// unheated length of the fuel Pin at the entry of the assembly 168 : Real _unheated_length_entry; 169 : /// heated length of the fuel Pin 170 : Real _heated_length; 171 : /// unheated length of the fuel Pin at the exit of the assembly 172 : Real _unheated_length_exit; 173 : /// axial location of nodes 174 : std::vector<Real> _z_grid; 175 : /// axial form loss coefficient per computational cell 176 : std::vector<std::vector<Real>> _k_grid; 177 : /// Lateral form loss coefficient 178 : Real _kij; 179 : /// Distance between neighboring assemblies 180 : Real _assembly_pitch; 181 : /// Size of assembly sides 182 : Real _assembly_side_x; 183 : Real _assembly_side_y; 184 : /// number of axial cells 185 : unsigned int _n_cells; 186 : 187 : public: 188 : static InputParameters validParams(); 189 : 190 : /** 191 : * Generate the spacing in z-direction using heated and unheated lengths 192 : */ 193 : static void generateZGrid(Real unheated_length_entry, 194 : Real heated_length, 195 : Real unheated_length_exit, 196 : unsigned int n_cells, 197 : std::vector<Real> & z_grid); 198 : };