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
SCMDetailedTriSubChannelMeshGenerator Class Reference

Mesh generator that builds a 3D mesh representing triangular subchannels. More...

#include <SCMDetailedTriSubChannelMeshGenerator.h>

Inheritance diagram for SCMDetailedTriSubChannelMeshGenerator:
[legend]

Public Types

typedef DataFileName DataFileParameterType
 

Public Member Functions

 SCMDetailedTriSubChannelMeshGenerator (const InputParameters &parameters)
 
virtual std::unique_ptr< MeshBase > generate () override
 
std::unique_ptr< CSG::CSGBasegenerateInternalCSG ()
 
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 hasGenerateCSG () const
 
bool isDataOnly () const
 
virtual bool enabled () const
 
std::shared_ptr< MooseObjectgetSharedPtr ()
 
std::shared_ptr< const MooseObjectgetSharedPtr () const
 
bool isKokkosObject () const
 
MooseAppgetMooseApp () const
 
const std::string & type () const
 
const std::string & name () const
 
std::string typeAndName () const
 
MooseObjectParameterName uniqueParameterName (const std::string &parameter_name) const
 
MooseObjectName uniqueName () const
 
const InputParametersparameters () const
 
const hit::Node * getHitNode () const
 
bool hasBase () const
 
const std::string & getBase () const
 
const TgetParam (const std::string &name) const
 
std::vector< std::pair< T1, T2 > > getParam (const std::string &param1, const std::string &param2) const
 
const TqueryParam (const std::string &name) const
 
const TgetRenamedParam (const std::string &old_name, const std::string &new_name) const
 
T getCheckedPointerParam (const std::string &name, const std::string &error_string="") const
 
bool haveParameter (const std::string &name) const
 
bool isParamValid (const std::string &name) const
 
bool isParamSetByUser (const std::string &name) const
 
void connectControllableParams (const std::string &parameter, const std::string &object_type, const std::string &object_name, const std::string &object_parameter) const
 
void paramError (const std::string &param, Args... args) const
 
