https://mooseframework.inl.gov
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Protected Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
SCMTriSubChannelMeshGenerator Class Reference

Mesh class for triangular, edge and corner subchannels for hexagonal lattice fuel assemblies. More...

#include <SCMTriSubChannelMeshGenerator.h>

Inheritance diagram for SCMTriSubChannelMeshGenerator:
[legend]

Public Types

typedef DataFileName DataFileParameterType
 

Public Member Functions

 SCMTriSubChannelMeshGenerator (const InputParameters &parameters)
 
std::unique_ptr< MeshBase > generate () override
 
std::unique_ptr< MeshBase > generateInternal ()
 
const std::set< MeshGeneratorName > & getRequestedMeshGenerators () const
 
const std::set< MeshGeneratorName > & getRequestedMeshGeneratorsForSub () const
 
void addParentMeshGenerator (const MeshGenerator &mg, const AddParentChildKey)
 
void addChildMeshGenerator (const MeshGenerator &mg, const AddParentChildKey)
 
const std::set< const MeshGenerator *, Comparator > & getParentMeshGenerators () const
 
const std::set< const MeshGenerator *, Comparator > & getChildMeshGenerators () const
 
const std::set< const MeshGenerator *, Comparator > & getSubMeshGenerators () const
 
bool isParentMeshGenerator (const MeshGeneratorName &name, const bool direct=true) const
 
bool isChildMeshGenerator (const MeshGeneratorName &name, const bool direct=true) const
 
bool isNullMeshName (const MeshGeneratorName &name) const
 
bool hasSaveMesh () const
 
bool hasOutput () const
 
const std::string & getSavedMeshName () const
 
bool hasGenerateData () const
 
bool isDataOnly () const
 
virtual bool enabled () const
 
std::shared_ptr< MooseObjectgetSharedPtr ()
 
std::shared_ptr< const MooseObjectgetSharedPtr () const
 
MooseAppgetMooseApp () const
 
const std::string & type () const
 
virtual const std::string & name () const
 
std::string typeAndName () const
 
std::string errorPrefix (const std::string &error_type) const
 
void callMooseError (std::string msg, const bool with_prefix) const
 
MooseObjectParameterName uniqueParameterName (const std::string &parameter_name) const
 
const InputParametersparameters () const
 
MooseObjectName uniqueName () const
 
const T & getParam (const std::string &name) const
 
std::vector< std::pair< T1, T2 > > getParam (const std::string &param1, const std::string &param2) const
 
const T * queryParam (const std::string &name) const
 
const T & getRenamedParam (const std::string &old_name, const std::string &new_name) const
 
getCheckedPointerParam (const std::string &name, const std::string &error_string="") const
 
bool isParamValid (const std::string &name) const
 
bool isParamSetByUser (const std::string &nm) const
 
void paramError (const std::string &param, Args... args) const
 
void paramWarning (const std::string &param, Args... args) const
 
void paramInfo (const std::string &param, Args... args) const
 
void connectControllableParams (const std::string &parameter, const std::string &object_type, const std::string &object_name, const std::string &object_parameter) const
 
void mooseError (Args &&... args) const
 
void mooseErrorNonPrefixed (Args &&... args) const
 
void mooseDocumentedError (const std::string &repo_name, const unsigned int issue_num, Args &&... args) const
 
void mooseWarning (Args &&... args) const
 
void mooseWarningNonPrefixed (Args &&... args) const
 
void mooseDeprecated (Args &&... args) const
 
void mooseInfo (Args &&... args) const
 
std::string getDataFileName (const std::string &param) const
 
std::string getDataFileNameByName (const std::string &relative_path) const
 
std::string getDataFilePath (const std::string &relative_path) const
 
const Parallel::Communicator & comm () const
 
processor_id_type n_processors () const
 
processor_id_type processor_id () const
 

Static Public Member Functions

static InputParameters validParams ()
 
static bool hasGenerateData (const InputParameters &params)
 
static void setHasGenerateData (InputParameters &params)
 

Public Attributes

const ConsoleStream _console
 

Static Public Attributes

static const std::string data_only_param
 
static constexpr auto SYSTEM
 
static constexpr auto NAME
 

Protected Member Functions

virtual void generateData ()
 
T & copyMeshProperty (const std::string &target_data_name, const std::string &source_data_name, const std::string &source_mesh)
 
T & copyMeshProperty (const std::string &source_data_name, const std::string &source_mesh)
 
std::unique_ptr< MeshBase > & getMesh (const std::string &param_name, const bool allow_invalid=false)
 
std::vector< std::unique_ptr< MeshBase > *> getMeshes (const std::string &param_name)
 
std::unique_ptr< MeshBase > & getMeshByName (const MeshGeneratorName &mesh_generator_name)
 
std::vector< std::unique_ptr< MeshBase > *> getMeshesByName (const std::vector< MeshGeneratorName > &mesh_generator_names)
 
void declareMeshForSub (const std::string &param_name)
 
void declareMeshesForSub (const std::string &param_name)
 
void declareMeshForSubByName (const MeshGeneratorName &mesh_generator_name)
 
void declareMeshesForSubByName (const std::vector< MeshGeneratorName > &mesh_generator_names)
 
std::unique_ptr< MeshBase > buildMeshBaseObject (unsigned int dim=libMesh::invalid_uint)
 
std::unique_ptr< ReplicatedMesh > buildReplicatedMesh (unsigned int dim=libMesh::invalid_uint)
 
std::unique_ptr< DistributedMesh > buildDistributedMesh (unsigned int dim=libMesh::invalid_uint)
 
void addMeshSubgenerator (const std::string &type, const std::string &name, Ts... extra_input_parameters)
 
void addMeshSubgenerator (const std::string &type, const std::string &name, InputParameters params)
 
void declareNullMeshName (const MeshGeneratorName &name)
 
const T & getMeshProperty (const std::string &data_name, const std::string &prefix)
 
const T & getMeshProperty (const std::string &data_name)
 
bool hasMeshProperty (const std::string &data_name, const std::string &prefix) const
 
bool hasMeshProperty (const std::string &data_name, const std::string &prefix) const
 
bool hasMeshProperty (const std::string &data_name) const
 
bool hasMeshProperty (const std::string &data_name) const
 
std::string meshPropertyName (const std::string &data_name) const
 
T & declareMeshProperty (const std::string &data_name, Args &&... args)
 
T & declareMeshProperty (const std::string &data_name, const T &data_value)
 
T & declareMeshProperty (const std::string &data_name, Args &&... args)
 
T & declareMeshProperty (const std::string &data_name, const T &data_value)
 
T & setMeshProperty (const std::string &data_name, Args &&... args)
 
T & setMeshProperty (const std::string &data_name, const T &data_value)
 
T & setMeshProperty (const std::string &data_name, Args &&... args)
 
T & setMeshProperty (const std::string &data_name, const T &data_value)
 

Static Protected Member Functions

static std::string meshPropertyName (const std::string &data_name, const std::string &prefix)
 

Protected Attributes

const Real _unheated_length_entry
 unheated length of the fuel Pin at the entry of the assembly More...
 
const Real _heated_length
 heated length of the fuel Pin More...
 
const Real _unheated_length_exit
 unheated length of the fuel Pin at the exit of the assembly More...
 
const unsigned int _block_id
 block index More...
 
std::vector< Real_z_grid
 axial location of nodes More...
 
std::vector< std::vector< Real > > _k_grid
 axial form loss coefficient per computational cell More...
 
const std::vector< Real > & _spacer_z
 axial location of the spacers More...
 
const std::vector< Real > & _spacer_k
 form loss coefficient of the spacers More...
 
const std::vector< Real_z_blockage
 axial location of blockage (inlet, outlet) [m] More...
 
const std::vector< unsigned int_index_blockage
 index of subchannels affected by blockage More...
 
const std::vector< Real_reduction_blockage
 area reduction of subchannels affected by blockage More...
 
const std::vector< Real_k_blockage
 form loss coefficient of subchannels affected by blockage More...
 
const Real _pitch
 Distance between the neighbor fuel pins, pitch. More...
 
const Real_kij
 Lateral form loss coefficient. More...
 
const Real _pin_diameter
 fuel Pin diameter More...
 
