Skip to content

Commit

Permalink
Update unit tests with blocks that have depletable components.
Browse files Browse the repository at this point in the history
  • Loading branch information
mgjarrett committed Jan 30, 2025
1 parent 7a63464 commit 82102e1
Showing 1 changed file with 30 additions and 1 deletion.
31 changes: 30 additions & 1 deletion armi/reactor/tests/test_blocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def buildSimpleFuelBlock():
return b


def loadTestBlock(cold=True) -> blocks.HexBlock:
def loadTestBlock(cold=True, depletable=False) -> blocks.HexBlock:
"""Build an annular test block for evaluating unit tests."""
caseSetting = settings.Settings()
caseSetting[CONF_XS_KERNEL] = "MC2v2"
Expand Down Expand Up @@ -110,6 +110,8 @@ def loadTestBlock(cold=True) -> blocks.HexBlock:
"mult": NUM_PINS_IN_TEST_BLOCK,
}
fuel = components.Circle("fuel", "UZr", **fuelDims)
if depletable:
fuel.p.flags = Flags.fromString("fuel depletable")

bondDims = {
"Tinput": coldTemp,
Expand Down Expand Up @@ -180,6 +182,8 @@ def loadTestBlock(cold=True) -> blocks.HexBlock:
"mult": NUM_PINS_IN_TEST_BLOCK,
}
cladding = components.Circle("clad", "HT9", **claddingDims)
if depletable:
cladding.p.flags = Flags.fromString("clad depletable")

linerCladGapDims = {
"Tinput": hotTempStructure,
Expand All @@ -201,6 +205,8 @@ def loadTestBlock(cold=True) -> blocks.HexBlock:
"mult": NUM_PINS_IN_TEST_BLOCK,
}
wire = components.Helix("wire", "HT9", **wireDims)
if depletable:
wire.p.flags = Flags.fromString("wire depletable")

coolantDims = {"Tinput": hotTempCoolant, "Thot": hotTempCoolant}
coolant = components.DerivedShape("coolant", "Sodium", **coolantDims)
Expand All @@ -213,6 +219,8 @@ def loadTestBlock(cold=True) -> blocks.HexBlock:
"mult": 1,
}
duct = components.Hexagon("duct", "HT9", **ductDims)
if depletable:
duct.p.flags = Flags.fromString("duct depletable")

interDims = {
"Tinput": hotTempCoolant,
Expand Down Expand Up @@ -339,6 +347,7 @@ class Block_TestCase(unittest.TestCase):
def setUp(self):
self.block = loadTestBlock()
self._hotBlock = loadTestBlock(cold=False)
self._deplBlock = loadTestBlock(depletable=True)

def test_getSmearDensity(self):
cur = self.block.getSmearDensity()
Expand Down Expand Up @@ -845,6 +854,26 @@ def test_replaceBlockWithBlock(self):
self.assertEqual(3, len(block))
self.assertEqual(block.p.height, refHeight)

def test_getWettedPerimeterDepletable(self):
# calculate the reference value
wire = self._deplBlock.getComponent(Flags.WIRE)
correctionFactor = np.hypot(
1.0,
math.pi
* wire.getDimension("helixDiameter")
/ wire.getDimension("axialPitch"),
)
wireDiam = wire.getDimension("od") * correctionFactor

ipDim = self.block.getDim(Flags.DUCT, "ip")
odDim = self.block.getDim(Flags.CLAD, "od")
mult = self.block.getDim(Flags.CLAD, "mult")
ref = math.pi * (odDim + wireDiam) * mult + 6 * ipDim / math.sqrt(3)

# test getWettedPerimeter
cur = self._deplBlock.getWettedPerimeter()
self.assertAlmostEqual(cur, ref)

def test_getWettedPerimeter(self):
# calculate the reference value
wire = self.block.getComponent(Flags.WIRE)
Expand Down

0 comments on commit 82102e1

Please sign in to comment.