https://mooseframework.inl.gov
SCMDetailedTriPinMeshGenerator.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 "TriSubChannelMesh.h"
12 #include "libmesh/cell_prism6.h"
13 
15 registerMooseObjectRenamed("SubChannelApp",
16  DetailedTriPinMeshGenerator,
17  "06/30/2025 24:00",
19 
22 {
24  params.addClassDescription(
25  "Creates a detailed mesh of fuel pins in a triangular lattice arrangement");
26  params.addRequiredParam<MeshGeneratorName>("input", "The corresponding subchannel mesh");
27  params.addRequiredParam<unsigned int>("nrings", "Number of fuel Pin rings per assembly [-]");
28  return params;
29 }
30 
32  : DetailedPinMeshGeneratorBase(parameters),
33  _input(getMesh("input")),
34  _n_rings(getParam<unsigned int>("nrings"))
35 {
36 }
37 
38 std::unique_ptr<MeshBase>
40 {
41  std::unique_ptr<MeshBase> mesh_base = std::move(_input);
42  if (!mesh_base)
43  mesh_base = buildMeshBaseObject();
44  mesh_base->set_mesh_dimension(3);
45 
46  std::vector<Point> pin_centers;
47  TriSubChannelMesh::rodPositions(pin_centers, _n_rings, _pitch, Point(0, 0));
48 
49  _elem_id = mesh_base->n_elem();
50  for (auto & ctr : pin_centers)
51  generatePin(mesh_base, ctr);
52 
53  mesh_base->subdomain_name(_block_id) = name();
54  mesh_base->prepare_for_use();
55 
56  return mesh_base;
57 }
T & getMesh(MooseMesh &mesh)
function to cast mesh
Definition: SCM.h:35
registerMooseObjectRenamed("SubChannelApp", DetailedTriPinMeshGenerator, "06/30/2025 24:00", SCMDetailedTriPinMeshGenerator)
virtual std::unique_ptr< MeshBase > generate() override
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)
SCMDetailedTriPinMeshGenerator(const InputParameters &parameters)
dof_id_type _elem_id
Counter for element numbering.
std::unique_ptr< MeshBase > & _input
Mesh that comes from another generator.
void generatePin(std::unique_ptr< MeshBase > &mesh_base, const Point &center)
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 & _n_rings
Number of rings in the fuel assembly.
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.
Mesh generator for fuel pins in a triangular lattice.
registerMooseObject("SubChannelApp", SCMDetailedTriPinMeshGenerator)