const unsigned int _n_cells
 number of axial cells More...
 
const unsigned int _n_rings
 number of rings of fuel pins More...
 
unsigned int _n_channels
 number of subchannels More...
 
const Real _flat_to_flat
 the distance between flat surfaces of the duct facing each other More...
 
const Real _dwire
 wire diameter More...
 
const Real _hwire
 wire lead length More...
 
const Real _duct_to_pin_gap
 the gap thickness between the duct and peripheral fuel pins More...
 
std::vector< std::vector< Node * > > _nodes
 nodes More...
 
std::vector< std::pair< unsigned int, unsigned int > > _gap_to_chan_map
 stores the channel pairs for each gap More...
 
std::vector< std::pair< unsigned int, unsigned int > > _gap_to_pin_map
 stores the fuel pin pairs for each gap each gap More...
 
std::vector< std::vector< unsigned int > > _chan_to_gap_map
 stores the gaps that forms each subchannel More...
 
std::vector< std::vector< Real > > _sign_id_crossflow_map
 Defines the global cross-flow direction -1 or 1 for each subchannel and for all gaps that are belonging to the corresponding subchannel. More...
 
std::vector< std::vector< Real > > _gij_map
 gap size More...
 
std::vector< std::vector< Real > > _subchannel_position
 x,y coordinates of the subchannel centroids More...
 
std::vector< Point > _pin_position
 x,y coordinates of the fuel pins More...
 
std::vector< std::vector< Real > > _pins_in_rings
 fuel pins that are belonging to each ring More...
 
std::vector< std::vector< unsigned int > > _chan_to_pin_map
 stores the fuel pins belonging to each subchannel More...
 
std::vector< std::vector< unsigned int > > _pin_to_chan_map
 stores the map from pins to channels More...
 
unsigned int _npins
 number of fuel pins More...
 
unsigned int _n_gaps
 number of gaps More...
 
std::vector< EChannelType_subch_type
 subchannel type More...
 
std::vector< EChannelType_gap_type
 gap type More...
 
std::vector< std::pair< unsigned int, unsigned int > > _gap_pairs_sf
 sweeping flow model gap pairs per channel to specify directional edge flow More...
 
std::vector< std::pair< unsigned int, unsigned int > > _chan_pairs_sf
 sweeping flow model channel pairs to specify directional edge flow More...
 
MooseMesh *const _mesh
 
const bool & _enabled
 
MooseApp_app
 
const std::string _type
 
const std::string _name
 
const InputParameters_pars
 
Factory_factory
 
ActionFactory_action_factory
 
const Parallel::Communicator & _communicator
 

Detailed Description

Mesh class for triangular, edge and corner subchannels for hexagonal lattice fuel assemblies.

Definition at line 18 of file SCMTriSubChannelMeshGenerator.h.

Constructor & Destructor Documentation

◆ SCMTriSubChannelMeshGenerator()

SCMTriSubChannelMeshGenerator::SCMTriSubChannelMeshGenerator ( const InputParameters parameters)

initial assignment

Special case _n_rings == 1

Definition at line 61 of file SCMTriSubChannelMeshGenerator.C.

