https://mooseframework.inl.gov
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Protected Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
SCMDetailedTriPinMeshGenerator Class Reference

Mesh generator for fuel pins in a triangular lattice. More...

#include <SCMDetailedTriPinMeshGenerator.h>

Inheritance diagram for SCMDetailedTriPinMeshGenerator:
[legend]

Public Types

typedef DataFileName DataFileParameterType
 

Public Member Functions

 SCMDetailedTriPinMeshGenerator (const InputParameters &parameters)
 
virtual std::unique_ptr< MeshBase > generate () override
 
std::unique_ptr< MeshBase > generateInternal ()
 
const std::set< MeshGeneratorName > & getRequestedMeshGenerators () const
 
const std::set< MeshGeneratorName > & getRequestedMeshGeneratorsForSub () const
 
void addParentMeshGenerator (const MeshGenerator &mg, const AddParentChildKey)
 
void addChildMeshGenerator (const MeshGenerator &mg, const AddParentChildKey)
 
const std::set< const MeshGenerator *, Comparator > & getParentMeshGenerators () const
 
const std::set< const MeshGenerator *, Comparator > & getChildMeshGenerators () const
 
const std::set< const MeshGenerator *, Comparator > & getSubMeshGenerators () const
 
bool isParentMeshGenerator (const MeshGeneratorName &name, const bool direct=true) const
 
bool isChildMeshGenerator (const MeshGeneratorName &name, const bool direct=true) const
 
bool isNullMeshName (const MeshGeneratorName &name) const
 
bool hasSaveMesh () const
 
bool hasOutput () const
 
const std::string & getSavedMeshName () const
 
bool hasGenerateData () const
 
bool isDataOnly () const
 
virtual bool enabled () const
 
std::shared_ptr< MooseObjectgetSharedPtr ()
 
std::shared_ptr< const MooseObjectgetSharedPtr () const
 
MooseAppgetMooseApp () const
 
const std::string & type () const
 
virtual const std::string & name () const
 
std::string typeAndName () const
 
std::string errorPrefix (const std::string &error_type) const
 
void callMooseError (std::string msg, const bool with_prefix) const
 
MooseObjectParameterName uniqueParameterName (const std::string &parameter_name) const
 
const InputParametersparameters () const
 
MooseObjectName uniqueName () const
 
const T & getParam (const std::string &name) const
 
std::vector< std::pair< T1, T2 > > getParam (const std::string &param1, const std::string &param2) const
 
const T * queryParam (const std::string &name) const
 
const T & getRenamedParam (const std::string &old_name, const std::string &new_name) const
 
getCheckedPointerParam (const std::string &name, const std::string &error_string="") const
 
bool isParamValid (const std::string &name) const
 
bool isParamSetByUser (const std::string &nm) const
 
void paramError (const std::string &param, Args... args) const
 
void paramWarning (const std::string &param, Args... args) const
 
void paramInfo (const std::string &param, Args... args) const
 
void connectControllableParams (const std::string &parameter, const std::string &object_type, const std::string &object_name, const std::string &object_parameter) const
 
void mooseError (Args &&... args) const
 
void mooseErrorNonPrefixed (Args &&... args) const
 
void mooseDocumentedError (const std::string &repo_name, const unsigned int issue_num, Args &&... args) const
 
void mooseWarning (Args &&... args) const
 
void mooseWarningNonPrefixed (Args &&... args) const
 
void mooseDeprecated (Args &&... args) const
 
void mooseInfo (Args &&... args) const
 
std::string getDataFileName (const std::string &param) const
 
std::string getDataFileNameByName (const std::string &relative_path) const
 
std::string getDataFilePath (const std::string &relative_path) const
 
const Parallel::Communicator & comm () const
 
processor_id_type n_processors () const
 
processor_id_type processor_id () const
 

Static Public Member Functions

static InputParameters validParams ()
 
static bool hasGenerateData (const InputParameters &params)
 
static void setHasGenerateData (InputParameters &params)
 

Public Attributes

const ConsoleStream _console
 

Static Public Attributes

static const std::string data_only_param
 
static constexpr auto SYSTEM
 
static constexpr auto NAME
 

Protected Member Functions

void generatePin (std::unique_ptr< MeshBase > &mesh_base, const Point &center)
 
virtual void generateData ()
 
T & copyMeshProperty (const std::string &target_data_name, const std::string &source_data_name, const std::string &source_mesh)
 
T & copyMeshProperty (const std::string &source_data_name, const std::string &source_mesh)
 
std::unique_ptr< MeshBase > & getMesh (const std::string &param_name, const bool allow_invalid=false)
 
std::vector< std::unique_ptr< MeshBase > *> getMeshes (const std::string &param_name)
 
std::unique_ptr< MeshBase > & getMeshByName (const MeshGeneratorName &mesh_generator_name)
 
std::vector< std::unique_ptr< MeshBase > *> getMeshesByName (const std::vector< MeshGeneratorName > &mesh_generator_names)
 
void declareMeshForSub (const std::string &param_name)
 
void declareMeshesForSub (const std::string &param_name)
 
void declareMeshForSubByName (const MeshGeneratorName &mesh_generator_name)
 
void declareMeshesForSubByName (const std::vector< MeshGeneratorName > &mesh_generator_names)
 
std::unique_ptr< MeshBase > buildMeshBaseObject (unsigned int dim=libMesh::invalid_uint)
 
std::unique_ptr< ReplicatedMesh > buildReplicatedMesh (unsigned int dim=libMesh::invalid_uint)
 
std::unique_ptr< DistributedMesh > buildDistributedMesh (unsigned int dim=libMesh::invalid_uint)
 
void addMeshSubgenerator (const std::string &type, const std::string &name, Ts... extra_input_parameters)
 
void addMeshSubgenerator (const std::string &type, const std::string &name, InputParameters params)
 
void declareNullMeshName (const MeshGeneratorName &name)
 
const T & getMeshProperty (const std::string &data_name, const std::string &prefix)
 
const T & getMeshProperty (const std::string &data_name)
 
bool hasMeshProperty (const std::string &data_name, const std::string &prefix) const
 
bool hasMeshProperty (const std::string &data_name, const std::string &prefix) const
 
bool hasMeshProperty (const std::string &data_name) const
 
bool hasMeshProperty (const std::string &data_name) const
 
std::string meshPropertyName (const std::string &data_name) const
 
T & declareMeshProperty (const std::string &data_name, Args &&... args)
 
T & declareMeshProperty (const std::string &data_name, const T &data_value)
 
T & declareMeshProperty (const std::string &data_name, Args &&... args)
 
T & declareMeshProperty (const std::string &data_name, const T &data_value)
 
T & setMeshProperty (const std::string &data_name, Args &&... args)
 
T & setMeshProperty (const std::string &data_name, const T &data_value)
 
T & setMeshProperty (const std::string &data_name, Args &&... args)
 
T & setMeshProperty (const std::string &data_name, const T &data_value)
 

Static Protected Member Functions

static std::string meshPropertyName (const std::string &data_name, const std::string &prefix)
 

Protected Attributes

std::unique_ptr< MeshBase > & _input
 Mesh that comes from another generator. More...
 
const unsigned int_n_rings
 Number of rings in the fuel assembly. More...
 
const Real _unheated_length_entry
 unheated length of the fuel Pin at the entry of the assembly More...
 
const Real _heated_length
 heated length of the fuel Pin More...
 
const Real _unheated_length_exit
 unheated length of the fuel Pin at the exit of the assembly More...
 
std::vector< Real_z_grid
 axial location of nodes More...
 
const Real _pitch
 Distance between the neighbor fuel pins, pitch. More...
 
const Real _pin_diameter
 fuel Pin diameter More...
 
const unsigned int _n_cells
 Number of cells in the axial direction. More...
 
const unsigned int_block_id
 Subdomain ID used for the mesh block. More...
 
const unsigned int_num_radial_parts
 Number of radial parts. More...
 
dof_id_type _elem_id
 Counter for element numbering. More...
 
MooseMesh *const _mesh
 
const bool & _enabled
 
MooseApp_app
 
const std::string _type
 
const std::string _name
 
const InputParameters_pars
 
Factory_factory
 
ActionFactory_action_factory
 
const Parallel::Communicator & _communicator
 

