armi.reactor.grids package

This contains structured meshes in multiple geometries and spatial locators (i.e. locations).

Grids are objects that map indices (i, j, k) to spatial locations (x,y,z) or (t,r,z). They are useful for arranging things in reactors, such as:

  • Fuel assemblies in a reactor

  • Plates in a heat exchanger

  • Pins in a fuel assembly

  • Blocks in a fuel assembly (1-D)

Fast reactors often use a hexagonal grid, while other reactors may be better suited for Cartesian or RZT grids. This module contains representations of all these.

Grids can be defined by any arbitrary combination of absolute grid boundaries and unit step directions.

Associated with grids are IndexLocations. Each of these maps to a single cell in a grid, or to an arbitrary point in the continuous space represented by a grid. When a Grid` is built, it builds a collection of IndexLocations, one for each cell.

In the ARMI armi.reactor module, each object is assigned a locator either from a grid or in arbitrary, continuous space (using a CoordinateLocation) on the spatialLocator attribute.

Below is a basic example of how to use a 2-D grid:

>>> grid = CartesianGrid.fromRectangle(1.0, 1.0)  # 1 cm square-pitch Cartesian grid
>>> location = grid[1,2,0]
>>> location.getGlobalCoordinates()
array([ 1.,  2.,  0.])

Grids can be chained together in a parent-child relationship. This is often used in ARMI where a 1-D axial grid (e.g. in an assembly) is being positioned in a core or spent-fuel pool. See example in armi.reactor.tests.test_grids.TestSpatialLocator.test_recursion().

The “radial” (ring, position) indexing used in DIF3D can be converted to and from the more quasi-Cartesian indexing in a hex mesh easily with the utility methods HexGrid.getRingPos() and indicesToRingPos().

This module is designed to satisfy the spatial arrangement requirements of the Reactor package.

Throughout the module, the term global refers to the top-level coordinate system while the word local refers to within the current coordinate system defined by the current grid.

armi.reactor.grids.locatorLabelToIndices(label: str) Tuple[int, int, Optional[int]][source]

Convert a locator label to numerical i,j,k indices.

If there are only i,j indices, make the last item None

Submodules