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 
18 {
20  params.addClassDescription(
21  "Creates a detailed mesh of fuel pins in a square lattice arrangement");
22  params.addRequiredParam<MeshGeneratorName>("input", "The corresponding subchannel mesh");
23  params.addRequiredParam<unsigned int>("nx", "Number of channels in the x direction [-]");
24  params.addRequiredParam<unsigned int>("ny", "Number of channels in the y direction [-]");
25  return params;
26 }
27 
29  : DetailedPinMeshGeneratorBase(parameters),
30  _input(getMesh("input")),
31  _nx(getParam<unsigned int>("nx")),
32  _ny(getParam<unsigned int>("ny"))
33 {
34 }
35 
36 std::unique_ptr<MeshBase>
38 {
39  std::unique_ptr<MeshBase> mesh_base = std::move(_input);
40  if (!mesh_base)
41  mesh_base = buildMeshBaseObject();
42  mesh_base->set_mesh_dimension(3);
43 
44  std::vector<Point> pin_centers;
46 
47  _elem_id = mesh_base->n_elem();
48  for (auto & ctr : pin_centers)
49  generatePin(mesh_base, ctr);
50 
51  mesh_base->subdomain_name(_block_id) = name();
52  mesh_base->prepare_for_use();
53 
54  return mesh_base;
55 }
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.
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.
const std::string & name() const
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.