armi.reactor.assemblies module

Assemblies are collections of Blocks.

Generally, blocks are stacked from bottom to top.

class armi.reactor.assemblies.Assembly(typ, assemNum=None)[source]

Bases: Composite

A single assembly in a reactor made up of blocks built from the bottom up. Append blocks to add them up. Index blocks with 0 being the bottom.

Parameters:
  • typ (str) – Name of assembly design (e.g. the name from the blueprints input file).

  • assemNum (int, optional) – The unique ID number of this assembly. If None is provided, we generate a random int. This makes it clear that it is a placeholder. When an assembly with a negative ID is placed into a Reactor, it will be given a new, positive ID.

pDefs = <armi.reactor.parameters.parameterDefinitions.ParameterDefinitionCollection object>
LOAD_QUEUE = 'LoadQueue'
SPENT_FUEL_POOL = 'SFP'
DATABASE = 'database'
NOT_IN_CORE = ['LoadQueue', 'SFP']
renameBlocksAccordingToAssemblyNum()[source]

Updates the names of all blocks to comply with the assembly number.

Useful after an assembly number/name has been loaded from a snapshot and you want to update all block names to be consistent.

It may be better to store block numbers on each block as params. A database that can hold strings would be even better.

Notes

You must run armi.reactor.reactors.Reactor.regenAssemblyLists after calling this.

static makeNameFromAssemNum(assemNum)[source]

Set the name of this assembly (and the containing blocks) based on an assemNum.

AssemNums are like serial numbers for assemblies.

renumber(newNum)[source]

Change the assembly number of this assembly.

And handle the downstream impacts of changing the name of this Assembly and all of the Blocks within this Assembly.

Parameters:

newNum (int) – The new Assembly number.

makeUnique()[source]

Function to make an assembly unique by getting a new assembly number.

This also adjusts the assembly’s blocks IDs. This is necessary when using deepcopy to get a unique assemNum since a deepcopy implies it would otherwise have been the same object.

add(obj: Block)[source]

Add an object to this assembly.

The simple act of adding a block to an assembly fully defines the location of the block in 3-D.

moveTo(locator)[source]

Move an assembly somewhere else.

insert(index, obj)[source]

Insert an object at a given index position with the assembly.

getNum()[source]

Return unique integer for this assembly.

getLocation()[source]

Get string label representing this object’s location.

coords()[source]

Return the location of the assembly in the plane using cartesian global coordinates.

getArea()[source]

Return the area of the assembly by looking at its first block.

The assumption is that all blocks in an assembly have the same area. Calculate the total assembly volume in cm^3.

getVolume()[source]

Calculate the total assembly volume in cm^3.

getPinPlenumVolumeInCubicMeters()[source]

Return the volume of the plenum for a pin in an assembly.

Notes

If there is no plenum blocks in the assembly, a plenum volume of 0.0 is returned

Warning

This is a bit design-specific for pinned assemblies

getAveragePlenumTemperature()[source]

Return the average of the plenum block outlet temperatures.

rotatePins(*args, **kwargs)[source]

Rotate an assembly, which means rotating the indexing of pins.

doubleResolution()[source]

Turns each block into two half-size blocks.

Notes

Used for mesh sensitivity studies.

Warning

This is likely destined for a geometry converter rather than this instance method.

adjustResolution(refA)[source]

Split the blocks in this assembly to have the same mesh structure as refA.

getAxialMesh(centers=False, zeroAtFuel=False)[source]

Make a list of the block z-mesh tops from bottom to top in cm.

Parameters:
  • centers (bool, optional) – Return centers instead of tops. If centers and zeroesAtFuel the zero point will be center of first fuel.

  • zeroAtFuel (bool, optional) – If true will make the (bottom or center depending on centers) of the first fuel block be the zero point instead of the bottom of the first block.

See also

armi.reactor.assemblies.Assembly.makeAxialSnapList

makes index-based lookup of

axial

armi.reactor.reactors.Reactor.findAllAxialMeshPoints

gets a global list of all

of, plus

calculateZCoords()[source]

Set the center z-coords of each block and the params for axial expansion.

getTotalHeight(typeSpec=None)[source]

Determine the height of this assembly in cm.

Parameters:

typeSpec (See armi.composites.Composite.hasFlags()) –

Returns:

height – the height in cm

Return type:

float

getHeight(typeSpec=None)[source]
getReactiveHeight(enrichThresh=0.02)[source]

Returns the zBottom and total height in cm that has fissile enrichment over enrichThresh.

getElevationBoundariesByBlockType(blockType=None)[source]

Gets of list of elevations, ordered from bottom to top of all boundaries of the block of specified type.

Useful for determining location of the top of the upper grid plate or active fuel, etc by using [0] to get the lowest boundary and [-1] to get highest

Notes

The list will have duplicates when blocks of the same type share a boundary. this is intentional. It makes it easy to grab pairs off the list and know that the first item in a pair is the bottom boundary and the second is the top.

Parameters:

blockType (str) – Block type to find. empty accepts all

Returns:

elevation – Every float in the list is an elevation of a block boundary for the block type specified (has duplicates)

Return type:

list of floats

getElevationsMatchingParamValue(param, value)[source]

Return the elevations (z-coordinates) where the specified param takes the specified value.

Uses linear interpolation, assuming params correspond to block centers

Parameters:
  • param (str) – Name of param to try and match

  • value (float) –

Returns:

heights – z-coordinates where the specified param takes the specified value

Return type:

list

getAge()[source]

Gets a height-averaged residence time of this assembly in days.

makeAxialSnapList(refAssem=None, refMesh=None, force=False)[source]

Creates a list of block indices that should track axially with refAssem’s.

When axially expanding, the control rods, shields etc. need to maintain mesh lines with the rest of the core. To do this, we’ll just keep track of which indices of a reference assembly we should stick with. This method writes the indices of the top of a block to settings as topIndex.

Keep in mind that assemblies can have different number of blocks. This is why this function is useful. So this makes a list of reference indices that correspond to different axial mesh points on this assembly.

This is the depletion mesh we’re returning, useful for snapping after axial extension. Note that the neutronics mesh on rebusOutputs might be different.

See also

setBlockMesh

applies a snap.

setBlockMesh(blockMesh, conserveMassFlag=False)[source]

Snaps the axial mesh points of this assembly to correspond with the reference mesh.

Notes

This function only conserves mass on certain conditions:
  1. Fuel Assembly
    1. Structural material below the assembly conserves mass to accurate depict grid plate shielding Sodium is not conserved.

    2. Fuel blocks only conserve mass of the fuel, not the structure since the fuel slides up through the cladding (thus fuel/cladding should be reduced).

    3. Structure above the assemblies (expected to be plenum) do not conserve mass since plenum regions have their height reduced to conserve the total structure mass when the fuel grows in the cladding. See b)

  2. Reflectors, shields, and control rods
    1. These assemblies do not conserve mass since they should remain uniform to keep radial shielding accurate. This approach should be conservative.

    2. Control rods do not have their mass conserved and the control rod interface is required to be run after this function is called to correctly place mass of poison axially.

Parameters:
  • blockMesh (iterable) – A list of floats describing the upper mesh points of each block in cm.

  • conserveMassFlag (bool or str) – Option for how to treat mass conservation when the block mesh changes. Conservation of mass for fuel components is enabled by conserveMassFlag=”auto”. If not auto, a boolean value should be passed. The default is False, which does not conserve any masses. True conserves mass for all components.

See also

makeAxialSnapList

Builds the lookup table used by this method

getAxialMesh

builds a mesh compatible with this

setBlockHeights(blockHeights)[source]

Set the block heights of all blocks in the assembly.

dump(fName=None)[source]

Pickle the assembly and write it to a file.

getBlocks(typeSpec=None, exact=False)[source]

Get blocks in an assembly from bottom to top.

Parameters:
  • typeSpec (Flags or list of Flags, optional) – Restrict returned blocks to those of this type.

  • exact (bool, optional) – If true, will only return if there’s an exact match in typeSpec

Returns:

blocks – List of blocks.

Return type:

list

getBlocksAndZ(typeSpec=None, returnBottomZ=False, returnTopZ=False)[source]

Get blocks and their z-coordinates from bottom to top.

This method is useful when you need to know the z-coord of a block.

