Пример #1
0
    def test_enforceBondRemovalFraction(self):
        """
        Tests that the bond sodium is removed from the `bond` component in a block
        and the mass is then evenly distributed across all other sodium containing components
        (e.g., coolant, intercoolant).
        """
        b = test_blocks.loadTestBlock()
        bond = b.getComponent(Flags.BOND)
        bondRemovalFrac = 0.705
        ndensBefore = b.getNumberDensity("NA")
        bondNdensBefore = bond.getNumberDensity("NA")
        b.p.bondBOL = bondNdensBefore
        utils.enforceBondRemovalFraction(b, bondRemovalFrac)
        bondNdensAfter = bond.getNumberDensity("NA")
        ndensAfter = b.getNumberDensity("NA")

        self.assertAlmostEqual(
            bondNdensAfter / bondNdensBefore, (1.0 - bondRemovalFrac)
        )
        self.assertAlmostEqual(ndensBefore, ndensAfter)

        # make sure it doesn't change if you run it twice
        utils.enforceBondRemovalFraction(b, bondRemovalFrac)
        bondNdensAfter = bond.getNumberDensity("NA")
        ndensAfter = b.getNumberDensity("NA")
        self.assertAlmostEqual(
            bondNdensAfter / bondNdensBefore, (1.0 - bondRemovalFrac)
        )
        self.assertAlmostEqual(ndensBefore, ndensAfter)
Пример #2
0
    def _updateBondFractions(reactor):
        """Move the coolant into the proper components as directed by fuel performance

        after loading from DB, coolant density is distributed evenly over all components
        containing this material (e.g. sodium in bond, coolant, intercoolant).
        But if bond removal was happening, we need to move it out of the bond
        according to the bondRemoved param.
        """
        for b in reactor.core.getBlocks(Flags.FUEL):
            fuelUtils.enforceBondRemovalFraction(b, b.p.bondRemoved)