62  : MeshGenerator(params),
63  _unheated_length_entry(getParam<Real>("unheated_length_entry")),
64  _heated_length(getParam<Real>("heated_length")),
65  _unheated_length_exit(getParam<Real>("unheated_length_exit")),
66  _block_id(getParam<unsigned int>("block_id")),
67  _spacer_z(getParam<std::vector<Real>>("spacer_z")),
68  _spacer_k(getParam<std::vector<Real>>("spacer_k")),
69  _z_blockage(getParam<std::vector<Real>>("z_blockage")),
70  _index_blockage(getParam<std::vector<unsigned int>>("index_blockage")),
71  _reduction_blockage(getParam<std::vector<Real>>("reduction_blockage")),
72  _k_blockage(getParam<std::vector<Real>>("k_blockage")),
73  _pitch(getParam<Real>("pitch")),
74  _kij(getParam<Real>("Kij")),
75  _pin_diameter(getParam<Real>("pin_diameter")),
76  _n_cells(getParam<unsigned int>("n_cells")),
77  _n_rings(getParam<unsigned int>("nrings")),
78  _flat_to_flat(getParam<Real>("flat_to_flat")),
79  _dwire(getParam<Real>("dwire")),
80  _hwire(getParam<Real>("hwire")),
81  _duct_to_pin_gap(0.5 *
82  (_flat_to_flat - (_n_rings - 1) * _pitch * std::sqrt(3.0) - _pin_diameter))
83 {
84  if (_spacer_z.size() != _spacer_k.size())
85  mooseError(name(), ": Size of vector spacer_z should be equal to size of vector spacer_k");
86 
87  if (_spacer_z.size() &&
89  mooseError(name(), ": Location of spacers should be less than the total bundle length");
90 
91  if (_z_blockage.size() != 2)
92  mooseError(name(), ": Size of vector z_blockage must be 2");
93 
94  if (*max_element(_reduction_blockage.begin(), _reduction_blockage.end()) > 1)
95  mooseError(name(), ": The area reduction of the blocked subchannels cannot be more than 1");
96 
97  if ((_index_blockage.size() != _reduction_blockage.size()) ||
98  (_index_blockage.size() != _k_blockage.size()) ||
99  (_reduction_blockage.size() != _k_blockage.size()))
100  mooseError(name(),
101  ": Size of vectors: index_blockage, reduction_blockage, k_blockage, must be equal "
102  "to eachother");
103 
106 
107  // Defining the total length from 3 axial sections
109 
110  // Defining the position of the spacer grid in the numerical solution array
111  std::vector<int> spacer_cell;
112  for (const auto & elem : _spacer_z)
113  spacer_cell.emplace_back(std::round(elem * _n_cells / L));
114 
115  // Defining the array for axial resistances
116  std::vector<Real> kgrid;
117  kgrid.resize(_n_cells + 1, 0.0);
118 
119  // Summing the spacer resistance to the grid resistance array
120  for (unsigned int index = 0; index < spacer_cell.size(); index++)
121  kgrid[spacer_cell[index]] += _spacer_k[index];
122 
123  // compute the hex mesh variables
124  // -------------------------------------------
125 
126  // x coordinate for the first position
127  Real x0 = 0.0;
128  // y coordinate for the first position
129  Real y0 = 0.0;
130  // x coordinate for the second position
131  Real x1 = 0.0;
132  // y coordinate for the second position dummy variable
133  Real y1 = 0.0;
134  // dummy variable
135  Real a1 = 0.0;
136  // dummy variable
137  Real a2 = 0.0;
138  // average x coordinate
139  Real avg_coor_x = 0.0;
140  // average y coordinate
141  Real avg_coor_y = 0.0;
142  // distance between two points
143  Real dist = 0.0;
144  // distance between two points
145  Real dist0 = 0.0;
146  // integer counter
147  unsigned int kgap = 0;
148  // dummy integer
149  unsigned int icorner = 0;
150  // used to defined global direction of the cross_flow_map coefficients for each subchannel and gap
151  const Real positive_flow = 1.0;
152  // used to defined global direction of the cross_flow_map coefficients for each subchannel and gap
153  const Real negative_flow = -1.0;
154  // the indicator used while setting _gap_to_chan_map array
155  std::vector<std::pair<unsigned int, unsigned int>> gap_fill;
157  _npins = _pin_position.size();
158  // assign the pins to the corresponding rings
159  unsigned int k = 0; // initialize the fuel Pin counter index
160  _pins_in_rings.resize(_n_rings);
161  _pins_in_rings[0].push_back(k++);
162  for (unsigned int i = 1; i < _n_rings; i++)
163  for (unsigned int j = 0; j < i * 6; j++)
164  _pins_in_rings[i].push_back(k++);
165  // Given the number of pins and number of fuel Pin rings, the number of subchannels can be
166  // computed as follows:
167  unsigned int chancount = 0.0;
168  // Summing internal channels
169  for (unsigned int j = 0; j < _n_rings - 1; j++)
170  chancount += j * 6;
171  // Adding external channels to the total count
172  _n_channels = chancount + _npins - 1 + (_n_rings - 1) * 6 + 6;
173 
174  if (*max_element(_index_blockage.begin(), _index_blockage.end()) > (_n_channels - 1))
175  mooseError(name(),
176  ": The index of the blocked subchannel cannot be more than the max index of the "
177  "subchannels");
178 
179  if ((_index_blockage.size() > _n_channels) || (_reduction_blockage.size() > _n_channels) ||
180  (_k_blockage.size() > _n_channels))
181  mooseError(name(),
182  ": Size of vectors: index_blockage, reduction_blockage, k_blockage, cannot be more "
183  "than the total number of subchannels");
184 
185  // Defining the 2D array for axial resistances
186  _k_grid.resize(_n_channels, std::vector<Real>(_n_cells + 1));
187  for (unsigned int i = 0; i < _n_channels; i++)
188  _k_grid[i] = kgrid;
189 
190  // Add blockage resistance to the 2D grid resistane array
191  Real dz = L / _n_cells;
192  for (unsigned int i = 0; i < _n_cells + 1; i++)
193  {
194  if ((dz * i >= _z_blockage.front() && dz * i <= _z_blockage.back()))
195  {
196  unsigned int index(0);
197  for (const auto & i_ch : _index_blockage)
198  {
199  _k_grid[i_ch][i] += _k_blockage[index];
200  index++;
201  }
202  }
203  }
204 
206  _pin_to_chan_map.resize(_npins);
207  _subch_type.resize(_n_channels);
208  _n_gaps = _n_channels + _npins - 1;
209  _gap_to_chan_map.resize(_n_gaps);
210  _gap_to_pin_map.resize(_n_gaps);
211  gap_fill.resize(_n_gaps);
213  _gap_pairs_sf.resize(_n_channels);
214  _chan_pairs_sf.resize(_n_channels);
215  _gij_map.resize(_n_cells + 1);
217  _gap_type.resize(_n_gaps);
219 
220  for (unsigned int i = 0; i < _n_channels; i++)
221  {
222  _chan_to_pin_map[i].reserve(3);
223  _chan_to_gap_map[i].reserve(3);
224  _sign_id_crossflow_map[i].reserve(3);
225  _subchannel_position[i].reserve(3);
226  for (unsigned int j = 0; j < 3; j++)
227  {
228  _sign_id_crossflow_map.at(i).push_back(positive_flow);
229  _subchannel_position.at(i).push_back(0.0);
230  }
231  }
232 
233  for (unsigned int iz = 0; iz < _n_cells + 1; iz++)
234  {
235  _gij_map[iz].reserve(_n_gaps);
236  }
237 
238  for (unsigned int i = 0; i < _npins; i++)
239  _pin_to_chan_map[i].reserve(6);
240 
241  // create the subchannels
242  k = 0; // initialize the subchannel counter index
243  kgap = 0;
244  // for each ring we trace the subchannels by pairing up to neighbor pins and looking for the third
245  // Pin at inner or outer ring compared to the current ring.
246  for (unsigned int i = 1; i < _n_rings; i++)
247  {
248  // find the closest Pin at back ring
249  for (unsigned int j = 0; j < _pins_in_rings[i].size(); j++)
250  {
251  if (j == _pins_in_rings[i].size() - 1)
252  {
253  _chan_to_pin_map[k].push_back(_pins_in_rings[i][j]);
254  _chan_to_pin_map[k].push_back(_pins_in_rings[i][0]);
255  avg_coor_x =
256  0.5 * (_pin_position[_pins_in_rings[i][j]](0) + _pin_position[_pins_in_rings[i][0]](0));
257  avg_coor_y =
258  0.5 * (_pin_position[_pins_in_rings[i][j]](1) + _pin_position[_pins_in_rings[i][0]](1));
259  _gap_to_pin_map[kgap].first = _pins_in_rings[i][0];
260  _gap_to_pin_map[kgap].second = _pins_in_rings[i][j];
262  kgap = kgap + 1;
263  }
264  else
265  {
266  _chan_to_pin_map[k].push_back(_pins_in_rings[i][j]);
267  _chan_to_pin_map[k].push_back(_pins_in_rings[i][j + 1]);
268  avg_coor_x = 0.5 * (_pin_position[_pins_in_rings[i][j]](0) +
269  _pin_position[_pins_in_rings[i][j + 1]](0));
270  avg_coor_y = 0.5 * (_pin_position[_pins_in_rings[i][j]](1) +
271  _pin_position[_pins_in_rings[i][j + 1]](1));
272  _gap_to_pin_map[kgap].first = _pins_in_rings[i][j];
273  _gap_to_pin_map[kgap].second = _pins_in_rings[i][j + 1];
275  kgap = kgap + 1;
276  }
277 
278  dist0 = 1.0e+5;
279 
280  _chan_to_pin_map[k].push_back(_pins_in_rings[i - 1][0]);
281  unsigned int l0 = 0;
282 
283  for (unsigned int l = 0; l < _pins_in_rings[i - 1].size(); l++)
284  {
285  dist = std::sqrt(pow(_pin_position[_pins_in_rings[i - 1][l]](0) - avg_coor_x, 2) +
286  pow(_pin_position[_pins_in_rings[i - 1][l]](1) - avg_coor_y, 2));
287 
288  if (dist < dist0)
289  {
290  _chan_to_pin_map[k][2] = _pins_in_rings[i - 1][l];
291  l0 = l;
292  dist0 = dist;
293  } // if
294  } // l
295 
296  _gap_to_pin_map[kgap].first = _pins_in_rings[i][j];
297  _gap_to_pin_map[kgap].second = _pins_in_rings[i - 1][l0];
299  kgap = kgap + 1;
301  k = k + 1;
302 
303  } // for j
304 
305  // find the closest Pin at front ring
306 
307  for (unsigned int j = 0; j < _pins_in_rings[i].size(); j++)
308  {
309  if (j == _pins_in_rings[i].size() - 1)
310  {
311  _chan_to_pin_map[k].push_back(_pins_in_rings[i][j]);
312  _chan_to_pin_map[k].push_back(_pins_in_rings[i][0]);
313  avg_coor_x =
314  0.5 * (_pin_position[_pins_in_rings[i][j]](0) + _pin_position[_pins_in_rings[i][0]](0));
315  avg_coor_y =
316  0.5 * (_pin_position[_pins_in_rings[i][j]](1) + _pin_position[_pins_in_rings[i][0]](1));
317  }
318  else
319  {
320  _chan_to_pin_map[k].push_back(_pins_in_rings[i][j]);
321  _chan_to_pin_map[k].push_back(_pins_in_rings[i][j + 1]);
322  avg_coor_x = 0.5 * (_pin_position[_pins_in_rings[i][j]](0) +
323  _pin_position[_pins_in_rings[i][j + 1]](0));
324  avg_coor_y = 0.5 * (_pin_position[_pins_in_rings[i][j]](1) +
325  _pin_position[_pins_in_rings[i][j + 1]](1));
326  }
327 
328  // if the outermost ring, set the edge subchannels first... then the corner subchannels
329  if (i == _n_rings - 1)
330  {
331  // add edges
332  _subch_type[k] = EChannelType::EDGE; // an edge subchannel is created
333  _gap_to_pin_map[kgap].first = _pins_in_rings[i][j];
334  _gap_to_pin_map[kgap].second = _pins_in_rings[i][j];
336  _chan_to_gap_map[k].push_back(kgap);
337  kgap = kgap + 1;
338  k = k + 1;
339 
340  if (j % i == 0)
341  {
342  // generate a corner subchannel, generate the additional gap and fix chan_to_gap_map
343  _gap_to_pin_map[kgap].first = _pins_in_rings[i][j];
344  _gap_to_pin_map[kgap].second = _pins_in_rings[i][j];
346 
347  // corner subchannel
348  _chan_to_pin_map[k].push_back(_pins_in_rings[i][j]);
349  _chan_to_gap_map[k].push_back(kgap - 1);
350  _chan_to_gap_map[k].push_back(kgap);
352 
353  kgap = kgap + 1;
354  k = k + 1;
355  }
356  // if not the outer most ring
357  }
358  else
359  {
360  dist0 = 1.0e+5;
361  unsigned int l0 = 0;
362  _chan_to_pin_map[k].push_back(_pins_in_rings[i + 1][0]);
363  for (unsigned int l = 0; l < _pins_in_rings[i + 1].size(); l++)
364  {
365  dist = std::sqrt(pow(_pin_position[_pins_in_rings[i + 1][l]](0) - avg_coor_x, 2) +
366  pow(_pin_position[_pins_in_rings[i + 1][l]](1) - avg_coor_y, 2));
367  if (dist < dist0)
368  {
369  _chan_to_pin_map[k][2] = _pins_in_rings[i + 1][l];
370  dist0 = dist;
371  l0 = l;
372  } // if
373  } // l
374 
375  _gap_to_pin_map[kgap].first = _pins_in_rings[i][j];
376  _gap_to_pin_map[kgap].second = _pins_in_rings[i + 1][l0];
378  kgap = kgap + 1;
380  k = k + 1;
381  } // if
382  } // for j
383  } // for i
384 
385  // Constructing pins to channels mao
386  for (unsigned int loc_rod = 0; loc_rod < _npins; loc_rod++)
387  {
388  for (unsigned int i = 0; i < _n_channels; i++)
389  {
390  bool rod_in_sc = false;
391  for (unsigned int j : _chan_to_pin_map[i])
392  {
393  if (j == loc_rod)
394  rod_in_sc = true;
395  }
396  if (rod_in_sc)
397  {
398  _pin_to_chan_map[loc_rod].push_back(i);
399  }
400  }
401  }
402 
403  // find the _gap_to_chan_map and _chan_to_gap_map using the gap_to_rod and subchannel_to_rod_maps
404 
405  for (unsigned int i = 0; i < _n_channels; i++)
406  {
408  {
409  for (unsigned int j = 0; j < _n_gaps; j++)
410  {
412  {
413  if (((_chan_to_pin_map[i][0] == _gap_to_pin_map[j].first) &&
414  (_chan_to_pin_map[i][1] == _gap_to_pin_map[j].second)) ||
415  ((_chan_to_pin_map[i][0] == _gap_to_pin_map[j].second) &&
416  (_chan_to_pin_map[i][1] == _gap_to_pin_map[j].first)))
417  {
418  _chan_to_gap_map[i].push_back(j);
419  }
420 
421  if (((_chan_to_pin_map[i][0] == _gap_to_pin_map[j].first) &&
422  (_chan_to_pin_map[i][2] == _gap_to_pin_map[j].second)) ||
423  ((_chan_to_pin_map[i][0] == _gap_to_pin_map[j].second) &&
424  (_chan_to_pin_map[i][2] == _gap_to_pin_map[j].first)))
425  {
426  _chan_to_gap_map[i].push_back(j);
427  }
428 
429  if (((_chan_to_pin_map[i][1] == _gap_to_pin_map[j].first) &&
430  (_chan_to_pin_map[i][2] == _gap_to_pin_map[j].second)) ||
431  ((_chan_to_pin_map[i][1] == _gap_to_pin_map[j].second) &&
432  (_chan_to_pin_map[i][2] == _gap_to_pin_map[j].first)))
433  {
434  _chan_to_gap_map[i].push_back(j);
435  }
436  }
437  } // for j
438  }
439  else if (_subch_type[i] == EChannelType::EDGE)
440  {
441  for (unsigned int j = 0; j < _n_gaps; j++)
442  {
444  {
445  if (((_chan_to_pin_map[i][0] == _gap_to_pin_map[j].first) &&
446  (_chan_to_pin_map[i][1] == _gap_to_pin_map[j].second)) ||
447  ((_chan_to_pin_map[i][0] == _gap_to_pin_map[j].second) &&
448  (_chan_to_pin_map[i][1] == _gap_to_pin_map[j].first)))
449  {
450  _chan_to_gap_map[i].push_back(j);
451  }
452  }
453  }
454 
455  icorner = 0;
456  for (unsigned int k = 0; k < _n_channels; k++)
457  {
459  _chan_to_pin_map[i][1] == _chan_to_pin_map[k][0])
460  {
461  _chan_to_gap_map[i].push_back(_chan_to_gap_map[k][1]);
462  icorner = 1;
463  break;
464  } // if
465  } // for
466 
467  for (unsigned int k = 0; k < _n_channels; k++)
468  {
470  _chan_to_pin_map[i][0] == _chan_to_pin_map[k][0])
471  {
472  _chan_to_gap_map[i].push_back(_chan_to_gap_map[k][1] + 1);
473  icorner = 1;
474  break;
475  }
476  }
477 
478  if (icorner == 0)
479  {
480  _chan_to_gap_map[i].push_back(_chan_to_gap_map[i][0] + 1);
481  }
482  }
483  }
484 
485  // find gap_to_chan_map pair
486 
487  for (unsigned int j = 0; j < _n_gaps; j++)
488  {
489  for (unsigned int i = 0; i < _n_channels; i++)
490  {
492  {
493  if ((j == _chan_to_gap_map[i][0]) || (j == _chan_to_gap_map[i][1]) ||
494  (j == _chan_to_gap_map[i][2]))
495  {
496  if (_gap_to_chan_map[j].first == 0 && gap_fill[j].first == 0)
497  {
498  _gap_to_chan_map[j].first = i;
499  gap_fill[j].first = 1;
500  }
501  else if (_gap_to_chan_map[j].second == 0 && gap_fill[j].second == 0)
502  {
503  _gap_to_chan_map[j].second = i;
504  gap_fill[j].second = 1;
505  }
506  else
507  {
508  }
509  }
510  }
511  else if (_subch_type[i] == EChannelType::CORNER)
512  {
513  if ((j == _chan_to_gap_map[i][0]) || (j == _chan_to_gap_map[i][1]))
514  {
515  if (_gap_to_chan_map[j].first == 0 && gap_fill[j].first == 0)
516  {
517  _gap_to_chan_map[j].first = i;
518  gap_fill[j].first = 1;
519  }
520  else if (_gap_to_chan_map[j].second == 0 && gap_fill[j].second == 0)
521  {
522  _gap_to_chan_map[j].second = i;
523  gap_fill[j].second = 1;
524  }
525  else
526  {
527  }
528  }
529  }
530  } // i
531  } // j
532 
533  for (unsigned int k = 0; k < _n_channels; k++)
534  {
536  {
537  _gap_pairs_sf[k].first = _chan_to_gap_map[k][0];
538  _gap_pairs_sf[k].second = _chan_to_gap_map[k][2];
539  auto k1 = _gap_pairs_sf[k].first;
540  auto k2 = _gap_pairs_sf[k].second;
541  if (_gap_to_chan_map[k1].first == k)
542  {
543  _chan_pairs_sf[k].first = _gap_to_chan_map[k1].second;
544  }
545  else
546  {
547  _chan_pairs_sf[k].first = _gap_to_chan_map[k1].first;
548  }
549 
550  if (_gap_to_chan_map[k2].first == k)
551  {
552  _chan_pairs_sf[k].second = _gap_to_chan_map[k2].second;
553  }
554  else
555  {
556  _chan_pairs_sf[k].second = _gap_to_chan_map[k2].first;
557  }
558  }
559  else if (_subch_type[k] == EChannelType::CORNER)
560  {
561  _gap_pairs_sf[k].first = _chan_to_gap_map[k][1];
562  _gap_pairs_sf[k].second = _chan_to_gap_map[k][0];
563 
564  auto k1 = _gap_pairs_sf[k].first;
565  auto k2 = _gap_pairs_sf[k].second;
566 
567  if (_gap_to_chan_map[k1].first == k)
568  {
569  _chan_pairs_sf[k].first = _gap_to_chan_map[k1].second;
570  }
571  else
572  {
573  _chan_pairs_sf[k].first = _gap_to_chan_map[k1].first;
574  }
575 
576  if (_gap_to_chan_map[k2].first == k)
577  {
578  _chan_pairs_sf[k].second = _gap_to_chan_map[k2].second;
579  }
580  else
581  {
582  _chan_pairs_sf[k].second = _gap_to_chan_map[k2].first;
583  }
584  }
585  }
586 
587  // set the _gij_map
588  for (unsigned int iz = 0; iz < _n_cells + 1; iz++)
589  {
590  for (unsigned int i_gap = 0; i_gap < _n_gaps; i_gap++)
591  {
592  if (_gap_type[i_gap] == EChannelType::CENTER)
593  {
594  _gij_map[iz].push_back(_pitch - _pin_diameter);
595  }
596  else if (_gap_type[i_gap] == EChannelType::EDGE || _gap_type[i_gap] == EChannelType::CORNER)
597  {
598  _gij_map[iz].push_back(_duct_to_pin_gap);
599  }
600  }
601  }
602 
603  for (unsigned int i = 0; i < _n_channels; i++)
604  {
606  {
607  for (unsigned int k = 0; k < 3; k++)
608  {
609  for (unsigned int j = 0; j < _n_gaps; j++)
610  {
611  if (_chan_to_gap_map[i][k] == j && i == _gap_to_chan_map[j].first)
612  {
613  if (i > _gap_to_chan_map[j].second)
614  {
615  _sign_id_crossflow_map[i][k] = negative_flow;
616  }
617  else
618  {
619  _sign_id_crossflow_map[i][k] = positive_flow;
620  }
621  }
622  else if (_chan_to_gap_map[i][k] == j && i == _gap_to_chan_map[j].second)
623  {
624  if (i > _gap_to_chan_map[j].first)
625  {
626  _sign_id_crossflow_map[i][k] = negative_flow;
627  }
628  else
629  {
630  _sign_id_crossflow_map[i][k] = positive_flow;
631  }
632  }
633  } // j
634  } // k
635  }
636  else if (_subch_type[i] == EChannelType::CORNER)
637  {
638  for (unsigned int k = 0; k < 2; k++)
639  {
640  for (unsigned int j = 0; j < _n_gaps; j++)
641  {
642  if (_chan_to_gap_map[i][k] == j && i == _gap_to_chan_map[j].first)
643  {
644  if (i > _gap_to_chan_map[j].second)
645  {
646  _sign_id_crossflow_map[i][k] = negative_flow;
647  }
648  else
649  {
650  _sign_id_crossflow_map[i][k] = positive_flow;
651  }
652  }
653  else if (_chan_to_gap_map[i][k] == j && i == _gap_to_chan_map[j].second)
654  {
655  if (i > _gap_to_chan_map[j].first)
656  {
657  _sign_id_crossflow_map[i][k] = negative_flow;
658  }
659  else
660  {
661  _sign_id_crossflow_map[i][k] = positive_flow;
662  }
663  }
664  } // j
665  } // k
666  } // subch_type =2
667  } // i
668 
669  // set the subchannel positions
670  for (unsigned int i = 0; i < _n_channels; i++)
671  {
673  {
674  _subchannel_position[i][0] =
676  _pin_position[_chan_to_pin_map[i][2]](0)) /
677  3.0;
678  _subchannel_position[i][1] =
680  _pin_position[_chan_to_pin_map[i][2]](1)) /
681  3.0;
682  }
683  else if (_subch_type[i] == EChannelType::EDGE)
684  {
685  for (unsigned int j = 0; j < _n_channels; j++)
686  {
688  ((_chan_to_pin_map[i][0] == _chan_to_pin_map[j][0] &&
689  _chan_to_pin_map[i][1] == _chan_to_pin_map[j][1]) ||
690  (_chan_to_pin_map[i][0] == _chan_to_pin_map[j][1] &&
691  _chan_to_pin_map[i][1] == _chan_to_pin_map[j][0])))
692  {
693  x0 = _pin_position[_chan_to_pin_map[j][2]](0);
694  y0 = _pin_position[_chan_to_pin_map[j][2]](1);
695  }
696  else if (_subch_type[j] == EChannelType::CENTER &&
697  ((_chan_to_pin_map[i][0] == _chan_to_pin_map[j][0] &&
698  _chan_to_pin_map[i][1] == _chan_to_pin_map[j][2]) ||
699  (_chan_to_pin_map[i][0] == _chan_to_pin_map[j][2] &&
700  _chan_to_pin_map[i][1] == _chan_to_pin_map[j][0])))
701  {
702  x0 = _pin_position[_chan_to_pin_map[j][1]](0);
703  y0 = _pin_position[_chan_to_pin_map[j][1]](1);
704  }
705  else if (_subch_type[j] == EChannelType::CENTER &&
706  ((_chan_to_pin_map[i][0] == _chan_to_pin_map[j][1] &&
707  _chan_to_pin_map[i][1] == _chan_to_pin_map[j][2]) ||
708  (_chan_to_pin_map[i][0] == _chan_to_pin_map[j][2] &&
709  _chan_to_pin_map[i][1] == _chan_to_pin_map[j][1])))
710  {
711  x0 = _pin_position[_chan_to_pin_map[j][0]](0);
712  y0 = _pin_position[_chan_to_pin_map[j][0]](1);
713  }
714  x1 = 0.5 *
716  y1 = 0.5 *
718  a1 = _pin_diameter / 2.0 + _duct_to_pin_gap / 2.0;
719  a2 = std::sqrt((x1 - x0) * (x1 - x0) + (y1 - y0) * (y1 - y0)) + a1;
720  _subchannel_position[i][0] = (a2 * x1 - a1 * x0) / (a2 - a1);
721  _subchannel_position[i][1] = (a2 * y1 - a1 * y0) / (a2 - a1);
722  } // j
723  }
724  else if (_subch_type[i] == EChannelType::CORNER)
725  {
726  x0 = _pin_position[0](0);
727  y0 = _pin_position[0](1);
728  x1 = _pin_position[_chan_to_pin_map[i][0]](0);
729  y1 = _pin_position[_chan_to_pin_map[i][0]](1);
730  a1 = _pin_diameter / 2.0 + _duct_to_pin_gap / 2.0;
731  a2 = std::sqrt((x1 - x0) * (x1 - x0) + (y1 - y0) * (y1 - y0)) + a1;
732  _subchannel_position[i][0] = (a2 * x1 - a1 * x0) / (a2 - a1);
733  _subchannel_position[i][1] = (a2 * y1 - a1 * y0) / (a2 - a1);
734  }
735  }
736 
738  if (_n_rings == 1)
739  {
740  for (unsigned int i = 0; i < _n_channels; i++)
741  {
742  Real angle = (2 * i + 1) * libMesh::pi / 6.0;
744  _subchannel_position[i][0] = std::cos(angle) * _flat_to_flat / 2.0;
745  _subchannel_position[i][1] = std::sin(angle) * _flat_to_flat / 2.0;
746  }
747  }
748 
749  // Reduce reserved memory in the channel-to-gap map.
750  for (auto & gap : _chan_to_gap_map)
751  {
752  gap.shrink_to_fit();
753  }
754 }
unsigned int _npins
number of fuel pins
std::vector< EChannelType > _gap_type
gap type
std::vector< std::vector< Real > > _pins_in_rings
fuel pins that are belonging to each ring
std::vector< std::pair< unsigned int, unsigned int > > _chan_pairs_sf
sweeping flow model channel pairs to specify directional edge flow
std::vector< std::pair< unsigned int, unsigned int > > _gap_to_chan_map
stores the channel pairs for each gap
std::vector< EChannelType > _subch_type
subchannel type
std::vector< std::pair< unsigned int, unsigned int > > _gap_pairs_sf
sweeping flow model gap pairs per channel to specify directional edge flow
const unsigned int _n_cells
number of axial cells
std::vector< Real > _z_grid
axial location of nodes
MeshGenerator(const InputParameters &parameters)
const std::vector< unsigned int > _index_blockage
index of subchannels affected by blockage
const std::vector< Real > _z_blockage
axial location of blockage (inlet, outlet) [m]
const std::vector< Real > & _spacer_z
axial location of the spacers
const unsigned int _block_id
block index
virtual const std::string & name() const
const Real _flat_to_flat
the distance between flat surfaces of the duct facing each other
unsigned int _n_channels
number of subchannels
std::vector< std::vector< Real > > _sign_id_crossflow_map
Defines the global cross-flow direction -1 or 1 for each subchannel and for all gaps that are belongi...
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.
const Real _pitch
Distance between the neighbor fuel pins, pitch.
const unsigned int _n_rings
number of rings of fuel pins
const std::vector< Real > _k_blockage
form loss coefficient of subchannels affected by blockage
std::vector< std::vector< Real > > _subchannel_position
x,y coordinates of the subchannel centroids
std::vector< Point > _pin_position
x,y coordinates of the fuel pins
const T & getParam(const std::string &name) const
std::vector< std::vector< Real > > _gij_map
gap size
const Real _pin_diameter
fuel Pin diameter
const Real _heated_length
heated length of the fuel Pin
std::vector< std::vector< unsigned int > > _chan_to_pin_map
stores the fuel pins belonging to each subchannel
const std::vector< Real > _reduction_blockage
area reduction of subchannels affected by blockage
static void rodPositions(std::vector< Point > &positions, unsigned int nrings, Real pitch, Point center)
Calculates and stores the pin positions/centers for a hexagonal assembly containing the given number ...
const Real _unheated_length_entry
unheated length of the fuel Pin at the entry of the assembly
ExpressionBuilder::EBTerm pow(const ExpressionBuilder::EBTerm &left, T exponent)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
std::vector< std::vector< Real > > _k_grid
axial form loss coefficient per computational cell
std::vector< std::pair< unsigned int, unsigned int > > _gap_to_pin_map
stores the fuel pin pairs for each gap each gap
void mooseError(Args &&... args) const
const Real _duct_to_pin_gap
the gap thickness between the duct and peripheral fuel pins
static const std::complex< double > j(0, 1)
Complex number "j" (also known as "i")
const Real & _kij
Lateral form loss coefficient.
std::vector< std::vector< unsigned int > > _pin_to_chan_map
stores the map from pins to channels
const std::vector< Real > & _spacer_k
form loss coefficient of the spacers
const Real _unheated_length_exit
unheated length of the fuel Pin at the exit of the assembly
std::vector< std::vector< unsigned int > > _chan_to_gap_map
stores the gaps that forms each subchannel
static const std::string k
Definition: NS.h:130
const Real pi

