armi.reactor.tests.test_blocks module

Tests blocks.py.

armi.reactor.tests.test_blocks.buildSimpleFuelBlock()[source]

Return a simple hex block containing fuel, clad, duct, and coolant.

armi.reactor.tests.test_blocks.loadTestBlock(cold=True) HexBlock[source]

Build an annular test block for evaluating unit tests.

armi.reactor.tests.test_blocks.applyDummyData(block)[source]

Add some dummy data to a block for physics-like tests.

armi.reactor.tests.test_blocks.getComponentData(component)[source]
class armi.reactor.tests.test_blocks.TestDetailedNDensUpdate(methodName='runTest')[source]

Bases: TestCase

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_updateDetailedNdens()[source]
class armi.reactor.tests.test_blocks.Block_TestCase(methodName='runTest')[source]

Bases: TestCase

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_getSmearDensity()[source]
test_getSmearDensityMultipleLiner()[source]
test_getSmearDensityEdgeCases()[source]
test_timeNodeParams()[source]
test_getType()[source]
test_hasFlags()[source]
test_setType()[source]
test_duplicate()[source]
test_homogenizedMixture()[source]

Confirms homogenized blocks have correct properties.

test_getXsType()[source]
test_27b_setEnvGroup()[source]
test_setZeroHeight()[source]

Test that demonstrates that a block’s height can be set to zero.

test_getVolumeFractionsWithZeroHeight()[source]

Tests that the component fractions are the same with a zero height block.

test_getVolumeFractionWithoutParent()[source]

Tests that the volume fraction of a block with no parent is zero.

test_clearDensity()[source]
test_getNumberDensity()[source]
test_getMasses()[source]
test_removeMass()[source]
test_setNumberDensity()[source]
test_setNumberDensities()[source]

Make sure we can set multiple number densities at once.

test_getMass()[source]
test_setMass()[source]
test_getTotalMass()[source]
test_replaceBlockWithBlock()[source]

Tests conservation of mass flag in replaceBlockWithBlock.

test_getWettedPerimeter()[source]
test_getWettedPerimeterCircularInnerDuct()[source]

Calculate the wetted perimeter for a HexBlock with circular inner duct.

test_getWettedPerimeterHexInnerDuct()[source]

Calculate the wetted perimeter for a HexBlock with hexagonal inner duct.

test_getFlowAreaPerPin()[source]
test_getFlowArea()[source]
test_getHydraulicDiameter()[source]
test_adjustUEnrich()[source]
test_setLocation()[source]

Retrieve a blocks location.

test_setBuLimitInfo()[source]
test_getTotalNDens()[source]
test_getHMDens()[source]
test_getFissileMassEnrich()[source]
test_getMicroSuffix()[source]
test_getUraniumMassEnrich()[source]
test_getUraniumNumEnrich()[source]
test_getNumberOfAtoms()[source]
test_getPu()[source]
test_adjustDensity()[source]
test_completeInitialLoading()[source]
test_add()[source]
test_hasComponents()[source]
test_getComponentNames()[source]
test_getComponents()[source]
test_getComponent()[source]
test_getComponentsOfShape()[source]
test_getComponentsOfMaterial()[source]
test_getComponentByName()[source]

Test children by name.

test_getSortedComponentsInsideOfComponentClad()[source]

Test that components can be sorted within a block and returned in the correct order.

For an arbitrary example: a clad component.

test_getSortedComponentsInsideOfComponentDuct()[source]

Test that components can be sorted within a block and returned in the correct order.

For an arbitrary example: a duct.

test_getNumComponents()[source]
test_getNumPins()[source]

Test that we can get the number of pins from various blocks.

test_setLinPowByPin()[source]
test_getComponentAreaFrac()[source]
test_100_getPinPitch()[source]
test_101_getPitch()[source]
test_102_setPitch()[source]
test_106_getAreaFractions()[source]
test_expandElementalToIsotopics()[source]

Tests the expand to elementals capability.

test_expandAllElementalsToIsotopics()[source]

Tests the expand all elementals simlutaneously capability.

test_setPitch()[source]

Checks consistency after adjusting pitch.

Needed to verify fix to Issue #165.

test_setImportantParams()[source]

Confirm that important block parameters can be set and get.

test_getMfp()[source]

Test mean free path.

test_consistentMassDensityVolumeBetweenColdBlockAndColdComponents()[source]
test_consistentMassDensityVolumeBetweenHotBlockAndHotComponents()[source]
test_consistentAreaWithOverlappingComponents()[source]

Test that negative gap areas correctly account for area overlapping upon thermal expansion.

Notes

This test calculates a reference coolant area by subtracting the areas of the intercoolant, duct, wire wrap, and pins from the total hex block area. The area of the pins is calculated using only the outer radius of the clad. This avoids the use of negative areas as implemented in Block.getVolumeFractions. Na-23 mass will not be conserved as when duct/clad expands sodium is evacuated.

See also

armi.reactor.blocks.Block.getVolumeFractions

test_breakFuelComponentsIntoIndividuals()[source]
test_pinMgFluxes()[source]

Test setting/getting of pin-wise fluxes.

Warning

This will likely be pushed to the component level.

test_getComponentsInLinkedOrder()[source]
test_mergeWithBlock()[source]
test_getDimensions()[source]
test_getPlenumPin()[source]
test_hasPinPitch()[source]
test_getReactionRates()[source]
class armi.reactor.tests.test_blocks.BlockInputHeightsTests(methodName='runTest')[source]

