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:
armi.reactor.composites.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.
- Variables
pinNum (int) – The number of pins in this assembly.
pinPeakingFactors (list of floats) – The assembly-averaged pin power peaking factors. This is the ratio of pin power to AVERAGE pin power in an assembly.
- Parameters
-
pDefs
= <armi.reactor.parameters.parameterDefinitions.ParameterDefinitionCollection object>¶
-
LOAD_QUEUE
= 'LoadQueue'¶
-
SPENT_FUEL_POOL
= 'SFP'¶
-
DATABASE
= 'database'¶
-
NOT_IN_CORE
= ['LoadQueue', 'SFP']¶
-
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 uniqueassemNum
since a deepcopy implies it would otherwise have been the same object.
-
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.
-
add
(obj)[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.
-
getLocation
()[source]¶ Get string label representing this object’s location.
Notes
This function (and its friends) were created before the advent of both the grid/spatialLocator system and the ability to represent things like the SFP as siblings of a Core. In future, this will likely be re-implemented in terms of just spatialLocator objects.
-
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.
-
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
-
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.
See also
-
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
-
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
-
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.
-
_shouldMassBeConserved
(belowFuelColumn, b)[source]¶ Determine from a rule set if the mass of a block should be conserved during axial expansion
- Parameters
belowFuelColumn (boolean) – Determines whether a block is below the fuel column or not in fuel assemblies
b (armi block) – The block that is being examined for modification
- Returns
conserveMass (boolean) – Should the mass be conserved in this block
adjustList (list of nuclides) – What nuclides should have their mass conserved (if any)
belowFuelColumn (boolean) – Update whether the block is above or below a fuel column
See also
armi.assemblies.Assembly.setBlockMesh()
-
setBlockMesh
(blockMesh, conserveMassFlag=False, adjustList=None)[source]¶ Snaps the axial mesh points of this assembly to correspond with the reference mesh.
Notes
- This function only conserves mass on certain conditions:
- Fuel Assembly
Structural material below the assembly conserves mass to accurate depict grid plate shielding Sodium is not conserved.
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).
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)
- Reflectors, shields, and control rods
These assemblies do not conserve mass since they should remain uniform to keep radial shielding accurate. This approach should be conservative.
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.
See also
makeAxialSnapList()
Builds the lookup table used by this method
getAxialMesh()
builds a mesh compatible with this
-
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))
-
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.
-
getBlocksBetweenElevations
(zLower, zUpper)[source]¶ Return block(s) between two axial elevations and their corresponding heights
- Parameters
zUpper (zLower,) – Elevations in cm where blocks should be found.
- Returns
blockInfo – list of (blockObj, overlapHeightInCm) tuples
- Return type
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)]
-
getBlockLengthAboveAndBelowHeight
(height)[source]¶ Returns a tuple with the amount of a block above or below a given height in an assembly.
Used to determine what fraction of the block should be merged with a control rod.
-
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
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 (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]¶ After children have been mixed up axially, this re-locates each block with the proper axial mesh.
See also
calculateZCoords()
updates the ztop/zbottom params on each block after reordering.
-
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.
-
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
-
axiallyExpandBlockHeights
(heightList, nucNamesToConserveMass)[source]¶ Takes a list of new fuel block heights and then scales the fuel blocks to the new heights, adjusting densities to preserve mass
Adjusts the height of the lowest plenum block to keep total assembly height constant.
- Parameters
heightList (list of floats) – Entry 0 represents the height (in cm) of the bottom fuel block closest to the grid plate Entry n represents the height (in cm) of the top fuel block closest to the plenum
nucNamesToConserveMass (list) – The nuclides to conserve mass of
See also
axiallyExpand()
expands blocks uniformly. could be combined.
-
axiallyExpand
(percent, adjustList)[source]¶ Axially expands an entire assembly.
- Parameters
See also
axiallyExpandBlockHeights()
allows non-uniform expansions. Does the work.
-
getDim
(typeSpec, dimName)[source]¶ Search through blocks in this assembly and find the first component of compName. Then, look on that component for dimName.
Example: getDim(Flags.WIRE, ‘od’) will return a wire’s OD in cm.
-
paramCollectionType
¶ alias of
armi.reactor.parameters.parameterCollections.AssemblyParameterCollection
-
class
armi.reactor.assemblies.
HexAssembly
(typ, assemNum=None)[source]¶ Bases:
armi.reactor.assemblies.Assembly
- Parameters
-
paramCollectionType
¶ alias of
armi.reactor.parameters.parameterCollections.AssemblyParameterCollection
-
class
armi.reactor.assemblies.
CartesianAssembly
(typ, assemNum=None)[source]¶ Bases:
armi.reactor.assemblies.Assembly
- Parameters
-
paramCollectionType
¶ alias of
armi.reactor.parameters.parameterCollections.AssemblyParameterCollection
-
class
armi.reactor.assemblies.
RZAssembly
(name, assemNum=None)[source]¶ Bases:
armi.reactor.assemblies.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
note 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.
- Parameters
-
paramCollectionType
¶ alias of
armi.reactor.parameters.parameterCollections.AssemblyParameterCollection
-
class
armi.reactor.assemblies.
ThRZAssembly
(assemType, assemNum=None)[source]¶ Bases:
armi.reactor.assemblies.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 its a subclass of the Generics Assembly Object
- Parameters
-
paramCollectionType
¶ alias of
armi.reactor.parameters.parameterCollections.AssemblyParameterCollection