https://mooseframework.inl.gov
SCMDetailedQuadPinMeshGenerator.C
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://mooseframework.inl.gov
3 //*
4 //* All rights reserved, see COPYRIGHT for full restrictions
5 //* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6 //*
7 //* Licensed under LGPL 2.1, please see LICENSE for details
8 //* https://www.gnu.org/licenses/lgpl-2.1.html
9 
11 #include "QuadSubChannelMesh.h"
12 #include "libmesh/cell_prism6.h"
13 
15 registerMooseObjectRenamed("SubChannelApp",
16  DetailedQuadPinMeshGenerator,
17  "06/30/2025 24:00",
19 
22 {
24  params.addClassDescription(
25  "Creates a detailed mesh of fuel pins in a square lattice arrangement");
26  params.addRequiredParam<MeshGeneratorName>("input", "The corresponding subchannel mesh");
27  params.addRequiredParam<unsigned int>("nx", "Number of channels in the x direction [-]");
28  params.addRequiredParam<unsigned int>("ny", "Number of channels in the y direction [-]");
29  return params;
30 }
31 
33  : DetailedPinMeshGeneratorBase(parameters),
34  _input(getMesh("input")),
35  _nx(getParam<unsigned int>("nx")),
36  _ny(getParam<unsigned int>("ny"))
37 {
38 }
39 
40 std::unique_ptr<MeshBase>
42 {
43  std::unique_ptr<MeshBase> mesh_base = std::move(_input);
44  if (!mesh_base)
45  mesh_base = buildMeshBaseObject();
46  mesh_base->set_mesh_dimension(3);
47 
48  std::vector<Point> pin_centers;
50 
51  _elem_id = mesh_base->n_elem();
52  for (auto & ctr : pin_centers)
53  generatePin(mesh_base, ctr);
54 
55  mesh_base->subdomain_name(_block_id) = name();
56  mesh_base->prepare_for_use();
57 
58  return mesh_base;
59 }
T & getMesh(MooseMesh &mesh)
function to cast mesh
Definition: SCM.h:35
virtual std::unique_ptr< MeshBase > generate() override
Mesh generator for fuel pins in a quadrilateral lattice.
SCMDetailedQuadPinMeshGenerator(const InputParameters &parameters)
const unsigned int & _ny
Number of subchannels in the y direction.
const Real _pitch
Distance between the neighbor fuel pins, pitch.
virtual const std::string & name() const
void addRequiredParam(const std::string &name, const std::string &doc_string)
std::unique_ptr< MeshBase > & _input
Mesh that comes from another generator.
dof_id_type _elem_id
Counter for element numbering.
registerMooseObjectRenamed("SubChannelApp", DetailedQuadPinMeshGenerator, "06/30/2025 24:00", SCMDetailedQuadPinMeshGenerator)
void generatePin(std::unique_ptr< MeshBase > &mesh_base, const Point &center)
registerMooseObject("SubChannelApp", SCMDetailedQuadPinMeshGenerator)
static void generatePinCenters(unsigned int nx, unsigned int ny, Real pitch, Real elev, std::vector< Point > &pin_centers)
Generate pin centers.
const unsigned int & _nx
Number of subchannels in the x direction.
void addClassDescription(const std::string &doc_string)
std::unique_ptr< MeshBase > buildMeshBaseObject(unsigned int dim=libMesh::invalid_uint)
Base class for generating fuel pins.
void ErrorVector unsigned int
const unsigned int & _block_id
Subdomain ID used for the mesh block.