Member Function Documentation

◆ generate()

std::unique_ptr< MeshBase > SCMTriSubChannelMeshGenerator::generate ( )
overridevirtual

Implements MeshGenerator.

Definition at line 757 of file SCMTriSubChannelMeshGenerator.C.

758 {
759  auto mesh_base = buildMeshBaseObject();
760 
761  BoundaryInfo & boundary_info = mesh_base->get_boundary_info();
762  mesh_base->set_spatial_dimension(3);
763  mesh_base->reserve_elem(_n_cells * _n_channels);
764  mesh_base->reserve_nodes((_n_cells + 1) * _n_channels);
765  _nodes.resize(_n_channels);
766  // Add the points for the give x,y subchannel positions. The grid is hexagonal.
767  // The grid along
768  // z is irregular to account for Pin spacers. Store pointers in the _nodes
769  // array so we can keep track of which points are in which channels.
770  unsigned int node_id = 0;
771  for (unsigned int i = 0; i < _n_channels; i++)
772  {
773  _nodes[i].reserve(_n_cells + 1);
774  for (unsigned int iz = 0; iz < _n_cells + 1; iz++)
775  {
776  _nodes[i].push_back(mesh_base->add_point(
777  Point(_subchannel_position[i][0], _subchannel_position[i][1], _z_grid[iz]), node_id++));
778  }
779  }
780 
781  // Add the elements which in this case are 2-node edges that link each
782  // subchannel's nodes vertically.
783  unsigned int elem_id = 0;
784  for (unsigned int i = 0; i < _n_channels; i++)
785  {
786  for (unsigned int iz = 0; iz < _n_cells; iz++)
787  {
788  Elem * elem = new Edge2;
789  elem->set_id(elem_id++);
790  elem = mesh_base->add_elem(elem);
791  const int indx1 = (_n_cells + 1) * i + iz;
792  const int indx2 = (_n_cells + 1) * i + (iz + 1);
793  elem->set_node(0, mesh_base->node_ptr(indx1));
794  elem->set_node(1, mesh_base->node_ptr(indx2));
795 
796  if (iz == 0)
797  boundary_info.add_side(elem, 0, 0);
798  if (iz == _n_cells - 1)
799  boundary_info.add_side(elem, 1, 1);
800  }
801  }
802  boundary_info.sideset_name(0) = "inlet";
803  boundary_info.sideset_name(1) = "outlet";
804  boundary_info.nodeset_name(0) = "inlet";
805  boundary_info.nodeset_name(1) = "outlet";
806 
807  // Naming the block
808  mesh_base->subdomain_name(_block_id) = name();
809 
810  mesh_base->prepare_for_use();
811 
812  // move the meta data into TriSubChannelMesh
813  auto & sch_mesh = static_cast<TriSubChannelMesh &>(*_mesh);
815  sch_mesh._heated_length = _heated_length;
816  sch_mesh._unheated_length_exit = _unheated_length_exit;
817  sch_mesh._z_grid = _z_grid;
818  sch_mesh._k_grid = _k_grid;
819  sch_mesh._spacer_z = _spacer_z;
820  sch_mesh._spacer_k = _spacer_k;
821  sch_mesh._z_blockage = _z_blockage;
822  sch_mesh._index_blockage = _index_blockage;
823  sch_mesh._reduction_blockage = _reduction_blockage;
824  sch_mesh._kij = _kij;
825  sch_mesh._pitch = _pitch;
826  sch_mesh._pin_diameter = _pin_diameter;
827  sch_mesh._n_cells = _n_cells;
828  sch_mesh._n_rings = _n_rings;
829  sch_mesh._n_channels = _n_channels;
830  sch_mesh._flat_to_flat = _flat_to_flat;
831  sch_mesh._dwire = _dwire;
832  sch_mesh._hwire = _hwire;
833  sch_mesh._duct_to_pin_gap = _duct_to_pin_gap;
834  sch_mesh._nodes = _nodes;
835  sch_mesh._gap_to_chan_map = _gap_to_chan_map;
836  sch_mesh._gap_to_pin_map = _gap_to_pin_map;
837  sch_mesh._chan_to_gap_map = _chan_to_gap_map;
838  sch_mesh._sign_id_crossflow_map = _sign_id_crossflow_map;
839  sch_mesh._gij_map = _gij_map;
840  sch_mesh._subchannel_position = _subchannel_position;
841  sch_mesh._pin_position = _pin_position;
842  sch_mesh._pins_in_rings = _pins_in_rings;
843  sch_mesh._chan_to_pin_map = _chan_to_pin_map;
844  sch_mesh._npins = _npins;
845  sch_mesh._n_gaps = _n_gaps;
846  sch_mesh._subch_type = _subch_type;
847  sch_mesh._gap_type = _gap_type;
848  sch_mesh._gap_pairs_sf = _gap_pairs_sf;
849  sch_mesh._chan_pairs_sf = _chan_pairs_sf;
850  sch_mesh._pin_to_chan_map = _pin_to_chan_map;
851 
852  return mesh_base;
853 }
unsigned int _npins
number of fuel pins
std::vector< EChannelType > _gap_type
gap type
std::vector< std::vector< Real > > _pins_in_rings
fuel pins that are belonging to each ring
std::vector< std::pair< unsigned int, unsigned int > > _chan_pairs_sf
sweeping flow model channel pairs to specify directional edge flow
std::vector< std::pair< unsigned int, unsigned int > > _gap_to_chan_map
stores the channel pairs for each gap
std::vector< EChannelType > _subch_type
subchannel type
std::vector< std::pair< unsigned int, unsigned int > > _gap_pairs_sf
sweeping flow model gap pairs per channel to specify directional edge flow
const unsigned int _n_cells
number of axial cells
std::vector< Real > _z_grid
axial location of nodes
Real _unheated_length_entry
unheated length of the fuel Pin at the entry of the assembly
const std::vector< unsigned int > _index_blockage
index of subchannels affected by blockage
const std::vector< Real > _z_blockage
axial location of blockage (inlet, outlet) [m]
const std::vector< Real > & _spacer_z
axial location of the spacers
const unsigned int _block_id
block index
virtual const std::string & name() const
const Real _flat_to_flat
the distance between flat surfaces of the duct facing each other
unsigned int _n_channels
number of subchannels
std::vector< std::vector< Real > > _sign_id_crossflow_map
Defines the global cross-flow direction -1 or 1 for each subchannel and for all gaps that are belongi...
const Real _pitch
Distance between the neighbor fuel pins, pitch.
const unsigned int _n_rings
number of rings of fuel pins
std::vector< std::vector< Real > > _subchannel_position
x,y coordinates of the subchannel centroids
std::vector< Point > _pin_position
x,y coordinates of the fuel pins
std::vector< std::vector< Real > > _gij_map
gap size
const Real _pin_diameter
fuel Pin diameter
const Real _heated_length
heated length of the fuel Pin
Mesh class for triangular, edge and corner subchannels for hexagonal lattice fuel assemblies...
std::vector< std::vector< unsigned int > > _chan_to_pin_map
stores the fuel pins belonging to each subchannel
const std::vector< Real > _reduction_blockage
area reduction of subchannels affected by blockage
const Real _unheated_length_entry
unheated length of the fuel Pin at the entry of the assembly
std::vector< std::vector< Real > > _k_grid
axial form loss coefficient per computational cell
std::vector< std::pair< unsigned int, unsigned int > > _gap_to_pin_map
stores the fuel pin pairs for each gap each gap
const Real _duct_to_pin_gap
the gap thickness between the duct and peripheral fuel pins
const Real & _kij
Lateral form loss coefficient.
std::vector< std::vector< unsigned int > > _pin_to_chan_map
stores the map from pins to channels
std::unique_ptr< MeshBase > buildMeshBaseObject(unsigned int dim=libMesh::invalid_uint)
const std::vector< Real > & _spacer_k
form loss coefficient of the spacers
std::vector< std::vector< Node * > > _nodes
nodes
const Real _unheated_length_exit
unheated length of the fuel Pin at the exit of the assembly
std::vector< std::vector< unsigned int > > _chan_to_gap_map
stores the gaps that forms each subchannel

