def test_NoMovementACLP(self): """ensures that above core load pad (ACLP) does not move during fuel-only expansion""" # build test assembly with ACLP assembly = HexAssembly("testAssemblyType") assembly.spatialGrid = grids.axialUnitGrid(numCells=1) assembly.spatialGrid.armiObject = assembly assembly.add(_buildTestBlock("shield", "FakeMat")) assembly.add(_buildTestBlock("fuel", "FakeMat")) assembly.add(_buildTestBlock("fuel", "FakeMat")) assembly.add(_buildTestBlock("plenum", "FakeMat")) assembly.add(_buildTestBlock("aclp", "FakeMat")) # "aclp plenum" also works assembly.add(_buildTestBlock("plenum", "FakeMat")) assembly.add(_buildDummySodium()) assembly.calculateZCoords() assembly.reestablishBlockOrder() # get zCoords for aclp aclp = assembly.getChildrenWithFlags(Flags.ACLP)[0] aclpZTop = aclp.p.ztop aclpZBottom = aclp.p.zbottom # expand fuel # get fuel components cList = [c for b in assembly for c in b if c.hasFlags(Flags.FUEL)] # 10% growth of fuel components pList = zeros(len(cList)) + 0.1 chngr = AxialExpansionChanger() chngr.performPrescribedAxialExpansion(assembly, cList, pList, setFuel=True) # do assertion self.assertEqual( aclpZBottom, aclp.p.zbottom, msg= "ACLP zbottom has changed. It should not with fuel component only expansion!", ) self.assertEqual( aclpZTop, aclp.p.ztop, msg= "ACLP ztop has changed. It should not with fuel component only expansion!", )
def test_createAssemblyOfType(self): """Test creation of new assemblies.""" # basic creation aOld = self.r.core.getFirstAssembly(Flags.FUEL) aNew = self.r.core.createAssemblyOfType(aOld.getType()) self.assertAlmostEqual(aOld.getMass(), aNew.getMass()) # creation with modified enrichment aNew2 = self.r.core.createAssemblyOfType(aOld.getType(), 0.195) fuelBlock = aNew2.getFirstBlock(Flags.FUEL) self.assertAlmostEqual(fuelBlock.getUraniumMassEnrich(), 0.195) # creation with modified enrichment on an expanded BOL assem. fuelComp = fuelBlock.getComponent(Flags.FUEL) bol = self.r.blueprints.assemblies[aOld.getType()] changer = AxialExpansionChanger() changer.performPrescribedAxialExpansion(bol, [fuelComp], [0.05]) aNew3 = self.r.core.createAssemblyOfType(aOld.getType(), 0.195) self.assertAlmostEqual( aNew3.getFirstBlock(Flags.FUEL).getUraniumMassEnrich(), 0.195 ) self.assertAlmostEqual(aNew3.getMass(), bol.getMass())
def test_ExpansionContractionConservation(self): """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%, and 5 at -1% - assertion on if original axial mesh matches the final axial mesh """ a = buildTestAssemblyWithFakeMaterial(name="FakeMat") obj = AxialExpansionChanger() oldMesh = a.getAxialMesh() componentLst = [c for b in a for c in b] for i in range(0, 10): # get the percentage change if i < 5: percents = 0.01 + zeros(len(componentLst)) else: percents = -0.01 + zeros(len(componentLst)) # set the expansion factors oldMasses = [c.getMass() for b in a for c in b] # do the expansion obj.performPrescribedAxialExpansion(a, componentLst, percents, setFuel=True) newMasses = [c.getMass() for b in a for c in b] for old, new in zip(oldMasses, newMasses): self.assertAlmostEqual(old, new) self.assertEqual( oldMesh, a.getAxialMesh(), msg= "Axial mesh is not the same after the expansion and contraction!", )