void paramWarning (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
 
std::string messagePrefix (const bool hit_prefix=true) const
 
std::string errorPrefix (const std::string &) const
 
void mooseError (Args &&... args) const
 
void mooseDocumentedError (const std::string &repo_name, const unsigned int issue_num, Args &&... args) const
 
void mooseErrorNonPrefixed (Args &&... args) const
 
void mooseWarning (Args &&... args) const
 
void mooseWarning (Args &&... args) const
 
void mooseWarningNonPrefixed (Args &&... args) const
 
void mooseWarningNonPrefixed (Args &&... args) const
 
void mooseDeprecated (Args &&... args) const
 
void mooseDeprecated (Args &&... args) const
 
void mooseDeprecatedNoTrace (Args &&... args) const
 
void mooseInfo (Args &&... args) const
 
void callMooseError (std::string msg, const bool with_prefix, const hit::Node *node=nullptr, const bool show_trace=true) 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 bool hasGenerateCSG (const InputParameters &params)
 
static void callMooseError (MooseApp *const app, const InputParameters &params, std::string msg, const bool with_prefix, const hit::Node *node, const bool show_trace=true)
 
static void setHasGenerateData (InputParameters &params)
 
static void setHasGenerateCSG (InputParameters &params)
 

Public Attributes

 usingCombinedWarningSolutionWarnings
 
const ConsoleStream _console
 

Static Public Attributes

static const std::string data_only_param
 
static const std::string type_param
 
static const std::string name_param
 
static const std::string unique_name_param
 
static const std::string app_param
 
static const std::string moose_base_param
 
static const std::string kokkos_object_param
 
static constexpr auto SYSTEM
 
static constexpr auto NAME
 

Protected Member Functions

EChannelType getSubchannelType (unsigned int index) const
 returns the type of the subchannel given the index More...
 
Point rotatePoint (Point b, Real theta)
 
Point translatePoint (Point &b, Point &translation_vector)
 
Point getPinPosition (unsigned int i)
 returns the position of pin given pin index More...
 
std::vector< RealgetSubchannelPosition (unsigned int i)
 returns the position of subchannel given pin index More...
 
std::vector< unsigned intgetSubChannelPins (unsigned int i)
 returns the index of neighboring pins given subchannel index More...
 
virtual void generateData ()
 
virtual std::unique_ptr< CSG::CSGBasegenerateCSG ()
 
TcopyMeshProperty (const std::string &target_data_name, const std::string &source_data_name, const std::string &source_mesh)
 
TcopyMeshProperty (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)
 
std::unique_ptr< CSG::CSGBase > & getCSGBase (const std::string &param_name)
 
std::unique_ptr< CSG::CSGBase > & getCSGBaseByName (const MeshGeneratorName &mesh_generator_name)
 
std::vector< std::unique_ptr< CSG::CSGBase > *> getCSGBases (const std::string &param_name)
 
std::vector< std::unique_ptr< CSG::CSGBase > *> getCSGBasesByName (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)
 
void flagInvalidSolutionInternal (const InvalidSolutionID invalid_solution_id) const
 
InvalidSolutionID registerInvalidSolutionInternal (const std::string &message, const bool warning) const
 
const TgetMeshProperty (const std::string &data_name, const std::string &prefix)
 
const TgetMeshProperty (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
 
TdeclareMeshProperty (const std::string &data_name, Args &&... args)
 
TdeclareMeshProperty (const std::string &data_name, const T &data_value)
 
TdeclareMeshProperty (const std::string &data_name, Args &&... args)
 
TdeclareMeshProperty (const std::string &data_name, const T &data_value)
 
TsetMeshProperty (const std::string &data_name, Args &&... args)
 
TsetMeshProperty (const std::string &data_name, const T &data_value)
 
TsetMeshProperty (const std::string &data_name, Args &&... args)
 
TsetMeshProperty (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...
 
std::vector< Real_z_grid
 axial location of nodes More...
 
const Real _pitch
 Distance between the neighbor fuel pins, pitch. More...
 
const Real _pin_diameter
 fuel Pin diameter More...
 
const unsigned int _n_rings
 Number of rings in the geometry. More...
 
const Real _flat_to_flat
 Half of gap between adjacent assemblies. More...
 
std::vector< EChannelType_subch_type
 Subchannel type. More...
 
std::vector< Point > _pin_position
 x,y coordinates of the fuel pins More...
 
std::vector< std::vector< Real > > _subchannel_position
 x,y coordinates of the subchannels More...
 
const unsigned int_block_id
 Subdomain ID used for the mesh block. More...
 
const unsigned int _n_cells
 Number of cells in the axial direction. More...
 
unsigned int _nrods
 Number of pins. More...
 
std::vector< std::vector< unsigned int > > _pins_in_rings
 fuel pins that are belonging to each ring More...
 
std::map< unsigned int, Real_orientation_map
 map inner and outer rings More...
 
unsigned int _n_channels
 number of subchannels More...
 
std::vector< std::vector< unsigned int > > _chan_to_pin_map
 stores the fuel pins belonging to each subchannel More...
 
const bool _verbose
 Flag to print out the detailed mesh assembly and coordinates. More...
 
MooseMesh *const _mesh
 
const bool & _enabled
 
MooseApp_app
 
Factory_factory
 
ActionFactory_action_factory
 
const std::string & _type
 
const std::string & _name
 
const InputParameters_pars
 
const Parallel::Communicator & _communicator
 

Detailed Description

Mesh generator that builds a 3D mesh representing triangular subchannels.

Definition at line 18 of file SCMDetailedTriSubChannelMeshGenerator.h.

Constructor & Destructor Documentation

◆ SCMDetailedTriSubChannelMeshGenerator()

SCMDetailedTriSubChannelMeshGenerator::SCMDetailedTriSubChannelMeshGenerator ( const InputParameters parameters)

Special case _n_rings == 1

Definition at line 39 of file SCMDetailedTriSubChannelMeshGenerator.C.

42  _unheated_length_entry(getParam<Real>("unheated_length_entry")),
43  _heated_length(getParam<Real>("heated_length")),
44  _unheated_length_exit(getParam<Real>("unheated_length_exit")),
45  _pitch(getParam<Real>("pitch")),
46  _pin_diameter(getParam<Real>("pin_diameter")),
47  _n_rings(getParam<unsigned int>("nrings")),
48  _flat_to_flat(getParam<Real>("flat_to_flat")),
49  _block_id(getParam<unsigned int>("block_id")),
50  _n_cells(getParam<unsigned int>("n_cells")),
51  _verbose(getParam<bool>("verbose_flag"))
52 {
54  Real dz = L / _n_cells;
55  for (unsigned int i = 0; i < _n_cells + 1; i++)
56  _z_grid.push_back(dz * i);
57 
58  // x coordinate for the first position
59  Real x0 = 0.0;
60  // y coordinate for the first position
61  Real y0 = 0.0;
62  // x coordinate for the second position
63  Real x1 = 0.0;
64  // y coordinate for the second position dummy variable
65  Real y1 = 0.0;
66  // dummy variable
67  Real a1 = 0.0;
68  // dummy variable
69  Real a2 = 0.0;
70  // average x coordinate
71  Real avg_coor_x = 0.0;
72  // average y coordinate
73  Real avg_coor_y = 0.0;
74  // distance between two points
75  Real dist = 0.0;
76  // distance between two points
77  Real dist0 = 0.0;
78  // the indicator used while setting _gap_to_chan_map array
79  std::vector<std::pair<unsigned int, unsigned int>> gap_fill;
81  _nrods = _pin_position.size();
82  // assign the pins to the corresponding rings
83  unsigned int k = 0; // initialize the fuel Pin counter index
84  _pins_in_rings.resize(_n_rings);
85  _pins_in_rings[0].push_back(k++);
86  for (unsigned int i = 1; i < _n_rings; i++)
87  for (unsigned int j = 0; j < i * 6; j++)
88  _pins_in_rings[i].push_back(k++);
89  // Given the number of pins and number of fuel Pin rings, the number of subchannels can be
90  // computed as follows:
91  unsigned int chancount = 0.0;
92  // Summing internal channels
93  for (unsigned int j = 0; j < _n_rings - 1; j++)
94  chancount += j * 6;
95  // Adding external channels to the total count
96  _n_channels = chancount + _nrods - 1 + (_n_rings - 1) * 6 + 6;
97 
98  // Utils for building the mesh
100  _subch_type.resize(_n_channels);
102 
103  for (unsigned int i = 0; i < _n_channels; i++)
104  {
105  _subchannel_position[i].reserve(3);
106  for (unsigned int j = 0; j < 3; j++)
107  {
108  _subchannel_position.at(i).push_back(0.0);
109  }
110  }
111 
112  // create the subchannels
113  k = 0; // initialize the subchannel counter index
114  for (unsigned int i = 1; i < _n_rings; i++)
115  {
116  // find the closest Pin at back ring
117  for (unsigned int j = 0; j < _pins_in_rings[i].size(); j++)
118  {
119  if (j == _pins_in_rings[i].size() - 1)
120  {
121  _chan_to_pin_map[k].push_back(_pins_in_rings[i][j]);
122  _chan_to_pin_map[k].push_back(_pins_in_rings[i][0]);
123  avg_coor_x =
124  0.5 * (_pin_position[_pins_in_rings[i][j]](0) + _pin_position[_pins_in_rings[i][0]](0));
125  avg_coor_y =
126  0.5 * (_pin_position[_pins_in_rings[i][j]](1) + _pin_position[_pins_in_rings[i][0]](1));
127  }
128  else
129  {
130  _chan_to_pin_map[k].push_back(_pins_in_rings[i][j]);
131  _chan_to_pin_map[k].push_back(_pins_in_rings[i][j + 1]);
132  avg_coor_x = 0.5 * (_pin_position[_pins_in_rings[i][j]](0) +
133  _pin_position[_pins_in_rings[i][j + 1]](0));
134  avg_coor_y = 0.5 * (_pin_position[_pins_in_rings[i][j]](1) +
135  _pin_position[_pins_in_rings[i][j + 1]](1));
136  }
137  dist0 = 1.0e+5;
138  _chan_to_pin_map[k].push_back(_pins_in_rings[i - 1][0]);
139  for (unsigned int l = 0; l < _pins_in_rings[i - 1].size(); l++)
140  {
141  dist = std::sqrt(pow(_pin_position[_pins_in_rings[i - 1][l]](0) - avg_coor_x, 2) +
142  pow(_pin_position[_pins_in_rings[i - 1][l]](1) - avg_coor_y, 2));
143 
144  if (dist < dist0)
145  {
146  _chan_to_pin_map[k][2] = _pins_in_rings[i - 1][l];
147  dist0 = dist;
148  }
149  }
151  _orientation_map.insert(std::make_pair(k, 0.0));
152  k = k + 1;
153  }
154 
155  // find the closest Pin at front ring
156  for (unsigned int j = 0; j < _pins_in_rings[i].size(); j++)
157  {
158  if (j == _pins_in_rings[i].size() - 1)
159  {
160  _chan_to_pin_map[k].push_back(_pins_in_rings[i][j]);
161  _chan_to_pin_map[k].push_back(_pins_in_rings[i][0]);
162  avg_coor_x =
163  0.5 * (_pin_position[_pins_in_rings[i][j]](0) + _pin_position[_pins_in_rings[i][0]](0));
164  avg_coor_y =
165  0.5 * (_pin_position[_pins_in_rings[i][j]](1) + _pin_position[_pins_in_rings[i][0]](1));
166  }
167  else
168  {
169  _chan_to_pin_map[k].push_back(_pins_in_rings[i][j]);
170  _chan_to_pin_map[k].push_back(_pins_in_rings[i][j + 1]);
171  avg_coor_x = 0.5 * (_pin_position[_pins_in_rings[i][j]](0) +
172  _pin_position[_pins_in_rings[i][j + 1]](0));
173  avg_coor_y = 0.5 * (_pin_position[_pins_in_rings[i][j]](1) +
174  _pin_position[_pins_in_rings[i][j + 1]](1));
175  }
176  // if the outermost ring, set the edge subchannels first... then the corner subchannels
177  if (i == _n_rings - 1)
178  {
179  // add edges
180  _subch_type[k] = EChannelType::EDGE; // an edge subchannel is created
181  k = k + 1;
182  if (j % i == 0)
183  {
184  // corner subchannel
185  _chan_to_pin_map[k].push_back(_pins_in_rings[i][j]);
187  k = k + 1;
188  }
189  // if not the outer most ring
190  }
191  else
192  {
193  dist0 = 1.0e+5;
194  _chan_to_pin_map[k].push_back(_pins_in_rings[i + 1][0]);
195  for (unsigned int l = 0; l < _pins_in_rings[i + 1].size(); l++)
196  {
197  dist = std::sqrt(pow(_pin_position[_pins_in_rings[i + 1][l]](0) - avg_coor_x, 2) +
198  pow(_pin_position[_pins_in_rings[i + 1][l]](1) - avg_coor_y, 2));
199  if (dist < dist0)
200  {
201  _chan_to_pin_map[k][2] = _pins_in_rings[i + 1][l];
202  dist0 = dist;
203  }
204  }
206  _orientation_map.insert(std::make_pair(k, libMesh::pi));
207  k = k + 1;
208  }
209  }
210  }
211 
212  for (auto & pin : _chan_to_pin_map)
213  pin.shrink_to_fit();
214 
215  // set the subchannel positions
216  Real _duct_to_pin_gap =
217  0.5 * (_flat_to_flat - (_n_rings - 1) * _pitch * std::sqrt(3.0) - _pin_diameter);
218  for (unsigned int i = 0; i < _n_channels; i++)
219  {
221  {
222  _subchannel_position[i][0] =
224  _pin_position[_chan_to_pin_map[i][2]](0)) /
225  3.0;
226  _subchannel_position[i][1] =
228  _pin_position[_chan_to_pin_map[i][2]](1)) /
229  3.0;
230  }
231  else if (_subch_type[i] == EChannelType::EDGE)
232  {
233  for (unsigned int j = 0; j < _n_channels; j++)
234  {
236  ((_chan_to_pin_map[i][0] == _chan_to_pin_map[j][0] &&
237  _chan_to_pin_map[i][1] == _chan_to_pin_map[j][1]) ||
238  (_chan_to_pin_map[i][0] == _chan_to_pin_map[j][1] &&
239  _chan_to_pin_map[i][1] == _chan_to_pin_map[j][0])))
240  {
241  x0 = _pin_position[_chan_to_pin_map[j][2]](0);
242  y0 = _pin_position[_chan_to_pin_map[j][2]](1);
243  }
244  else if (_subch_type[j] == EChannelType::CENTER &&
245  ((_chan_to_pin_map[i][0] == _chan_to_pin_map[j][0] &&
246  _chan_to_pin_map[i][1] == _chan_to_pin_map[j][2]) ||
247  (_chan_to_pin_map[i][0] == _chan_to_pin_map[j][2] &&
248  _chan_to_pin_map[i][1] == _chan_to_pin_map[j][0])))
249  {
250  x0 = _pin_position[_chan_to_pin_map[j][1]](0);
251  y0 = _pin_position[_chan_to_pin_map[j][1]](1);
252  }
253  else if (_subch_type[j] == EChannelType::CENTER &&
254  ((_chan_to_pin_map[i][0] == _chan_to_pin_map[j][1] &&
255  _chan_to_pin_map[i][1] == _chan_to_pin_map[j][2]) ||
256  (_chan_to_pin_map[i][0] == _chan_to_pin_map[j][2] &&
257  _chan_to_pin_map[i][1] == _chan_to_pin_map[j][1])))
258  {
259  x0 = _pin_position[_chan_to_pin_map[j][0]](0);
260  y0 = _pin_position[_chan_to_pin_map[j][0]](1);
261  }
262  x1 = 0.5 *
264  y1 = 0.5 *
266  a1 = _pin_diameter / 2.0 + _duct_to_pin_gap / 2.0;
267  a2 = std::sqrt((x1 - x0) * (x1 - x0) + (y1 - y0) * (y1 - y0)) + a1;
268  _subchannel_position[i][0] = (a2 * x1 - a1 * x0) / (a2 - a1);
269  _subchannel_position[i][1] = (a2 * y1 - a1 * y0) / (a2 - a1);
270  } // j
271  }
272  else if (_subch_type[i] == EChannelType::CORNER)
273  {
274  x0 = _pin_position[0](0);
275  y0 = _pin_position[0](1);
276  x1 = _pin_position[_chan_to_pin_map[i][0]](0);
277  y1 = _pin_position[_chan_to_pin_map[i][0]](1);
278  a1 = _pin_diameter / 2.0 + _duct_to_pin_gap / 2.0;
279  a2 = std::sqrt((x1 - x0) * (x1 - x0) + (y1 - y0) * (y1 - y0)) + a1;
280  _subchannel_position[i][0] = (a2 * x1 - a1 * x0) / (a2 - a1);
281  _subchannel_position[i][1] = (a2 * y1 - a1 * y0) / (a2 - a1);
282  }
283 
285  if (_n_rings == 1)
286  {
287  for (unsigned int i = 0; i < _n_channels; i++)
288  {
289  Real angle = (2 * i + 1) * libMesh::pi / 6.0;
291  _subchannel_position[i][0] = std::cos(angle) * _flat_to_flat / 2.0;
292  _subchannel_position[i][1] = std::sin(angle) * _flat_to_flat / 2.0;
293  }
294  }
295  }
296 }
const unsigned int _n_rings
Number of rings in the geometry.
const unsigned int & _block_id
Subdomain ID used for the mesh block.
std::vector< std::vector< Real > > _subchannel_position
x,y coordinates of the subchannels
const InputParameters & parameters() const
static void pinPositions(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 _pitch
Distance between the neighbor fuel pins, pitch.
MeshGenerator(const InputParameters &parameters)
std::vector< Real > _z_grid
axial location of nodes
const Real _unheated_length_exit
unheated length of the fuel Pin at the exit of the assembly
ExpressionBuilder::EBTerm pow(const ExpressionBuilder::EBTerm &left, T exponent)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const Real _flat_to_flat
Half of gap between adjacent assemblies.
std::vector< Point > _pin_position
x,y coordinates of the fuel pins
std::vector< EChannelType > _subch_type
Subchannel type.
std::vector< std::vector< unsigned int > > _pins_in_rings
fuel pins that are belonging to each ring
static const std::complex< double > j(0, 1)
Complex number "j" (also known as "i")
const Real _unheated_length_entry
unheated length of the fuel Pin at the entry of the assembly
const unsigned int _n_cells
Number of cells in the axial direction.
std::vector< std::vector< unsigned int > > _chan_to_pin_map
stores the fuel pins belonging to each subchannel
const bool _verbose
Flag to print out the detailed mesh assembly and coordinates.
const Real _heated_length
heated length of the fuel Pin
static const std::string k
Definition: NS.h:134
const Real pi
std::map< unsigned int, Real > _orientation_map
map inner and outer rings

Member Function Documentation

◆ generate()

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

Implements MeshGenerator.

Definition at line 299 of file SCMDetailedTriSubChannelMeshGenerator.C.

300 {
301  auto mesh_base = buildMeshBaseObject();
302  BoundaryInfo & boundary_info = mesh_base->get_boundary_info();
303  mesh_base->set_spatial_dimension(3);
304  // Define the resolution (the number of points used to represent a circle).
305  // This must be divisible by 4.
306  const unsigned int theta_res_triangle = 24; // TODO: parameterize
307  const unsigned int theta_res_square = 24; // TODO: parameterize
308  // Compute the number of points needed to represent one sixth and quadrant of a circle.
309  const unsigned int points_per_sixth = theta_res_triangle / 6 + 1;
310  const unsigned int points_per_quadrant = theta_res_square / 4 + 1;
311 
312  // Compute the points needed to represent one axial cross-flow of a subchannel.
313  // For the center subchannel (sc) there is one center point plus the points from 3 side
314  // circles.
315  const unsigned int points_per_center = points_per_sixth * 3 + 1;
316  // For the corner sc there is one center point plus the points from 1 side circle plus 3
317  // corners
318  const unsigned int points_per_corner = points_per_sixth * 1 + 1 + 3;
319  // For the side sc there is one center point plus the points from 2 intersecting circles plus 2
320  // corners
321  const unsigned int points_per_side = points_per_quadrant * 2 + 1 + 2;
322 
323  if (_verbose)
324  {
325  _console << "Points per center: " << points_per_center << std::endl;
326  _console << "Points per side: " << points_per_side << std::endl;
327  _console << "Points per corner: " << points_per_corner << std::endl;
328  }
329 
330  // Compute the number of elements (Prism6) which combined base creates the sub-channel
331  // cross-section
332  const unsigned int elems_per_center = theta_res_triangle * 3 / 6 + 3; // TODO: check
333  const unsigned int elems_per_corner = theta_res_triangle / 6 + 4;
334  const unsigned int elems_per_side = 2 * theta_res_square / 4 + 4;
335  if (_verbose)
336  {
337  _console << "Elems per center: " << elems_per_center << std::endl;
338  _console << "Elems per side: " << elems_per_side << std::endl;
339  _console << "Elems per corner: " << elems_per_corner << std::endl;
340  }
341 
342  // specify number and type of sub-channel
343  unsigned int n_center, n_side, n_corner;
344  if (_n_rings == 1)
345  {
346  n_corner = 6;
347  n_side = 0;
348  n_center = _n_channels - n_side - n_corner;
349  }
350  else
351  {
352  n_corner = 6;
353  n_side = (_n_rings - 1) * 6;
354  n_center = _n_channels - n_side - n_corner;
355  }
356  if (_verbose)
357  {
358  _console << "Centers: " << n_center << std::endl;
359  _console << "Sides: " << n_side << std::endl;
360  _console << "Corners: " << n_corner << std::endl;
361  }
362 
363  // Compute the total number of points and elements.
364  const unsigned int points_per_level =
365  n_corner * points_per_corner + n_side * points_per_side + n_center * points_per_center;
366  const unsigned int elems_per_level =
367  n_corner * elems_per_corner + n_side * elems_per_side + n_center * elems_per_center;
368  if (_verbose)
369  {
370  _console << "Points per level: " << points_per_level << std::endl;
371  _console << "Elements per level: " << elems_per_level << std::endl;
372  }
373  const unsigned int n_points = points_per_level * (_n_cells + 1);
374  const unsigned int n_elems = elems_per_level * _n_cells;
375  if (_verbose)
376  {
377  _console << "Number of points: " << n_points << std::endl;
378  _console << "Number of elements: " << n_elems << std::endl;
379  }
380  mesh_base->reserve_nodes(n_points);
381  mesh_base->reserve_elem(n_elems);
382  // Build an array of points arranged in a circle on the xy-plane. (last and first node overlap)
383  // We build for both the square discretization in the edges and the triangular discretization
384  // within the mesh
385  const Real radius = _pin_diameter / 2.0;
386  std::array<Point, theta_res_square + 1> circle_points_square;
387  {
388  Real theta = 0;
389  for (unsigned int i = 0; i < theta_res_square + 1; i++)
390  {
391  circle_points_square[i](0) = radius * std::cos(theta);
392  circle_points_square[i](1) = radius * std::sin(theta);
393  theta += 2.0 * libMesh::pi / theta_res_square;
394  }
395  }
396  std::array<Point, theta_res_triangle + 1> circle_points_triangle;
397  {
398  Real theta = 0;
399  for (unsigned int i = 0; i < theta_res_triangle + 1; i++)
400  {
401  circle_points_triangle[i](0) = radius * std::cos(theta);
402  circle_points_triangle[i](1) = radius * std::sin(theta);
403  theta += 2.0 * libMesh::pi / theta_res_triangle;
404  }
405  }
406  // Define "quadrant center" reference points. These will be the centers of
407  // the 3 circles that represent the fuel pins. These centers are
408  // offset a little bit so that in the final mesh, there is a tiny gap between
409  // neighboring subchannel cells. That allows us to easily map a solution to
410  // this detailed mesh with a nearest-neighbor search.
411  const Real shrink_factor = 0.99999;
412  // Quadrants are used only for the side and corner subchannels
413  Real _duct_to_pin_gap =
414  0.5 * (_flat_to_flat - (_n_rings - 1) * _pitch * std::sqrt(3.0) - _pin_diameter);
415  std::array<Point, 2> quadrant_centers_sides;
416  quadrant_centers_sides[0] = Point(
417  -_pitch * 0.5 * shrink_factor, -(_duct_to_pin_gap + _pin_diameter) * 0.5 * shrink_factor, 0);
418  quadrant_centers_sides[1] = Point(
419  _pitch * 0.5 * shrink_factor, -(_duct_to_pin_gap + _pin_diameter) * 0.5 * shrink_factor, 0);
420  std::array<Point, 1> quadrant_centers_corner;
421  quadrant_centers_corner[0] =
422  Point(-(_duct_to_pin_gap + _pin_diameter) * 0.5 * std::sin(libMesh::pi / 6) * shrink_factor,
423  -(_duct_to_pin_gap + _pin_diameter) * 0.5 * std::cos(libMesh::pi / 6) * shrink_factor,
424  0);
425  // Triangles are used for all center subchannels
426  std::array<Point, 3> triangle_centers;
427  triangle_centers[0] = Point(0, _pitch * std::cos(libMesh::pi / 6) * 2 / 3 * shrink_factor, 0);
428  triangle_centers[1] = Point(-_pitch * 0.5 * shrink_factor,
429  -_pitch * std::cos(libMesh::pi / 6) * 1 / 3 * shrink_factor,
430  0);
431  triangle_centers[2] = Point(
432  _pitch * 0.5 * shrink_factor, -_pitch * std::cos(libMesh::pi / 6) * 1 / 3 * shrink_factor, 0);
433 
434  const unsigned int m_sixth = theta_res_triangle / 6;
435  const unsigned int m_quarter = theta_res_square / 4;
436  // Build an array of points that represent a cross section of a center subchannel
437  // cell. The points are ordered in this fashion:
438  // 3 1
439  // 2
440  // 0
441  // 4 5 8 9
442  // 6 7
443  std::array<Point, points_per_center> center_points;
444  {
445  unsigned int start;
446  for (unsigned int i = 0; i < 3; i++)
447  {
448  if (i == 0)
449  start = 5 * (m_sixth);
450  if (i == 1)
451  start = 1 * (m_sixth);
452  if (i == 2)
453  start = 3 * (m_sixth);
454  for (unsigned int ii = 0; ii < points_per_sixth; ii++)
455  {
456  auto c_pt = circle_points_triangle[start - ii];
457  center_points[i * points_per_sixth + ii + 1] = triangle_centers[i] + c_pt;
458  }
459  }
460  }
461 
462  // Build an array of points that represent a cross section of a top left corner subchannel
463  // cell. The points are ordered in this fashion (x direction towards point 4, y direction towards
464  // point 6):
465  // 5 6
466  //
467  // 0
468  // 4 2 3
469  // 1
470  std::array<Point, points_per_corner> corner_points;
471  {
472  for (unsigned int ii = 0; ii < points_per_sixth; ii++)
473  {
474  auto c_pt = circle_points_triangle[1 * m_quarter - ii];
475  corner_points[ii + 1] = quadrant_centers_corner[0] + c_pt;
476  }
477  Real side_short = (_duct_to_pin_gap + _pin_diameter) * 0.5;
478  Real side_long = (2.0 * _duct_to_pin_gap + _pin_diameter) * 0.5;
479  Real side_length = std::sqrt(std::pow(side_short, 2) + std::pow(side_long, 2) -
480  2 * side_short * side_long * std::cos(libMesh::pi / 6));
481  Real angle =
482  libMesh::pi - libMesh::pi / 3 -
483  std::acos((-std::pow(side_long, 2) + std::pow(side_short, 2) + std::pow(side_length, 2)) /
484  (2 * side_short * side_length));
485  corner_points[points_per_sixth + 1] = Point(side_length * std::cos(angle) * shrink_factor,
486  -side_length * std::sin(angle) * shrink_factor,
487  0);
488  corner_points[points_per_sixth + 2] =
489  Point(side_length * std::sin(libMesh::pi / 2 - angle - libMesh::pi / 6) * shrink_factor *
490  std::tan(libMesh::pi / 6),
491  side_length * std::sin(libMesh::pi / 2 - angle - libMesh::pi / 6) * shrink_factor,
492  0);
493  corner_points[points_per_sixth + 3] =
494  Point(-side_length * std::cos(libMesh::pi / 2 - angle - libMesh::pi / 6) * shrink_factor,
495  side_length * std::sin(libMesh::pi / 2 - angle - libMesh::pi / 6) * shrink_factor,
496  0);
497  }
498 
499  // Build an array of points that represent a cross-section of a top side subchannel
500  // cell. The points are ordered in this fashion:
501  // 8 7
502  //
503  // 0
504  // 1 2 5 6
505  // 3 4
506  std::array<Point, points_per_side> side_points;
507  {
508  for (unsigned int ii = 0; ii < points_per_quadrant; ii++)
509  {
510  auto c_pt = circle_points_square[m_quarter - ii];
511  side_points[ii + 1] = quadrant_centers_sides[0] + c_pt;
512  }
513  for (unsigned int ii = 0; ii < points_per_quadrant; ii++)
514  {
515  auto c_pt = circle_points_square[2 * m_quarter - ii];
516  side_points[points_per_quadrant + ii + 1] = quadrant_centers_sides[1] + c_pt;
517  }
518  side_points[2 * points_per_quadrant + 1] =
519  Point(_pitch * 0.5 * shrink_factor, 0.5 * _duct_to_pin_gap * shrink_factor, 0);
520  side_points[2 * points_per_quadrant + 2] =
521  Point(-_pitch * 0.5 * shrink_factor, 0.5 * _duct_to_pin_gap * shrink_factor, 0);
522  }
523 
524  int point_counter = 0;
525  unsigned int node_id = 0;
526  for (unsigned int i = 0; i < _n_channels; i++)
527  {
528  // Real offset_x = _flat_to_flat / 2.0;
529  // Real offset_y = _flat_to_flat / 2.0;
530 
532  {
533  for (auto z : _z_grid)
534  {
535  // Get height
536  Point z0{0, 0, z};
537 
538  // Get suchannel position and assign to point
539  auto loc_position = getSubchannelPosition(i);
540  Point p0{loc_position[0], loc_position[1], 0};
541 
542  // Determine orientation of current subchannel
543  auto subchannel_pins = getSubChannelPins(i);
544  Point subchannel_side =
545  getPinPosition(subchannel_pins[0]) + getPinPosition(subchannel_pins[1]);
546  Point base_center_orientation = {0, -1};
547 
548  // Get rotation angle for current subchannel
549  Real dot_prod = 0;
550  for (unsigned int lp = 0; lp < 2; lp++)
551  dot_prod += base_center_orientation(lp) * subchannel_side(lp);
552  auto theta =
553  std::acos(dot_prod / (base_center_orientation.norm() * subchannel_side.norm()));
554  if (subchannel_side(0) < 0)
555  theta = 2.0 * libMesh::pi - theta;
556 
557  // Real distance_side = subchannel_side.norm();
558  // Real distance_top = getPinPosition(subchannel_pins[2]).norm();
559  // if (distance_top > distance_side)
560  // theta += libMesh::pi * 0.0;
561 
562  theta += _orientation_map[i];
563 
564  theta = trunc((theta + (libMesh::pi / 6.0)) / (libMesh::pi / 3.0)) * libMesh::pi / 3.0;
565 
566  if (_verbose)
567  {
568  if (z == 0)
569  {
570  _console << "Subchannel Position: " << p0 << std::endl;
571  auto pins = getSubChannelPins(i);
572  for (auto r : pins)
573  _console << r << " ";
574  _console << std::endl;
575  _console << "Theta: " << theta / libMesh::pi * 180. << std::endl;
576  }
577  }
578 
579  // Assigning points for center channels
580  for (unsigned int i = 0; i < points_per_center; i++)
581  {
582  auto new_point = rotatePoint(center_points[i], theta) + p0 + z0;
583  if (_verbose)
584  {
585  if (z == 0)
586  _console << i << " - " << new_point << std::endl;
587  }
588  mesh_base->add_point(new_point, node_id++);
589  point_counter += 1;
590  }
591  }
592  }
593  else if (getSubchannelType(i) == EChannelType::EDGE)
594  {
595  for (auto z : _z_grid)
596  {
597  // Get height
598  Point z0{0, 0, z};
599 
600  // Get suchannel position and assign to point
601  auto loc_position = getSubchannelPosition(i);
602  Point p0{loc_position[0], loc_position[1], 0};
603 
604  // Determine orientation of current subchannel
605  auto subchannel_pins = getSubChannelPins(i);
606  Point subchannel_side =
607  getPinPosition(subchannel_pins[0]) + getPinPosition(subchannel_pins[1]);
608  Point base_center_orientation = {0, 1};
609 
610  // Get rotation angle for current subchannel
611  Real dot_prod = 0;
612  for (unsigned int lp = 0; lp < 2; lp++)
613  dot_prod += base_center_orientation(lp) * subchannel_side(lp);
614  auto theta =
615  std::acos(dot_prod / (base_center_orientation.norm() * subchannel_side.norm()));
616  if (subchannel_side(0) > 0)
617  theta = 2. * libMesh::pi - theta;
618  theta = trunc((theta + (libMesh::pi / 6.0)) / (libMesh::pi / 3.0)) * libMesh::pi / 3.0;
619 
620  if (_verbose)
621  {
622  if (z == 0)
623  {
624  _console << "Subchannel Position: " << p0 << std::endl;
625  auto pins = getSubChannelPins(i);
626  for (auto r : pins)
627  _console << r << " ";
628  _console << std::endl;
629  _console << "Theta: " << theta * 180 / libMesh::pi << std::endl;
630  }
631  }
632 
633  // Assigning points for center channels
634  for (unsigned int i = 0; i < points_per_side; i++)
635  {
636  auto new_point = rotatePoint(side_points[i], theta) + p0 + z0;
637  if (_verbose)
638  {
639  if (z == 0)
640  _console << i << " - " << new_point << std::endl;
641  }
642  mesh_base->add_point(new_point, node_id++);
643  point_counter += 1;
644  }
645  }
646  }
647  else // getSubchannelType(i) == EChannelType::CORNER
648  {
649  for (auto z : _z_grid)
650  {
651  // Get height
652  Point z0{0, 0, z};
653 
654  // Get suchannel position and assign to point
655  auto loc_position = getSubchannelPosition(i);
656  Point p0{loc_position[0], loc_position[1], 0};
657 
658  // Determine orientation of current subchannel
659  auto subchannel_pins = getSubChannelPins(i);
660  Point subchannel_side = getPinPosition(subchannel_pins[0]);
661  Point base_center_orientation = {1, 1};
662 
663  // Get rotation angle for current subchannel
664  Real dot_prod = 0;
665  for (unsigned int lp = 0; lp < 2; lp++)
666  dot_prod += base_center_orientation(lp) * subchannel_side(lp);
667  auto theta =
668  std::acos(dot_prod / (base_center_orientation.norm() * subchannel_side.norm()));
669  if (subchannel_side(0) > 0)
670  theta = 2. * libMesh::pi - theta;
671  theta = trunc((theta + (libMesh::pi / 6.0)) / (libMesh::pi / 3.0)) * libMesh::pi / 3.0;
672 
673  if (_verbose)
674  {
675  if (z == 0)
676  {
677  _console << "Subchannel Position: " << p0 << std::endl;
678  auto pins = getSubChannelPins(i);
679  for (auto r : pins)
680  _console << r << " ";
681  _console << std::endl;
682  _console << "Theta: " << theta * 180 / libMesh::pi << std::endl;
683  }
684  }
685 
686  // Assigning points for center channels
687  for (unsigned int i = 0; i < points_per_corner; i++)
688  {
689  auto new_point = rotatePoint(corner_points[i], theta) + p0 + z0;
690  if (_verbose)
691  {
692  if (z == 0)
693  _console << i << " - " << new_point << std::endl;
694  }
695  mesh_base->add_point(new_point, node_id++);
696  point_counter += 1;
697  }
698  }
699  }
700  } // i
701  if (_verbose)
702  _console << "Point counter: " << point_counter << std::endl;
703 
704  int element_counter = 0;
705  unsigned int elem_id = 0;
706  unsigned int number_of_corner = 0;
707  unsigned int number_of_side = 0;
708  unsigned int number_of_center = 0;
709  unsigned int elems_per_channel = 0;
710  unsigned int points_per_channel = 0;
711  for (unsigned int i = 0; i < _n_channels; i++)
712  {
713  auto subch_type = getSubchannelType(i);
714  if (subch_type == EChannelType::CORNER)
715  {
716  number_of_corner++;
717  elems_per_channel = elems_per_corner;
718  points_per_channel = points_per_corner;
719  if (_verbose)
720  _console << "Corner" << std::endl;
721  }
722  else if (subch_type == EChannelType::EDGE)
723  {
724  number_of_side++;
725  elems_per_channel = elems_per_side;
726  points_per_channel = points_per_side;
727  if (_verbose)
728  _console << "Edge" << std::endl;
729  }
730  else if (subch_type == EChannelType::CENTER)
731  {
732  number_of_center++;
733  elems_per_channel = elems_per_center;
734  points_per_channel = points_per_center;
735  if (_verbose)
736  _console << "Center" << std::endl;
737  }
738  for (unsigned int iz = 0; iz < _n_cells; iz++)
739  {
740  unsigned int elapsed_points = number_of_corner * points_per_corner * (_n_cells + 1) +
741  number_of_side * points_per_side * (_n_cells + 1) +
742  number_of_center * points_per_center * (_n_cells + 1) -
743  points_per_channel * (_n_cells + 1);
744  // index of the central node at base of cell
745  unsigned int indx1 = iz * points_per_channel + elapsed_points;
746  // index of the central node at top of cell
747  unsigned int indx2 = (iz + 1) * points_per_channel + elapsed_points;
748 
749  for (unsigned int i = 0; i < elems_per_channel; i++)
750  {
751  Elem * elem = new Prism6;
752  elem->subdomain_id() = _block_id;
753  elem->set_id(elem_id++);
754  elem = mesh_base->add_elem(elem);
755 
756  if (_verbose)
757  _console << "Node 0: " << *mesh_base->node_ptr(indx1) << std::endl;
758 
759  elem->set_node(0, mesh_base->node_ptr(indx1));
760  elem->set_node(1, mesh_base->node_ptr(indx1 + i + 1));
761  if (i != elems_per_channel - 1)
762  elem->set_node(2, mesh_base->node_ptr(indx1 + i + 2));
763  else
764  elem->set_node(2, mesh_base->node_ptr(indx1 + 1));
765 
766  elem->set_node(3, mesh_base->node_ptr(indx2));
767  elem->set_node(4, mesh_base->node_ptr(indx2 + i + 1));
768  if (i != elems_per_channel - 1)
769  elem->set_node(5, mesh_base->node_ptr(indx2 + i + 2));
770  else
771  elem->set_node(5, mesh_base->node_ptr(indx2 + 1));
772 
773  if (iz == 0)
774  boundary_info.add_side(elem, 0, 0);
775  if (iz == _n_cells - 1)
776  boundary_info.add_side(elem, 4, 1);
777 
778  element_counter += 1;
779  }
780  }
781  }
782  if (_verbose)
783  _console << "Element counter: " << element_counter << std::endl;
784  boundary_info.sideset_name(0) = "inlet";
785  boundary_info.sideset_name(1) = "outlet";
786  mesh_base->subdomain_name(_block_id) = name();
787  if (_verbose)
788  _console << "Mesh assembly done" << std::endl;
789  mesh_base->prepare_for_use();
790 
791  return mesh_base;
792 }
const unsigned int _n_rings
Number of rings in the geometry.
const unsigned int & _block_id
Subdomain ID used for the mesh block.
const Real _pitch
Distance between the neighbor fuel pins, pitch.
Point getPinPosition(unsigned int i)
returns the position of pin given pin index
EChannelType getSubchannelType(unsigned int index) const
returns the type of the subchannel given the index
std::vector< Real > _z_grid
axial location of nodes
const std::string & name() const
std::vector< unsigned int > getSubChannelPins(unsigned int i)
returns the index of neighboring pins given subchannel index
const double radius
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const Real _flat_to_flat
Half of gap between adjacent assemblies.
std::vector< Real > getSubchannelPosition(unsigned int i)
returns the position of subchannel given pin index
const ConsoleStream _console
std::unique_ptr< MeshBase > buildMeshBaseObject(unsigned int dim=libMesh::invalid_uint)
const unsigned int _n_cells
Number of cells in the axial direction.
const bool _verbose
Flag to print out the detailed mesh assembly and coordinates.
MooseUnits pow(const MooseUnits &, int)
const Real pi
std::map< unsigned int, Real > _orientation_map
map inner and outer rings

◆ getPinPosition()

Point SCMDetailedTriSubChannelMeshGenerator::getPinPosition ( unsigned int  i)
inlineprotected

returns the position of pin given pin index

Definition at line 30 of file SCMDetailedTriSubChannelMeshGenerator.h.

Referenced by generate().

30 { return _pin_position[i]; }
std::vector< Point > _pin_position
x,y coordinates of the fuel pins

◆ getSubChannelPins()

std::vector<unsigned int> SCMDetailedTriSubChannelMeshGenerator::getSubChannelPins ( unsigned int  i)
inlineprotected

returns the index of neighboring pins given subchannel index

Definition at line 34 of file SCMDetailedTriSubChannelMeshGenerator.h.

Referenced by generate().

34 { return _chan_to_pin_map[i]; }
std::vector< std::vector< unsigned int > > _chan_to_pin_map
stores the fuel pins belonging to each subchannel

◆ getSubchannelPosition()

std::vector<Real> SCMDetailedTriSubChannelMeshGenerator::getSubchannelPosition ( unsigned int  i)
inlineprotected

returns the position of subchannel given pin index

Definition at line 32 of file SCMDetailedTriSubChannelMeshGenerator.h.

Referenced by generate().

32 { return _subchannel_position[i]; }
std::vector< std::vector< Real > > _subchannel_position
x,y coordinates of the subchannels

◆ getSubchannelType()

EChannelType SCMDetailedTriSubChannelMeshGenerator::getSubchannelType ( unsigned int  index) const
inlineprotected

returns the type of the subchannel given the index

Definition at line 26 of file SCMDetailedTriSubChannelMeshGenerator.h.

Referenced by generate().

26 { return _subch_type[index]; }
std::vector< EChannelType > _subch_type
Subchannel type.

◆ rotatePoint()

Point SCMDetailedTriSubChannelMeshGenerator::rotatePoint ( Point  b,
Real  theta 
)
protected

Definition at line 795 of file SCMDetailedTriSubChannelMeshGenerator.C.

Referenced by generate().

796 {
797 
798  // Building rotation matrix
799  std::vector<std::vector<Real>> A;
800  A.resize(3);
801  for (std::vector<Real> a : A)
802  {
803  a.resize(3);
804  }
805 
806  A[0] = {std::cos(theta), -std::sin(theta), 0.0};
807  A[1] = {std::sin(theta), std::cos(theta), 0.0};
808  A[2] = {0.0, 0.0, 1.0};
809 
810  // Rotating vector
811  Point rotated_vector = Point(0.0, 0.0, 0.0);
812  for (unsigned int i = 0; i < 3; i++)
813  {
814  for (unsigned int j = 0; j < 3; j++)
815  {
816  rotated_vector(i) += A[i][j] * b(j);
817  }
818  }
819 
820  return rotated_vector;
821 }
static const std::complex< double > j(0, 1)
Complex number "j" (also known as "i")

◆ translatePoint()

Point SCMDetailedTriSubChannelMeshGenerator::translatePoint ( Point &  b,
Point &  translation_vector 
)
protected

Definition at line 824 of file SCMDetailedTriSubChannelMeshGenerator.C.

825 {
826  // Translating point
827  Point translated_vector = Point(0.0, 0.0, 0.0);
828  for (unsigned int i = 0; i < 3; i++)
829  {
830  translated_vector(i) = b(i) + translation_vector(i);
831  }
832 
833  return translated_vector;
834 }

◆ validParams()

InputParameters SCMDetailedTriSubChannelMeshGenerator::validParams ( )
static

Definition at line 20 of file SCMDetailedTriSubChannelMeshGenerator.C.

21 {
23  params.addClassDescription(
24  "Creates a detailed mesh of subchannels in a triangular lattice arrangement");
25  params.addRequiredParam<Real>("pitch", "Pitch [m]");
26  params.addRequiredParam<Real>("pin_diameter", "Rod diameter [m]");
27  params.addParam<Real>("unheated_length_entry", 0.0, "Unheated length at entry [m]");
28  params.addRequiredParam<Real>("heated_length", "Heated length [m]");
29  params.addParam<Real>("unheated_length_exit", 0.0, "Unheated length at exit [m]");
30  params.addRequiredParam<unsigned int>("nrings", "Number of fuel Pin rings per assembly [-]");
31  params.addRequiredParam<Real>("flat_to_flat",
32  "Flat to flat distance for the hexagonal assembly [m]");
33  params.addParam<unsigned int>("block_id", 0, "Block ID used for the mesh subdomain.");
34  params.addRequiredParam<unsigned int>("n_cells", "The number of cells in the axial direction");
35  params.addParam<bool>("verbose_flag", false, "Flag to print out the mesh coordinates.");
36  return params;
37 }
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& SCMDetailedTriSubChannelMeshGenerator::_block_id
protected

Subdomain ID used for the mesh block.

Definition at line 59 of file SCMDetailedTriSubChannelMeshGenerator.h.

Referenced by generate().

◆ _chan_to_pin_map

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

stores the fuel pins belonging to each subchannel

Definition at line 71 of file SCMDetailedTriSubChannelMeshGenerator.h.

Referenced by getSubChannelPins(), and SCMDetailedTriSubChannelMeshGenerator().

◆ _flat_to_flat

const Real SCMDetailedTriSubChannelMeshGenerator::_flat_to_flat
protected

Half of gap between adjacent assemblies.

Definition at line 51 of file SCMDetailedTriSubChannelMeshGenerator.h.

Referenced by generate(), and SCMDetailedTriSubChannelMeshGenerator().

◆ _heated_length

const Real SCMDetailedTriSubChannelMeshGenerator::_heated_length
protected

heated length of the fuel Pin

Definition at line 39 of file SCMDetailedTriSubChannelMeshGenerator.h.

Referenced by SCMDetailedTriSubChannelMeshGenerator().

◆ _n_cells

const unsigned int SCMDetailedTriSubChannelMeshGenerator::_n_cells
protected

Number of cells in the axial direction.

Definition at line 61 of file SCMDetailedTriSubChannelMeshGenerator.h.

Referenced by generate(), and SCMDetailedTriSubChannelMeshGenerator().

◆ _n_channels

unsigned int SCMDetailedTriSubChannelMeshGenerator::_n_channels
protected

number of subchannels

Definition at line 69 of file SCMDetailedTriSubChannelMeshGenerator.h.

Referenced by generate(), and SCMDetailedTriSubChannelMeshGenerator().

◆ _n_rings

const unsigned int SCMDetailedTriSubChannelMeshGenerator::_n_rings
protected

Number of rings in the geometry.

Definition at line 49 of file SCMDetailedTriSubChannelMeshGenerator.h.

Referenced by generate(), and SCMDetailedTriSubChannelMeshGenerator().

◆ _nrods

unsigned int SCMDetailedTriSubChannelMeshGenerator::_nrods
protected

Number of pins.

Definition at line 63 of file SCMDetailedTriSubChannelMeshGenerator.h.

Referenced by SCMDetailedTriSubChannelMeshGenerator().

◆ _orientation_map

std::map<unsigned int, Real> SCMDetailedTriSubChannelMeshGenerator::_orientation_map
protected

map inner and outer rings

Definition at line 67 of file SCMDetailedTriSubChannelMeshGenerator.h.

Referenced by generate(), and SCMDetailedTriSubChannelMeshGenerator().

◆ _pin_diameter

const Real SCMDetailedTriSubChannelMeshGenerator::_pin_diameter
protected

fuel Pin diameter

Definition at line 47 of file SCMDetailedTriSubChannelMeshGenerator.h.

Referenced by generate(), and SCMDetailedTriSubChannelMeshGenerator().

◆ _pin_position

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

x,y coordinates of the fuel pins

Definition at line 55 of file SCMDetailedTriSubChannelMeshGenerator.h.

Referenced by getPinPosition(), and SCMDetailedTriSubChannelMeshGenerator().

◆ _pins_in_rings

std::vector<std::vector<unsigned int> > SCMDetailedTriSubChannelMeshGenerator::_pins_in_rings
protected

fuel pins that are belonging to each ring

Definition at line 65 of file SCMDetailedTriSubChannelMeshGenerator.h.

Referenced by SCMDetailedTriSubChannelMeshGenerator().

◆ _pitch

const Real SCMDetailedTriSubChannelMeshGenerator::_pitch
protected

Distance between the neighbor fuel pins, pitch.

Definition at line 45 of file SCMDetailedTriSubChannelMeshGenerator.h.

Referenced by generate(), and SCMDetailedTriSubChannelMeshGenerator().

◆ _subch_type

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

Subchannel type.

Definition at line 53 of file SCMDetailedTriSubChannelMeshGenerator.h.

Referenced by getSubchannelType(), and SCMDetailedTriSubChannelMeshGenerator().

◆ _subchannel_position

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

x,y coordinates of the subchannels

Definition at line 57 of file SCMDetailedTriSubChannelMeshGenerator.h.

Referenced by getSubchannelPosition(), and SCMDetailedTriSubChannelMeshGenerator().

◆ _unheated_length_entry

const Real SCMDetailedTriSubChannelMeshGenerator::_unheated_length_entry
protected

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

Definition at line 37 of file SCMDetailedTriSubChannelMeshGenerator.h.

Referenced by SCMDetailedTriSubChannelMeshGenerator().

◆ _unheated_length_exit

const Real SCMDetailedTriSubChannelMeshGenerator::_unheated_length_exit
protected

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

Definition at line 41 of file SCMDetailedTriSubChannelMeshGenerator.h.

Referenced by SCMDetailedTriSubChannelMeshGenerator().

◆ _verbose

const bool SCMDetailedTriSubChannelMeshGenerator::_verbose
protected

Flag to print out the detailed mesh assembly and coordinates.

Definition at line 73 of file SCMDetailedTriSubChannelMeshGenerator.h.

Referenced by generate().

◆ _z_grid

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

axial location of nodes

Definition at line 43 of file SCMDetailedTriSubChannelMeshGenerator.h.

Referenced by generate(), and SCMDetailedTriSubChannelMeshGenerator().


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