armi.reactor.blocks.hexBlock module
The HexBlock is a vertical slice of a hexagon-shaped assembly. This is a common geometry in reactor design.
- class armi.reactor.blocks.hexBlock.HexBlock(name, height=1.0)[source]
Bases:
BlockDefines a Block shaped like a hexagon.
This class defines hexagonal-shaped Blocks. It inherits functionality from the parent class, Block, and defines hexagonal-specific methods including, but not limited to, querying pin pitch, pin linear power densities, hydraulic diameter, and retrieving inner and outer pitch.
- PITCH_COMPONENT_TYPE: ClassVar[Tuple[Type[Component], ...] | None] = (<class 'armi.reactor.components.basicShapes.Hexagon'>,)
- coords()[source]
Returns the coordinates of the block.
Calls to the
getGlobalCoordinates()method of the block’sspatialLocatorattribute, which recursively calls itself on all parents of the block to get the coordinates of the block’s centroid in 3D cartesian space.Will additionally adjust the x and y coordinates based on the block parameters
displacementXanddisplacementY.
- createHomogenizedCopy(pinSpatialLocators=False)[source]
Create a new homogenized copy of a block that is less expensive than a full deepcopy.
This method creates and returns a homogenized representation of itself in the form of a new Block. The homogenization occurs in the following manner. A single Hexagon Component is created and added to the new Block. This Hexagon Component is given the
armi.materials.mixture._Mixturematerial and a volume averaged temperature (getAverageTempInC). The number densities of the original Block are also stored on this new Component (I_ARMI_CMP_GET_NDENS). Several parameters from the original block are copied onto the homogenized block (e.g., macros, lumped fission products, burnup group, number of pins, and spatial grid).Notes
This can be used to improve performance when a new copy of a reactor needs to be built, but the full detail of the block (including component geometry, material, number density, etc.) is not required for the targeted physics solver being applied to the new reactor model.
The main use case is for the uniform mesh converter (UMC). Frequently, a deterministic neutronics solver will require a uniform mesh reactor, which is produced by the UMC. Many deterministic solvers for fast spectrum reactors will also treat the individual blocks as homogenized mixtures. Since the neutronics solver does not need to know about the geometric and material details of the individual child components within a block, we can save significant effort while building the uniform mesh reactor with the UMC by omitting this detailed data and only providing the necessary level of detail for the uniform mesh reactor: number densities on each block.
Individual components within a block can have different temperatures, and this can affect cross sections. This temperature variation is captured by the lattice physics module. As long as temperature distribution is correctly captured during cross section generation, it does not need to be transferred to the neutronics solver directly through this copy operation.
If you make a new block, you must add it to an assembly and a reactor.
- Returns:
b – temperature and the number densities from the original block.
- Return type:
A homogenized block containing a single Hexagon Component that contains an average
- setPinPowers(powers, powerKeySuffix='')[source]
Updates the pin linear power densities of this block.
The linear densities are represented by the
linPowByPinparameter.It is expected that the ordering of
powersis consistent withgetPinLocations(). That helps ensure alignment with component-level look ups likegetPinIndices().The
linPowByPinparameter can be directly assigned to instead of using this method if the multiplicity of the pins in the block is equal to the number of pins in the block.- Parameters:
powers (list of floats, required) – The block-level pin linear power densities.
powers[i]represents the average linear power density of pinilocation atself.getPinLocations()[i]. The units of linear power density is watts/cm (i.e., watts produced per cm of pin length).powerKeySuffix (str, optional) – Must be either an empty string,
NEUTRON, orGAMMA. Defaults to empty string.
- rotate(rad: float)[source]
Rotates a block’s spatially varying parameters by a specified angle in the counter-clockwise direction.
The parameters must have a ParamLocation of either CORNERS or EDGES and must be a Python list of length 6 in order to be eligible for rotation; all parameters that do not meet these two criteria are not rotated.
Implementation: Rotating a hex block updates parameters on the boundary, the orientation parameter, and the spatial coordinates on contained objects. I_ARMI_ROTATE_HEX_BLOCKThis method rotates a block on a hexagonal grid, conserving the 60-degree symmetry of the grid. It first determines how many rotations the block will undergo based on the 60-degree hex grid. Then it uses that “rotation number” to do a few things: reset the orientation parameter, rotate the children, and rotate the boundary parameters. It also sets the “displacement in X” and “displacement in Y” parameters.
- Parameters:
rad (float, required) – Angle of counter-clockwise rotation in units of radians. Rotations must be in 60-degree increments (i.e., PI/3, 2 * PI/3, PI, 4 * PI/3, 5 * PI/3, and 2 * PI).
- getPinToDuctGap(cold=False)[source]
Returns the distance in cm between the outer most pin and the duct in a block.
- Parameters:
cold (boolean) – Determines whether the results should be cold or hot dimensions.
- Returns:
pinToDuctGap – Returns the diameteral gap between the outer most pins in a hex pack to the duct inner face to face in cm.
- Return type:
- getRotationNum() int[source]
Get index 0 through 5 indicating number of rotations counterclockwise around the z-axis.
- setRotationNum(rotNum: int)[source]
Set orientation based on a number 0 through 5 indicating number of rotations counterclockwise around the z-axis.
- getSymmetryFactor()[source]
Return a factor between 1 and N where 1/N is how much cut-off by symmetry lines this mesh cell is.
Reactor-level meshes have symmetry information so we have a reactor for this to work. That is why it is not implemented on the grid/locator level.
When edge-assemblies are included on both edges (i.e. MCNP or DIF3D-FD 1/3-symmetric cases), the edge assemblies have symmetry factors of 2.0. Otherwise (DIF3D-nodal) there’s a full assembly on the bottom edge (overhanging) and no assembly at the top edge so the ones at the bottom are considered full (symmetryFactor=1).
If this block is not in any grid at all, then there can be no symmetry so return 1.
- autoCreateSpatialGrids(systemSpatialGrid=None)[source]
Given a block without a spatialGrid, create a spatialGrid and give its children the corresponding spatialLocators (if it is a simple block).
In this case, a simple block would be one that has either multiplicity of components equal to 1 or N but no other multiplicities. Also, this should only happen when N fits exactly into a given number of hex rings. Otherwise, do not create a grid for this block.
- Parameters:
systemSpatialGrid (Grid, optional) – Spatial Grid of the system-level parent of this Assembly that contains this Block.
Notes
When a hex grid has another hex grid nested inside it, the nested grid has the opposite orientation (corners vs flats up). This method takes care of that.
If components inside this block are multiplicity 1, they get a single locator at the center of the grid cell. If the multiplicity is greater than 1, all the components are added to a multiIndexLocation on the hex grid.
- Raises:
ValueError – If the multiplicities of the block are not only 1 or N or if generated ringNumber leads to more positions than necessary.
- getPinCenterFlatToFlat(cold=False)[source]
Return the flat-to-flat distance between the centers of opposing pins in the outermost ring.
- getPinPitch(cold=False)[source]
Get the pin pitch in cm.
Assumes that the pin pitch is defined entirely by contacting cladding tubes and wire wraps. Grid spacers not yet supported.
- Parameters:
cold (boolean) – Determines whether the dimensions should be cold or hot
- Returns:
pinPitch – pin pitch in cm
- Return type:
- getWettedPerimeter()[source]
Return the total wetted perimeter of the block in cm.
Notes
Please be aware that this method is specific to Fast Reactors, and probably even Sodium Fast Reactors. This is obviously an awkward design choice, and we hope to improve upon it soon.
- getHydraulicDiameter()[source]
Return the hydraulic diameter in this block in cm.
Hydraulic diameter is 4A/P where A is the flow area and P is the wetted perimeter. In a hex assembly, the wetted perimeter includes the cladding, the wire wrap, and the inside of the duct. The flow area is the inner area of the duct minus the area of the pins and the wire.
- paramCollectionType
alias of
BlockParameterCollection