https://mooseframework.inl.gov
SubChannelMesh.h
Go to the documentation of this file.
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 
19 class SubChannelMesh : public MooseMesh
20 {
21 public:
23  SubChannelMesh(const SubChannelMesh & other_mesh);
24 
28  virtual const std::vector<Real> & getZGrid() const { return _z_grid; }
29 
33  virtual unsigned int getZIndex(const Point & point) const;
34 
38  virtual const std::vector<std::vector<Real>> & getKGrid() const { return _k_grid; }
39 
43  virtual const std::vector<Real> & getZBlockage() const { return _z_blockage; }
44 
48  virtual const std::vector<unsigned int> & getIndexBlockage() const { return _index_blockage; }
49 
53  virtual const std::vector<Real> & getReductionBlockage() const { return _reduction_blockage; }
54 
58  virtual const Real & getKij() const { return _kij; }
59 
63  virtual const unsigned int & getNumOfAxialCells() const { return _n_cells; }
64 
68  virtual Node * getChannelNode(unsigned int i_chan, unsigned iz) const = 0;
69 
73  virtual Node * getPinNode(unsigned int i_pin, unsigned iz) const = 0;
74 
78  virtual Node * getChanNodeFromDuct(Node * duct_node) = 0;
79 
83  virtual Node * getChannelNodeFromDuct(Node * channel_node) = 0;
84 
88  virtual Node * getDuctNodeFromChannel(Node * channel_node) = 0;
89 
93  virtual const unsigned int & getNumOfChannels() const = 0;
94 
98  virtual bool pinMeshExist() const = 0;
99 
103  virtual bool ductMeshExist() const = 0;
104 
108  virtual const unsigned int & getNumOfGapsPerLayer() const = 0;
109 
113  virtual const unsigned int & getNumOfPins() const = 0;
114 
118  virtual const std::pair<unsigned int, unsigned int> &
119  getGapChannels(unsigned int i_gap) const = 0;
120 
124  virtual const std::pair<unsigned int, unsigned int> & getGapPins(unsigned int i_gap) const = 0;
125 
129  virtual const std::vector<unsigned int> & getChannelGaps(unsigned int i_chan) const = 0;
130 
134  virtual const std::vector<unsigned int> & getPinChannels(unsigned int i_pin) const = 0;
135 
139  virtual const std::vector<unsigned int> & getChannelPins(unsigned int i_chan) const = 0;
140 
144  virtual const Real & getPitch() const { return _pitch; }
145 
149  virtual const Real & getPinDiameter() const { return _pin_diameter; }
150 
154  virtual const Real & getCrossflowSign(unsigned int i_chan, unsigned int i_local) const = 0;
155 
159  virtual const Real & getHeatedLengthEntry() const { return _unheated_length_entry; }
160 
164  virtual const Real & getHeatedLength() const { return _heated_length; }
165 
169  virtual const Real & getHeatedLengthExit() const { return _unheated_length_exit; }
170 
174  virtual unsigned int getSubchannelIndexFromPoint(const Point & p) const = 0;
175 
176  virtual unsigned int channelIndex(const Point & point) const = 0;
177 
181  virtual unsigned int getPinIndexFromPoint(const Point & p) const = 0;
182 
183  virtual unsigned int pinIndex(const Point & p) const = 0;
184 
188  virtual EChannelType getSubchannelType(unsigned int index) const = 0;
189 
193  virtual Real getGapWidth(unsigned int axial_index, unsigned int gap_index) const = 0;
194 
198  virtual const std::vector<Node *> getDuctNodes() const = 0;
199 
200 protected:
208  std::vector<Real> _z_grid;
210  std::vector<std::vector<Real>> _k_grid;
212  std::vector<Real> _spacer_z;
214  std::vector<Real> _spacer_k;
216  std::vector<Real> _z_blockage;
218  std::vector<unsigned int> _index_blockage;
220  std::vector<Real> _reduction_blockage;
228  unsigned int _n_cells;
229 
230 public:
232  std::vector<std::vector<Real>> _subchannel_position;
233  static InputParameters validParams();
234 
238  static void generateZGrid(Real unheated_length_entry,
239  Real heated_length,
240  Real unheated_length_exit,
241  unsigned int n_cells,
242  std::vector<Real> & z_grid);
243 };
virtual unsigned int getSubchannelIndexFromPoint(const Point &p) const =0
Return a subchannel index for a given physical point p
static InputParameters validParams()
virtual unsigned int pinIndex(const Point &p) const =0
virtual const unsigned int & getNumOfChannels() const =0
Return the number of channels per layer.
virtual const std::pair< unsigned int, unsigned int > & getGapPins(unsigned int i_gap) const =0
Return a pair of pin indices for a given gap index.
virtual const Real & getPinDiameter() const
Return Pin diameter.
std::vector< Real > _z_grid
axial location of nodes
virtual const std::vector< unsigned int > & getPinChannels(unsigned int i_pin) const =0
Return a vector of channel indices for a given Pin index.
virtual Node * getChannelNodeFromDuct(Node *channel_node)=0
Function that gets the channel node from the duct node.
virtual const std::vector< unsigned int > & getChannelPins(unsigned int i_chan) const =0
Return a vector of pin indices for a given channel index.
virtual const std::vector< Real > & getZGrid() const
Get axial location of layers.
virtual const Real & getPitch() const
Return the pitch between 2 subchannels.
virtual EChannelType getSubchannelType(unsigned int index) const =0
Return the type of the subchannel for given subchannel index.
virtual const Real & getKij() const
Return lateral loss coefficient.
std::vector< std::vector< Real > > _k_grid
axial form loss coefficient per computational cell
Real _unheated_length_entry
unheated length of the fuel Pin at the entry of the assembly
virtual Node * getChanNodeFromDuct(Node *duct_node)=0
Function that gets the channel node from the duct node.
virtual Node * getPinNode(unsigned int i_pin, unsigned iz) const =0
Get the pin mesh node for a given pin index and elevation index.
std::vector< std::vector< Real > > _subchannel_position
x,y coordinates of the subchannel centroids
virtual const std::vector< unsigned int > & getChannelGaps(unsigned int i_chan) const =0
Return a vector of gap indices for a given channel index.
virtual Node * getChannelNode(unsigned int i_chan, unsigned iz) const =0
Get the subchannel mesh node for a given channel index and elevation index.
static void generateZGrid(Real unheated_length_entry, Real heated_length, Real unheated_length_exit, unsigned int n_cells, std::vector< Real > &z_grid)
Generate the spacing in z-direction using heated and unteaded lengths.
virtual const Real & getHeatedLength() const
Return heated length.
std::vector< Real > _spacer_k
form loss coefficient of the spacers
virtual const unsigned int & getNumOfPins() const =0
Return the number of pins.
virtual Node * getDuctNodeFromChannel(Node *channel_node)=0
Function that gets the duct node from the channel node.
Real _unheated_length_exit
unheated length of the fuel Pin at the exit of the assembly
std::vector< Real > _z_blockage
axial location of blockage (inlet, outlet) [m]
Real _pin_diameter
fuel Pin diameter
virtual const std::vector< std::vector< Real > > & getKGrid() const
Get axial cell location and value of loss coefficient.
std::vector< Real > _reduction_blockage
area reduction of subchannels affected by blockage
virtual const std::vector< Real > & getReductionBlockage() const
Get area reduction of blocked subchannels.
EChannelType
Enum for describing the center, edge and corner subchannels or gap types.
Real _pitch
Distance between the neighbor fuel pins, pitch.
std::vector< Real > _spacer_z
axial location of the spacers
virtual const unsigned int & getNumOfAxialCells() const
Return the number of axial cells.
virtual Real getGapWidth(unsigned int axial_index, unsigned int gap_index) const =0
Return gap width for a given gap index.
virtual unsigned int channelIndex(const Point &point) const =0
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
virtual const std::vector< Node * > getDuctNodes() const =0
Function that return the vector with the maps to the nodes if they exist.
virtual const std::vector< Real > & getZBlockage() const
Get axial location of blockage (in,out) [m].
virtual bool pinMeshExist() const =0
Return if Pin Mesh exists or not.
virtual const Real & getCrossflowSign(unsigned int i_chan, unsigned int i_local) const =0
Return a sign for the crossflow given a subchannel index and local neighbor index.
virtual const unsigned int & getNumOfGapsPerLayer() const =0
Return the number of gaps per layer.
const InputParameters & parameters() const
virtual const std::vector< unsigned int > & getIndexBlockage() const
Get index of blocked subchannels.
Base class for subchannel meshes.
virtual const Real & getHeatedLengthExit() const
Return unheated length at exit.
Real _kij
Lateral form loss coefficient.
unsigned int _n_cells
number of axial cells
virtual unsigned int getPinIndexFromPoint(const Point &p) const =0
Return a pin index for a given physical point p
virtual bool ductMeshExist() const =0
Return if Duct Mesh exists or not.
virtual unsigned int getZIndex(const Point &point) const
Get axial index of point.
Real _heated_length
heated length of the fuel Pin
SubChannelMesh(const InputParameters &parameters)
virtual const Real & getHeatedLengthEntry() const
Return unheated length at entry.
std::vector< unsigned int > _index_blockage
index of subchannels affected by blockage
virtual const std::pair< unsigned int, unsigned int > & getGapChannels(unsigned int i_gap) const =0
Return a pair of subchannel indices for a given gap index.