https://mooseframework.inl.gov
QuadInterWrapperMesh.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 "InterWrapperMesh.h"
13 #include "SubChannelEnums.h"
14 
19 {
20 public:
22  QuadInterWrapperMesh(const QuadInterWrapperMesh & other_mesh);
23  virtual std::unique_ptr<MooseMesh> safeClone() const override;
24  virtual void buildMesh() override;
25 
26  virtual Node * getChannelNode(unsigned int i_chan, unsigned iz) const override
27  {
28  return _nodes[i_chan][iz];
29  }
30 
31  virtual Node * getPinNode(unsigned int i_pin, unsigned iz) const override
32  {
33  return _pin_nodes[i_pin][iz];
34  }
35 
36  virtual const unsigned int & getNumOfChannels() const override { return _n_channels; }
37  virtual const unsigned int & getNumOfGapsPerLayer() const override { return _n_gaps; }
38  virtual const unsigned int & getNumOfAssemblies() const override { return _n_assemblies; }
39  virtual bool pinMeshExist() const override { return false; }
40  virtual bool ductMeshExist() const override { return false; }
41  virtual const std::pair<unsigned int, unsigned int> &
42  getGapChannels(unsigned int i_gap) const override
43  {
44  return _gap_to_chan_map[i_gap];
45  }
46  virtual const std::vector<unsigned int> & getChannelGaps(unsigned int i_chan) const override
47  {
48  return _chan_to_gap_map[i_chan];
49  }
50  virtual const std::vector<unsigned int> & getPinChannels(unsigned int i_pin) const override
51  {
52  return _pin_to_chan_map[i_pin];
53  }
54  virtual const std::vector<unsigned int> & getChannelPins(unsigned int i_chan) const override
55  {
56  return _chan_to_pin_map[i_chan];
57  }
58  virtual const std::vector<double> & getGapMap() const override { return _gij_map; }
59  virtual const Real & getPitch() const override { return _assembly_pitch; }
60  virtual const Real & getCrossflowSign(unsigned int i_chan, unsigned int i_local) const override
61  {
62  return _sign_id_crossflow_map[i_chan][i_local];
63  }
64 
66  virtual const unsigned int & getNx() const { return _nx; }
68  virtual const unsigned int & getNy() const { return _ny; }
69  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  virtual EChannelType getSubchannelType(unsigned int index) const override
78  {
79  return _subch_type[index];
80  }
81 
83  virtual Real getGapWidth(unsigned int gap_index) const override { return _gij_map[gap_index]; }
84 
85 protected:
87  unsigned int _nx;
89  unsigned int _ny;
91  unsigned int _n_channels;
93  unsigned int _n_gaps;
95  unsigned int _n_assemblies;
98  std::vector<std::vector<Node *>> _nodes;
100  std::vector<std::vector<Node *>> _pin_nodes;
102  std::vector<std::vector<Node *>> _gapnodes;
104  std::vector<std::pair<unsigned int, unsigned int>> _gap_to_chan_map;
106  std::vector<std::vector<unsigned int>> _chan_to_gap_map;
108  std::vector<std::vector<unsigned int>> _chan_to_pin_map;
110  std::vector<std::vector<unsigned int>> _pin_to_chan_map;
112  std::vector<std::vector<double>> _sign_id_crossflow_map;
114  std::vector<double> _gij_map;
116  std::vector<EChannelType> _subch_type;
119 
120 public:
121  static InputParameters validParams();
122 
131  static void generatePinCenters(
132  unsigned int nx, unsigned int ny, Real pitch, Real elev, std::vector<Point> & pin_centers);
133 
136 };
virtual Real getGapWidth(unsigned int gap_index) const override
returns the size of the gap in the interface of between assemblies
std::vector< std::vector< Node * > > _pin_nodes
vector of fuel assembly nodes
Base class for inter-wrapper meshes.
static InputParameters validParams()
std::vector< EChannelType > _subch_type
Subchannel type.
unsigned int getPinIndexFromPoint(const Point &p) const override
Return a pin index for a given physical point p
virtual const unsigned int & getNumOfGapsPerLayer() const override
Return the number of gaps per layer.
virtual unsigned int channelIndex(const Point &point) const override
unsigned int _n_assemblies
Number of assemblies.
virtual EChannelType getSubchannelType(unsigned int index) const override
Return the type of the inter-wrapper for given inter-wrapper index.
virtual bool pinMeshExist() const override
Return if Pin Mesh exists or not.
virtual std::unique_ptr< MooseMesh > safeClone() const override
std::vector< std::vector< double > > _sign_id_crossflow_map
Matrix used to give local sign to crossflow quantities.
virtual const unsigned int & getNumOfChannels() const override
Return the number of channels per layer.
virtual const Real & getPitch() const override
Return the pitch between 2 inter-wrappers.
unsigned int _nx
Number of assemblies in the -x direction.
virtual const std::pair< unsigned int, unsigned int > & getGapChannels(unsigned int i_gap) const override
Return a pair of inter-wrapper indices for a given gap index.
std::vector< std::vector< Node * > > _gapnodes
vector of gap (interface between pairs of neighboring assemblies) nodes
virtual const std::vector< unsigned int > & getPinChannels(unsigned int i_pin) const override
Return a vector of channel indices for a given Pin index.
virtual void buildMesh() override
virtual const std::vector< double > & getGapMap() const override
Return a map with gap sizes.
virtual bool ductMeshExist() const override
Return if duct Mesh exists or not.
std::vector< std::vector< unsigned int > > _chan_to_pin_map
map relating subchannel index to assembly index
virtual unsigned int pinIndex(const Point &p) const override
unsigned int getSubchannelIndexFromPoint(const Point &p) const override
Return a inter-wrapper index for a given physical point p
std::vector< double > _gij_map
Vector to store gap size.
static const std::string pitch
virtual const std::vector< unsigned int > & getChannelPins(unsigned int i_chan) const override
Return a vector of pin indices for a given channel index.
std::vector< std::vector< unsigned int > > _chan_to_gap_map
map relating subchannel index to gap index
virtual Node * getPinNode(unsigned int i_pin, unsigned iz) const override
Get the pin mesh node for a given pin index and elevation index.
unsigned int _n_gaps
Number of gaps per layer.
EChannelType
Enum for describing the center, edge and corner subchannels or gap types.
QuadInterWrapperMesh(const InputParameters &parameters)
virtual const std::vector< unsigned int > & getChannelGaps(unsigned int i_chan) const override
Return a vector of gap indices for a given channel index.
Creates the mesh of an inter-wrapper around square assemblies.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
virtual const Real & getCrossflowSign(unsigned int i_chan, unsigned int i_local) const override
Return a signs for the cross flow given a inter-wrapper index and local neighbor index.
bool _pin_mesh_exist
Flag that informs the solver whether there is a Pin Mesh or not.
std::vector< std::vector< Node * > > _nodes
vector of subchannel nodes
virtual const unsigned int & getNx() const
number of inter-wrapper channels in the -x direction
unsigned int _n_channels
Number of subchannels.
unsigned int _ny
Number of assemblies in the -y direction.
const InputParameters & parameters() const
std::vector< std::vector< unsigned int > > _pin_to_chan_map
map relating fuel assembly index to subchannel index
virtual const unsigned int & getNumOfAssemblies() const override
Return the number of assemblies.
Real _assembly_pitch
Distance between neighboring assemblies.
static void generatePinCenters(unsigned int nx, unsigned int ny, Real pitch, Real elev, std::vector< Point > &pin_centers)
Generate pin centers.
virtual const unsigned int & getNy() const
number of inter-wrapper channels in the -y direction
std::vector< std::pair< unsigned int, unsigned int > > _gap_to_chan_map
map relating gap index to subchannel index
Class to create Pin mesh in the square lattice geometry.
Class for Subchannel mesh generation in the square lattice geometry.
virtual Node * getChannelNode(unsigned int i_chan, unsigned iz) const override
Get the inter-wrapper mesh node for a given channel index and elevation index.