12 #include "libmesh/edge_edge2.h" 25 params.
addRequiredParam<MeshGeneratorName>(
"input",
"The corresponding subchannel mesh");
26 params.
addClassDescription(
"Creates a mesh of 1D fuel pins in a triangular lattice arrangement");
27 params.
addParam<
Real>(
"unheated_length_entry", 0.0,
"Unheated length at entry [m]");
29 params.
addParam<
Real>(
"unheated_length_exit", 0.0,
"Unheated length at exit [m]");
31 params.
addRequiredParam<
unsigned int>(
"nrings",
"Number of fuel Pin rings per assembly [-]");
32 params.
addRequiredParam<
unsigned int>(
"n_cells",
"The number of cells in the axial direction");
33 params.
addParam<
unsigned int>(
"block_id", 1,
"Domain Index");
40 _unheated_length_entry(getParam<
Real>(
"unheated_length_entry")),
41 _heated_length(getParam<
Real>(
"heated_length")),
42 _unheated_length_exit(getParam<
Real>(
"unheated_length_exit")),
43 _pitch(getParam<
Real>(
"pitch")),
44 _n_rings(getParam<unsigned
int>(
"nrings")),
45 _n_cells(getParam<unsigned
int>(
"n_cells")),
46 _block_id(getParam<unsigned
int>(
"block_id"))
49 for (
unsigned int i = 0; i <
_n_cells + 1; i++)
53 std::unique_ptr<MeshBase>
58 std::unique_ptr<MeshBase> mesh_base = std::move(
_input);
62 mesh_base->set_mesh_dimension(3);
69 mesh_base->reserve_elem(
_n_cells * _nrods);
70 mesh_base->reserve_nodes((
_n_cells + 1) * _nrods);
75 unsigned int chancount = 0;
78 unsigned int _n_channels = chancount + _nrods - 1 + (
_n_rings - 1) * 6 + 6;
79 unsigned int node_sub = (
_n_cells + 1) * _n_channels;
80 unsigned int elem_sub =
_n_cells * _n_channels;
86 unsigned int node_id = node_sub;
87 for (
unsigned int i = 0; i < _nrods; i++)
90 for (
unsigned int iz = 0; iz <
_n_cells + 1; iz++)
99 unsigned int elem_id = elem_sub;
100 for (
unsigned int i = 0; i < _nrods; i++)
102 for (
unsigned int iz = 0; iz <
_n_cells; iz++)
104 Elem * elem =
new Edge2;
106 elem->set_id(elem_id++);
107 elem = mesh_base->add_elem(elem);
108 const int indx1 = (
_n_cells + 1) * i + iz + node_sub;
109 const int indx2 = (
_n_cells + 1) * i + (iz + 1) + node_sub;
110 elem->set_node(0, mesh_base->node_ptr(indx1));
111 elem->set_node(1, mesh_base->node_ptr(indx2));
115 mesh_base->prepare_for_use();
120 sch_mesh._pin_mesh_exist =
true;
std::vector< Real > _z_grid
axial location of nodes
SCMTriPinMeshGenerator(const InputParameters ¶meters)
std::unique_ptr< MeshBase > generate() override
std::vector< Point > _pin_position
x-y positions of the fuel pins
const Real _unheated_length_entry
unheated length of the fuel Pin at the entry of the assembly
T & getMesh(MooseMesh &mesh)
function to cast mesh
std::unique_ptr< MeshBase > & _input
Mesh that comes from another generator.
const unsigned int _n_cells
number of axial cells
virtual const std::string & name() const
registerMooseObjectRenamed("SubChannelApp", TriPinMeshGenerator, "06/30/2025 24:00", SCMTriPinMeshGenerator)
const Real _unheated_length_exit
unheated length of the fuel Pin at the exit of the assembly
std::vector< std::vector< Node * > > _pin_nodes
Pin nodes.
static InputParameters validParams()
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
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 unsigned int _block_id
block index
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
Class to create Pin mesh in the square lattice geometry.
static InputParameters validParams()
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)
registerMooseObject("SubChannelApp", SCMTriPinMeshGenerator)
void ErrorVector unsigned int
const Real _heated_length
heated length of the fuel Pin