Skip to content

Commit

Permalink
Fixing wetted perimeter for hex inner ducts (#1985)
Browse files Browse the repository at this point in the history
  • Loading branch information
john-science authored Oct 30, 2024
1 parent 6b356b3 commit 6fcc481
Show file tree
Hide file tree
Showing 3 changed files with 95 additions and 20 deletions.
26 changes: 18 additions & 8 deletions armi/reactor/blocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -2509,13 +2509,10 @@ def getWettedPerimeter(self):
)

# 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 pertaining to circular components where both the interior and exterior of the circle are wetted
wettedHollowCircleComponentFlags = (Flags.DUCT | Flags.INNER,)
# flags pertaining to components where both the interior and exterior are wetted
wettedHollowComponentFlags = (Flags.DUCT | Flags.INNER,)

# obtain all wetted components based on type
wettedHollowHexagonComponents = []
Expand All @@ -2529,9 +2526,13 @@ def getWettedPerimeter(self):
wettedPinComponents.append(c) if c else None

wettedHollowCircleComponents = []
for flag in wettedHollowCircleComponentFlags:
wettedHollowHexComponents = []
for flag in wettedHollowComponentFlags:
c = self.getComponent(flag, exact=True)
wettedHollowCircleComponents.append(c) if c else None
if isinstance(c, Hexagon):
wettedHollowHexComponents.append(c) if c else None
else:
wettedHollowCircleComponents.append(c) if c else None

# calculate wetted perimeters according to their geometries

Expand Down Expand Up @@ -2565,10 +2566,19 @@ def getWettedPerimeter(self):
)
wettedHollowCirclePerimeter *= math.pi

# hollow hexagon = 6 * (ip + op) / sqrt(3)
wettedHollowHexPerimeter = 0.0
for c in wettedHollowHexComponents:
wettedHollowHexPerimeter += (
c.getDimension("ip") + c.getDimension("op") if c else 0.0
)
wettedHollowHexPerimeter *= 6 / math.sqrt(3)

return (
wettedHollowHexagonPerimeter
+ wettedPinPerimeter
+ wettedHollowCirclePerimeter
+ wettedHollowHexPerimeter
)

def getFlowArea(self):
Expand Down
88 changes: 76 additions & 12 deletions armi/reactor/tests/test_blocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@


def buildSimpleFuelBlock():
"""Return a simple block containing fuel, clad, duct, and coolant."""
"""Return a simple hex block containing fuel, clad, duct, and coolant."""
b = blocks.HexBlock("fuel", height=10.0)

fuelDims = {"Tinput": 25.0, "Thot": 600, "od": 0.76, "id": 0.00, "mult": 127.0}
Expand Down Expand Up @@ -816,25 +816,89 @@ def test_replaceBlockWithBlock(self):
self.assertEqual(block.p.height, refHeight)

def test_getWettedPerimeter(self):
cur = self.block.getWettedPerimeter()

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

ref = math.pi * (
self.block.getDim(Flags.CLAD, "od") + wireDiameter
) * self.block.getDim(Flags.CLAD, "mult") + 6 * self.block.getDim(
Flags.DUCT, "ip"
) / math.sqrt(
3
)
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.block.getWettedPerimeter()
self.assertAlmostEqual(cur, ref)

def test_getWettedPerimeterCircularInnerDuct(self):
"""Calculate the wetted perimeter for a HexBlock with circular inner duct."""
# build a test block with a Hex inner duct
fuelDims = {"Tinput": 400, "Thot": 400, "od": 0.76, "id": 0.00, "mult": 127.0}
cladDims = {"Tinput": 400, "Thot": 400, "od": 0.80, "id": 0.77, "mult": 127.0}
ductDims = {"Tinput": 400, "Thot": 400, "od": 16, "id": 15.3, "mult": 1.0}
intercoolantDims = {
"Tinput": 400,
"Thot": 400,
"od": 17.0,
"id": ductDims["od"],
"mult": 1.0,
}

fuel = components.Circle("fuel", "UZr", **fuelDims)
clad = components.Circle("clad", "HT9", **cladDims)
duct = components.Circle("inner duct", "HT9", **ductDims)
intercoolant = components.Circle("intercoolant", "Sodium", **intercoolantDims)

b = blocks.HexBlock("fuel", height=10.0)
b.add(fuel)
b.add(clad)
b.add(duct)
b.add(intercoolant)

# calculate the reference value
ref = (ductDims["id"] + ductDims["od"]) * math.pi
ref += b.getNumPins() * cladDims["od"] * math.pi

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

def test_getWettedPerimeterHexInnerDuct(self):
"""Calculate the wetted perimeter for a HexBlock with hexagonal inner duct."""
# build a test block with a Hex inner duct
fuelDims = {"Tinput": 400, "Thot": 400, "od": 0.76, "id": 0.00, "mult": 127.0}
cladDims = {"Tinput": 400, "Thot": 400, "od": 0.80, "id": 0.77, "mult": 127.0}
ductDims = {"Tinput": 400, "Thot": 400, "op": 16, "ip": 15.3, "mult": 1.0}
intercoolantDims = {
"Tinput": 400,
"Thot": 400,
"op": 17.0,
"ip": ductDims["op"],
"mult": 1.0,
}

fuel = components.Circle("fuel", "UZr", **fuelDims)
clad = components.Circle("clad", "HT9", **cladDims)
duct = components.Hexagon("inner duct", "HT9", **ductDims)
intercoolant = components.Hexagon("intercoolant", "Sodium", **intercoolantDims)

b = blocks.HexBlock("fuel", height=10.0)
b.add(fuel)
b.add(clad)
b.add(duct)
b.add(intercoolant)

# calculate the reference value
ref = 6 * (ductDims["ip"] + ductDims["op"]) / math.sqrt(3)
ref += b.getNumPins() * cladDims["od"] * math.pi

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

def test_getFlowAreaPerPin(self):
Expand Down
1 change: 1 addition & 0 deletions doc/release/0.4.rst
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ Bug Fixes
#. Material theoretical density is serialized to and read from database. (`PR#1852 <https://github.com/terrapower/armi/pull/1852>`_)
#. Removed broken and unused column in ``summarizeMaterialData``. (`PR#1925 <https://github.com/terrapower/armi/pull/1925>`_)
#. Fixed edge case in ``assemblyBlueprint._checkParamConsistency()``. (`PR#1928 <https://github.com/terrapower/armi/pull/1928>`_)
#. Fixed wetted perimeter for hex inner ducts. (`PR#1985 <https://github.com/terrapower/armi/pull/1985>`_)
#. TBD

Quality Work
Expand Down

0 comments on commit 6fcc481

Please sign in to comment.