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

Improving HexBlock.getFlowArea #1995

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
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
6 changes: 5 additions & 1 deletion armi/reactor/blocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -2593,7 +2593,11 @@ def getFlowArea(self):
Retrieving the flow area requires that there be a single coolant Component.
If available, the area is calculated (:need:`I_ARMI_COMP_VOL0`).
"""
return self.getComponent(Flags.COOLANT, exact=True).getArea()
area = self.getComponent(Flags.COOLANT, exact=True).getArea()
for c in self.getComponents(Flags.INTERDUCTCOOLANT, exact=True):
area += c.getArea()

return area

def getHydraulicDiameter(self):
r"""
Expand Down
28 changes: 26 additions & 2 deletions armi/reactor/tests/test_blocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -937,9 +937,33 @@ def test_getFlowAreaPerPin(self):
self.assertAlmostEqual(cur, ref)

def test_getFlowArea(self):
area = self.block.getComponent(Flags.COOLANT).getArea()
"""Test Block.getFlowArea() for a Block with just coolant."""
ref = self.block.getComponent(Flags.COOLANT).getArea()
cur = self.block.getFlowArea()
ref = area
self.assertAlmostEqual(cur, ref)

def test_getFlowAreaInterDuctCoolant(self):
"""Test Block.getFlowArea() for a Block with coolant and interductcoolant."""
# build a test block with a Hex inter duct collant
fuelDims = {"Tinput": 400, "Thot": 400, "od": 0.76, "id": 0.00, "mult": 127.0}
ductDims = {"Tinput": 400, "Thot": 400, "op": 16, "ip": 15.3, "mult": 1.0}
coolDims = {"Tinput": 400, "Thot": 400}
iCoolantDims = {"Tinput": 400, "Thot": 400, "op": 17.0, "ip": 16, "mult": 1.0}

fuel = components.Circle("fuel", "UZr", **fuelDims)
duct = components.Hexagon("inner duct", "HT9", **ductDims)
coolant = components.DerivedShape("coolant", "Sodium", **coolDims)
iCoolant = components.Hexagon("interductcoolant", "Sodium", **iCoolantDims)

b = blocks.HexBlock("fuel", height=10.0)
b.add(fuel)
b.add(coolant)
b.add(duct)
b.add(iCoolant)

ref = b.getComponent(Flags.COOLANT).getArea()
ref += b.getComponent(Flags.INTERDUCTCOOLANT).getArea()
cur = b.getFlowArea()
self.assertAlmostEqual(cur, ref)

def test_getHydraulicDiameter(self):
Expand Down
Loading