コード例 #1
0
 def setUp(self):
     o = buildOperatorOfEmptyHexBlocks()
     self.fpModel = fissionProductModel.FissionProductModel(o.r, o.cs)
     o.removeAllInterfaces()
     o.addInterface(self.fpModel)
     dummyLFPs = test_lumpedFissionProduct.getDummyLFPFile()
     self.fpModel.setGlobalLumpedFissionProducts(
         dummyLFPs.createLFPsFromFile())
     self.fpModel.setAllBlockLFPs()
コード例 #2
0
 def setUp(self):
     fpFactory = test_lumpedFissionProduct.getDummyLFPFile()
     self.blockList = makeBlocks(5)
     for bi, b in enumerate(self.blockList):
         b.setType("fuel")
         b.p.percentBu = bi / 4.0 * 100
         b.setLumpedFissionProducts(fpFactory.createLFPsFromFile())
         b.setNumberDensity("U235", bi)
         b.p.gasReleaseFraction = bi * 2 / 8.0
     self.bc = AverageBlockCollection(
         self.blockList[0].r.blueprints.allNuclidesInProblem)
     self.bc.extend(self.blockList)
コード例 #3
0
ファイル: test_composites.py プロジェクト: wilcoxjd/armi
    def test_addMass(self):
        """
        test:
            addMasses
            addMass
            removeMass
            getMasses

        right now it doesn't make sense to add mass to anything other than a
        component, some one else can implement addMass and update this test
        on block, assembly and reactor.
        """

        loc = locations.Location(i1=1, i2=1, axial=1)
        mass = 1.0

        aB = batch.Batch("testBatch")
        c = shapes.UnshapedVolumetricComponent("batchMassAdditionComponent",
                                               custom.Custom(),
                                               0.0,
                                               0.0,
                                               volume=1)
        b = blocks.Block("testBlock", location=loc)
        b.add(c)
        a = assemblies.Assembly("testAssembly")
        a.spatialGrid = grids.axialUnitGrid(1)
        a.add(b)

        r = getEmptyHexReactor()
        a.spatialLocator = r.core.spatialGrid[0, 0, 0]
        r.core.add(a)

        # these armi objects have addMass implemented
        for armiObj in [aB, c]:
            for nucName in ["U235"]:
                masses = {nucName: mass}
                armiObj.addMasses(masses)
                self.assertAlmostEqual(armiObj.getMass(nucName), mass, 6)

                armiObj.removeMass(nucName, mass)
                self.assertAlmostEqual(armiObj.getMass(nucName), 0, 6)

        # create a global lumped fission product collection with a single lfp
        Fpdf = test_lumpedFissionProduct.getDummyLFPFile()
        cLfps = Fpdf.createSingleLFPCollectionFromFile("LFP35")
        self.assertAlmostEqual(aB.getMass(), 0, 6)
        aB.addMass("LFP35", mass, lumpedFissionProducts=cLfps)
        self.assertAlmostEqual(aB.getMass(), mass, 6)

        self.assertAlmostEqual(c.getMass(), 0, 6)
        c.addMass("LFP35", mass, lumpedFissionProducts=cLfps)
        self.assertAlmostEqual(c.getMass(), mass, 6)
コード例 #4
0
    def test_expandLFPs(self):
        # simple test, with no lumped fission product mappings
        numDens = {"NA23": 1.0}
        numDens = self.container._expandLFPs(numDens)
        self.assertEqual(len(numDens), 1)

        # set the lumped fission product mapping
        fpd = getDummyLFPFile()
        lfps = fpd.createLFPsFromFile()
        self.container.setLumpedFissionProducts(lfps)

        # get back the lumped fission product mapping, just to check
        lfp = self.container.getLumpedFissionProductCollection()
        self.assertEqual(len(lfp), 3)
        self.assertIn("LFP35", lfp)
        self.assertIn("LFP38", lfp)
        self.assertIn("LFP39", lfp)

        # quick test WITH some lumped fission products in the mix
        numDens = {"NA23": 1.0, "LFP35": 2.0}
        numDens = self.container._expandLFPs(numDens)
        self.assertEqual(len(numDens), 9)
        self.assertEqual(numDens["MO99"], 0)