Detailed Description

Mesh generator for fuel pins in a triangular lattice.

Definition at line 17 of file SCMDetailedTriPinMeshGenerator.h.

Constructor & Destructor Documentation

◆ SCMDetailedTriPinMeshGenerator()

SCMDetailedTriPinMeshGenerator::SCMDetailedTriPinMeshGenerator ( const InputParameters parameters)

Definition at line 31 of file SCMDetailedTriPinMeshGenerator.C.

33  _input(getMesh("input")),
34  _n_rings(getParam<unsigned int>("nrings"))
35 {
36 }
DetailedPinMeshGeneratorBase(const InputParameters &parameters)
std::unique_ptr< MeshBase > & _input
Mesh that comes from another generator.
std::unique_ptr< MeshBase > & getMesh(const std::string &param_name, const bool allow_invalid=false)
const unsigned int & _n_rings
Number of rings in the fuel assembly.
const InputParameters & parameters() const

Member Function Documentation

◆ generate()

std::unique_ptr< MeshBase > SCMDetailedTriPinMeshGenerator::generate ( )
overridevirtual

Implements MeshGenerator.

Definition at line 39 of file SCMDetailedTriPinMeshGenerator.C.

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 }
const Real _pitch
Distance between the neighbor fuel pins, pitch.
virtual const std::string & name() const
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.
std::unique_ptr< MeshBase > buildMeshBaseObject(unsigned int dim=libMesh::invalid_uint)
const unsigned int & _block_id
Subdomain ID used for the mesh block.

◆ generatePin()

void DetailedPinMeshGeneratorBase::generatePin ( std::unique_ptr< MeshBase > &  mesh_base,
const Point &  center 
)
protectedinherited

Definition at line 51 of file DetailedPinMeshGeneratorBase.C.

Referenced by SCMDetailedQuadPinMeshGenerator::generate(), and generate().

53 {
54  const Real dalpha = 360. / _num_radial_parts;
55  Real radius = _pin_diameter / 2.;
56 
57  // nodes
58  std::vector<std::vector<Node *>> nodes;
59  nodes.resize(_n_cells + 1);
60  for (unsigned int k = 0; k < _n_cells + 1; k++)
61  {
62  const Real elev = _z_grid[k];
63  // center node
64  nodes[k].push_back(mesh_base->add_point(Point(center(0), center(1), elev)));
65  // ring around the center
66  Real alpha = 0.;
67  for (unsigned int i = 0; i < _num_radial_parts; i++, alpha += dalpha)
68  {
69  const Real dx = radius * std::cos(alpha * M_PI / 180.);
70  const Real dy = radius * std::sin(alpha * M_PI / 180.);
71  Point pt(center(0) + dx, center(1) + dy, elev);
72  nodes[k].push_back(mesh_base->add_point(pt));
73  }
74  }
75 
76  // elements
77  for (unsigned int k = 0; k < _n_cells; k++)
78  {
79  for (unsigned int i = 0; i < _num_radial_parts; i++)
80  {
81  Elem * elem = new Prism6;
82  elem->subdomain_id() = _block_id;
83  elem->set_id(_elem_id++);
84  mesh_base->add_elem(elem);
85  const unsigned int ctr_idx = 0;
86  const unsigned int idx1 = (i % _num_radial_parts) + 1;
87  const unsigned int idx2 = ((i + 1) % _num_radial_parts) + 1;
88  elem->set_node(0, nodes[k][ctr_idx]);
89  elem->set_node(1, nodes[k][idx1]);
90  elem->set_node(2, nodes[k][idx2]);
91  elem->set_node(3, nodes[k + 1][ctr_idx]);
92  elem->set_node(4, nodes[k + 1][idx1]);
93  elem->set_node(5, nodes[k + 1][idx2]);
94  }
95  }
96 }
const unsigned int _n_cells
Number of cells in the axial direction.
const Real radius
const unsigned int & _num_radial_parts
Number of radial parts.
dof_id_type _elem_id
Counter for element numbering.
std::vector< Real > _z_grid
axial location of nodes
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
static const std::string alpha
Definition: NS.h:134
static const std::string k
Definition: NS.h:130
const unsigned int & _block_id
Subdomain ID used for the mesh block.
static const std::string center
Definition: NS.h:28
const Real _pin_diameter
fuel Pin diameter

