示例#1
0
def getEmptyHexReactor(cs=None):
    """Make an empty hex reactor used in some tests."""
    cs = cs or settings.getMasterCs()
    bp = blueprints.Blueprints()
    reactor = reactors.Reactor(cs, bp)
    reactor.add(reactors.Core("Core", cs))
    reactor.core.spatialGrid = grids.hexGridFromPitch(1.0)
    reactor.core.spatialGrid.symmetry = geometry.THIRD_CORE + geometry.PERIODIC
    reactor.core.spatialGrid.geomType = geometry.HEX
    reactor.core.spatialGrid.armiObject = reactor.core
    return reactor
示例#2
0
def getEmptyHexReactor():
    """Make an empty hex reactor used in some tests."""
    from armi.reactor import blueprints

    bp = blueprints.Blueprints()
    reactor = reactors.Reactor("Reactor", bp)
    reactor.add(reactors.Core("Core"))
    reactor.core.spatialGrid = grids.hexGridFromPitch(1.0)
    reactor.core.spatialGrid.symmetry = geometry.THIRD_CORE + geometry.PERIODIC
    reactor.core.spatialGrid.geomType = geometry.HEX
    reactor.core.spatialGrid.armiObject = reactor.core
    return reactor
示例#3
0
 def setUp(self):
     bp = blueprints.Blueprints()
     r = reactors.Reactor(settings.getMasterCs(), bp)
     r.add(reactors.Core("Core", settings.getMasterCs()))
     r.core.spatialGrid = grids.hexGridFromPitch(1.0)
     r.core.spatialGrid.symmetry = geometry.THIRD_CORE + geometry.PERIODIC
     r.core.spatialGrid.geomType = geometry.HEX
     aList = []
     for ring in range(10):
         a = assemblies.HexAssembly("fuel")
         a.spatialLocator = r.core.spatialGrid[ring, 1, 0]
         a.parent = r.core
         aList.append(a)
     self.aList = aList
示例#4
0
 def setUp(self):
     bp = blueprints.Blueprints()
     geom = geometry.SystemLayoutInput()
     geom.symmetry = "third core periodic"
     r = reactors.Reactor(settings.getMasterCs(), bp)
     r.add(reactors.Core("Core", settings.getMasterCs(), geom))
     r.core.spatialGrid = grids.hexGridFromPitch(1.0)
     aList = []
     for ring in range(10):
         a = assemblies.HexAssembly("fuel")
         a.spatialLocator = r.core.spatialGrid[ring, 1, 0]
         a.parent = r.core
         aList.append(a)
     self.aList = aList
示例#5
0
文件: __init__.py 项目: GCZhang/armi
def getEmptyCartesianReactor():
    """Return an empty Cartesian reactor used in some tests."""
    from armi.reactor import blueprints

    bp = blueprints.Blueprints()
    reactor = reactors.Reactor("Reactor", bp)
    reactor.add(reactors.Core("Core"))
    reactor.core.spatialGrid = grids.CartesianGrid.fromRectangle(1.0, 1.0)
    reactor.core.spatialGrid.symmetry = (
        geometry.QUARTER_CORE + geometry.REFLECTIVE + geometry.THROUGH_CENTER_ASSEMBLY
    )
    reactor.core.spatialGrid.geomType = geometry.CARTESIAN
    reactor.core.spatialGrid.armiObject = reactor.core
    return reactor
示例#6
0
 def setUp(self):
     bp = blueprints.Blueprints()
     r = reactors.Reactor("zonetest", 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.HEX
     aList = []
     for ring in range(10):
         a = assemblies.HexAssembly("fuel")
         a.spatialLocator = r.core.spatialGrid[ring, 1, 0]
         a.parent = r.core
         aList.append(a)
     self.aList = aList
示例#7
0
文件: __init__.py 项目: ntouran/armi
def getEmptyCartesianReactor(pitch=(10.0, 16.0)):
    """Return an empty Cartesian reactor used in some tests."""
    from armi.reactor import blueprints

    bp = blueprints.Blueprints()
    reactor = reactors.Reactor("Reactor", bp)
    reactor.add(reactors.Core("Core"))
    reactor.core.spatialGrid = grids.CartesianGrid.fromRectangle(*pitch)
    reactor.core.spatialGrid.symmetry = geometry.SymmetryType(
        geometry.DomainType.QUARTER_CORE,
        geometry.BoundaryType.REFLECTIVE,
        throughCenterAssembly=True,
    )
    reactor.core.spatialGrid.geomType = geometry.CARTESIAN
    reactor.core.spatialGrid.armiObject = reactor.core
    return reactor
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
示例#9
0
def buildCase():
    """Build input components and a case."""
    bp = blueprints.Blueprints()
    bp.customIsotopics = isotopicOptions.CustomIsotopics()
    bp.nuclideFlags = isotopicOptions.genDefaultNucFlags()

    components = buildComponents()
    bp.blockDesigns = buildBlocks(components)
    bp.assemDesigns = buildAssemblies(bp.blockDesigns)
    bp.gridDesigns = buildGrids()
    bp.systemDesigns = buildSystems()

    cs = caseSettings.Settings()
    cs.path = None
    cs.caseTitle = "scripted-case"
    case = cases.Case(cs=cs, bp=bp)

    return case
示例#10
0
    def setUp(self):
        self.cs = settings.Settings()
        newSettings = {"xsKernel": "MC2v2"}  # don't try to expand elementals
        self.cs = self.cs.modified(newSettings=newSettings)

        settings.setMasterCs(self.cs)
        bp = blueprints.Blueprints()
        self.r = reactors.Reactor("test", bp)
        self.r.add(reactors.Core("Core"))

        inputStr = """blocks:
    ann fuel: &block_ann_fuel
        gap:
            shape: Circle
            material: Void
            Tinput: 20.0
            Thot: 435.0
            id: 0.0
            mult: fuel.mult
            od: fuel.id
        fuel:
            shape: Circle
            material: UZr
            Tinput: 20.0
            Thot: 600.0
            id: 0.1
            mult: 127
            od: 0.8
        gap1:
            shape: Circle
            material: Void
            Tinput: 20.0
            Thot: 435.0
            id: fuel.od
            mult: fuel.mult
            od: clad.id
        clad:
            shape: Circle
            material: HT9
            Tinput: 20.0
            Thot: 435.0
            id: .85
            mult: fuel.mult
            od: .95
        duct: &component_type2_fuel_duct
            shape: Hexagon
            material: HT9
            Tinput: 20.0
            Thot: 435.0
            ip: 13.00
            op: 13.9
            mult: 1
        intercoolant: &component_type2_fuel_intercoolant
            shape: Hexagon
            material: Sodium
            Tinput: 435.0
            Thot: 435.0
            ip: duct.op
            mult: 1
            op: 16
        coolant: &component_type2_fuel_coolant
            shape: DerivedShape
            material: Sodium
            Tinput: 435.0
            Thot: 435.0
assemblies:
    heights: &standard_heights [30.0]
    axial mesh points: &standard_axial_mesh_points [2]
    ann fuel:
        specifier: FA
        blocks: &inner_igniter_fuel_blocks [*block_ann_fuel]
        height: *standard_heights
        axial mesh points: *standard_axial_mesh_points
        hotChannelFactors: TWRPclad
        xs types:  &inner_igniter_fuel_xs_types [D]
"""
        self.blueprints = blueprints.Blueprints.load(inputStr)
        self.blueprints._prepConstruction(self.cs)