◆ validParams()

InputParameters SCMTriSubChannelMeshGenerator::validParams ( )
static

Definition at line 23 of file SCMTriSubChannelMeshGenerator.C.

24 {
26  params.addClassDescription(
27  "Creates a mesh of 1D subchannels in a triangular lattice arrangement");
28  params.addRequiredParam<unsigned int>("n_cells", "The number of cells in the axial direction");
29  params.addRequiredParam<Real>("pitch", "Pitch [m]");
30  params.addRequiredParam<Real>("pin_diameter", "Rod diameter [m]");
31  params.addParam<Real>("unheated_length_entry", 0.0, "Unheated length at entry [m]");
32  params.addRequiredParam<Real>("heated_length", "Heated length [m]");
33  params.addParam<Real>("unheated_length_exit", 0.0, "Unheated length at exit [m]");
34  params.addRequiredParam<unsigned int>("nrings", "Number of fuel Pin rings per assembly [-]");
35  params.addRequiredParam<Real>("flat_to_flat",
36  "Flat to flat distance for the hexagonal assembly [m]");
37  params.addRequiredParam<Real>("dwire", "Wire diameter [m]");
38  params.addRequiredParam<Real>("hwire", "Wire lead length [m]");
39  params.addParam<std::vector<Real>>(
40  "spacer_z", {}, "Axial location of spacers/vanes/mixing_vanes [m]");
41  params.addParam<std::vector<Real>>(
42  "spacer_k", {}, "K-loss coefficient of spacers/vanes/mixing_vanes [-]");
43  params.addParam<Real>("Kij", 0.5, "Lateral form loss coefficient [-]");
44  params.addParam<std::vector<Real>>("z_blockage",
45  std::vector<Real>({0.0, 0.0}),
46  "axial location of blockage (inlet, outlet) [m]");
47  params.addParam<std::vector<unsigned int>>("index_blockage",
48  std::vector<unsigned int>({0}),
49  "index of subchannels affected by blockage");
50  params.addParam<std::vector<Real>>(
51  "reduction_blockage",
52  std::vector<Real>({1.0}),
53  "Area reduction of subchannels affected by blockage (number to muliply the area)");
54  params.addParam<std::vector<Real>>("k_blockage",
55  std::vector<Real>({0.0}),
56  "Form loss coefficient of subchannels affected by blockage");
57  params.addParam<unsigned int>("block_id", 0, "Domain Index");
58  return params;
59 }
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
void addRequiredParam(const std::string &name, const std::string &doc_string)
static InputParameters validParams()
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
void addClassDescription(const std::string &doc_string)