Parameters:
  • typeSpec (Flags or list of Flags, optional) – Block type specification to restrict to

  • returnBottomZ (bool, optional) – If true, will return bottom coordinates instead of centers.

Returns:

(block, zCoord) tuples

Return type:

blocksAndCoords, list

Examples

for block, bottomZ in a.getBlocksAndZ(returnBottomZ=True):

print({0}’s bottom mesh point is {1}’.format(block, bottomZ))

hasContinuousCoolantChannel()[source]
getFirstBlock(typeSpec=None, exact=False)[source]
getFirstBlockByType(typeName)[source]
getBlockAtElevation(elevation)[source]

Returns the block at a specified axial dimension elevation (given in cm).

If height matches the exact top of the block, the block is considered at that height.

Used as a way to determine what block the control rod will be modifying with a mergeBlocks.

Parameters:

elevation (float) – The elevation of interest to grab a block (cm)

Returns:

targetBlock – The block that exists at the specified height in the reactor

Return type:

block

getBIndexFromZIndex(zIndex)[source]

Returns the ARMI block axial index corresponding to a DIF3D node axial index.

Parameters:

zIndex (float) – The axial index (beginning with 0) of a DIF3D node.

Returns:

bIndex – The axial index (beginning with 0) of the ARMI block containing the DIF3D node corresponding to zIndex.

Return type:

int

getBlocksBetweenElevations(zLower, zUpper)[source]

Return block(s) between two axial elevations and their corresponding heights.

Parameters:
  • zLower (float) – Elevations in cm where blocks should be found.

  • zUpper (float) – Elevations in cm where blocks should be found.

Returns:

blockInfo – list of (blockObj, overlapHeightInCm) tuples

Return type:

list

Examples

If the block structure looks like: 50.0 to 100.0 Block3 25.0 to 50.0 Block2 0.0 to 25.0 Block1

Then,

>>> a.getBlocksBetweenElevations(0,50)
[(Block1, 25.0), (Block2, 25.0)]
>>> a.getBlocksBetweenElevations(0,30)
[(Block1, 25.0), (Block2, 5.0)]
getParamValuesAtZ(param, elevations, interpType='linear', fillValue=nan)[source]

Interpolates a param axially to find it at any value of elevation z.

By default, assumes that all parameters are for the center of a block. So for parameters such as THoutletTemperature that are defined on the top, this may be off. See the paramDefinedAt parameters.

Defaults to linear interpolations.

Notes

This caches interpolators for each param and must be cleared if new params are set or new heights are set.

WARNING: Fails when requested to extrapolate.With higher order splines it is possible to interpolate non-physical values, for example a negative flux or dpa. Please use caution when going off default in interpType and be certain that interpolated values are physical.

Parameters:
  • param (str) – the parameter to interpolate

  • elevations (array of float) – the elevations from the bottom of the assembly in cm at which you want the point.

  • interpType (str or int) – used in interp1d. interp1d documention: Specifies the kind of interpolation as a string (‘linear’, ‘nearest’, ‘zero’, ‘slinear’, ‘quadratic’, ‘cubic’ where ‘slinear’, ‘quadratic’ and ‘cubic’ refer to a spline interpolation of first, second or third order) or as an integer specifying the order of the spline interpolator to use. Default is ‘linear’.

  • fillValue (str) – Rough pass through to scipy.interpolate.interp1d. If ‘extend’, then the lower and upper bounds are used as the extended value. If ‘extrapolate’, then extrapolation is permitted.

Returns:

valAtZ – This will be of the shape (z,data-shape)

Return type:

numpy.ndarray

getParamOfZFunction(param, interpType='linear', fillValue=nan)[source]

Interpolates a param axially to find it at any value of elevation z.

By default, assumes that all parameters are for the center of a block. So for parameters such as THoutletTemperature that are defined on the top, this may be off. See the paramDefinedAt parameters.

Defaults to linear interpolations.

Notes

This caches interpolators for each param and must be cleared if new params are set or new heights are set.

WARNING: Fails when requested to extrapololate. With higher order splines it is possible to interpolate nonphysical values, for example a negative flux or dpa. Please use caution when going off default in interpType and be certain that interpolated values are physical.

