Skip to content

Commit

Permalink
Ensuring we only calculate smear density for pinned blocks (#1933)
Browse files Browse the repository at this point in the history
  • Loading branch information
john-science authored Oct 8, 2024
1 parent 83f880f commit 9dbe15c
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 6 deletions.
17 changes: 11 additions & 6 deletions armi/reactor/blocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,9 +205,10 @@ def getSmearDensity(self, cold=True):
all the area is fuel, it has 100% smear density. Lower smear density allows more room for
swelling.
.. warning:: This requires circular fuel and circular cladding. Designs that vary
from this will be wrong. It may make sense in the future to put this somewhere a
bit more design specific.
Warning
-------
This requires circular fuel and circular cladding. Designs that vary from this will be
wrong. It may make sense in the future to put this somewhere a bit more design specific.
Notes
-----
Expand All @@ -225,12 +226,16 @@ def getSmearDensity(self, cold=True):
Returns
-------
smearDensity : float
The smear density as a fraction
float
The smear density as a fraction.
"""
fuels = self.getComponents(Flags.FUEL)
if not fuels:
return 0.0 # Smear density is not computed for non-fuel blocks
# smear density is not computed for non-fuel blocks
return 0.0
elif not self.getNumPins():
# smear density is only defined for pinned blocks
return 0.0

circles = self.getComponentsOfShape(components.Circle)
if not circles:
Expand Down
15 changes: 15 additions & 0 deletions armi/reactor/tests/test_blocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,21 @@ def test_getSmearDensityMultipleLiner(self):
) / self.block.getDim(Flags.INNER | Flags.LINER, "id") ** 2
self.assertAlmostEqual(cur, ref, places=10)

def test_getSmearDensityEdgeCases(self):
# show smear density is not computed for non-fuel blocks
b0 = blocks.Block("DummyReflectorBlock")
self.assertEqual(b0.getSmearDensity(), 0.0)

# show smear density is only defined for pinned fuel blocks
b1 = blocks.HexBlock("TestFuelHexBlock")
b1.setType("fuel")
b1.p.nPins = 0
fuel = components.Circle(
"fuel", "UZr", Tinput=25.0, Thot=25.0, od=0.84, id=0.6, mult=0
)
b1.add(fuel)
self.assertEqual(b1.getSmearDensity(), 0.0)

def test_timeNodeParams(self):
self.block.p["buRate", 3] = 0.1
self.assertEqual(0.1, self.block.p[("buRate", 3)])
Expand Down

0 comments on commit 9dbe15c

Please sign in to comment.