1212#include " SubChannelMesh.h"
1313#include " SubChannelEnums.h"
1414
15+ #include < map>
16+ #include < vector>
17+ #include < memory> // for unique_ptr
18+ #include < utility> // for std::pair
19+
1520/* *
1621 * Creates the mesh of subchannels in a quadrilateral lattice.
1722 */
@@ -20,90 +25,70 @@ class QuadSubChannelMesh : public SubChannelMesh
2025public:
2126 QuadSubChannelMesh (const InputParameters & parameters);
2227 QuadSubChannelMesh (const QuadSubChannelMesh & other_mesh);
23- virtual std::unique_ptr<MooseMesh> safeClone () const override ;
24- virtual void buildMesh () override ;
2528
26- virtual Node * getChannelNode (unsigned int i_chan, unsigned iz) const override
29+ std::unique_ptr<MooseMesh> safeClone () const override ;
30+ void buildMesh () override ;
31+
32+ Node * getChannelNode (unsigned int i_chan, unsigned int iz) const override
2733 {
2834 return _nodes[i_chan][iz];
2935 }
3036
31- virtual Node * getPinNode (unsigned int i_pin, unsigned iz) const override
37+ Node * getPinNode (unsigned int i_pin, unsigned int iz) const override
3238 {
3339 return _pin_nodes[i_pin][iz];
3440 }
3541
36- /* *
37- * Duct functions not applicable to quad channel
38- *
39- * Over-writing to avoid abstract template definition in this class
40- */
41- // /@{
42- virtual Node * getDuctNodeFromChannel (Node *) override { return nullptr ; }
43- virtual Node * getChannelNodeFromDuct (Node *) override { return nullptr ; }
44- virtual const std::vector<Node *> getDuctNodes () const override { return std::vector<Node *>(); }
45- // /@}
42+ unsigned int getNumOfChannels () const override { return processor_id () == 0 ? _n_channels : 0 ; }
43+ unsigned int getNumOfGapsPerLayer () const override { return processor_id () == 0 ? _n_gaps : 0 ; }
44+ unsigned int getNumOfPins () const override { return processor_id () == 0 ? _n_pins : 0 ; }
4645
47- virtual unsigned int getNumOfChannels () const override
48- {
49- return processor_id () == 0 ? _n_channels : 0 ;
50- }
51- virtual unsigned int getNumOfGapsPerLayer () const override
52- {
53- return processor_id () == 0 ? _n_gaps : 0 ;
54- }
55- virtual unsigned int getNumOfPins () const override { return processor_id () == 0 ? _n_pins : 0 ; }
56- virtual bool pinMeshExist () const override { return _pin_mesh_exist; }
57- virtual bool ductMeshExist () const override { return false ; }
58- virtual const std::pair<unsigned int , unsigned int > &
59- getGapChannels (unsigned int i_gap) const override
46+ const std::pair<unsigned int , unsigned int > & getGapChannels (unsigned int i_gap) const override
6047 {
6148 return _gap_to_chan_map[i_gap];
6249 }
63- virtual const std::pair<unsigned int , unsigned int > &
64- getGapPins (unsigned int i_gap) const override
50+ const std::pair<unsigned int , unsigned int > & getGapPins (unsigned int i_gap) const override
6551 {
6652 return _gap_to_pin_map[i_gap];
6753 }
68- virtual const std::vector<unsigned int > & getChannelGaps (unsigned int i_chan) const override
54+ const std::vector<unsigned int > & getChannelGaps (unsigned int i_chan) const override
6955 {
7056 return _chan_to_gap_map[i_chan];
7157 }
72- virtual const std::vector<unsigned int > & getPinChannels (unsigned int i_pin) const override
58+ const std::vector<unsigned int > & getPinChannels (unsigned int i_pin) const override
7359 {
7460 return _pin_to_chan_map[i_pin];
7561 }
76- virtual const std::vector<unsigned int > & getChannelPins (unsigned int i_chan) const override
62+ const std::vector<unsigned int > & getChannelPins (unsigned int i_chan) const override
7763 {
7864 return _chan_to_pin_map[i_chan];
7965 }
80- virtual const Real & getPitch () const override { return _pitch; }
81- virtual const Real & getCrossflowSign (unsigned int i_chan, unsigned int i_local) const override
66+ const Real & getPitch () const override { return _pitch; }
67+ const Real & getCrossflowSign (unsigned int i_chan, unsigned int i_local) const override
8268 {
8369 return _sign_id_crossflow_map[i_chan][i_local];
8470 }
71+
8572 // / Number of subchannels in the -x direction
86- virtual const unsigned int & getNx () const { return _nx; }
73+ const unsigned int & getNx () const { return _nx; }
8774 // / Number of subchannels in the -y direction
88- virtual const unsigned int & getNy () const { return _ny; }
75+ const unsigned int & getNy () const { return _ny; }
76+
8977 /* *
9078 * Returns the side gap, not to be confused with the gap between pins, this refers to the gap
9179 * next to the duct. Edge Pitch W = (pitch/2 - pin_diameter/2 + gap) [m]
9280 */
9381 const Real & getSideGap () const { return _side_gap; }
9482
9583 unsigned int getSubchannelIndexFromPoint (const Point & p) const override ;
96- virtual unsigned int channelIndex (const Point & point) const override ;
84+ unsigned int channelIndex (const Point & point) const override ;
9785
9886 unsigned int getPinIndexFromPoint (const Point & p) const override ;
99- virtual unsigned int pinIndex (const Point & p) const override ;
87+ unsigned int pinIndex (const Point & p) const override ;
10088
101- virtual EChannelType getSubchannelType (unsigned int index) const override
102- {
103- return _subch_type[index];
104- }
89+ EChannelType getSubchannelType (unsigned int index) const override { return _subch_type[index]; }
10590
106- virtual Real getGapWidth (unsigned int axial_index, unsigned int gap_index) const override
91+ Real getGapWidth (unsigned int axial_index, unsigned int gap_index) const override
10792 {
10893 return _gij_map[axial_index][gap_index];
10994 }
@@ -119,18 +104,21 @@ class QuadSubChannelMesh : public SubChannelMesh
119104 unsigned int _n_gaps;
120105 // / Number of pins
121106 unsigned int _n_pins;
107+
122108 /* *
123109 * The side gap, not to be confused with the gap between pins, this refers to the gap
124110 * next to the duct or else the distance between the subchannel centroid to the duct wall.
125111 * Edge Pitch W = (pitch/2 - pin_diameter/2 + gap) [m]
126112 */
127113 Real _side_gap;
114+
128115 // / vector of subchannel nodes
129116 std::vector<std::vector<Node *>> _nodes;
130117 // / vector of fuel pin nodes
131118 std::vector<std::vector<Node *>> _pin_nodes;
132119 // / vector of gap (interface between pairs of neighboring subchannels) nodes
133120 std::vector<std::vector<Node *>> _gapnodes;
121+
134122 // / map relating gap index to subchannel index
135123 std::vector<std::pair<unsigned int , unsigned int >> _gap_to_chan_map;
136124 // / map relating gap index to fuel pin index
@@ -141,14 +129,13 @@ class QuadSubChannelMesh : public SubChannelMesh
141129 std::vector<std::vector<unsigned int >> _chan_to_pin_map;
142130 // / map relating fuel pin index to subchannel index
143131 std::vector<std::vector<unsigned int >> _pin_to_chan_map;
132+
144133 // / Matrix used to give local sign to crossflow quantities
145134 std::vector<std::vector<double >> _sign_id_crossflow_map;
146135 // / Vector to store gap size
147136 std::vector<std::vector<Real>> _gij_map;
148137 // / Subchannel type
149138 std::vector<EChannelType> _subch_type;
150- // / Flag that informs the solver whether there is a Pin Mesh or not
151- bool _pin_mesh_exist;
152139
153140public:
154141 static InputParameters validParams ();
0 commit comments