Skip to content

Commit

Permalink
Assembly Level Axial Expansion Prototype (#606)
Browse files Browse the repository at this point in the history
Aims to improve assembly-level axial expansion through component-level expansion of all blocks within an assembly. Enables 1) both thermal and non-thermal (e.g., burnup) driven expansion, and 2) the input of cold/as-built component dimensions and axial expansion within an assembly as temperatures vary.

This replaces the fuel-block driven expansion previously found in `armi.reaector.assemblies.py::axiallyExpandBlockHeights`.

A few notes:

- Includes both assembly- and core-level axial expansion functionality.
- Tested assembly types found in `armi.reactor.tests.test_reactors.py::loadTestReactor` (various fuel assembly types, shield, and control assemblies)
- Assembly-level expansion has expansion height verification with hand calculation.
  • Loading branch information
albeanth committed May 2, 2022
1 parent 183ff31 commit 25f33c7
Show file tree
Hide file tree
Showing 8 changed files with 1,294 additions and 473 deletions.
94 changes: 0 additions & 94 deletions armi/reactor/assemblies.py
Expand Up @@ -1196,100 +1196,6 @@ def countBlocksWithFlags(self, blockTypeSpec=None):
"""
return len(self.getBlocks(blockTypeSpec))

def axiallyExpandBlockHeights(self, heightList, nucNamesToConserveMass):
"""
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.
"""
if self.countBlocksWithFlags(Flags.FUEL) != len(heightList):
raise RuntimeError(
"number of blocks {} and len of height list {} not equal in "
"assembly {}. Cannot axially expand".format(
self.countBlocksWithFlags(Flags.FUEL), len(heightList), self
)
)

initialHeight = self.getHeight()

cumulativeHeightAdded = 0.0
for b, newHeight in zip(self.getBlocks(Flags.FUEL), heightList):
originalHeight = b.getHeight()
b.setHeight(newHeight, conserveMass=True, adjustList=nucNamesToConserveMass)
cumulativeHeightAdded += newHeight - originalHeight

# shrink/grow plenum accordingly to keep T/H parameters, etc. consistent.
plenumBlocks = self.getBlocks(Flags.PLENUM)
if not plenumBlocks:
runLog.warning(
"No plenum blocks found in {0}. Axial expansion is modifying the "
"total assembly height and volume.".format(self)
)
# Alter assembly number density to account conserve attoms during volume
# change.
# This is analogous to what happens to component/block number density
# during `armi.reactor.blocks.Block.adjustDensity`, which gets called when
# block heights change.
if self.p.detailedNDens is not None:
self.p.detailedNDens *= initialHeight / (
initialHeight + cumulativeHeightAdded
)
else:
plenumBlock = plenumBlocks[-1] # adjust the top plenum block
plenumHeight = plenumBlock.getHeight()
if cumulativeHeightAdded < plenumHeight:
plenumBlock.setHeight(plenumHeight - cumulativeHeightAdded)
else:
raise RuntimeError(
"Cannot subtract {0} cm from plenum block "
"that is only {1} tall.".format(cumulativeHeightAdded, plenumHeight)
)

def axiallyExpand(self, percent, adjustList):
"""
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.
"""
growFrac = percent / 100.0
fuelBlockHeights = []
for b in self.getBlocks(Flags.FUEL):
heightOriginal = b.getHeight()
if growFrac > 0:
fuelBlockHeights.append(heightOriginal * (1.0 + growFrac))
else:
# NOTICE THE SIGN SWITCH! SINCE WE GAVE NEGATIVE NUMBER AS AN INDICATOR!
fuelBlockHeights.append(heightOriginal * (1.0 / (1.0 - growFrac)))

self.axiallyExpandBlockHeights(fuelBlockHeights, adjustList)

def getDim(self, typeSpec, dimName):
"""
Search through blocks in this assembly and find the first component of compName.
Expand Down
1 change: 1 addition & 0 deletions armi/reactor/blocks.py
Expand Up @@ -91,6 +91,7 @@ def __init__(self, name: str, height: float = 1.0):
"""
composites.Composite.__init__(self, name)
self.p.height = height
self.p.heightBOL = height

self.p.orientation = numpy.array((0.0, 0.0, 0.0))

Expand Down

0 comments on commit 25f33c7

Please sign in to comment.