Skip to content

Commit

Permalink
Perform scaling during blueprints load.
Browse files Browse the repository at this point in the history
  • Loading branch information
mgjarrett committed Jan 21, 2025
1 parent 6d40dfe commit bea1e25
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 12 deletions.
2 changes: 1 addition & 1 deletion armi/physics/neutronics/globalFlux/globalFluxInterface.py
Original file line number Diff line number Diff line change
Expand Up @@ -645,7 +645,7 @@ def _undoGeometryTransformations(self):
geomConverter = self.geomConverters.get("edgeAssems")
if geomConverter:
geomConverter.scaleParamsRelatedToSymmetry(
self.r, paramsToScaleSubset=self.options.paramsToScaleSubset
self.r.core, paramsToScaleSubset=self.options.paramsToScaleSubset
)

# Resets the reactor core model to the correct symmetry and removes
Expand Down
1 change: 1 addition & 0 deletions armi/reactor/blueprints/reactorBlueprint.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,7 @@ def _modifyGeometry(self, container, gridDesign):

runLog.header("=========== Applying Geometry Modifications ===========")
converter = geometryConverters.EdgeAssemblyChanger()
converter.scaleParamsRelatedToSymmetry(container)
converter.removeEdgeAssemblies(container)

# now update the spatial grid dimensions based on the populated children
Expand Down
17 changes: 7 additions & 10 deletions armi/reactor/converters/geometryConverters.py
Original file line number Diff line number Diff line change
Expand Up @@ -1513,8 +1513,6 @@ def removeEdgeAssemblies(self, core):
assembliesOnLowerBoundary = core.getAssembliesOnSymmetryLine(
grids.BOUNDARY_0_DEGREES
)

self.scaleParamsRelatedToSymmetry(core.parent)
# Don't use newAssembliesAdded b/c this may be BOL cleaning of a fresh case that has edge
# assems.
edgeAssemblies = core.getAssembliesOnSymmetryLine(grids.BOUNDARY_120_DEGREES)
Expand All @@ -1540,7 +1538,7 @@ def removeEdgeAssemblies(self, core):
self.reset()

@staticmethod
def scaleParamsRelatedToSymmetry(reactor, paramsToScaleSubset=None):
def scaleParamsRelatedToSymmetry(core, paramsToScaleSubset=None):
"""
Scale volume-dependent params like power to account for cut-off edges.
Expand All @@ -1557,11 +1555,11 @@ def scaleParamsRelatedToSymmetry(reactor, paramsToScaleSubset=None):
"Scaling edge-assembly parameters to account for full hexes instead of two halves"
)
completeListOfParamsToScale = _generateListOfParamsToScale(
reactor, paramsToScaleSubset
core, paramsToScaleSubset
)
symmetricAssems = (
reactor.core.getAssembliesOnSymmetryLine(grids.BOUNDARY_0_DEGREES),
reactor.core.getAssembliesOnSymmetryLine(grids.BOUNDARY_120_DEGREES),
core.getAssembliesOnSymmetryLine(grids.BOUNDARY_0_DEGREES),
core.getAssembliesOnSymmetryLine(grids.BOUNDARY_120_DEGREES),
)
if not all(symmetricAssems):
runLog.extra("No edge-assemblies found to scale parameters for.")
Expand All @@ -1570,16 +1568,15 @@ def scaleParamsRelatedToSymmetry(reactor, paramsToScaleSubset=None):
for b, bSymmetric in zip(a, aSymmetric):
_scaleParamsInBlock(b, bSymmetric, completeListOfParamsToScale)


def _generateListOfParamsToScale(r, paramsToScaleSubset):
def _generateListOfParamsToScale(core, paramsToScaleSubset):
fluxParamsToScale = (
r.core.getFirstBlock()
core.getFirstBlock()
.p.paramDefs.inCategory(Category.fluxQuantities)
.inCategory(Category.multiGroupQuantities)
.names
)
listOfVolumeIntegratedParamsToScale = (
r.core.getFirstBlock()
core.getFirstBlock()
.p.paramDefs.atLocation(ParamLocation.VOLUME_INTEGRATED)
.since(SINCE_LAST_GEOMETRY_TRANSFORMATION)
)
Expand Down
2 changes: 1 addition & 1 deletion armi/reactor/converters/tests/test_geometryConverters.py
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ def getAssemByRingPos(ringPos: tuple):
# must be added after geom transform
for b in self.o.r.core.getBlocks():
b.p.power = 1.0
converter.scaleParamsRelatedToSymmetry(self.r)
converter.scaleParamsRelatedToSymmetry(self.r.core)
a = self.r.core.getAssembliesOnSymmetryLine(grids.BOUNDARY_0_DEGREES)[0]
self.assertTrue(all(b.p.power == 2.0 for b in a), "Powers were not scaled")

Expand Down

0 comments on commit bea1e25

Please sign in to comment.