armi.reactor.converters.tests.test_axialExpansionChanger module

Test axialExpansionChanger.

class armi.reactor.converters.tests.test_axialExpansionChanger.AxialExpansionTestBase(methodName='runTest')[source]

Bases: TestCase

Common methods and variables for unit tests.

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.

Steel_Component_Lst = [<Flags.DUCT: 137438953472>, <Flags.GRID_PLATE: 274877906944>, <Flags.HANDLING_SOCKET: 549755813888>, <Flags.INLET_NOZZLE: 1099511627776>, <Flags.CLAD: 17592186044416>, <Flags.WIRE: 140737488355328>, <Flags.ACLP: 2251799813685248>, <Flags.GUIDE_TUBE: 72057594037927936>]
class armi.reactor.converters.tests.test_axialExpansionChanger.Temperature(L, coldTemp=25.0, hotInletTemp=360.0, numTempGridPts=25, tempSteps=100, uniform=False)[source]

Bases: object

Create and store temperature grid/field.

Parameters:
  • L (float) – length of self.tempGrid. Should be the height of the corresponding assembly.

  • coldTemp (float) – component as-built temperature

  • hotInletTemp (float) – temperature closest to bottom of assembly. Interpreted as inlet temp at nominal operations.

  • numTempGridPts (integer) – the number of temperature measurement locations along the z-axis of the assembly

  • tempSteps (integer) – the number of temperatures to create (analogous to time steps)

class armi.reactor.converters.tests.test_axialExpansionChanger.TestAxialExpansionHeight(methodName='runTest')[source]

Bases: AxialExpansionTestBase, TestCase

Verify that test assembly is expanded correctly.

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

Test the axial expansion gives correct heights for component-based expansion.

class armi.reactor.converters.tests.test_axialExpansionChanger.TestConservation(methodName='runTest')[source]

Bases: AxialExpansionTestBase, TestCase

Verify that conservation is maintained in assembly-level axial 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.

expandAssemForMassConservationTest()[source]

Do the thermal expansion and store conservation metrics of interest.

test_thermalExpansionContractionConservation_simple()[source]

Thermally expand and then contract to ensure original state is recovered.

Notes

Temperature field is always isothermal and initially at 25 C.

test_thermalExpansionContractionConservation_complex()[source]

Thermally expand and then contract to ensure original state is recovered.

Notes

Assemblies with liners are not supported and not considered for conservation testing.

complexConservationTest(a)[source]
test_prescribedExpansionContractionConservation()[source]

Expand all components and then contract back to original state.

Notes

  • uniform expansion over all components within the assembly

  • 10 total expansion steps: 5 at +1.01 L1/L0, and 5 at -(1.01^-1) L1/L0

test_targetComponentMassConservation()[source]

Tests mass conservation for target components.

test_noMovementACLP()[source]

Ensures the above core load pad (ACLP) does not move during fuel-only expansion.

test_reset()[source]
test_computeThermalExpansionFactors()[source]

Ensure expansion factors are as expected.

class armi.reactor.converters.tests.test_axialExpansionChanger.TestManageCoreMesh(methodName='runTest')[source]

Bases: TestCase

Verify that manage core mesh unifies the mesh for detailedAxialExpansion: False.

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_manageCoreMesh()[source]
test_componentConservation()[source]
class armi.reactor.converters.tests.test_axialExpansionChanger.TestExceptions(methodName='runTest')[source]

Bases: AxialExpansionTestBase, TestCase

Verify exceptions are caught.

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_isTopDummyBlockPresent()[source]
test_setExpansionFactors()[source]
test_updateComponentTempsBy1DTempFieldValueError()[source]
test_updateComponentTempsBy1DTempFieldRuntimeError()[source]
test_AssemblyAxialExpansionException()[source]

Test that negative height exception is caught.

test_isFuelLocked()[source]

Ensures that the RuntimeError statement in ExpansionData::_isFuelLocked is raised appropriately.

Notes

This is implemented by creating a fuel block that contains no fuel component and passing it to ExpansionData::_isFuelLocked.

test_determineLinked()[source]
test_getLinkedComponents()[source]

Test for multiple component axial linkage.

class armi.reactor.converters.tests.test_axialExpansionChanger.TestDetermineTargetComponent(methodName='runTest')[source]

Bases: AxialExpansionTestBase, TestCase

Verify determineTargetComponent method is properly updating _componentDeterminesBlockHeight.

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

Provides coverage for searching TARGET_FLAGS_IN_PREFERRED_ORDER.

test_determineTargetComponentBlockWithMultipleFlags()[source]

Provides coverage for searching TARGET_FLAGS_IN_PREFERRED_ORDER with multiple flags.

test_specifyTargetComponent_NotFound()[source]

Ensure RuntimeError gets raised when no target component is found.

test_specifyTargetComponent_singleSolid()[source]

Ensures that specifyTargetComponent is smart enough to set the only solid as the target component.

test_specifyTargetComponet_MultipleFound()[source]

Ensure RuntimeError is hit when multiple target components are found.

Notes

