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 getWettedPerimeter calculation #1299

Merged
merged 6 commits into from
Jun 12, 2023
Merged
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
21 changes: 15 additions & 6 deletions armi/reactor/blocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,20 @@

import numpy

from armi import nuclideBases
from armi import runLog
from armi.bookkeeping import report
from armi import nuclideBases
from armi.physics.neutronics import GAMMA
from armi.physics.neutronics import NEUTRON
from armi.reactor.components import basicShapes
from armi.reactor import blockParameters
from armi.reactor import components
from armi.reactor.components.basicShapes import Hexagon, Circle
from armi.reactor import composites
from armi.reactor import geometry
from armi.reactor import grids
from armi.reactor import parameters
from armi.reactor.components import basicShapes
from armi.reactor.components.basicShapes import Hexagon, Circle
from armi.reactor.components.complexShapes import Helix
from armi.reactor.flags import Flags
from armi.reactor.parameters import ParamLocation
from armi.utils import densityTools
Expand Down Expand Up @@ -2211,11 +2212,19 @@ def getWettedPerimeter(self):
6 * c.getDimension("ip") / math.sqrt(3) if c else 0.0
)

# solid circle = od * pi
# NOTE: since these are pin components, multiply by the number of pins
# solid circle = NumPins * pi * (Comp Diam + Wire Diam)
wettedPinPerimeter = 0.0
for c in wettedPinComponents:
wettedPinPerimeter += c.getDimension("od") if c else 0.0
correctionFactor = 1.0
if isinstance(c, Helix):
# account for the helical wire wrap
correctionFactor = numpy.hypot(
1.0,
math.pi
* c.getDimension("helixDiameter")
/ c.getDimension("axialPitch"),
)
wettedPinPerimeter += c.getDimension("od") * correctionFactor
wettedPinPerimeter *= self.getNumPins() * math.pi

# hollow circle = (id + od) * pi
Expand Down
15 changes: 13 additions & 2 deletions armi/reactor/tests/test_blocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -747,7 +747,7 @@ def test_getTotalMass(self):
self.assertAlmostEqual(cur, ref, places=places)

def test_replaceBlockWithBlock(self):
r"""Tests conservation of mass flag in replaceBlockWithBlock."""
"""Tests conservation of mass flag in replaceBlockWithBlock."""
block = self.block
ductBlock = block.__class__("duct")
ductBlock.add(block.getComponent(Flags.COOLANT, exact=True))
Expand All @@ -771,13 +771,24 @@ def test_replaceBlockWithBlock(self):

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

wire = self.block.getComponent(Flags.WIRE)
correctionFactor = numpy.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") + self.block.getDim(Flags.WIRE, "od")
self.block.getDim(Flags.CLAD, "od") + wireDiameter
) * self.block.getDim(Flags.CLAD, "mult") + 6 * self.block.getDim(
Flags.DUCT, "ip"
) / math.sqrt(
3
)

self.assertAlmostEqual(cur, ref)

def test_getFlowAreaPerPin(self):
Expand Down
1 change: 1 addition & 0 deletions doc/release/0.2.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ What's new in ARMI
Bug fixes
---------
#. Changed units.FLOAT_DIMENSION_DECIMALS from 10 to 8 (`PR#1183 <https://github.com/terrapower/armi/pull/1183>`_)
#. Improved ``HexBlock.getWettedPerimeter()`` to include wire. (`PR#1299 <https://github.com/terrapower/armi/pull/1299>`_)
#. Fixed a bug in the ISOTXS file name used for snapshots. (`PR#1277 <https://github.com/terrapower/armi/pull/1277>`_)
#. Fix a bug in uniform mesh decusping when assemblies of same type have drastically different height. (`PR#1282 <https://github.com/terrapower/armi/pull/1282>`_)
#. Sort components on representativeBlock for consistency check. (`PR#1275 <https://github.com/terrapower/armi/pull/1275>`_)
Expand Down