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

Insufficient testing on buReducingAssemblyRotation #1921

Open
drewj-tp opened this issue Oct 3, 2024 · 2 comments · May be fixed by #2019
Open

Insufficient testing on buReducingAssemblyRotation #1921

drewj-tp opened this issue Oct 3, 2024 · 2 comments · May be fixed by #2019
Assignees
Labels
testing Related to tests

Comments

@drewj-tp
Copy link
Contributor

drewj-tp commented Oct 3, 2024

ARMI provides functionality for a fuel handler to do "burnup reducing" assembly rotation

def buReducingAssemblyRotation(fh):
"""
Rotates all detail assemblies to put the highest bu pin in the lowest power orientation.

def getOptimalAssemblyOrientation(a, aPrev):
"""
Get optimal assembly orientation/rotation to minimize peak burnup.
Notes
-----
Works by placing the highest-BU pin in the location (of 6 possible locations) with lowest
expected pin power. We evaluated "expected pin power" based on the power distribution in
aPrev, which is the previous assembly located here. If aPrev has no pin detail, then we must use its
corner fast fluxes to make an estimate.

The testing for this functionality is lacking, in my opinion; it checks that that the orientation is different, not "optimal"

class TestFuelHandlerMgmtTools(FuelHandlerTestHelper):
def test_buReducingAssemblyRotation(self):
fh = fuelHandlers.FuelHandler(self.o)
hist = self.o.getInterface("history")
newSettings = {CONF_ASSEM_ROTATION_STATIONARY: True}
self.o.cs = self.o.cs.modified(newSettings=newSettings)
assem = self.o.r.core.getFirstAssembly(Flags.FUEL)
# apply dummy pin-level data to allow intelligent rotation
for b in assem.getBlocks(Flags.FUEL):
b.breakFuelComponentsIntoIndividuals()
b.initializePinLocations()
b.p.percentBuMaxPinLocation = 10
b.p.percentBuMax = 5
b.p.linPowByPin = list(reversed(range(b.getNumPins())))
addSomeDetailAssemblies(hist, [assem])
rotNum = b.getRotationNum()
rotAlgos.buReducingAssemblyRotation(fh)
self.assertNotEqual(b.getRotationNum(), rotNum)

So that could use some improvement.

I propose we add more testing, specifically on the internal getOptimalAssemblyOrientation function, to check that

  1. We get the correct, not just different, orientation rotating an assembly "in place" (a is aPrev in the function)
  2. We get the correct orientation rotating an assembly in the location of a different assembly (a is not aPrev)

Addendum

This last sentence

aPrev, which is the previous assembly located here. If aPrev has no pin detail, then we must use its
corner fast fluxes to make an estimate.

is wrong and should be removed. If we don't have any pin information, the getOptimalAssemblyOrientation raises an error

raise ValueError(
"Cannot perform detailed rotation analysis without pin-level "
"flux information."
)

@drewj-tp drewj-tp added the testing Related to tests label Oct 3, 2024
@drewj-tp drewj-tp self-assigned this Oct 3, 2024
@john-science
Copy link
Member

If we had unit tests for this that were of very small reactors (~three rings), would that make it easier to hand-calculate the optimum rotation?

(And yes, ditch that last sentence.)

@drewj-tp
Copy link
Contributor Author

drewj-tp commented Oct 7, 2024

If we had unit tests for this that were of very small reactors (~three rings), would that make it easier to hand-calculate the optimum rotation?

It's probably good to have. I'm working on a test that picks up a test reactor like

def setUp(self):
"""
Build a dummy reactor without using input files.
There are some igniters and feeds but none of these have any number densities.
"""
self.o, self.r = test_reactors.loadTestReactor(
self.directoryChanger.destination,
customSettings={"nCycles": 3, "trackAssems": True},
)

So we already have something that's halfway decent. The trick is setting the block data such that you have a known input state (pin powers, max burnup pin index, etc.) such that you can compare the rotation you get vs. the rotation you expect

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
testing Related to tests
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants