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

Class to create Pin mesh in the square lattice geometry. More...

#include <SCMTriPinMeshGenerator.h>

Inheritance diagram for SCMTriPinMeshGenerator:
[legend]

Public Types

typedef DataFileName DataFileParameterType
 

Public Member Functions

 SCMTriPinMeshGenerator (const InputParameters &parameters)
 
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

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

std::unique_ptr< MeshBase > & _input
 Mesh that comes from another generator. More...
 
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 unsigned int _n_rings
 number of subchannels in the x direction More...
 
const unsigned int _n_cells
 number of axial cells More...
 
std::vector< std::vector< Node * > > _pin_nodes
 Pin nodes. More...
 
const unsigned int _block_id
 block index More...
 
std::vector< Point > _pin_position
 x-y positions of the fuel pins 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

Class to create Pin mesh in the square lattice geometry.

Definition at line 18 of file SCMTriPinMeshGenerator.h.

Constructor & Destructor Documentation

◆ SCMTriPinMeshGenerator()

SCMTriPinMeshGenerator::SCMTriPinMeshGenerator ( const InputParameters parameters)

Definition at line 33 of file SCMTriPinMeshGenerator.C.

34  : MeshGenerator(params),
35  _input(getMesh("input")),
36  _unheated_length_entry(getParam<Real>("unheated_length_entry")),
37  _heated_length(getParam<Real>("heated_length")),
38  _unheated_length_exit(getParam<Real>("unheated_length_exit")),
39  _pitch(getParam<Real>("pitch")),
40  _n_rings(getParam<unsigned int>("nrings")),
41  _n_cells(getParam<unsigned int>("n_cells")),
42  _block_id(getParam<unsigned int>("block_id"))
43 {
45  for (unsigned int i = 0; i < _n_cells + 1; i++)
46  _z_grid.push_back(dz * i);
47 }
std::vector< Real > _z_grid
axial location of nodes
const Real _unheated_length_entry
unheated length of the fuel Pin at the entry of the assembly
MeshGenerator(const InputParameters &parameters)
std::unique_ptr< MeshBase > & _input
Mesh that comes from another generator.
const unsigned int _n_cells
number of axial cells
const Real _unheated_length_exit
unheated length of the fuel Pin at the exit of the assembly
std::unique_ptr< MeshBase > & getMesh(const std::string &param_name, const bool allow_invalid=false)
const unsigned int _n_rings
number of subchannels in the x direction
const unsigned int _block_id
block index
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const Real _pitch
Distance between the neighbor fuel pins, pitch.
const Real _heated_length
heated length of the fuel Pin

Member Function Documentation

◆ generate()

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

Implements MeshGenerator.

Definition at line 50 of file SCMTriPinMeshGenerator.C.

51 {
52 
53  // Setting up base elements in the mesh
54  std::unique_ptr<MeshBase> mesh_base = std::move(_input);
55  if (!mesh_base)
56  mesh_base = buildMeshBaseObject();
57 
58  mesh_base->set_mesh_dimension(3);
59 
60  // Defining the Pin positions
62  auto _nrods = _pin_position.size();
63 
64  // Reserving memory in the mesh
65  mesh_base->reserve_elem(_n_cells * _nrods);
66  mesh_base->reserve_nodes((_n_cells + 1) * _nrods);
67  _pin_nodes.resize(_nrods);
68 
69  // Defining the extent of the subchanel mesh to append pins mesh
70  // to the current subchannel mesh
71  unsigned int chancount = 0;
72  for (unsigned int j = 0; j < _n_rings - 1; j++)
73  chancount += j * 6;
74  unsigned int _n_channels = chancount + _nrods - 1 + (_n_rings - 1) * 6 + 6;
75  unsigned int node_sub = (_n_cells + 1) * _n_channels;
76  unsigned int elem_sub = _n_cells * _n_channels;
77 
78  // Add the points in the shape of a rectilinear grid. The grid is regular
79  // on the xy-plane with a spacing of `pitch` between points. The grid along
80  // z is also regular. Store pointers in the _nodes
81  // array so we can keep track of which points are in which pins.
82  unsigned int node_id = node_sub;
83  for (unsigned int i = 0; i < _nrods; i++)
84  {
85  _pin_nodes[i].reserve(_n_cells);
86  for (unsigned int iz = 0; iz < _n_cells + 1; iz++)
87  {
88  _pin_nodes[i].push_back(mesh_base->add_point(
89  Point(_pin_position[i](0), _pin_position[i](1), _z_grid[iz]), node_id++));
90  }
91  }
92 
93  // Add the elements which in this case are 2-node edges that link each
94  // pin nodes vertically.
95  unsigned int elem_id = elem_sub;
96  for (unsigned int i = 0; i < _nrods; i++)
97  {
98  for (unsigned int iz = 0; iz < _n_cells; iz++)
99  {
100  Elem * elem = new Edge2;
101  elem->subdomain_id() = _block_id;
102  elem->set_id(elem_id++);
103  elem = mesh_base->add_elem(elem);
104  const int indx1 = (_n_cells + 1) * i + iz + node_sub;
105  const int indx2 = (_n_cells + 1) * i + (iz + 1) + node_sub;
106  elem->set_node(0, mesh_base->node_ptr(indx1));
107  elem->set_node(1, mesh_base->node_ptr(indx2));
108  }
109  }
110  mesh_base->subdomain_name(_block_id) = name();
111  mesh_base->prepare_for_use();
112 
113  // move the meta data into TriSubChannelMesh
114  auto & sch_mesh = static_cast<TriSubChannelMesh &>(*_mesh);
115  sch_mesh._pin_nodes = _pin_nodes;
116  sch_mesh._pin_mesh_exist = true;
117 
118  return mesh_base;
119 }
std::vector< Real > _z_grid
axial location of nodes
std::vector< Point > _pin_position
x-y positions of the fuel pins
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 ...
std::unique_ptr< MeshBase > & _input
Mesh that comes from another generator.
const unsigned int _n_cells
number of axial cells
const std::string & name() const
std::vector< std::vector< Node * > > _pin_nodes
Pin nodes.
Mesh class for triangular, edge and corner subchannels for hexagonal lattice fuel assemblies...
const unsigned int _n_rings
number of subchannels in the x direction
const unsigned int _block_id
block index
std::vector< std::vector< Node * > > _pin_nodes
pin nodes
static const std::complex< double > j(0, 1)
Complex number "j" (also known as "i")
const Real _pitch
Distance between the neighbor fuel pins, pitch.
std::unique_ptr< MeshBase > buildMeshBaseObject(unsigned int dim=libMesh::invalid_uint)

