12 #include "libmesh/edge_edge2.h" 24 params.
addClassDescription(
"Creates a mesh of 1D fuel pins in a square lattice arrangement");
25 params.
addRequiredParam<MeshGeneratorName>(
"input",
"The corresponding subchannel mesh");
26 params.
addParam<
Real>(
"unheated_length_entry", 0.0,
"Unheated length at entry [m]");
28 params.
addParam<
Real>(
"unheated_length_exit", 0.0,
"Unheated length at exit [m]");
30 params.
addRequiredParam<
unsigned int>(
"nx",
"Number of subchannels in the x direction [-]");
31 params.
addRequiredParam<
unsigned int>(
"ny",
"Number of subchannels in the y direction [-]");
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 _nx(getParam<unsigned
int>(
"nx")),
45 _ny(getParam<unsigned
int>(
"ny")),
46 _n_cells(getParam<unsigned
int>(
"n_cells")),
47 _block_id(getParam<unsigned
int>(
"block_id"))
50 for (
unsigned int i = 0; i <
_n_cells + 1; i++)
54 std::unique_ptr<MeshBase>
57 std::unique_ptr<MeshBase> mesh_base = std::move(
_input);
60 mesh_base->set_mesh_dimension(3);
75 unsigned int node_id = node_sub;
76 for (
unsigned int iy = 0; iy <
_ny - 1; iy++)
78 for (
unsigned int ix = 0; ix <
_nx - 1; ix++)
80 int i_node = (
_nx - 1) * iy + ix;
82 for (
unsigned int iz = 0; iz <
_n_cells + 1; iz++)
84 _pin_nodes[i_node].push_back(mesh_base->add_point(
92 unsigned int elem_id = elem_sub;
93 for (
unsigned int iy = 0; iy <
_ny - 1; iy++)
95 for (
unsigned int ix = 0; ix <
_nx - 1; ix++)
97 for (
unsigned int iz = 0; iz <
_n_cells; iz++)
99 Elem * elem =
new Edge2;
101 elem->set_id(elem_id++);
102 elem = mesh_base->add_elem(elem);
106 elem->set_node(0, mesh_base->node_ptr(indx1));
107 elem->set_node(1, mesh_base->node_ptr(indx2));
112 mesh_base->prepare_for_use();
117 sch_mesh._pin_mesh_exist =
true;
const unsigned int _n_cells
number of axial cells
const Real _heated_length
heated length of the fuel Pin
T & getMesh(MooseMesh &mesh)
function to cast mesh
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.
const unsigned int _block_id
block index
std::unique_ptr< MeshBase > & _input
Mesh that comes from another generator.
Creates the mesh of subchannels in a quadrilateral lattice.
SCMQuadPinMeshGenerator(const InputParameters ¶meters)
virtual const std::string & name() const
static InputParameters validParams()
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const unsigned int _ny
number of subchannels in the y direction
static InputParameters validParams()
registerMooseObjectRenamed("SubChannelApp", QuadPinMeshGenerator, "06/30/2025 24:00", SCMQuadPinMeshGenerator)
std::vector< std::vector< Node * > > _pin_nodes
vector of fuel pin nodes
std::vector< Real > _z_grid
axial location of nodes
std::unique_ptr< MeshBase > buildMeshBaseObject(unsigned int dim=libMesh::invalid_uint)
std::unique_ptr< MeshBase > generate() override
const unsigned int _nx
number of subchannels in the x direction
registerMooseObject("SubChannelApp", SCMQuadPinMeshGenerator)
void ErrorVector unsigned int
const Real _pitch
Distance between the neighbor fuel pins, pitch.
Class to create Pin mesh in the square lattice geometry.
const Real _unheated_length_entry
unheated length of the fuel Pin at the entry of the assembly