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.
- 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.
- 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_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_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_completeInitialLoading(mock_sf)[source]
Ensure that some BOL block and component params are populated properly.
Notes
When checking component-level BOL params, puFrac is skipped due to 1) there’s no Pu in the block, and 2) getPuMoles is functionally identical to getHMMoles (just limits nuclides from heavy metal to just Pu).
getSymmetryFactor is mocked to return 3. This indicates that the block is in the center-most assembly. Providing this mock ensures that symmetry factors are tested as well (otherwise it’s just a factor of 1 and it is a less robust test).
- 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_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_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
- 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.
- 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.
- 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.
- 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_block_dims()[source]
Tests that the block class can provide basic dimensionality information about itself.
- test_getPinCoordsAndLocsAgree()[source]
Ensure consistency in ordering of pin locations and coordinates.
- 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.
- 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.
- 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.
- 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
- 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).