Bases: TestCase

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_foundReactor()[source]

Test the input height is pullable from blueprints.

test_noBlueprints()[source]

Verify an error is raised if there are no blueprints.

class armi.reactor.tests.test_blocks.BlockEnergyDepositionConstants(methodName='runTest')[source]

Bases: TestCase

Tests the energy deposition methods.

MagicMocks xsCollections.compute*Constants() – we’re not testing those methods specifically so just make sure they’re hit

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_getTotalEnergyGenerationConstants(mock_capture, mock_fission)[source]

Mock both xsCollections methods so you get complete coverage.

test_getFissionEnergyDepositionConstants(mock_method)[source]

Test RuntimeError and that it gets to the deposition constant call.

test_getCaptureEnergyGenerationConstants(mock_method)[source]

Test RuntimeError and that it gets to the deposition constant call.

test_getNeutronEnergyDepositionConstants(mock_method)[source]

Test RuntimeError and that it gets to the deposition constant call.

test_getGammaEnergyDepositionConstants(mock_method)[source]

Test RuntimeError and that it gets to the deposition constant call.

class armi.reactor.tests.test_blocks.TestNegativeVolume(methodName='runTest')[source]

Bases: TestCase

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_negativeVolume()[source]

Build a Block with WAY too many fuel pins & show that the derived volume is negative.

class armi.reactor.tests.test_blocks.HexBlock_TestCase(methodName='runTest')[source]

Bases: TestCase

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_getArea()[source]

Test that we can correctly calculate the area of a hexagonal block.

test_component_type()[source]

Test that a hex block has the proper “hexagon” __name__.

test_coords()[source]

Test that coordinates are retrievable from a block.

test_getNumPins()[source]
test_block_dims()[source]

Tests that the block class can provide basic dimensionality information about itself.

test_symmetryFactor()[source]
test_retainState()[source]

Ensure retainState restores params and spatialGrids.

test_getPinLocations()[source]

Test pin locations can be obtained.

test_getPinCoordsAndLocsAgree()[source]

Ensure consistency in ordering of pin locations and coordinates.

test_getPinCoords()[source]
test_getPitchHomogeneousBlock()[source]

Demonstrate how to communicate pitch on a hex block with unshaped components.

Notes

This assumes there are 3 materials in the homogeneous block, one with half the area fraction, and 2 with 1/4 each.

test_getDuctPitch()[source]
test_getPinCenterFlatToFlat()[source]
test_gridCreation()[source]

Create a grid for a block, and show that it can handle components with multiplicity > 1.

test_gridNumPinsAndLocations()[source]
test_gridNotCreatedMultipleMultiplicities()[source]
class armi.reactor.tests.test_blocks.TestHexBlockOrientation(methodName='runTest')[source]

Bases: TestCase

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.

static getLocalCoordinatesBlockBounds(b: HexBlock)[source]

Call getLocalCoordinates() for every Component in the Block and find the X/Y bounds.

test_validateReactorCornersUp()[source]

Validate the spatial grid for a corners up HexBlock and its children.

test_validateReactorFlatsUp()[source]

Validate the spatial grid for a flats up HexBlock and its children.

class armi.reactor.tests.test_blocks.ThRZBlock_TestCase(methodName='runTest')[source]

Bases: TestCase

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_radii()[source]
test_theta()[source]
test_axial()[source]
test_verifyBlockDims()[source]

This function is currently null. It consists of a single line that returns nothing. This test covers that line. If the function is ever implemented, it can be tested here.

test_getThetaRZGrid()[source]

Since not applicable to ThetaRZ Grids.

test_getWettedPerimeter()[source]
test_getHydraulicDiameter()[source]
class armi.reactor.tests.test_blocks.CartesianBlock_TestCase(methodName='runTest')[source]

Bases: TestCase

Tests for blocks with rectangular/square outer shape.

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.

PITCH = 70
test_getPitchSquare()[source]
test_getPitchHomogeneousBlock()[source]

Demonstrate how to communicate pitch on a hex block with unshaped components.

Notes

This assumes there are 3 materials in the homogeneous block, one with half the area fraction, and 2 with 1/4 each.

test_getCartesianGrid()[source]

Since not applicable to Cartesian Grids.

test_getWettedPerimeter()[source]
test_getHydraulicDiameter()[source]
class armi.reactor.tests.test_blocks.MassConservationTests(methodName='runTest')[source]

Bases: TestCase

Tests designed to verify mass conservation during thermal expansion.

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_heightExpansionDifferences()[source]

The point of this test is to determine if the number densities stay the same with two different heights of the same block. Since we want to expand a block from cold temperatures to hot using the fuel expansion coefficient (most important neutronicall), other components are not grown correctly. This means that on the block level, axial expansion will NOT conserve mass of non-fuel components. However, the excess mass is simply added to the top of the reactor in the plenum regions (or any non fueled region).

test_massFuelHeatup()[source]
test_massCladHeatup()[source]
test_massDuctHeatup()[source]
test_massCoolHeatup()[source]

Make sure mass of coolant goes down when it heats up.

test_dimensionDuctHeatup()[source]
test_coldMass()[source]

Verify that the cold mass is what it should be, even though the hot height is input.

At the cold temperature (but with hot height), the mass should be the same as at hot temperature and hot height.

test_massConsistency()[source]

Verify that the sum of the component masses equals the total mass.