Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add New Component Axial Linking Approach #1376

Draft
wants to merge 29 commits into
base: main
Choose a base branch
from
Draft
Changes from 1 commit
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
8174fbe
WIP: have the pin groupings working.
albeanth Jul 26, 2023
0a5b205
adjusting blueprints to have for block grids
albeanth Jul 27, 2023
02c5685
resolve multiple axial linkage w/ spatialLocator
albeanth Jul 27, 2023
e789aa5
add check to skip non-pinned assemblies
albeanth Jul 27, 2023
cd3a1c7
remove requirement for consistent pin groupings
albeanth Jul 28, 2023
db8bbd0
rm unused methods
albeanth Jul 31, 2023
8098453
rm unused instance variable
albeanth Jul 31, 2023
1a1b347
clean up a terrible docstring
albeanth Jul 31, 2023
115c3a9
retain original behavior for multiple linkage
albeanth Jul 31, 2023
7f4ca22
improve docstrings
albeanth Jul 31, 2023
cf62f02
make determineLinked and checkOverlap static methods
albeanth Jul 31, 2023
4eeef7a
organizing and adding new tests
albeanth Aug 3, 2023
ee9e252
adding test coverage for grid-based linking
albeanth Aug 4, 2023
169edc4
rm duplicate test
albeanth Aug 4, 2023
0d1a5b9
enable multiple axial linkage during set up
albeanth Aug 4, 2023
ab7cdb5
add case3 to TestDetermineLinked
albeanth Aug 7, 2023
1259c1f
add additional complexities to test blueprints
albeanth Aug 7, 2023
04a4e24
fix broken unit test
albeanth Aug 7, 2023
9c795c8
Merge branch 'main' into addNewCompAxialLinkMthd
albeanth Sep 6, 2023
bd9bfa6
Update ztop for blocks that don't have any solid components
keckler Oct 9, 2023
4f1dd9c
Add test on assembly that has a purely fluid block
keckler Oct 9, 2023
73e7795
Remove use of walrus operator
keckler Oct 9, 2023
63e37fd
Revert "Remove use of walrus operator"
keckler Oct 10, 2023
25f8e9f
Revert "Add test on assembly that has a purely fluid block"
keckler Oct 10, 2023
989a43b
Revert "Update ztop for blocks that don't have any solid components"
keckler Oct 10, 2023
e3b4765
Explicitly raise an error if assemblies include blocks without solid …
keckler Oct 10, 2023
836be51
Add test on new check
keckler Oct 10, 2023
0c995d0
Merge branch 'main' of https://github.com/terrapower/armi into addNew…
keckler Feb 25, 2024
41127a2
Merge branch 'main' into addNewCompAxialLinkMthd
albeanth Mar 7, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 34 additions & 1 deletion armi/reactor/converters/axialExpansionChanger.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
from armi.reactor.components import UnshapedComponent
from armi.reactor.flags import Flags
from armi.reactor.grids import MultiIndexLocation
from armi.utils.customExceptions import InputError

from numpy import array

TARGET_FLAGS_IN_PREFERRED_ORDER = [
Expand Down Expand Up @@ -219,7 +221,7 @@ def setAssembly(self, a, setFuel=True, expandFromTinputToThot=False):
self.expansionData = ExpansionData(
a, setFuel=setFuel, expandFromTinputToThot=expandFromTinputToThot
)
self._isTopDummyBlockPresent()
self._checkAssemblyConstructionIsValid()

def applyColdHeightMassIncrease(self):
"""
Expand All @@ -238,6 +240,10 @@ def applyColdHeightMassIncrease(self):
)
c.changeNDensByFactor(axialExpansionFactor)

def _checkAssemblyConstructionIsValid(self):
self._isTopDummyBlockPresent()
self._checkForBlocksWithoutSolids()

def _isTopDummyBlockPresent(self):
"""Determines if top most block of assembly is a dummy block.

Expand All @@ -259,6 +265,33 @@ def _isTopDummyBlockPresent(self):
runLog.error(msg)
raise RuntimeError(msg)

def _checkForBlocksWithoutSolids(self):
"""
Makes sure that there aren't any blocks (other than the top-most dummy block)
that are entirely fluid filled, unless all blocks in the assembly are only
fluids. The expansion changer doesn't know what to do with such mixed assemblies.
"""
solidCompsInAssem = [
c
for c in self.linked.a.iterComponents()
if not isinstance(c.material, material.Fluid)
]
if len(solidCompsInAssem) == 0:
return

for b in self.linked.a[:-1]:
# the topmost block has already been confirmed as the dummy block
solidCompsInBlock = [
c
for c in b.iterComponents()
if not isinstance(c.material, material.Fluid)
]
if len(solidCompsInBlock) == 0:
raise InputError(
f"Assembly {self.linked.a} is constructed improperly for use with the axial expansion changer.\n"
"Consider using the assemFlagsToSkipAxialExpansion case setting."
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's give a little more detail so users don't have to dig into the source code. E.g. "...is constructed improperly for use with the axial expansion changer; i.e., assemblies cannot have intermediate blocks void of a solid component. Consider using....

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well ideally there would be some documentation that outlines how to use the axial expansion capability ;-)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hah! Yeah yeah.... very true....

)

def axiallyExpandAssembly(self):
"""Utilizes assembly linkage to do axial expansion."""
mesh = [0.0]
Expand Down