This can occur if a block has a mixture of fuel types. E.g., different fuel materials, or different fuel geometries.

test_manuallySetTargetComponent()[source]

Ensures that target components can be manually set (is done in practice via blueprints).

class armi.reactor.converters.tests.test_axialExpansionChanger.TestGetSolidComponents(methodName='runTest')[source]

Bases: TestCase

Verify that getSolidComponents returns just solid components.

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

Show that getSolidComponents produces a list of solids, and is consistent with iterSolidComponents.

class armi.reactor.converters.tests.test_axialExpansionChanger.TestInputHeightsConsideredHot(methodName='runTest')[source]

Bases: TestCase

Verify thermal expansion for process loading of core.

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

Block heights are cold and should be expanded.

Notes

For R_ARMI_INP_COLD_HEIGHT, the action of axial expansion occurs in setUp() during core construction, specifically in constructAssem

Two assertions here:
  1. total assembly height should be preserved (through use of top dummy block)

  2. in armi.tests.detailedAxialExpansion.refSmallReactorBase.yaml, Thot > Tinput resulting in a non-zero DeltaT. Each block in the expanded case should therefore be a different height than that of the standard case.

checkColdHeightBlockMass(bStd: HexBlock, bExp: HexBlock, flagType: Flags, nuclide: str)[source]

Checks that nuclide masses for blocks with input cold heights and “inputHeightsConsideredHot”: True are underpredicted.

Notes

If blueprints have cold blocks heights with “inputHeightsConsideredHot”: True in the inputs, then the nuclide densities are thermally expanded but the block height is not. This ultimately results in nuclide masses being underpredicted relative to the case where both nuclide densities and block heights are thermally expanded.

armi.reactor.converters.tests.test_axialExpansionChanger.checkColdBlockHeight(bStd, bExp, assertType, strForAssertion)[source]

Bases: AxialExpansionTestBase, TestCase

Test axial linkage between components.

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.

runTest(componentsToTest: dict, assertionBool: bool, name: str, commonArgs: Optional[tuple] = None)[source]

Runs various linkage tests.

Parameters:
  • componentsToTest (dict) – keys –> component class type; values –> dimensions specific to key

  • assertionBool (boolean) – expected truth value for test

  • name (str) – the name of the test

  • commonArgs (tuple, optional) – arguments common to all Component class types

Notes

  • components “typeA” and “typeB” are assumed to be vertically stacked

  • two assertions: 1) comparing “typeB” component to “typeA”; 2) comparing “typeA” component to “typeB”

  • the different assertions are particularly useful for comparing two annuli

  • to add Component class types to a test:
    Add dictionary entry with following:

    {Component Class Type: [{<settings for component 1>}, {<settings for component 2>}]

test_overlappingSolidPins()[source]
test_differentMultNotOverlapping()[source]
test_solidPinNotOverlappingAnnulus()[source]
test_solidPinOverlappingWithAnnulus()[source]
test_annularPinNotOverlappingWithAnnulus()[source]
test_annularPinOverlappingWithAnnuls()[source]
test_thinAnnularPinOverlappingWithThickAnnulus()[source]
test_AnnularHexOverlappingThickAnnularHex()[source]
test_liquids()[source]
test_unshapedComponentAndCircle()[source]
armi.reactor.converters.tests.test_axialExpansionChanger.buildTestAssemblyWithFakeMaterial(name: str, hot: bool = False)[source]

Create test assembly consisting of list of fake material.

Parameters:

name (string) – determines which fake material to use

class armi.reactor.converters.tests.test_axialExpansionChanger.FakeMat[source]

Bases: HT9

Fake material used to verify armi.reactor.converters.axialExpansionChanger.

Notes

  • specifically used in TestAxialExpansionHeight to verify axialExpansionChanger produces expected heights from hand calculation

  • also used to verify mass and height conservation resulting from even amounts of expansion and contraction. See TestConservation.

name = 'FakeMat'
linearExpansionPercent(Tk=None, Tc=None)[source]

A fake linear expansion percent.

class armi.reactor.converters.tests.test_axialExpansionChanger.FakeMatException[source]

Bases: HT9

Fake material used to verify TestExceptions.

Notes

  • the only difference between this and class Fake(HT9) above is that the thermal expansion factor is higher to ensure that a negative block height is caught in TestExceptions:test_AssemblyAxialExpansionException.

name = 'FakeMatException'
linearExpansionPercent(Tk=None, Tc=None)[source]

A fake linear expansion percent.

class armi.reactor.converters.tests.test_axialExpansionChanger.TestAxialLinkHelper(methodName='runTest')[source]

Bases: TestCase

Tests for the AxialLink dataclass / namedtuple like class.

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

Test the upper and lower attributes can be set after construction.

test_construct()[source]

Test the upper and lower attributes can be set at construction.

Bases: TestCase

Test the ability to link blocks in an assembly.

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

Test an edge case where a single block exists.

test_multiBlock()[source]

Test links with multiple blocks.

test_emptyBlocks()[source]

Test even smaller edge case when no blocks are passed.

test_onAssembly()[source]

Test assembly behavior is the same as sequence of blocks.