Пример #1
0
    def test_convert(self):
        """Test conversion with no fuel driver."""
        block = (
            loadTestReactor(TEST_ROOT)[1]
            .core.getAssemblies(Flags.FUEL)[2]
            .getFirstBlock(Flags.FUEL)
        )
        area = block.getArea()
        converter = blockConverters.HexComponentsToCylConverter(block)
        converter.convert()
        self.assertAlmostEqual(area, converter.convertedBlock.getArea())
        self.assertAlmostEqual(area, block.getArea())

        for compType in [Flags.FUEL, Flags.CLAD, Flags.DUCT]:
            self.assertAlmostEqual(
                block.getComponent(compType).getArea(),
                sum(
                    [
                        component.getArea()
                        for component in converter.convertedBlock
                        if component.hasFlags(compType)
                    ]
                ),
            )

        self._checkAreaAndComposition(block, converter.convertedBlock)
        self._checkCiclesAreInContact(converter.convertedBlock)
Пример #2
0
 def test_build_NthRing(self):
     """Test building of one ring."""
     RING = 6
     block = loadTestBlock(cold=False)
     numPinsInRing = 30
     converter = blockConverters.HexComponentsToCylConverter(block)
     fuel, clad = _buildJoyoFuel()
     pinComponents = [fuel, clad]
     converter._buildFirstRing(pinComponents)
     converter.pinPitch = 0.76
     converter._buildNthRing(pinComponents, RING)
     components = converter.convertedBlock
     self.assertEqual(components[3].name.split()[0], components[-1].name.split()[0])
     self.assertAlmostEqual(
         clad.getNumberDensity("FE56"), components[1].getNumberDensity("FE56")
     )
     self.assertAlmostEqual(
         components[3].getArea() + components[-1].getArea(),
         clad.getArea() * numPinsInRing / clad.getDimension("mult"),
     )
Пример #3
0
accurate cross sections.

By automating these kinds of geometry conversions, ARMI allows core designers to maintain
the design in real geometry while still performing appropriate approximations for
efficient analysis.

.. warning:: 
    This uses :py:mod:`armi.reactor.converters.blockConverters`, which
    currently only works on a constrained set of hex-based geometries. For your systems,
    consider these an example and starting point and build your own converters as
    appropriate.

"""

from armi.reactor.tests import test_reactors
from armi.reactor.flags import Flags
from armi.reactor.converters import blockConverters
import armi

armi.configure(permissive=True)

_o, r = test_reactors.loadTestReactor()

bFuel = r.core.getBlocks(Flags.FUEL)[0]
bControl = r.core.getBlocks(Flags.CONTROL)[0]
converter = blockConverters.HexComponentsToCylConverter(sourceBlock=bControl,
                                                        driverFuelBlock=bFuel,
                                                        numExternalRings=1)
converter.convert()
converter.plotConvertedBlock()