Skip to content

Commit

Permalink
Allow square componets to be used for cartesian lattice
Browse files Browse the repository at this point in the history
  • Loading branch information
onufer committed Apr 23, 2020
1 parent 108e321 commit e395f5a
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 7 deletions.
11 changes: 8 additions & 3 deletions armi/reactor/blocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -2343,7 +2343,8 @@ def breakFuelComponentsIntoIndividuals(self):
# update moles at BOL for each pin
self.p.molesHmBOLByPin = []
for pinNum, pin in enumerate(self.iterComponents(Flags.FUEL)):
pin.p.flags = fuelFlags # Update the fuel component flags to be the same as before the split (i.e., DEPLETABLE)
# Update the fuel component flags to be the same as before the split (i.e., DEPLETABLE)
pin.p.flags = fuelFlags
self.p.molesHmBOLByPin.append(pin.getHMMoles())
pin.p.massHmBOL /= nPins

Expand Down Expand Up @@ -2702,7 +2703,8 @@ def getPinToDuctGap(self, cold=False):
face to face in cm.
"""
if self.LOCATION_CLASS is None:
return None # can't assume anything about dimensions if there is no location type
# can't assume anything about dimensions if there is no location type
return None

wire = self.getComponent(Flags.WIRE)
ducts = sorted(self.getChildrenWithFlags(Flags.DUCT))
Expand Down Expand Up @@ -2909,8 +2911,11 @@ def getPitch(self, returnComp=False):
# block as opposed to initializing _pitchDefiningComponent to (None, None)
if c is None:
raise ValueError("{} has no valid pitch".format(self))

# ask component for dimensions, since they could have changed
elif isinstance(c, components.Square):
maxLength = maxWidth = c.getDimension("widthOuter")
else:
# ask component for dimensions, since they could have changed
maxLength = c.getDimension("lengthOuter")
maxWidth = c.getDimension("widthOuter")

Expand Down
29 changes: 25 additions & 4 deletions armi/reactor/tests/test_blocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import numpy
from numpy.testing import assert_allclose

import tparmi
from armi.reactor import blocks
from armi.reactor import components
import armi.runLog as runLog
Expand Down Expand Up @@ -1524,11 +1525,32 @@ def test_getPinCoords(self):


class CartesianBlock_TestCase(unittest.TestCase):
"""Tests for blocks with rectangular/square outer shape."""

PITCH = 70

def setUp(self):
caseSetting = settings.Settings()
caseSetting["xw"] = 5.0
caseSetting["yw"] = 3.0
self.CartesianBlock = blocks.CartesianBlock("TestCartesianBlock", caseSetting)
self.cartesianBlock = blocks.CartesianBlock("TestCartesianBlock", caseSetting)

self.cartesianComponent = components.HoledSquare(
"duct",
"UZr",
Tinput=273.0,
Thot=273.0,
holeOD=68.0,
widthOuter=self.PITCH,
mult=1.0,
)
self.cartesianBlock.addComponent(self.cartesianComponent)
self.cartesianBlock.addComponent(
components.Circle(
"clad", "HT9", Tinput=273.0, Thot=273.0, od=68.0, mult=169.0
)
)

def test_getPitch(self):
self.assertEqual(self.cartesianBlock.getPitch(), (self.PITCH, self.PITCH))


class MassConservationTests(unittest.TestCase):
Expand All @@ -1538,7 +1560,6 @@ class MassConservationTests(unittest.TestCase):

def setUp(self):
# build a block that has some basic components in it.
cs = settings.Settings()
self.b = blocks.HexBlock("fuel", height=10.0)

fuelDims = {"Tinput": 25.0, "Thot": 600, "od": 0.76, "id": 0.00, "mult": 127.0}
Expand Down

0 comments on commit e395f5a

Please sign in to comment.