https://mooseframework.inl.gov
TriInterWrapperMesh.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 
18 {
19 public:
21  TriInterWrapperMesh(const TriInterWrapperMesh & other_mesh);
22  virtual std::unique_ptr<MooseMesh> safeClone() const override;
23  virtual void buildMesh() override;
24 
25  virtual const unsigned int & getNumOfAssemblies() const override { return _n_assemblies; }
26 
27  virtual Node * getPinNode(unsigned int, unsigned) const override { return nullptr; }
28 
29  virtual bool pinMeshExist() const override { return false; }
30  virtual bool ductMeshExist() const override { return false; }
31 
32  virtual const Real & getDuctToPinGap() const { return _duct_to_pin_gap; }
33 
37  virtual const unsigned int & getPinIndex(const unsigned int channel_idx,
38  const unsigned int neighbor_idx)
39  {
40  return _chan_to_pin_map[channel_idx][neighbor_idx];
41  }
42 
43  virtual Node * getChannelNode(unsigned int i_chan, unsigned iz) const override
44  {
45  return _nodes[i_chan][iz];
46  }
47  virtual const unsigned int & getNumOfChannels() const override { return _n_channels; }
48  virtual const unsigned int & getNumOfGapsPerLayer() const override { return _n_gaps; }
49  virtual const std::pair<unsigned int, unsigned int> &
50  getGapChannels(unsigned int i_gap) const override
51  {
52  return _gap_to_chan_map[i_gap];
53  }
54  virtual const std::vector<unsigned int> & getChannelGaps(unsigned int i_chan) const override
55  {
56  return _chan_to_gap_map[i_chan];
57  }
58  virtual const std::vector<double> & getGapMap() const override { return _gij_map; }
59  virtual const Real & getCrossflowSign(unsigned int i_chan, unsigned int i_local) const override
60  {
61  return _sign_id_crossflow_map[i_chan][i_local];
62  }
63 
64  virtual unsigned int getSubchannelIndexFromPoint(const Point & p) const override;
65  virtual unsigned int channelIndex(const Point & point) const override;
66 
67  virtual EChannelType getSubchannelType(unsigned int index) const override
68  {
69  return _subch_type[index];
70  }
71 
72  virtual Real getGapWidth(unsigned int gap_index) const override { return _gij_map[gap_index]; }
73 
74  virtual const std::pair<unsigned int, unsigned int> & getSweepFlowGaps(unsigned int i_chan) const
75  {
76  return _gap_pairs_sf[i_chan];
77  }
78 
79  virtual const std::pair<unsigned int, unsigned int> & getSweepFlowChans(unsigned int i_chan) const
80  {
81  return _chan_pairs_sf[i_chan];
82  }
83 
84  virtual const std::vector<unsigned int> & getPinChannels(unsigned int i_pin) const override
85  {
86  return _pin_to_chan_map[i_pin];
87  }
88 
89  virtual const std::vector<unsigned int> & getChannelPins(unsigned int i_chan) const override
90  {
91  return _chan_to_pin_map[i_chan];
92  }
93 
94  virtual const bool & getIsTightSide() const { return _tight_side_bypass; }
95 
96  virtual unsigned int getPinIndexFromPoint(const Point & p) const override;
97  virtual unsigned int pinIndex(const Point & p) const override;
98 
102  void setChannelToDuctMaps(const std::vector<Node *> & duct_nodes);
103 
104 protected:
106  unsigned int _n_rings;
108  unsigned int _n_channels;
114  std::vector<std::vector<Node *>> _nodes;
115 
118  std::vector<Node *> _duct_nodes;
121  std::map<Node *, Node *> _chan_to_duct_node_map;
124  std::map<Node *, Node *> _duct_node_to_chan_map;
125 
127  std::vector<std::pair<unsigned int, unsigned int>> _gap_to_chan_map;
129  std::vector<std::pair<unsigned int, unsigned int>> _gap_to_pin_map;
131  std::vector<std::vector<unsigned int>> _chan_to_gap_map;
136  std::vector<std::vector<Real>> _sign_id_crossflow_map;
138  std::vector<Real> _gij_map;
140  std::vector<std::vector<Real>> _subchannel_position;
142  std::vector<Point> _pin_position;
144  std::vector<std::vector<Real>> _pins_in_rings;
146  std::vector<std::vector<unsigned int>> _chan_to_pin_map;
148  unsigned int _n_assemblies;
150  unsigned int _n_gaps;
152  std::vector<EChannelType> _subch_type;
154  std::vector<EChannelType> _gap_type;
156  std::vector<std::pair<unsigned int, unsigned int>> _gap_pairs_sf;
158  std::vector<std::pair<unsigned int, unsigned int>> _chan_pairs_sf;
160  std::vector<std::vector<unsigned int>> _pin_to_chan_map;
163 
164 public:
165  static InputParameters validParams();
166 
173  static void rodPositions(std::vector<Point> & positions,
174  unsigned int nrings,
175  Real assembly_pitch,
176  Point center);
177 
179 
181  static const unsigned int N_CORNERS = 6;
182 };
Mesh class for triangular, edge and corner subchannels for hexagonal lattice fuel assemblies...
std::vector< std::vector< Real > > _sign_id_crossflow_map
Defines the global cross-flow direction -1 or 1 for each interstice and for all gaps that are belongi...
TriInterWrapperMesh(const InputParameters &parameters)
std::vector< Node * > _duct_nodes
A list of all mesh nodes that form the (elements of) the hexagonal duct mesh that surrounds the pins/...
virtual const std::vector< unsigned int > & getChannelGaps(unsigned int i_chan) const override
Return a vector of gap indices for a given channel index.
virtual EChannelType getSubchannelType(unsigned int index) const override
Return the type of the inter-wrapper for given inter-wrapper index.
Base class for inter-wrapper meshes.
unsigned int _n_assemblies
number of assemblies
static InputParameters validParams()
std::vector< EChannelType > _gap_type
gap type
virtual Node * getPinNode(unsigned int, unsigned) const override
Get the pin mesh node for a given pin index and elevation index.
std::vector< Point > _pin_position
x,y coordinates of the fuel pins
virtual const std::vector< unsigned int > & getPinChannels(unsigned int i_pin) const override
Return a vector of channel indices for a given Pin index.
std::vector< std::vector< Real > > _subchannel_position
x,y coordinates of the interstice
Real _flat_to_flat
the distance between flat surfaces of the duct facing each other
static const std::string assembly_pitch
virtual const unsigned int & getNumOfAssemblies() const override
Return the number of assemblies.
static void rodPositions(std::vector< Point > &positions, unsigned int nrings, Real assembly_pitch, Point center)
Calculates and stores the Pin positions/centers for a hexagonal assembly containing the given number ...
std::map< Node *, Node * > _duct_node_to_chan_map
A map for providing the closest/corresponding interstice node associated with each duct node...
Real _duct_to_pin_gap
the gap thickness between the duct and peripheral fuel pins
virtual const unsigned int & getNumOfGapsPerLayer() const override
Return the number of gaps per layer.
virtual const std::vector< double > & getGapMap() const override
Return a map with gap sizes.
bool _tight_side_bypass
whether the side bypass shape follows the assemblies
virtual const std::pair< unsigned int, unsigned int > & getSweepFlowGaps(unsigned int i_chan) const
virtual const unsigned int & getPinIndex(const unsigned int channel_idx, const unsigned int neighbor_idx)
Return Pin index given inter_wrapper index and local neighbor index.
unsigned int _n_rings
number of rings of fuel pins
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.
virtual const std::pair< unsigned int, unsigned int > & getSweepFlowChans(unsigned int i_chan) const
void setChannelToDuctMaps(const std::vector< Node *> &duct_nodes)
Setup the internal maps when there is a outside duct present.
EChannelType
Enum for describing the center, edge and corner subchannels or gap types.
static const unsigned int N_CORNERS
number of corners in the duct x-sec
std::vector< std::pair< unsigned int, unsigned int > > _gap_to_chan_map
stores the channel pairs for each gap
std::vector< std::pair< unsigned int, unsigned int > > _gap_pairs_sf
sweeping flow model gap pairs per channel to specify directional edge flow
std::vector< std::pair< unsigned int, unsigned int > > _chan_pairs_sf
sweeping flow model channel pairs to specify directional edge flow
unsigned int _n_gaps
number of gaps
virtual bool ductMeshExist() const override
Return if duct Mesh exists or not.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
std::vector< EChannelType > _subch_type
interstice type
virtual const std::vector< unsigned int > & getChannelPins(unsigned int i_chan) const override
Return a vector of pin indices for a given channel index.
virtual const bool & getIsTightSide() const
virtual unsigned int getSubchannelIndexFromPoint(const Point &p) const override
Return a inter-wrapper index for a given physical point p
std::vector< std::vector< Real > > _pins_in_rings
fuel pins that are belonging to each ring
std::vector< std::pair< unsigned int, unsigned int > > _gap_to_pin_map
stores the fuel pins belonging to each gap
unsigned int _n_channels
number of subchannels
virtual unsigned int getPinIndexFromPoint(const Point &p) const override
Return a pin index for a given physical point p
std::vector< Real > _gij_map
gap size
std::vector< std::vector< unsigned int > > _chan_to_pin_map
stores the fuel pins belonging to each interstice
const InputParameters & parameters() const
virtual unsigned int pinIndex(const Point &p) const override
std::vector< std::vector< Node * > > _nodes
nodes
std::vector< std::vector< unsigned int > > _pin_to_chan_map
TODO: channel indices corresponding to a given pin index.
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.
virtual unsigned int channelIndex(const Point &point) const override
virtual const unsigned int & getNumOfChannels() const override
Return the number of channels per layer.
std::map< Node *, Node * > _chan_to_duct_node_map
A map for providing the closest/corresponding duct node associated with each interstice node...
virtual Real getGapWidth(unsigned int gap_index) const override
Return gap width for a given gap index.
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.
Mesh class for triangular, edge and corner inter_wrappers for hexagonal lattice fuel assemblies...
static const std::string center
Definition: NS.h:28
std::vector< std::vector< unsigned int > > _chan_to_gap_map
stores the gaps that forms each interstice
virtual void buildMesh() override
virtual const Real & getDuctToPinGap() const
virtual std::unique_ptr< MooseMesh > safeClone() const override
virtual bool pinMeshExist() const override
Return if Pin Mesh exists or not.