def test_componentInteractionsLinkingBySubtraction(self): r"""Tests linking of components by subtraction.""" nPins = 217 gapDims = { "Tinput": 25.0, "Thot": 430.0, "od": 1.0, "id": 0.9, "mult": nPins } gap = Circle("gap", "Void", **gapDims) fuelDims = { "Tinput": 25.0, "Thot": 430.0, "od": 0.9, "id": 0.0, "mult": nPins, "modArea": "gap.sub", } fuel = Circle("fuel", "UZr", components={"gap": gap}, **fuelDims) gapArea = (gap.getDimension("mult") * math.pi * ((gap.getDimension("od") / 2.0)**2 - (gap.getDimension("id") / 2.0)**2)) fuelArea = (fuel.getDimension("mult") * math.pi * ((fuel.getDimension("od") / 2.0)**2 - (fuel.getDimension("id") / 2.0)**2)) ref = fuelArea - gapArea cur = fuel.getArea() self.assertAlmostEqual(cur, ref)
def test_componentInteractionsLinkingByDimensions(self): r"""Tests linking of components by dimensions.""" nPins = 217 fuelDims = { "Tinput": 25.0, "Thot": 430.0, "od": 0.9, "id": 0.0, "mult": nPins } cladDims = { "Tinput": 25.0, "Thot": 430.0, "od": 1.1, "id": 1.0, "mult": nPins } fuel = Circle("fuel", "UZr", **fuelDims) clad = Circle("clad", "HT9", **cladDims) gapDims = { "Tinput": 25.0, "Thot": 430.0, "od": "clad.id", "id": "fuel.od", "mult": nPins, } gapDims["components"] = {"clad": clad, "fuel": fuel} gap = Circle("gap", "Void", **gapDims) mult = gap.getDimension("mult") od = gap.getDimension("od") id = gap.getDimension("id") ref = mult * math.pi * ((od / 2.0)**2 - (id / 2.0)**2) cur = gap.getArea() self.assertAlmostEqual(cur, ref)
def setUp(self): dims = {"Tinput": 25.0, "Thot": 600.0, "od": 10.0, "id": 5.0, "mult": 1.0} self.fuel = Circle("fuel", "UZr", **dims) class fakeBlock: def getHeight(self): # unit height return 1.0 def getSymmetryFactor(self): return 1.0 self.fuel.parent = fakeBlock()
def createDummyReactor(): """ Create a dummy reactor with a single fuel assembly and a single fuel block. Often, a reactor model like this is built directly from input files rather than from code as done here. """ bp = blueprints.Blueprints() cs = settings.Settings() r = reactors.Reactor("Reactor", bp) r.add(reactors.Core("Core")) r.core.spatialGrid = grids.HexGrid.fromPitch(1.0) r.core.spatialGrid.symmetry = geometry.SymmetryType( geometry.DomainType.THIRD_CORE, geometry.BoundaryType.PERIODIC) r.core.spatialGrid.geomType = geometry.GeomType.HEX r.core.spatialGrid.armiObject = r.core r.core.setOptionsFromCs(cs) # Create a single fuel assembly a = assemblies.HexAssembly("fuel assembly") a.spatialGrid = grids.axialUnitGrid(1) a.spatialLocator = r.core.spatialGrid[1, 0, 0] # Create a single fuel block b = blocks.HexBlock("fuel block") b.setType("fuel") # Create a single fuel component with UZr fuel. dims = {"Tinput": 20, "Thot": 900, "id": 0.0, "od": 2.9, "mult": 7} c = Circle("fuel", uZr.UZr(), **dims) b.add(c) # Create a single structure component with HT9. dims = {"Tinput": 20, "Thot": 600, "op": 16.0, "ip": 15.0, "mult": 1} c = Hexagon("structure", ht9.HT9(), **dims) b.add(c) # Fill in the rest of the block with sodium coolant. dims = {"Tinput": 600, "Thot": 600} c = DerivedShape("coolant", sodium.Sodium(), **dims) b.add(c) a.add(b) r.core.add(a) _addFlux(b) return r