armi.reactor.assemblies module¶
Assemblies are collections of Blocks.
Generally, blocks are stacked from bottom to top.
-
class
armi.reactor.assemblies.Assembly(designName, assemNum=None)[source]¶ Bases:
armi.reactor.composites.CompositeA 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.
-
pinNum¶ The number of pins in this assembly.
- Type
int
-
pinPeakingFactors¶ The assembly-averaged pin power peaking factors. This is the ratio of pin power to AVERAGE pin power in an assembly.
- Type
list of floats
- Parameters
designName (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 passed, the class-level value will be taken and then incremented.
-
pDefs= <armi.reactor.parameters.parameterDefinitions.ParameterDefinitionCollection object>¶
-
LOCATION_CLASS= None¶
-
LOAD_QUEUE= 'LoadQueue'¶
-
SPENT_FUEL_POOL= 'SFP'¶
-
CHARGED_FUEL_POOL= 'CFP'¶
-
DATABASE= 'database'¶
-
NOT_IN_CORE= ['LoadQueue', 'SFP', 'CFP']¶
-
ignoredRegions= [(3, 4), (5, 7), (7, 10), (9, 13), (11, 16), (13, 19), (15, 22), (17, 25), (19, 28), (21, 31), (23, 34), (25, 37), (27, 40), (29, 43), (31, 46), (33, 49), (35, 52), (37, 55), (39, 58), (41, 61), (43, 64), (45, 67), (47, 70), (49, 73)]¶
-
__lt__(other)[source]¶ Compare two assemblies by location.
This allow consistent sorting of assemblies based on location. If either assembly is not in the core (or more accurately a container), returns False.
-
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
deepcopyto get a uniqueassemNumsince a deepcopy implies it would otherwise have been the same object.
-
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.
-
getLocationObject()[source]¶ Return the location of the assembly in the plane using spatial grid indices.
-
coords()[source]¶ Return the location of the assembly in the plane using cartesian global coordinates.
-
property
location¶ Patch to keep code working while location system is refactored to use spatialLocators.
Just creates a new location object based on current spatialLocator.
-
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.
Originally used to turn shields into fuel assemblies in post processing for NUBOW.
-
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
float
-
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]¶ Returns 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
-
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, 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
-
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))
-
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
zUpper (zLower,) – 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)]
-
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
- Parameters
height (float) – The height of interest to grab a block (cm)
- Returns
distances – tuple containing the distance from height to top of block followed by distance of height to bottom of block
- Return type
tuple
-
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
int
-
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
percent (float) – Number from 0 to 100 to make this assembly grow by that much. If you pass a negative number, the code will actually shrink the assembly by that percent.
adjustList (list) – Nuclides to modify. Omit things like sodium to let it flow.
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.
-
getDominantMaterial(typeSpec=None, blockList=None)[source]¶ Returns the most common material in the compositions of the blocks. If you pass [‘clad’,’duct’], you might get HT9, for example. This allows generality in reading material properties on groups of blocks. Dominant is defined by most volume. This version is assembly-level.
- Parameters
typeSpec (Flags or list of Flags, optional) – Specification of the type of components to pull the dominant materials from
blockList (list of block objects) – A list of blocks to look at in this assembly.
- Returns
samples[maxMat] – The material that has the most volume within this assembly within the given typeSpec and blockList.
- Return type
Material object
-
paramCollectionType¶ alias of
armi.reactor.parameters.parameterCollections.AssemblyParameterCollection
-
-
class
armi.reactor.assemblies.HexAssembly(designName, assemNum=None)[source]¶ Bases:
armi.reactor.assemblies.Assembly- Parameters
designName (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 passed, the class-level value will be taken and then incremented.
-
LOCATION_CLASS¶ alias of
armi.reactor.locations.HexLocation
-
convert2DPinValsTo1D(vals, imax, jmax)[source]¶ This converts a 2-D list of vals as a function of (i,j) = (ring-1,pos-1) to a 1-D list of the same vals indexed by n = sum(jmax[0:i]) + j
No hex surface index (k = 0 to 5) is used here.
- Parameters
vals (2-D list of floats) – The arbitrary quantity that is to be re-indexed from 2-D to 1-D.
imax (int) – The maximum number of hex assembly rings in the reactor (including partially-filled rings).
jmax (list of ints) – A list containing the total number of hex assembly “positions” in each hex assembly “ring”. This includes “ghost” assemblies that do not exist in a 1/3 or 1/6 core.
- Returns
vals1D – The arbitrary quantity that has been re-indexed from 2-D to 1-D.
- Return type
list of floats
-
paramCollectionType¶ alias of
armi.reactor.parameters.parameterCollections.AssemblyParameterCollection
-
class
armi.reactor.assemblies.RZAssembly(name, assemNum=None)[source]¶ Bases:
armi.reactor.assemblies.AssemblyRZAssembly 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
designName (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 passed, the class-level value will be taken and then incremented.
-
LOCATION_CLASS¶
-
paramCollectionType¶ alias of
armi.reactor.parameters.parameterCollections.AssemblyParameterCollection
-
class
armi.reactor.assemblies.ThRZAssembly(assemType, assemNum=None)[source]¶ Bases:
armi.reactor.assemblies.RZAssemblyThRZAssembly 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
designName (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 passed, the class-level value will be taken and then incremented.
-
LOCATION_CLASS¶
-
paramCollectionType¶ alias of
armi.reactor.parameters.parameterCollections.AssemblyParameterCollection
-
class
armi.reactor.assemblies.CartesianAssembly(designName, assemNum=None)[source]¶ Bases:
armi.reactor.assemblies.Assembly- Parameters
designName (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 passed, the class-level value will be taken and then incremented.
-
LOCATION_CLASS¶
-
ignoredRegions= []¶
-
paramCollectionType¶ alias of
armi.reactor.parameters.parameterCollections.AssemblyParameterCollection