Skip to content

Commit

Permalink
Conserve mass at component level for a.setBlockMesh()
Browse files Browse the repository at this point in the history
a.setBlockMesh() had an option, `conserveMassFlag="auto"`, which would
try to automatically conserve mass of the fuel while allowing other
components to change mass with changing block heights. This conservation
was based upon getting the nuclides associated with the fuel component,
and then scaling the density of those nuclides based on the change in
block height using b.setNumberDensities().

This method does not work when the fuel has nuclides that are also in
other components of the block, like cladding or structure. In this case,
the mass of those components will also be conserved, which is not the
desired behavior.

Instead, a.setBlockMesh() needs to conserve mass by setting number
densities directly on the components where mass needs to be conserved,
instead of setting the densities on the full block.
  • Loading branch information
mgjarrett committed Mar 4, 2024
1 parent 0668e8c commit 2c26041
Showing 1 changed file with 23 additions and 18 deletions.
41 changes: 23 additions & 18 deletions armi/reactor/assemblies.py
Expand Up @@ -673,7 +673,7 @@ def makeAxialSnapList(self, refAssem=None, refMesh=None, force=False):

def _shouldMassBeConserved(self, belowFuelColumn, b):
"""
Determine from a rule set if the mass of a block should be conserved during axial expansion.
Determine from a rule set if the mass of a block component should be conserved during axial expansion.
Parameters
----------
Expand All @@ -689,8 +689,8 @@ def _shouldMassBeConserved(self, belowFuelColumn, b):
conserveMass : boolean
Should the mass be conserved in this block
adjustList : list of nuclides
What nuclides should have their mass conserved (if any)
conserveComponents : list of components
What components should have their mass conserved (if any)
belowFuelColumn : boolean
Update whether the block is above or below a fuel column
Expand All @@ -703,30 +703,31 @@ def _shouldMassBeConserved(self, belowFuelColumn, b):
if b.hasFlags(Flags.FUEL):
# fuel block
conserveMass = True
adjustList = b.getComponent(Flags.FUEL).getNuclides()
conserveComponents = b.getComponents(Flags.FUEL)
elif self.hasFlags(Flags.FUEL):
# non-fuel block of a fuel assembly.
if belowFuelColumn:
# conserve mass of everything below the fuel so as to not invalidate
# grid-plate dose calcs.
conserveMass = True
adjustList = b.getNuclides()
# conserve mass of everything except coolant.
coolant = b.getComponent(Flags.COOLANT)
coolantList = coolant.getNuclides() if coolant else []
for nuc in coolantList:
if nuc in adjustList:
adjustList.remove(nuc)
conserveComponents = [
comp
for comp in b.getComponents()
if not comp.hasFlags(
[Flags.COOLANT, Flags.INTERCOOLANT, Flags.INTERDUCTCOOLANT]
)
]
else:
# plenum or above block in fuel assembly. don't conserve mass.
conserveMass = False
adjustList = None
conserveComponents = []
else:
# non fuel block in non-fuel assem. Don't conserve mass.
conserveMass = False
adjustList = None
conserveComponents = []

return conserveMass, adjustList
return conserveMass, conserveComponents

def setBlockMesh(self, blockMesh, conserveMassFlag=False, adjustList=None):
"""
Expand Down Expand Up @@ -796,15 +797,19 @@ def setBlockMesh(self, blockMesh, conserveMassFlag=False, adjustList=None):
return

if conserveMassFlag == "auto":
conserveMass, adjustList = self._shouldMassBeConserved(
conserveMass, conserveComponents = self._shouldMassBeConserved(
belowFuelColumn, b
)
else:
conserveMass = conserveMassFlag

b.setHeight(
newTop - zBottom, conserveMass=conserveMass, adjustList=adjustList
)
conserveComponents = b.getComponents()

oldBlockHeight = b.getHeight()
b.setHeight(newTop - zBottom, conserveMass=False)
if conserveMass:
heightRatio = oldBlockHeight / b.getHeight()
for c in conserveComponents:
c.changeNDensByFactor(heightRatio)
zBottom = newTop

self.calculateZCoords()
Expand Down

0 comments on commit 2c26041

Please sign in to comment.