◆ validParams()

InputParameters SCMDetailedTriPinMeshGenerator::validParams ( )
static

Definition at line 21 of file SCMDetailedTriPinMeshGenerator.C.

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 }
void addRequiredParam(const std::string &name, const std::string &doc_string)
void addClassDescription(const std::string &doc_string)

Member Data Documentation

◆ _block_id

const unsigned int& DetailedPinMeshGeneratorBase::_block_id
protectedinherited

Subdomain ID used for the mesh block.

Definition at line 40 of file DetailedPinMeshGeneratorBase.h.

Referenced by SCMDetailedQuadPinMeshGenerator::generate(), generate(), and DetailedPinMeshGeneratorBase::generatePin().

◆ _elem_id

dof_id_type DetailedPinMeshGeneratorBase::_elem_id
protectedinherited

Counter for element numbering.

Definition at line 44 of file DetailedPinMeshGeneratorBase.h.

Referenced by SCMDetailedQuadPinMeshGenerator::generate(), generate(), and DetailedPinMeshGeneratorBase::generatePin().

◆ _heated_length

const Real DetailedPinMeshGeneratorBase::_heated_length
protectedinherited

heated length of the fuel Pin

Definition at line 28 of file DetailedPinMeshGeneratorBase.h.

Referenced by DetailedPinMeshGeneratorBase::DetailedPinMeshGeneratorBase().

◆ _input

std::unique_ptr<MeshBase>& SCMDetailedTriPinMeshGenerator::_input
protected

Mesh that comes from another generator.

Definition at line 26 of file SCMDetailedTriPinMeshGenerator.h.

Referenced by generate().

◆ _n_cells

const unsigned int DetailedPinMeshGeneratorBase::_n_cells
protectedinherited

Number of cells in the axial direction.

Definition at line 38 of file DetailedPinMeshGeneratorBase.h.

Referenced by DetailedPinMeshGeneratorBase::DetailedPinMeshGeneratorBase(), and DetailedPinMeshGeneratorBase::generatePin().

◆ _n_rings

const unsigned int& SCMDetailedTriPinMeshGenerator::_n_rings
protected

Number of rings in the fuel assembly.

Definition at line 28 of file SCMDetailedTriPinMeshGenerator.h.

Referenced by generate().

◆ _num_radial_parts

const unsigned int& DetailedPinMeshGeneratorBase::_num_radial_parts
protectedinherited

Number of radial parts.

Definition at line 42 of file DetailedPinMeshGeneratorBase.h.

Referenced by DetailedPinMeshGeneratorBase::generatePin().

◆ _pin_diameter

const Real DetailedPinMeshGeneratorBase::_pin_diameter
protectedinherited

fuel Pin diameter

Definition at line 36 of file DetailedPinMeshGeneratorBase.h.

Referenced by DetailedPinMeshGeneratorBase::generatePin().

◆ _pitch

const Real DetailedPinMeshGeneratorBase::_pitch
protectedinherited

Distance between the neighbor fuel pins, pitch.

Definition at line 34 of file DetailedPinMeshGeneratorBase.h.

Referenced by SCMDetailedQuadPinMeshGenerator::generate(), and generate().

◆ _unheated_length_entry

const Real DetailedPinMeshGeneratorBase::_unheated_length_entry
protectedinherited

unheated length of the fuel Pin at the entry of the assembly

Definition at line 26 of file DetailedPinMeshGeneratorBase.h.

Referenced by DetailedPinMeshGeneratorBase::DetailedPinMeshGeneratorBase().

◆ _unheated_length_exit

const Real DetailedPinMeshGeneratorBase::_unheated_length_exit
protectedinherited

unheated length of the fuel Pin at the exit of the assembly

Definition at line 30 of file DetailedPinMeshGeneratorBase.h.

Referenced by DetailedPinMeshGeneratorBase::DetailedPinMeshGeneratorBase().

◆ _z_grid

std::vector<Real> DetailedPinMeshGeneratorBase::_z_grid
protectedinherited

The documentation for this class was generated from the following files: