PatternedHexMeshGenerator

This PatternedHexMeshGenerator source code assembles hexagonal meshes into a hexagonal grid and optionally forces the outer boundary to be hexagonal and/or adds a duct.

Overview

The PatternedHexMeshGenerator object generates a 2D mesh by stitching hexagonal meshes generated by PolygonConcentricCircleMeshGenerator, HexagonConcentricCircleAdaptiveBoundaryMeshGenerator, and itself, based on a user-defined hexagonal grid pattern. The generated 2D mesh can optionally contain an extra background region and/or external duct regions to form a hexagonal external shape rather than a jagged boundary edge.

Geometry Information

In order to generate the hexagonal patterned mesh, three fundamental parameters are needed:

  • "inputs": a vector of mesh generator names that will be used as elements to form the patterned mesh;

  • "pattern": a two-dimensional vector that represents the pattern of mesh to be generated. The elements must be integers from 0 to N-1, where N is the length of vector parameter "inputs".

  • "pattern_boundary": a MooseEnum parameter that can be either hexagon or none. When none is selected, this object only stitches "inputs" meshes into a patterned mesh without extraneous geometry, resulting in an outer boundary with a zig-zag edge. When hexagon is selected, a background region is added so that the generated mesh has a hexagonal shape instead of a zig-zag one. Concentric duct regions may also be optionally added to the hexagon periphery when this parameter is hexagon. The user can refer to Figure 1 for more details.

Figure 1: A schematic showing the difference between none and hexagon pattern_boundary.

When "pattern_boundary" is set as hexagon, the user can also provide "duct_sizes" in either apothem or radius style to add external duct regions to the generated hexagon mesh. Also, "hexagon_size" must also be provided to define the external hexagon boundary size, which can be either apothem or radius of the hexagon, as determined by "hexagon_size_style". In some cases, if "hexagon_size" is small enough, the hexagon external boundary may cut off some of the stitched hexagonal meshes. As long as the concentric circular (rings) regions are not cut off, the rest of the mesh is deformed to accommodate the limited external boundaries. Users can also set "deform_non_circular_region" as false to prevent the non-circular regions from being deformed.

By default, the generated boundary mesh consists of linear elements. If quadratic elements are preferred, users can set "boundary_region_element_type" as QUAD8 or QUAD9.

MeshMetaData of Input and Output Meshes

As mentioned before, the PatternedHexMeshGenerator is capable of two modes of mesh patterning jobs, which require different mesh metadata from the input meshes to be patterned. These mesh metadata can be automatically assigned by the typical mesh generators that produce the input meshes. Alternatively, users can manually assign the required metadata using AddMetaDataGenerator.

1. Assembly Mode: patterning unit cell input meshes together to form an "assembly" mesh:

Select this mode by setting "generate_core_metadata" as false. A typical unit cell input mesh can be generated by PolygonConcentricCircleMeshGenerator. The hexagon "pattern_boundary" can only be used in this mode. When "pattern_boundary" is set as hexagon, PatternedHexMeshGenerator automatically assigns the mesh metadata required for the "core mode" as discussed in the following text.

2. Core Mode: patterning assembly input meshes together to form a "core" mesh:

Select this mode by setting "generate_core_metadata" as true. A typical assembly input mesh can be generated by another PatternedHexMeshGenerator in assembly mode, HexagonConcentricCircleAdaptiveBoundaryMeshGenerator, or FlexiblePatternGenerator.

One of the applications of this object is to generate meshes for prismatic reactor cores. In that case, by setting "generate_core_metadata" as true, control drum meshes can also be used as part of "inputs" to construct the core mesh. To facilitate the use of control drum rotation simulation objects, a series of MeshMetaData can be generated, including:

  • control_drum_positions: a vector of control drum center positions. This MeshMetaData can also be outputted as an ASCII file by setting "generate_control_drum_positions_file" as true and providing "position_file";

  • control_drum_angles: a vector of the azimuthal angles of the control drum center positions to the center of the core.

  • control_drums_azimuthal_meta: a two-dimensional vector containing the sorted azimuthal angles of nodes to the corresponding control drum center for all the control drums.

In addition, "assign_control_drum_id" can be set as true so that the control drum "inputs" meshes can be indexed using an element extra integer called control_drum_id. As illustrated in Figure 2, the control_drum_id is indexed based on the azimuthal angles of the control drums.

Figure 2: A schematic drawing the indexing rule of control_drum_id in the PatternedHexMeshGenerator object.

These MeshMetaData as well as control_drum_id can be used by other MOOSE objects such as MultiControlDrumFunction to simulate control drums rotation during power transients.

Interface Boundaries

The user can also decide whether the interface boundaries are generated or not in the peripheral region.

There are two types of interface boundaries, "inward interface boundaries" and "outward interface boundaries". The "inward" and "outward" here refer to the direction of the boundary's normal vector. As a sideset must be defined on the sides of elements, which belong to one or multiple subdomains, an interface boundary can be defined either on the subdomain immediately inside the interface (i.e., with an "outward" normal vector) or on the subdomain immediately outside the interface (i.e., with an "inward" normal vector).

The user can set "create_inward_interface_boundaries" and "create_outward_interface_boundaries" to control which interface boundaries will be created. If generated, the outward interface boundaries will be assigned ids using sequential odd numbers (i.e., 1, 3, 5, 7, ...) shifted by INTRINSIC_SIDESET_ID::SLICE_ALT=30500 from center to periphery, while the inward interface boundaries will be assigned ids using sequential even numbers (i.e., 0, 2, 4, 6, ...) shifted by INTRINSIC_SIDESET_ID::SLICE_ALT similarly.

The interface boundary IDs within each hexagonal lattice cell can be shifted by setting "interface_boundary_id_shift_pattern". Note that these IDs on each lattice cell are pre-generated when the input tiles are generated by PolygonConcentricCircleMeshGenerator. To customize the interface boundary IDs for each lattice cell location, the user can define a value of boundary ID shift for each lattice cell location in a two-dimensional vector form, matching the dimensions of "pattern". These shift values, specified by "interface_boundary_id_shift_pattern", are applied to each lattice cell location during the stitching process. This allows for unique interface boundary ID values for each cell (or pattern-defined groups of cells) within the hexagonal lattice, based on its specific location.

Reporting ID Information

This object can generate a hexagonal lattice mesh with reporting ID assignments, and can be used successively on its own output mesh to add IDs on the pin and assembly levels, for example. The reporting ID option can be turned on by defining the name of the reporting ID variable is provided through "id_name".

A user can select an ID assignment scheme using "assign_type", and the following schemes are currently available:

  • cell (default): Assign unique IDs for each component/tile in the lattice in sequential order.

  • pattern: Assign IDs based on the ID of the input tiles.

  • manual: Assign IDs based on user-defined mapping defined in "id_pattern".

The default numbering scheme starts at 0 in the upper left hand corner of the hexagon grid (not including duct region) and increments by 1 as the grid is traversed left to right, top to bottom. In presence of duct regions, separate reporting IDs are automatically generated for the elements in duct regions. For the pattern scheme, all tiles in the pattern with the same input will bear the same reporting ID. The duct regions will be assigned reporting IDs starting from the next integer higher than the highest one used inside of the ducts.

The name of the reporting ID variable is provided through "id_name" depending on the hierarchical level of component. The ID values themselves are stored as extra element integers on the mesh. For example, the reporting IDs for individual pins (pin_id) can be assigned when assemblies are built because the IDs for pin level are uniquely determined from the pin arrangement within each assembly type. Similarly, the assembly reporting IDs (assembly_id) are assigned in the core construction process.

The multiple reporting IDs can be assigned by defining the multiple names of the reporting ID variable, which are provided through the"id_name". The corresponding assignment scheme should be provided in "assign_type" for each reporting ID names, accordingly. In the case that multiple manual assign_types are used, the same number of manual ID patterns should be provided in "id_pattern". Each manual pattern in "id_pattern" should be separated by using the delimiter '|'. These defined ID patterns are sequentially assigned to the reporting IDs having manual assignment scheme. The below is an example of using multiple reporting ID assignment. Here, manual_1_id uses the first pattern in defined in "id_pattern", and manual_2_id uses the second one.

id_name = 'manual_1_id cell_id manual_2_id'
assign_type 'manual cell manual'
id_pattern = '1 1;
             2 2 2;
              3 3|
              1 2;
             1 2 3
              2 3;

Certain regions can be excluded from being labeled with an ID, for example dummy regions that will later be deleted. This can be accommodated by listing mesh objects in the "exclude_id" input parameter. IDs will not be assigned to these mesh objects. Usage of this parameter is helpful to retain sequential numbering when dummy region are later deleted, or to only label areas of interest.

Example Syntax

[Mesh]
  [pattern_1]
    type = PatternedHexMeshGenerator
    inputs = 'hex_1'
    pattern = '0 0;
              0 0 0;
               0 0'
    hexagon_size = 15
    background_block_id = 80
    background_block_name = hex_background
  []
[]
(contrib/moose/modules/reactor/test/tests/meshgenerators/patterned_hex_mesh_generator/patterned_pattern.i)

Input Parameters

  • inputsThe input MeshGenerators.

    C++ Type:std::vector<MeshGeneratorName>

    Unit:(no unit assumed)

    Controllable:No

    Description:The input MeshGenerators.

  • patternA double-indexed hexagonal-shaped array starting with the upper-left corner.

    C++ Type:std::vector<std::vector<unsigned int>>

    Unit:(no unit assumed)

    Controllable:No

    Description:A double-indexed hexagonal-shaped array starting with the upper-left corner.

Required Parameters

  • duct_sizesDistance(s) from center to duct(s) inner boundaries.

    C++ Type:std::vector<double>

    Unit:(no unit assumed)

    Controllable:No

    Description:Distance(s) from center to duct(s) inner boundaries.

  • duct_sizes_styleapothemStyle in which hexagon center to duct distance(s) is given (apothem = center-to-face, radius = center-to-vertex).

    Default:apothem

    C++ Type:MooseEnum

    Unit:(no unit assumed)

    Options:apothem, radius

    Controllable:No

    Description:Style in which hexagon center to duct distance(s) is given (apothem = center-to-face, radius = center-to-vertex).

  • generate_core_metadataFalseA Boolean parameter that controls whether the core related metadata is generated for other MOOSE objects such as 'MultiControlDrumFunction' or not.

    Default:False

    C++ Type:bool

    Unit:(no unit assumed)

    Controllable:No

    Description:A Boolean parameter that controls whether the core related metadata is generated for other MOOSE objects such as 'MultiControlDrumFunction' or not.

  • hexagon_sizeSize of the outmost hexagon boundary to be generated; this is required only when pattern type is 'hexagon'.

    C++ Type:double

    Unit:(no unit assumed)

    Controllable:No

    Description:Size of the outmost hexagon boundary to be generated; this is required only when pattern type is 'hexagon'.

  • hexagon_size_styleapothemStyle in which the hexagon size is given (default: apothem i.e. half-pitch).

    Default:apothem

    C++ Type:MooseEnum

    Unit:(no unit assumed)

    Options:apothem, radius

    Controllable:No

    Description:Style in which the hexagon size is given (default: apothem i.e. half-pitch).

  • interface_boundary_id_shift_patternUser-defined shift values for each pattern cell. A double-indexed array starting with the upper-left corner.

    C++ Type:std::vector<std::vector<short>>

    Unit:(no unit assumed)

    Controllable:No

    Description:User-defined shift values for each pattern cell. A double-indexed array starting with the upper-left corner.

  • pattern_boundaryhexagonThe boundary shape of the patterned mesh.

    Default:hexagon

    C++ Type:MooseEnum

    Unit:(no unit assumed)

    Options:none, hexagon

    Controllable:No

    Description:The boundary shape of the patterned mesh.

  • rotate_angle90Rotate the entire patterned mesh by a certain degrees that is defined here.

    Default:90

    C++ Type:double

    Unit:(no unit assumed)

    Controllable:No

    Description:Rotate the entire patterned mesh by a certain degrees that is defined here.

Optional Parameters

  • assign_control_drum_idTrueWhether control drum id is assigned to the mesh as an extra integer.

    Default:True

    C++ Type:bool

    Unit:(no unit assumed)

    Controllable:No

    Description:Whether control drum id is assigned to the mesh as an extra integer.

  • generate_control_drum_positions_fileFalseWhether a positions file is generated in the core mesh mode.

    Default:False

    C++ Type:bool

    Unit:(no unit assumed)

    Controllable:No

    Description:Whether a positions file is generated in the core mesh mode.

  • position_filepositions_meta.dataData file name to store control drum positions.

    Default:positions_meta.data

    C++ Type:std::string

    Unit:(no unit assumed)

    Controllable:No

    Description:Data file name to store control drum positions.

Control Drum Parameters

  • assign_typecell List of integer ID assignment types

    Default:cell

    C++ Type:std::vector<MooseEnum>

    Unit:(no unit assumed)

    Options:cell, pattern, manual

    Controllable:No

    Description:List of integer ID assignment types

  • exclude_idName of input meshes to be excluded in ID generation

    C++ Type:std::vector<MeshGeneratorName>

    Unit:(no unit assumed)

    Controllable:No

    Description:Name of input meshes to be excluded in ID generation

  • id_nameList of extra integer ID set names

    C++ Type:std::vector<std::string>

    Unit:(no unit assumed)

    Controllable:No

    Description:List of extra integer ID set names

  • id_patternUser-defined element IDs. A double-indexed array starting with the upper-left corner. When providing multiple patterns, each pattern should be separated using '|'

    C++ Type:std::vector<std::vector<std::vector<unsigned long, std::allocator<unsigned long>>>>

    Unit:(no unit assumed)

    Controllable:No

    Description:User-defined element IDs. A double-indexed array starting with the upper-left corner. When providing multiple patterns, each pattern should be separated using '|'

Reporting Id Parameters

  • background_block_idOptional customized block id for the background block in 'assembly' mode; must be provided along with 'duct_block_ids' if 'duct_sizes' is provided.

    C++ Type:unsigned short

    Unit:(no unit assumed)

    Controllable:No

    Description:Optional customized block id for the background block in 'assembly' mode; must be provided along with 'duct_block_ids' if 'duct_sizes' is provided.

  • background_block_nameOptional customized block name for the background block in 'assembly' mode; must be provided along with 'duct_block_names' if 'duct_sizes' is provided.

    C++ Type:SubdomainName

    Unit:(no unit assumed)

    Controllable:No

    Description:Optional customized block name for the background block in 'assembly' mode; must be provided along with 'duct_block_names' if 'duct_sizes' is provided.

  • boundary_region_element_typeQUAD4Type of the quadrilateral elements to be generated in the boundary region.

    Default:QUAD4

    C++ Type:MooseEnum

    Unit:(no unit assumed)

    Options:QUAD4, QUAD8, QUAD9

    Controllable:No

    Description:Type of the quadrilateral elements to be generated in the boundary region.

  • create_inward_interface_boundariesFalseWhether the inward interface boundary sidesets are created.

    Default:False

    C++ Type:bool

    Unit:(no unit assumed)

    Controllable:No

    Description:Whether the inward interface boundary sidesets are created.

  • create_outward_interface_boundariesTrueWhether the outward interface boundary sidesets are created.

    Default:True

    C++ Type:bool

    Unit:(no unit assumed)

    Controllable:No

    Description:Whether the outward interface boundary sidesets are created.

  • duct_block_idsOptional customized block ids for each duct geometry block in 'assembly' mode; must be provided along with 'background_block_id'.

    C++ Type:std::vector<unsigned short>

    Unit:(no unit assumed)

    Controllable:No

    Description:Optional customized block ids for each duct geometry block in 'assembly' mode; must be provided along with 'background_block_id'.

  • duct_block_namesOptional customized block names for each duct geometry block in 'assembly' mode; must be provided along with 'background_block_name'.

    C++ Type:std::vector<SubdomainName>

    Unit:(no unit assumed)

    Controllable:No

    Description:Optional customized block names for each duct geometry block in 'assembly' mode; must be provided along with 'background_block_name'.

  • external_boundary_idOptional customized external boundary id.

    C++ Type:short

    Unit:(no unit assumed)

    Controllable:No

    Description:Optional customized external boundary id.

  • external_boundary_nameOptional customized external boundary name.

    C++ Type:std::string

    Unit:(no unit assumed)

    Controllable:No

    Description:Optional customized external boundary name.

Customized Subdomain/Boundary Parameters

  • background_intervals3Radial intervals in the assembly peripheral region.

    Default:3

    C++ Type:unsigned int

    Unit:(no unit assumed)

    Controllable:No

    Description:Radial intervals in the assembly peripheral region.

  • deform_non_circular_regionTrueWhether the non-circular region (outside the rings) can be deformed.

    Default:True

    C++ Type:bool

    Unit:(no unit assumed)

    Controllable:No

    Description:Whether the non-circular region (outside the rings) can be deformed.

  • duct_intervalsNumber of meshing intervals in each enclosing duct.

    C++ Type:std::vector<unsigned int>

    Unit:(no unit assumed)

    Controllable:No

    Description:Number of meshing intervals in each enclosing duct.

  • uniform_mesh_on_sidesFalseWhether the side elements are reorganized to have a uniform size.

    Default:False

    C++ Type:bool

    Unit:(no unit assumed)

    Controllable:No

    Description:Whether the side elements are reorganized to have a uniform size.

Mesh Density Parameters

  • control_tagsAdds user-defined labels for accessing object parameters via control logic.

    C++ Type:std::vector<std::string>

    Unit:(no unit assumed)

    Controllable:No

    Description:Adds user-defined labels for accessing object parameters via control logic.

  • enableTrueSet the enabled status of the MooseObject.

    Default:True

    C++ Type:bool

    Unit:(no unit assumed)

    Controllable:No

    Description:Set the enabled status of the MooseObject.

  • save_with_nameKeep the mesh from this mesh generator in memory with the name specified

    C++ Type:std::string

    Unit:(no unit assumed)

    Controllable:No

    Description:Keep the mesh from this mesh generator in memory with the name specified

Advanced Parameters

  • nemesisFalseWhether or not to output the mesh file in the nemesisformat (only if output = true)

    Default:False

    C++ Type:bool

    Unit:(no unit assumed)

    Controllable:No

    Description:Whether or not to output the mesh file in the nemesisformat (only if output = true)

  • outputFalseWhether or not to output the mesh file after generating the mesh

    Default:False

    C++ Type:bool

    Unit:(no unit assumed)

    Controllable:No

    Description:Whether or not to output the mesh file after generating the mesh

  • show_infoFalseWhether or not to show mesh info after generating the mesh (bounding box, element types, sidesets, nodesets, subdomains, etc)

    Default:False

    C++ Type:bool

    Unit:(no unit assumed)

    Controllable:No

    Description:Whether or not to show mesh info after generating the mesh (bounding box, element types, sidesets, nodesets, subdomains, etc)

Debugging Parameters