Parameters:
  • param (str) – the parameter to interpolate

  • interpType (str or int) – used in interp1d. interp1d documention: Specifies the kind of interpolation as a string (‘linear’, ‘nearest’, ‘zero’, ‘slinear’, ‘quadratic’, ‘cubic’ where ‘slinear’, ‘quadratic’ and ‘cubic’ refer to a spline interpolation of first, second or third order) or as an integer specifying the order of the spline interpolator to use. Default is ‘linear’.

  • fillValue (float) – Rough pass through to scipy.interpolate.interp1d. If ‘extend’, then the lower and upper bounds are used as the extended value. If ‘extrapolate’, then extrapolation is permitted.

Returns:

valAtZ – This will be of the shape (z,data-shape)

Return type:

numpy.ndarray

reestablishBlockOrder()[source]

The block ordering has changed, so the spatialGrid and Block-wise spatialLocator and name objects need updating.

See also

calculateZCoords

updates the ztop/zbottom params on each block after reordering.

countBlocksWithFlags(blockTypeSpec=None)[source]

Returns the number of blocks of a specified type.

blockTypeSpecFlags or list

Restrict to only these types of blocks. typeSpec is None, return all of the blocks

Returns:

blockCounter – number of blocks of this type

Return type:

int

getDim(typeSpec, dimName)[source]

With a preference for fuel blocks, find the first component in the Assembly with flags that match typeSpec and return dimension as specified by dimName.

Example: getDim(Flags.WIRE, ‘od’) will return a wire’s OD in cm.

getSymmetryFactor()[source]

Return the symmetry factor of this assembly.

rotate(rad)[source]

Rotates the spatial variables on an assembly by the specified angle.

Each Block on the Assembly is rotated in turn.

Parameters:

rad (float) – number (in radians) specifying the angle of counter clockwise rotation

Warning

rad must be in 60-degree increments! (i.e., PI/6, PI/3, PI, 2 * PI/3, etc)

isOnWhichSymmetryLine()[source]
paramCollectionType

alias of AssemblyParameterCollection

class armi.reactor.assemblies.HexAssembly(typ, assemNum=None)[source]

Bases: Assembly

Placeholder, so users can explicitly define a hex-based Assembly.

Parameters:
  • typ (str) – Name of assembly design (e.g. the name from the blueprints input file).

  • assemNum (int, optional) – The unique ID number of this assembly. If None is provided, we generate a random int. This makes it clear that it is a placeholder. When an assembly with a negative ID is placed into a Reactor, it will be given a new, positive ID.

paramCollectionType

alias of AssemblyParameterCollection

class armi.reactor.assemblies.CartesianAssembly(typ, assemNum=None)[source]

Bases: Assembly

Parameters:
  • typ (str) – Name of assembly design (e.g. the name from the blueprints input file).

  • assemNum (int, optional) – The unique ID number of this assembly. If None is provided, we generate a random int. This makes it clear that it is a placeholder. When an assembly with a negative ID is placed into a Reactor, it will be given a new, positive ID.

paramCollectionType

alias of AssemblyParameterCollection

class armi.reactor.assemblies.RZAssembly(name, assemNum=None)[source]

Bases: Assembly

RZAssembly are assemblies in RZ geometry; they need to be different objects than HexAssembly because they use different locations and need to have Radial Meshes in their setting.

Notes

ThRZAssemblies should be a subclass of Assemblies (similar to Hex-Z) because they should have a common place to put information about subdividing the global mesh for transport - this is similar to how blocks have ‘AxialMesh’ in their blocks.

radialOuter()[source]

Returns the outer radial boundary of this assembly.

radialInner()[source]

Returns the inner radial boundary of this assembly.

thetaOuter()[source]

Returns the outer azimuthal boundary of this assembly.

thetaInner()[source]

Returns the outer azimuthal boundary of this assembly.

paramCollectionType

alias of AssemblyParameterCollection

class armi.reactor.assemblies.ThRZAssembly(assemType, assemNum=None)[source]

Bases: RZAssembly

ThRZAssembly are assemblies in ThetaRZ geometry, they need to be different objects than HexAssembly because they use different locations and need to have Radial Meshes in their setting.

Notes

This is a subclass of RZAssemblies, which is itself a subclass of the generic Assembly class.

paramCollectionType

alias of AssemblyParameterCollection