armi.physics.fuelCycle.tests.test_assemblyRotationAlgorithms module

Tests for tools used to rotate hex assemblies.

Notes

These algorithms are defined in assemblyRotationAlgorithms.py, but they are used in: FuelHandler.outage().

class armi.physics.fuelCycle.tests.test_assemblyRotationAlgorithms.MockFuelHandler(operator)[source]

Bases: FuelHandler

Implements the entire interface but with empty methods.

chooseSwaps(*args, **kwargs)[source]
class armi.physics.fuelCycle.tests.test_assemblyRotationAlgorithms.ShuffleAndRotateTestHelper(methodName='runTest')[source]

Bases: TestCase

Fixture class to assist in testing rotation of assemblies via the fuel handler.

Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.

N_PINS = 169
static ensureBlockHasSpatialGrid(b: HexBlock)[source]

If b does not have a spatial grid, auto create one.

setAssemblyPinBurnups(a: HexAssembly, burnups: ndarray)[source]

Prepare the assembly that will be shuffled and rotated.

setAssemblyPinPowers(a: HexAssembly, pinPowers: ndarray)[source]

Prep the assembly that existed at the site a shuffled assembly will occupy.

powerWithMinValue(minIndex: int) ndarray[source]

Create a vector of pin powers with a minimum value at a given index.

burnupWithMaxValue(maxIndex: int) ndarray[source]

Create a vector of pin burnups with a maximum value at a given index.

compareMockedToExpectedRotation(nRotations: int, mRotate: Mock, msg: Optional[str] = None)[source]

Helper function to check the mocked rotate and compare against expected rotation.

class armi.physics.fuelCycle.tests.test_assemblyRotationAlgorithms.TestOptimalAssemblyRotation(methodName='runTest')[source]

Bases: ShuffleAndRotateTestHelper

Test the burnup dependent assembly rotation methods.

Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.

test_flatPowerNoRotation()[source]

If all pin powers are identical, no rotation is suggested.

test_maxBurnupAtCenterNoRotation()[source]

If max burnup pin is at the center, no rotation is suggested.

test_oppositeRotation()[source]

Test a 180 degree rotation is suggested when the max burnup pin is opposite the lowest power pin.

Use the second ring of the hexagon because it’s easier to write out pin locations and check work.

Notes

Use zero-indexed pin location not pin ID to assign burnups and powers. Since we have a single component, Block.p.linPowByPin[i] <-> Component.p.pinPercentBu[i]

test_noBlocksWithBurnup()[source]

Require at least one block to have burnup.

test_mismatchPinPowersAndLocations()[source]

Require pin powers and locations to be have the same length.

class armi.physics.fuelCycle.tests.test_assemblyRotationAlgorithms.TestFuelHandlerMgmtTools(methodName='runTest')[source]

Bases: ShuffleAndRotateTestHelper

Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.

test_buRotationWithFreshFeed()[source]

Test that rotation works if a new assembly is swapped with fresh fuel.

Fresh feed assemblies will not exist in the reactor, and various checks that try to the “previous” assembly’s location can fail.

test_buRotationWithStationaryRotation()[source]

Test that the burnup equalizing rotation algorithm works on non-shuffled assemblies.

test_rotateInShuffleQueue()[source]

Test for expected behavior when multiple assemblies are shuffled and rotated in one outage.

Examine the behavior of three assemblies: first -> second -> third

  1. first is moved to the location of second and rotated by comparing first burnup against second pin powers.

  2. second is moved to the location of third and rotated by comparing second burnup against third pin powers.

where:

  • first burnup is maximized in the upper left direction.

  • second pin power is minimized along the lower left direction.

  • second burnup is maximized in the upper right direction.

  • third pin power is minimized in the direct right direction.

We should expect:

  1. first is rotated from upper left to lower left => two 60 degree CCW rotations.

  2. second is rotated from upper right to direct right => five 60 degree CCW rotations.

class armi.physics.fuelCycle.tests.test_assemblyRotationAlgorithms.SimpleRotationTests(methodName='runTest')[source]

Bases: ShuffleAndRotateTestHelper

Test the simple rotation where assemblies are rotated a fixed amount.

Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.

test_simpleAssemblyRotation()[source]

Test rotating assemblies 120 degrees with two rotation events.