Member Data Documentation

◆ _block_id

const unsigned int SCMTriSubChannelMeshGenerator::_block_id
protected

block index

Definition at line 33 of file SCMTriSubChannelMeshGenerator.h.

Referenced by generate().

◆ _chan_pairs_sf

std::vector<std::pair<unsigned int, unsigned int> > SCMTriSubChannelMeshGenerator::_chan_pairs_sf
protected

sweeping flow model channel pairs to specify directional edge flow

Definition at line 107 of file SCMTriSubChannelMeshGenerator.h.

Referenced by generate(), and SCMTriSubChannelMeshGenerator().

◆ _chan_to_gap_map

std::vector<std::vector<unsigned int> > SCMTriSubChannelMeshGenerator::_chan_to_gap_map
protected

stores the gaps that forms each subchannel

Definition at line 78 of file SCMTriSubChannelMeshGenerator.h.

Referenced by generate(), and SCMTriSubChannelMeshGenerator().

◆ _chan_to_pin_map

std::vector<std::vector<unsigned int> > SCMTriSubChannelMeshGenerator::_chan_to_pin_map
protected

stores the fuel pins belonging to each subchannel

Definition at line 93 of file SCMTriSubChannelMeshGenerator.h.

Referenced by generate(), and SCMTriSubChannelMeshGenerator().

◆ _duct_to_pin_gap

const Real SCMTriSubChannelMeshGenerator::_duct_to_pin_gap
protected

the gap thickness between the duct and peripheral fuel pins

Definition at line 69 of file SCMTriSubChannelMeshGenerator.h.

Referenced by generate(), and SCMTriSubChannelMeshGenerator().

◆ _dwire

const Real SCMTriSubChannelMeshGenerator::_dwire
protected

wire diameter

Definition at line 65 of file SCMTriSubChannelMeshGenerator.h.

Referenced by generate().

◆ _flat_to_flat

const Real SCMTriSubChannelMeshGenerator::_flat_to_flat
protected

the distance between flat surfaces of the duct facing each other

Definition at line 63 of file SCMTriSubChannelMeshGenerator.h.

Referenced by generate(), and SCMTriSubChannelMeshGenerator().

◆ _gap_pairs_sf

std::vector<std::pair<unsigned int, unsigned int> > SCMTriSubChannelMeshGenerator::_gap_pairs_sf
protected

sweeping flow model gap pairs per channel to specify directional edge flow

Definition at line 105 of file SCMTriSubChannelMeshGenerator.h.

Referenced by generate(), and SCMTriSubChannelMeshGenerator().

◆ _gap_to_chan_map

std::vector<std::pair<unsigned int, unsigned int> > SCMTriSubChannelMeshGenerator::_gap_to_chan_map
protected

stores the channel pairs for each gap

Definition at line 74 of file SCMTriSubChannelMeshGenerator.h.

Referenced by generate(), and SCMTriSubChannelMeshGenerator().

◆ _gap_to_pin_map

std::vector<std::pair<unsigned int, unsigned int> > SCMTriSubChannelMeshGenerator::_gap_to_pin_map
protected

stores the fuel pin pairs for each gap each gap

Definition at line 76 of file SCMTriSubChannelMeshGenerator.h.

Referenced by generate(), and SCMTriSubChannelMeshGenerator().

◆ _gap_type

std::vector<EChannelType> SCMTriSubChannelMeshGenerator::_gap_type
protected

gap type

Definition at line 103 of file SCMTriSubChannelMeshGenerator.h.

Referenced by generate(), and SCMTriSubChannelMeshGenerator().

◆ _gij_map

std::vector<std::vector<Real> > SCMTriSubChannelMeshGenerator::_gij_map
protected

gap size