◆ validParams()

InputParameters SCMTriPinMeshGenerator::validParams ( )
static

Definition at line 18 of file SCMTriPinMeshGenerator.C.

19 {
21  params.addRequiredParam<MeshGeneratorName>("input", "The corresponding subchannel mesh");
22  params.addClassDescription("Creates a mesh of 1D fuel pins in a triangular lattice arrangement");
23  params.addParam<Real>("unheated_length_entry", 0.0, "Unheated length at entry [m]");
24  params.addRequiredParam<Real>("heated_length", "Heated length [m]");
25  params.addParam<Real>("unheated_length_exit", 0.0, "Unheated length at exit [m]");
26  params.addRequiredParam<Real>("pitch", "Pitch [m]");
27  params.addRequiredParam<unsigned int>("nrings", "Number of fuel Pin rings per assembly [-]");
28  params.addRequiredParam<unsigned int>("n_cells", "The number of cells in the axial direction");
29  params.addParam<unsigned int>("block_id", 1, "Domain Index");
30  return params;
31 }
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 SCMTriPinMeshGenerator::_block_id
protected

block index

Definition at line 44 of file SCMTriPinMeshGenerator.h.

Referenced by generate().

◆ _heated_length

const Real SCMTriPinMeshGenerator::_heated_length
protected

heated length of the fuel Pin

Definition at line 30 of file SCMTriPinMeshGenerator.h.

Referenced by SCMTriPinMeshGenerator().

◆ _input

std::unique_ptr<MeshBase>& SCMTriPinMeshGenerator::_input
protected

Mesh that comes from another generator.

Definition at line 26 of file SCMTriPinMeshGenerator.h.

Referenced by generate().

◆ _n_cells

const unsigned int SCMTriPinMeshGenerator::_n_cells
protected

number of axial cells

Definition at line 40 of file SCMTriPinMeshGenerator.h.

Referenced by generate(), and SCMTriPinMeshGenerator().

◆ _n_rings

const unsigned int SCMTriPinMeshGenerator::_n_rings
protected

number of subchannels in the x direction

Definition at line 38 of file SCMTriPinMeshGenerator.h.

Referenced by generate().

◆ _pin_nodes

std::vector<std::vector<Node *> > SCMTriPinMeshGenerator::_pin_nodes
protected

Pin nodes.

Definition at line 42 of file SCMTriPinMeshGenerator.h.

Referenced by generate().

◆ _pin_position

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

x-y positions of the fuel pins

Definition at line 46 of file SCMTriPinMeshGenerator.h.

Referenced by generate().

◆ _pitch

const Real SCMTriPinMeshGenerator::_pitch
protected

Distance between the neighbor fuel pins, pitch.

Definition at line 36 of file SCMTriPinMeshGenerator.h.

Referenced by generate().

◆ _unheated_length_entry

const Real SCMTriPinMeshGenerator::_unheated_length_entry
protected

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

Definition at line 28 of file SCMTriPinMeshGenerator.h.

Referenced by SCMTriPinMeshGenerator().

◆ _unheated_length_exit

const Real SCMTriPinMeshGenerator::_unheated_length_exit
protected

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

Definition at line 32 of file SCMTriPinMeshGenerator.h.

Referenced by SCMTriPinMeshGenerator().

◆ _z_grid

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

axial location of nodes

Definition at line 34 of file SCMTriPinMeshGenerator.h.

Referenced by generate(), and SCMTriPinMeshGenerator().


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