Skip to content

Commit

Permalink
allow nonuniform assemblies
Browse files Browse the repository at this point in the history
  • Loading branch information
onufer committed Aug 9, 2022
1 parent 37c13dc commit ab6cde3
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 3 deletions.
9 changes: 7 additions & 2 deletions armi/reactor/assemblies.py
Expand Up @@ -713,8 +713,13 @@ def setBlockMesh(self, blockMesh, conserveMassFlag=False, adjustList=None):
belowFuelColumn = True

if self[-1].p.topIndex == 0:
# this appears to not have been initialized, so initialize it
self.makeAxialSnapList(refMesh=blockMesh)
runLog.warning(
"Reference uniform mesh not being applied to {}. It was likely "
"excluded through the setting `nonUniformAssemFlags`.".format(
self.p.type
)
)
return

for b in self:
if b.isFuel():
Expand Down
7 changes: 6 additions & 1 deletion armi/reactor/blockParameters.py
Expand Up @@ -366,7 +366,12 @@ def buGroupNum(self, buGroupNum): # pylint: disable=method-hidden
pb.defParam(
"topIndex",
units="",
description="the axial block index within its parent assembly (0 is bottom block)",
description=(
"the axial block index within its parent assembly (0 is bottom block). This index with"
"regard to the mesh of the reference assembly so it does not increase by 1 for each block."
"It is used to keep the mesh of the assemblies uniform with axial expansion."
"See setBlockMesh, makeAxialSnapList",
),
default=0,
saveToDB=True,
categories=[parameters.Category.retainOnReplacement],
Expand Down
5 changes: 5 additions & 0 deletions armi/reactor/reactors.py
Expand Up @@ -2251,6 +2251,7 @@ def processLoading(self, cs, dbLoad: bool = False):
"Please make sure that this is intended and not a input error."
)

nonUniformAssems = [Flags.fromString(t) for t in cs["nonUniformAssemFlags"]]
if dbLoad:
# reactor.blueprints.assemblies need to be populated
# this normally happens during armi/reactor/blueprints/__init__.py::constructAssem
Expand All @@ -2268,6 +2269,8 @@ def processLoading(self, cs, dbLoad: bool = False):
reverse=True,
)[0]
for a in self.parent.blueprints.assemblies.values():
if a.hasFlags(nonUniformAssems, exact=True):
continue
a.makeAxialSnapList(refAssem=finestAssemblyMesh)

else:
Expand All @@ -2278,6 +2281,8 @@ def processLoading(self, cs, dbLoad: bool = False):
if not cs["detailedAxialExpansion"]:
# prepare core for mesh snapping during axial expansion
for a in self.getAssemblies(includeAll=True):
if a.hasFlags(nonUniformAssems, exact=True):
continue
a.makeAxialSnapList(self.refAssem)

if not cs["inputHeightsConsideredHot"]:
Expand Down
12 changes: 12 additions & 0 deletions armi/settings/fwSettings/globalSettings.py
Expand Up @@ -106,6 +106,7 @@
CONF_OUTPUT_CACHE_LOCATION = "outputCacheLocation"
CONF_MATERIAL_NAMESPACE_ORDER = "materialNamespaceOrder"
CONF_DETAILED_AXIAL_EXPANSION = "detailedAxialExpansion"
CONF_NON_UNIFORM_ASSEM_FLAGS = "nonUniformAssemFlags"
CONF_BLOCK_AUTO_GRID = "autoGenerateBlockGrids"
CONF_INPUT_HEIGHTS_HOT = "inputHeightsConsideredHot"
CONF_CYCLES = "cycles"
Expand Down Expand Up @@ -164,6 +165,17 @@ def defineSettings() -> List[setting.Setting]:
"axial mesh. Neutronics kernel must be able to handle."
),
),
setting.Setting(
CONF_NON_UNIFORM_ASSEM_FLAGS,
default=[],
label="Non Uniform Assem Flags",
description=(
"Assemblies that match a flag group on this list will not have their "
"mesh changed with the reference mesh of the core for uniform mesh cases (non-"
"detailed axial expansion). Another plugin may need to make the mesh uniform if "
"necessary."
),
),
setting.Setting(
CONF_INPUT_HEIGHTS_HOT,
default=True,
Expand Down

0 comments on commit ab6cde3

Please sign in to comment.