Definition at line 85 of file SCMTriSubChannelMeshGenerator.h.

Referenced by generate(), and SCMTriSubChannelMeshGenerator().

◆ _heated_length

const Real SCMTriSubChannelMeshGenerator::_heated_length
protected

heated length of the fuel Pin

Definition at line 29 of file SCMTriSubChannelMeshGenerator.h.

Referenced by generate(), and SCMTriSubChannelMeshGenerator().

◆ _hwire

const Real SCMTriSubChannelMeshGenerator::_hwire
protected

wire lead length

Definition at line 67 of file SCMTriSubChannelMeshGenerator.h.

Referenced by generate().

◆ _index_blockage

const std::vector<unsigned int> SCMTriSubChannelMeshGenerator::_index_blockage
protected

index of subchannels affected by blockage

Definition at line 45 of file SCMTriSubChannelMeshGenerator.h.

Referenced by generate(), and SCMTriSubChannelMeshGenerator().

◆ _k_blockage

const std::vector<Real> SCMTriSubChannelMeshGenerator::_k_blockage
protected

form loss coefficient of subchannels affected by blockage

Definition at line 49 of file SCMTriSubChannelMeshGenerator.h.

Referenced by SCMTriSubChannelMeshGenerator().

◆ _k_grid

std::vector<std::vector<Real> > SCMTriSubChannelMeshGenerator::_k_grid
protected

axial form loss coefficient per computational cell

Definition at line 37 of file SCMTriSubChannelMeshGenerator.h.

Referenced by generate(), and SCMTriSubChannelMeshGenerator().

◆ _kij

const Real& SCMTriSubChannelMeshGenerator::_kij
protected

Lateral form loss coefficient.

Definition at line 53 of file SCMTriSubChannelMeshGenerator.h.

Referenced by generate().

◆ _n_cells

const unsigned int SCMTriSubChannelMeshGenerator::_n_cells
protected

number of axial cells

Definition at line 57 of file SCMTriSubChannelMeshGenerator.h.

Referenced by generate(), and SCMTriSubChannelMeshGenerator().

◆ _n_channels

unsigned int SCMTriSubChannelMeshGenerator::_n_channels
protected

number of subchannels

Definition at line 61 of file SCMTriSubChannelMeshGenerator.h.

Referenced by generate(), and SCMTriSubChannelMeshGenerator().

◆ _n_gaps

unsigned int SCMTriSubChannelMeshGenerator::_n_gaps
protected

number of gaps

Definition at line 99 of file SCMTriSubChannelMeshGenerator.h.

Referenced by generate(), and SCMTriSubChannelMeshGenerator().

◆ _n_rings

const unsigned int SCMTriSubChannelMeshGenerator::_n_rings
protected

number of rings of fuel pins

Definition at line 59 of file SCMTriSubChannelMeshGenerator.h.

Referenced by generate(), and SCMTriSubChannelMeshGenerator().

◆ _nodes

std::vector<std::vector<Node *> > SCMTriSubChannelMeshGenerator::_nodes
protected

nodes

Definition at line 72 of file SCMTriSubChannelMeshGenerator.h.

Referenced by generate().

◆ _npins

unsigned int SCMTriSubChannelMeshGenerator::_npins
protected

number of fuel pins

Definition at line 97 of file SCMTriSubChannelMeshGenerator.h.

Referenced by generate(), and SCMTriSubChannelMeshGenerator().

◆ _pin_diameter

const Real SCMTriSubChannelMeshGenerator::_pin_diameter
protected

fuel Pin diameter

Definition at line 55 of file SCMTriSubChannelMeshGenerator.h.

Referenced by generate(), and SCMTriSubChannelMeshGenerator().

◆ _pin_position

std::vector<Point> SCMTriSubChannelMeshGenerator::_pin_position
protected

x,y coordinates of the fuel pins

Definition at line 89 of file SCMTriSubChannelMeshGenerator.h.

Referenced by generate(), and SCMTriSubChannelMeshGenerator().

◆ _pin_to_chan_map

std::vector<std::vector<unsigned int> > SCMTriSubChannelMeshGenerator::_pin_to_chan_map
protected

stores the map from pins to channels

Definition at line 95 of file SCMTriSubChannelMeshGenerator.h.

Referenced by generate(), and SCMTriSubChannelMeshGenerator().

◆ _pins_in_rings

std::vector<std::vector<Real> > SCMTriSubChannelMeshGenerator::_pins_in_rings
protected

fuel pins that are belonging to each ring

Definition at line 91 of file SCMTriSubChannelMeshGenerator.h.

Referenced by generate(), and SCMTriSubChannelMeshGenerator().

◆ _pitch

const Real SCMTriSubChannelMeshGenerator::_pitch
protected

Distance between the neighbor fuel pins, pitch.

Definition at line 51 of file SCMTriSubChannelMeshGenerator.h.

Referenced by generate(), and SCMTriSubChannelMeshGenerator().

◆ _reduction_blockage

const std::vector<Real> SCMTriSubChannelMeshGenerator::_reduction_blockage
protected

area reduction of subchannels affected by blockage

Definition at line 47 of file SCMTriSubChannelMeshGenerator.h.

Referenced by generate(), and SCMTriSubChannelMeshGenerator().

◆ _sign_id_crossflow_map

std::vector<std::vector<Real> > SCMTriSubChannelMeshGenerator::_sign_id_crossflow_map
protected

Defines the global cross-flow direction -1 or 1 for each subchannel and for all gaps that are belonging to the corresponding subchannel.

Given a subchannel and a gap, if the neighbor subchannel index belonging to the same gap is lower, set it to -1, otherwise set it to 1.

Definition at line 83 of file SCMTriSubChannelMeshGenerator.h.

Referenced by generate(), and SCMTriSubChannelMeshGenerator().

◆ _spacer_k

const std::vector<Real>& SCMTriSubChannelMeshGenerator::_spacer_k
protected

form loss coefficient of the spacers

Definition at line 41 of file SCMTriSubChannelMeshGenerator.h.

Referenced by generate(), and SCMTriSubChannelMeshGenerator().

◆ _spacer_z

const std::vector<Real>& SCMTriSubChannelMeshGenerator::_spacer_z
protected

axial location of the spacers

Definition at line 39 of file SCMTriSubChannelMeshGenerator.h.

Referenced by generate(), and SCMTriSubChannelMeshGenerator().

◆ _subch_type

std::vector<EChannelType> SCMTriSubChannelMeshGenerator::_subch_type
protected

subchannel type

Definition at line 101 of file SCMTriSubChannelMeshGenerator.h.

Referenced by generate(), and SCMTriSubChannelMeshGenerator().

◆ _subchannel_position

std::vector<std::vector<Real> > SCMTriSubChannelMeshGenerator::_subchannel_position
protected

x,y coordinates of the subchannel centroids

Definition at line 87 of file SCMTriSubChannelMeshGenerator.h.

Referenced by generate(), and SCMTriSubChannelMeshGenerator().

◆ _unheated_length_entry

const Real SCMTriSubChannelMeshGenerator::_unheated_length_entry
protected

unheated length of the fuel Pin at the entry of the assembly

Definition at line 27 of file SCMTriSubChannelMeshGenerator.h.

Referenced by generate(), and SCMTriSubChannelMeshGenerator().

◆ _unheated_length_exit

const Real SCMTriSubChannelMeshGenerator::_unheated_length_exit
protected

unheated length of the fuel Pin at the exit of the assembly

Definition at line 31 of file SCMTriSubChannelMeshGenerator.h.

Referenced by generate(), and SCMTriSubChannelMeshGenerator().

◆ _z_blockage

const std::vector<Real> SCMTriSubChannelMeshGenerator::_z_blockage
protected

axial location of blockage (inlet, outlet) [m]

Definition at line 43 of file SCMTriSubChannelMeshGenerator.h.

Referenced by generate(), and SCMTriSubChannelMeshGenerator().

◆ _z_grid

std::vector<Real> SCMTriSubChannelMeshGenerator::_z_grid
protected

axial location of nodes

Definition at line 35 of file SCMTriSubChannelMeshGenerator.h.

Referenced by generate(), and SCMTriSubChannelMeshGenerator().


The documentation for this class was generated from the following files: