Skip to content

Commit

Permalink
Apply component group blend fractions to mult after block construction.
Browse files Browse the repository at this point in the history
This allows users to not need to know anything about mults for
e.g. particle fuel and should get the appropriate mults derived
during init.
  • Loading branch information
ntouran committed Jul 5, 2022
1 parent 681ee14 commit 76c2356
Show file tree
Hide file tree
Showing 5 changed files with 69 additions and 22 deletions.
24 changes: 24 additions & 0 deletions armi/reactor/blocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -745,6 +745,30 @@ def _updateDetailedNdens(self, frac, adjustList):
# on the interface stack.
self.p.pdensDecay *= frac

def updateComponentGroupMults(self):
"""
Update component group mults.
They were temporarily set to the desired blend fraction during component
construction. This derives the actual multiplicity based on the target
blend fraction.
Note that the blend fractions are applied to the hot thermally-expanded
dimensions.
"""
for c in self.getChildren():
if len(c) > 1:
backgroundVol = c.getVolume()
# expect all mults to be temporarily set to blend frac from blueprints
blendFrac = c[0].p.mult
# remove scaling by mult=blendFrac here
childVol = sum(subchild.getVolume() / blendFrac for subchild in c)
# mult should be such that subchild/backgroundVol = blendFrac
# so subchild * blendFrac * newMult = blendFrac * backgroundVol
newMult = blendFrac * backgroundVol / childVol
for subchild in c:
subchild.setDimension("mult", newMult)

def completeInitialLoading(self, bolBlock=None):
"""
Does some BOL bookkeeping to track things like BOL HM density for burnup tracking.
Expand Down
6 changes: 6 additions & 0 deletions armi/reactor/blueprints/blockBlueprint.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ def construct(
Top layer groups the by-block material modifications under the `byBlock` key
and the by-component material modifications under the component's name.
The inner dict under each key contains material modification names and values.
"""
runLog.debug("Constructing block {}".format(self.name))
components = collections.OrderedDict()
Expand Down Expand Up @@ -188,6 +189,11 @@ def construct(
b.autoCreateSpatialGrids()
except (ValueError, NotImplementedError) as e:
runLog.warning(str(e), single=True)

# now that components are in blocks we have heights and can actually
# compute the mults of the component groups.
b.updateComponentGroupMults()

return b

def _checkByComponentMaterialInput(self, materialInput):
Expand Down
8 changes: 4 additions & 4 deletions armi/reactor/blueprints/componentBlueprint.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,10 +198,10 @@ def construct(self, blueprint, matMods):
groupedComponent.name
]
component = componentDesign.construct(blueprint, matMods=dict())
# override free component multiplicity if it's set based on the group definition
component.setDimension(
"mult", groupedComponent.mult * blendFrac
)
# temporarily set grouped component mults to the blend fraction
# these will be updated based on parent component volume
# during block construction
component.setDimension("mult", blendFrac)
_setComponentFlags(component, self.flags, blueprint)
insertDepletableNuclideKeys(component, blueprint)
constructedObject.add(component)
Expand Down
28 changes: 14 additions & 14 deletions armi/tests/refTriso-bp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ blocks:
fuel: &component_fuel_fuel
shape: Hexagon
material: UZr
Tinput: 25.0
Tinput: 600.0
Thot: 600.0
ip: 0.0
mult: 1.0
Expand All @@ -17,15 +17,15 @@ blocks:
blendFracs:
- 0.350
material: Graphite
Tinput: 25.0
Tinput: 600.0
Thot: 600.0
mult: 20.0
id: 0.0
od: 1.2446
duct:
shape: Hexagon
material: UZr
Tinput: 25.0
material: HT9
Tinput: 600.0
Thot: 600.0
ip: 9.0
mult: 1.0
Expand All @@ -41,39 +41,39 @@ components:
kernel:
shape: Sphere
material: UZr
Tinput: 25.0
Tinput: 600.0
Thot: 600.0
id: 0.0
mult: 1.0
od: 0.010625
buffer:
shape: Sphere
material: Graphite
Tinput: 25.0
Tinput: 600.0
Thot: 600.0
id: kernel.od
mult: 1.0
od: 0.015625
ipyc:
shape: Sphere
material: Graphite
Tinput: 25.0
Tinput: 600.0
Thot: 600.0
id: buffer.od
mult: 1.0
od: 0.017375
sic:
shape: Sphere
material: SiC
Tinput: 25.0
Tinput: 600.0
Thot: 600.0
id: ipyc.od
mult: 1.0
od: 0.019125
opyc:
shape: Sphere
material: Graphite
Tinput: 25.0
Tinput: 600.0
Thot: 600.0
id: sic.od
mult: 1.0
Expand All @@ -82,15 +82,15 @@ components:
component groups:
triso particle:
kernel:
mult: 1000
mult: 1
buffer:
mult: 1000
mult: 1
ipyc:
mult: 1000
mult: 1
sic:
mult: 1000
mult: 1
opyc:
mult: 1000
mult: 1


assemblies:
Expand Down
25 changes: 21 additions & 4 deletions armi/tests/test_trisoGeomCase.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
to support TRISO are added. It does not yet represent real TRISO.
"""
import unittest
import math

from armi.utils import directoryChangers
from armi.tests import TEST_ROOT
Expand Down Expand Up @@ -56,10 +57,26 @@ def test_particleFuel(self):
"""
Make sure composition is blended as expected
"""
triso = self.o.r.core[-1][0][0]
self.assertEqual(len(list(triso.iterComponents())), 5)
self.assertGreater(triso.getMass("U235"), 0.0)
self.assertGreater(triso.getMass("C"), 0.0)
trisoBlock = self.o.r.core[-1][0]
trisoComponent = trisoBlock[0]
self.assertEqual(len(list(trisoComponent.iterComponents())), 5)
self.assertGreater(trisoComponent.getMass("U235"), 0.0)
self.assertGreater(trisoComponent.getMass("C"), 0.0)

uraniumMass = trisoBlock.getMass("U")
# compute triso compact volume from blueprints dimensions
blockHeight = trisoBlock.getHeight()

# expected volume of all kernels in 1 block
trisoVolume = blockHeight * math.pi * 1.2466 ** 2 / 4.0 * 20 * 0.350

# u vol frac within one kernel
uraniumFrac = 0.010625 ** 3 / 0.021125 ** 3

# UZr is 15 g/cc with 90% U
expectedMass = 15.6 * 0.9 * trisoVolume * uraniumFrac
diff = abs(uraniumMass - expectedMass) / uraniumMass
self.assertLess(diff, 0.01)

def test_db(self):
"""Show that this kind of reactor configuration can write and load from DB"""
Expand Down

0 comments on commit 76c2356

Please sign in to comment.