Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correctly calculate wetted perimeter when components have depletable flags #2067

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions armi/reactor/blocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -2431,13 +2431,25 @@ def getWettedPerimeter(self):
Flags.GRID_PLATE,
Flags.INLET_NOZZLE,
Flags.HANDLING_SOCKET,
Flags.DUCT | Flags.DEPLETABLE,
Flags.GRID_PLATE | Flags.DEPLETABLE,
Flags.INLET_NOZZLE | Flags.DEPLETABLE,
Flags.HANDLING_SOCKET | Flags.DEPLETABLE,
)

# flags pertaining to circular pin components where the exterior of the circle is wetted
wettedPinComponentFlags = (Flags.CLAD, Flags.WIRE)
wettedPinComponentFlags = (
Flags.CLAD,
Flags.WIRE,
Flags.CLAD | Flags.DEPLETABLE,
Flags.WIRE | Flags.DEPLETABLE,
)

# flags pertaining to components where both the interior and exterior are wetted
wettedHollowComponentFlags = (Flags.DUCT | Flags.INNER,)
wettedHollowComponentFlags = (
Flags.DUCT | Flags.INNER,
Flags.DUCT | Flags.INNER | Flags.DEPLETABLE,
)

# obtain all wetted components based on type
wettedHollowHexagonComponents = []
Expand Down
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