diff --git a/smr/build-fresh.py b/smr/build-fresh.py
index 6d327ee..026bec5 100644
--- a/smr/build-fresh.py
+++ b/smr/build-fresh.py
@@ -10,7 +10,7 @@ import openmc
from smr.materials import materials
from smr.plots import plots
from smr.surfaces import lattice_pitch, bottom_fuel_stack, top_active_core
-from smr.core import geometry
+from smr.core import core_geometry
#### Query the user for options
@@ -27,6 +27,7 @@ distrib = input('Use distribmat or distribcells? [mat/cell]: ').lower()
if distrib not in ['cell', 'mat']:
raise InputError('Distrib type "{}" is unsupported'.format(distrib))
+geometry = core_geometry()
#### "Differentiate" the geometry if using distribmats
if distrib == 'mat':
diff --git a/smr/fresh/geometry.xml b/smr/fresh/geometry.xml
index 2c0d448..a3e377f 100644
--- a/smr/fresh/geometry.xml
+++ b/smr/fresh/geometry.xml
@@ -6315,11 +6315,11 @@
|
|
|
- |
+ |
|
|
|
- |
+ |
|
|
|
@@ -6331,7 +6331,7 @@
|
|
|
- |
+ |
|
|
|
@@ -6342,7 +6342,7 @@
|
|
|
- |
+ |
|
|
|
@@ -6353,31 +6353,31 @@
|
|
|
- |
+ |
|
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
|
|
|
diff --git a/smr/smr/assemblies.py b/smr/smr/assemblies.py
index 58d0f8b..3d9c996 100644
--- a/smr/smr/assemblies.py
+++ b/smr/smr/assemblies.py
@@ -6,7 +6,7 @@ import openmc
from .materials import mats
from .surfaces import surfs, pin_pitch
-from .pins import univs
+from .pins import univs as pins
def make_assembly(name, universes):
@@ -30,12 +30,12 @@ def make_assembly(name, universes):
# Instantiate the lattice
lattice = openmc.RectLattice(name=name)
- lattice.lower_left = [-17.*pin_pitch/2., -17.*pin_pitch/2.]
- lattice.pitch = [pin_pitch, pin_pitch]
+ lattice.lower_left = (-17.*pin_pitch/2., -17.*pin_pitch/2.)
+ lattice.pitch = (pin_pitch, pin_pitch)
lattice.universes = universes
# Create rectangular prism for lattice grid box
- lat_grid_box = (surfs['lat grid box outer'] & ~surfs['lat grid box inner'])
+ lat_grid_box = surfs['lat grid box outer'] & ~surfs['lat grid box inner']
# Add lattice to bounding cell
univ_name = name + ' lattice'
@@ -47,7 +47,7 @@ def make_assembly(name, universes):
# Add outer water cell
cell = openmc.Cell(name=univ_name + ' outer water')
- cell.fill = univs['water pin']
+ cell.fill = pins['water pin']
cell.region = ~surfs['lat grid box outer']
universe.add_cell(cell)
@@ -120,277 +120,283 @@ def make_assembly(name, universes):
return universe
-# commonly needed universes
-gtu = univs['GT empty']
-gti = univs['GT empty instr']
-bas = univs['BA stack']
-ins = univs['IT stack']
-crA = univs['GT CR bank A']
-crB = univs['GT CR bank B']
-crC = univs['GT CR bank C']
-crD = univs['GT CR bank D']
-crSA = univs['GT CR bank SA']
-crSB = univs['GT CR bank SB']
-crSC = univs['GT CR bank SC']
-crSD = univs['GT CR bank SD']
-crSE = univs['GT CR bank SE']
+def assembly_universes():
+ # Create dictionary to store assembly universes
+ univs = {}
+
+ # commonly needed universes
+ gtu = pins['GT empty']
+ gti = pins['GT empty instr']
+ bas = pins['BA stack']
+ ins = pins['IT stack']
+ crA = pins['GT CR bank A']
+ crB = pins['GT CR bank B']
+ crC = pins['GT CR bank C']
+ crD = pins['GT CR bank D']
+ crSA = pins['GT CR bank SA']
+ crSB = pins['GT CR bank SB']
+ crSC = pins['GT CR bank SC']
+ crSD = pins['GT CR bank SD']
+ crSE = pins['GT CR bank SE']
-# Define the NumPy array indices for assembly locations where there
-# may be CR guide tubes, instrument tubes and burnable absorbers
-nonfuel_y = \
- np.array([2,2,2,3,3,5,5,5,5,5,8,8,8,8,8,11,11,11,11,11,13,13,14,14,14])
-nonfuel_x = \
- np.array([5,8,11,3,13,2,5,8,11,14,2,5,8,11,14,2,5,8,11,14,3,13,5,8,11])
+ # Define the NumPy array indices for assembly locations where there
+ # may be CR guide tubes, instrument tubes and burnable absorbers
+ nonfuel_y = \
+ np.array([2,2,2,3,3,5,5,5,5,5,8,8,8,8,8,11,11,11,11,11,13,13,14,14,14])
+ nonfuel_x = \
+ np.array([5,8,11,3,13,2,5,8,11,14,2,5,8,11,14,2,5,8,11,14,3,13,5,8,11])
-#### 1.6% ENRICHED ASSEMBLIES
+ #### 1.6% ENRICHED ASSEMBLIES
-for cent, comment in [(gti, ''), (ins, ' instr')]:
-
- # NO BURNABLE ABSORBERS
- universes = np.empty((17,17), dtype=openmc.Universe)
- universes[:,:] = univs['Fuel (1.6%) stack']
- universes[nonfuel_y, nonfuel_x] = [ gtu, gtu, gtu,
- gtu, gtu,
- gtu, gtu, gtu, gtu, gtu,
- gtu, gtu, cent, gtu, gtu,
- gtu, gtu, gtu, gtu, gtu,
- gtu, gtu,
- gtu, gtu, gtu ]
- univs['Assembly (1.6%)' + comment] = \
- make_assembly('Assembly (1.6%) no BAs' + comment, universes)
-
- # WITH EACH CONTROL ROD BANK
- for bank, comment2 in [(crA, 'A'), (crB, 'B'), (crC, 'C'), (crD, 'D'),
- (crSB, 'SB'), (crSC, 'SC'), (crSD, 'SD'), (crSE, 'SE')]:
+ for cent, comment in [(gti, ''), (ins, ' instr')]:
+ # NO BURNABLE ABSORBERS
universes = np.empty((17,17), dtype=openmc.Universe)
- universes[:,:] = univs['Fuel (1.6%) stack']
- universes[nonfuel_y, nonfuel_x] = [ bank, bank, bank,
- bank, bank,
- bank, bank, bank, bank, bank,
- bank, bank, cent, bank, bank,
- bank, bank, bank, bank, bank,
- bank, bank,
- bank, bank, bank ]
- univs['Assembly (1.6%) CR {}'.format(comment2) + comment] = \
- make_assembly('Assembly (1.6%) CR {}'.format(comment2) + comment, universes)
+ universes[:,:] = pins['Fuel (1.6%) stack']
+ universes[nonfuel_y, nonfuel_x] = [ gtu, gtu, gtu,
+ gtu, gtu,
+ gtu, gtu, gtu, gtu, gtu,
+ gtu, gtu, cent, gtu, gtu,
+ gtu, gtu, gtu, gtu, gtu,
+ gtu, gtu,
+ gtu, gtu, gtu ]
+ univs['Assembly (1.6%)' + comment] = \
+ make_assembly('Assembly (1.6%) no BAs' + comment, universes)
+
+ # WITH EACH CONTROL ROD BANK
+ for bank, comment2 in [(crA, 'A'), (crB, 'B'), (crC, 'C'), (crD, 'D'),
+ (crSB, 'SB'), (crSC, 'SC'), (crSD, 'SD'), (crSE, 'SE')]:
+
+ universes = np.empty((17,17), dtype=openmc.Universe)
+ universes[:,:] = pins['Fuel (1.6%) stack']
+ universes[nonfuel_y, nonfuel_x] = [ bank, bank, bank,
+ bank, bank,
+ bank, bank, bank, bank, bank,
+ bank, bank, cent, bank, bank,
+ bank, bank, bank, bank, bank,
+ bank, bank,
+ bank, bank, bank ]
+ univs['Assembly (1.6%) CR {}'.format(comment2) + comment] = \
+ make_assembly('Assembly (1.6%) CR {}'.format(comment2) + comment, universes)
-#### 2.4% ENRICHED ASSEMBLIES
+ #### 2.4% ENRICHED ASSEMBLIES
-for cent, comment in [(gti, ''), (ins, ' instr')]:
+ for cent, comment in [(gti, ''), (ins, ' instr')]:
- # NO BURNABLE ABSORBERS
- universes = np.empty((17,17), dtype=openmc.Universe)
- universes[:,:] = univs['Fuel (2.4%) stack']
- universes[nonfuel_y, nonfuel_x] = [ gtu, gtu, gtu,
- gtu, gtu,
- gtu, gtu, gtu, gtu, gtu,
- gtu, gtu, cent, gtu, gtu,
- gtu, gtu, gtu, gtu, gtu,
- gtu, gtu,
- gtu, gtu, gtu ]
- univs['Assembly (2.4%) no BAs' + comment] = \
- make_assembly('Assembly (2.4%) no BAs' + comment, universes)
+ # NO BURNABLE ABSORBERS
+ universes = np.empty((17,17), dtype=openmc.Universe)
+ universes[:,:] = pins['Fuel (2.4%) stack']
+ universes[nonfuel_y, nonfuel_x] = [ gtu, gtu, gtu,
+ gtu, gtu,
+ gtu, gtu, gtu, gtu, gtu,
+ gtu, gtu, cent, gtu, gtu,
+ gtu, gtu, gtu, gtu, gtu,
+ gtu, gtu,
+ gtu, gtu, gtu ]
+ univs['Assembly (2.4%) no BAs' + comment] = \
+ make_assembly('Assembly (2.4%) no BAs' + comment, universes)
- # WITH CONTROL ROD D BANK
- universes = np.empty((17,17), dtype=openmc.Universe)
- universes[:,:] = univs['Fuel (2.4%) stack']
- universes[nonfuel_y, nonfuel_x] = [ crD, crD, crD,
- crD, crD,
- crD, crD, crD, crD, crD,
- crD, crD, cent, crD, crD,
- crD, crD, crD, crD, crD,
- crD, crD,
- crD, crD, crD ]
- univs['Assembly (2.4%) CR D' + comment] = \
- make_assembly('Assembly (2.4%) CR D' + comment, universes)
+ # WITH CONTROL ROD D BANK
+ universes = np.empty((17,17), dtype=openmc.Universe)
+ universes[:,:] = pins['Fuel (2.4%) stack']
+ universes[nonfuel_y, nonfuel_x] = [ crD, crD, crD,
+ crD, crD,
+ crD, crD, crD, crD, crD,
+ crD, crD, cent, crD, crD,
+ crD, crD, crD, crD, crD,
+ crD, crD,
+ crD, crD, crD ]
+ univs['Assembly (2.4%) CR D' + comment] = \
+ make_assembly('Assembly (2.4%) CR D' + comment, universes)
- # WITH 12 BURNABLE ABSORBERS
- universes = np.empty((17,17), dtype=openmc.Universe)
- universes[:,:] = univs['Fuel (2.4%) stack']
- universes[nonfuel_y, nonfuel_x] = [ bas, gtu, bas,
- bas, bas,
- bas, gtu, gtu, gtu, bas,
- gtu, gtu, cent, gtu, gtu,
- bas, gtu, gtu, gtu, bas,
- bas, bas,
- bas, gtu, bas ]
- univs['Assembly (2.4%) 12BA' + comment] = \
- make_assembly('Assembly (2.4%) 12BA' + comment, universes)
+ # WITH 12 BURNABLE ABSORBERS
+ universes = np.empty((17,17), dtype=openmc.Universe)
+ universes[:,:] = pins['Fuel (2.4%) stack']
+ universes[nonfuel_y, nonfuel_x] = [ bas, gtu, bas,
+ bas, bas,
+ bas, gtu, gtu, gtu, bas,
+ gtu, gtu, cent, gtu, gtu,
+ bas, gtu, gtu, gtu, bas,
+ bas, bas,
+ bas, gtu, bas ]
+ univs['Assembly (2.4%) 12BA' + comment] = \
+ make_assembly('Assembly (2.4%) 12BA' + comment, universes)
- # WITH 16 BURNABLE ABSORBERS
- universes = np.empty((17,17), dtype=openmc.Universe)
- universes[:,:] = univs['Fuel (2.4%) stack']
- universes[nonfuel_y, nonfuel_x] = [ bas, bas, bas,
- bas, bas,
- bas, gtu, gtu, gtu, bas,
- bas, gtu, cent, gtu, bas,
- bas, gtu, gtu, gtu, bas,
- bas, bas,
- bas, bas, bas ]
- univs['Assembly (2.4%) 16BA' + comment] = \
- make_assembly('Assembly (2.4%) 16BA' + comment, universes)
+ # WITH 16 BURNABLE ABSORBERS
+ universes = np.empty((17,17), dtype=openmc.Universe)
+ universes[:,:] = pins['Fuel (2.4%) stack']
+ universes[nonfuel_y, nonfuel_x] = [ bas, bas, bas,
+ bas, bas,
+ bas, gtu, gtu, gtu, bas,
+ bas, gtu, cent, gtu, bas,
+ bas, gtu, gtu, gtu, bas,
+ bas, bas,
+ bas, bas, bas ]
+ univs['Assembly (2.4%) 16BA' + comment] = \
+ make_assembly('Assembly (2.4%) 16BA' + comment, universes)
-#### 3.1% ENRICHED ASSEMBLIES
+ #### 3.1% ENRICHED ASSEMBLIES
-for cent, comment in [(gti, ''), (ins, ' instr')]:
+ for cent, comment in [(gti, ''), (ins, ' instr')]:
- # NO BURNABLE ABSORBERS
- universes = np.empty((17,17), dtype=openmc.Universe)
- universes[:,:] = univs['Fuel (3.1%) stack']
- universes[nonfuel_y, nonfuel_x] = [ gtu, gtu, gtu,
- gtu, gtu,
- gtu, gtu, gtu, gtu, gtu,
- gtu, gtu, cent, gtu, gtu,
- gtu, gtu, gtu, gtu, gtu,
- gtu, gtu,
- gtu, gtu, gtu ]
- univs['Assembly (3.1%)' + comment] = \
- make_assembly('Assembly (3.1%) no BAs' + comment, universes)
+ # NO BURNABLE ABSORBERS
+ universes = np.empty((17,17), dtype=openmc.Universe)
+ universes[:,:] = pins['Fuel (3.1%) stack']
+ universes[nonfuel_y, nonfuel_x] = [ gtu, gtu, gtu,
+ gtu, gtu,
+ gtu, gtu, gtu, gtu, gtu,
+ gtu, gtu, cent, gtu, gtu,
+ gtu, gtu, gtu, gtu, gtu,
+ gtu, gtu,
+ gtu, gtu, gtu ]
+ univs['Assembly (3.1%)' + comment] = \
+ make_assembly('Assembly (3.1%) no BAs' + comment, universes)
- # WITH CONTROL ROD SA BANK
- universes = np.empty((17,17), dtype=openmc.Universe)
- universes[:,:] = univs['Fuel (3.1%) stack']
- universes[nonfuel_y, nonfuel_x] = [ crSA, crSA, crSA,
- crSA, crSA,
- crSA, crSA, crSA, crSA, crSA,
- crSA, crSA, cent, crSA, crSA,
- crSA, crSA, crSA, crSA, crSA,
- crSA, crSA,
- crSA, crSA, crSA ]
- univs['Assembly (3.1%) CR SA' + comment] = \
- make_assembly('Assembly (3.1%) CR SA' + comment, universes)
+ # WITH CONTROL ROD SA BANK
+ universes = np.empty((17,17), dtype=openmc.Universe)
+ universes[:,:] = pins['Fuel (3.1%) stack']
+ universes[nonfuel_y, nonfuel_x] = [ crSA, crSA, crSA,
+ crSA, crSA,
+ crSA, crSA, crSA, crSA, crSA,
+ crSA, crSA, cent, crSA, crSA,
+ crSA, crSA, crSA, crSA, crSA,
+ crSA, crSA,
+ crSA, crSA, crSA ]
+ univs['Assembly (3.1%) CR SA' + comment] = \
+ make_assembly('Assembly (3.1%) CR SA' + comment, universes)
- # WITH 20 BURNABLE ABSORBERS
- universes = np.empty((17,17), dtype=openmc.Universe)
- universes[:,:] = univs['Fuel (3.1%) stack']
- universes[nonfuel_y, nonfuel_x] = [ bas, bas, bas,
- bas, bas,
- bas, bas, gtu, bas, bas,
- bas, gtu, cent, gtu, bas,
- bas, bas, gtu, bas, bas,
- bas, bas,
- bas, bas, bas ]
- univs['Assembly (3.1%) 20BA' + comment] = \
- make_assembly('Assembly (3.1%) 20BA' + comment, universes)
+ # WITH 20 BURNABLE ABSORBERS
+ universes = np.empty((17,17), dtype=openmc.Universe)
+ universes[:,:] = pins['Fuel (3.1%) stack']
+ universes[nonfuel_y, nonfuel_x] = [ bas, bas, bas,
+ bas, bas,
+ bas, bas, gtu, bas, bas,
+ bas, gtu, cent, gtu, bas,
+ bas, bas, gtu, bas, bas,
+ bas, bas,
+ bas, bas, bas ]
+ univs['Assembly (3.1%) 20BA' + comment] = \
+ make_assembly('Assembly (3.1%) 20BA' + comment, universes)
- # WITH 16 BURNABLE ABSORBERS
- universes = np.empty((17,17), dtype=openmc.Universe)
- universes[:,:] = univs['Fuel (3.1%) stack']
- universes[nonfuel_y, nonfuel_x] = [ bas, bas, bas,
- bas, bas,
- bas, gtu, gtu, gtu, bas,
- bas, gtu, cent, gtu, bas,
- bas, gtu, gtu, gtu, bas,
- bas, bas,
- bas, bas, bas ]
- univs['Assembly (3.1%) 16BA' + comment] = \
- make_assembly('Assembly (3.1%) 16BA' + comment, universes)
+ # WITH 16 BURNABLE ABSORBERS
+ universes = np.empty((17,17), dtype=openmc.Universe)
+ universes[:,:] = pins['Fuel (3.1%) stack']
+ universes[nonfuel_y, nonfuel_x] = [ bas, bas, bas,
+ bas, bas,
+ bas, gtu, gtu, gtu, bas,
+ bas, gtu, cent, gtu, bas,
+ bas, gtu, gtu, gtu, bas,
+ bas, bas,
+ bas, bas, bas ]
+ univs['Assembly (3.1%) 16BA' + comment] = \
+ make_assembly('Assembly (3.1%) 16BA' + comment, universes)
- # WITH 15 BURNABLE ABSORBERS NW
- universes = np.empty((17,17), dtype=openmc.Universe)
- universes[:,:] = univs['Fuel (3.1%) stack']
- universes[nonfuel_y, nonfuel_x] = [ gtu, gtu, gtu,
- gtu, gtu,
- gtu, bas, bas, bas, bas,
- gtu, bas, cent, bas, bas,
- gtu, bas, bas, bas, bas,
- gtu, bas,
- bas, bas, bas ]
- univs['Assembly (3.1%) 15BANW' + comment] = \
- make_assembly('Assembly (3.1%) 15BANW' + comment, universes)
+ # WITH 15 BURNABLE ABSORBERS NW
+ universes = np.empty((17,17), dtype=openmc.Universe)
+ universes[:,:] = pins['Fuel (3.1%) stack']
+ universes[nonfuel_y, nonfuel_x] = [ gtu, gtu, gtu,
+ gtu, gtu,
+ gtu, bas, bas, bas, bas,
+ gtu, bas, cent, bas, bas,
+ gtu, bas, bas, bas, bas,
+ gtu, bas,
+ bas, bas, bas ]
+ univs['Assembly (3.1%) 15BANW' + comment] = \
+ make_assembly('Assembly (3.1%) 15BANW' + comment, universes)
- # WITH 15 BURNABLE ABSORBERS NE
- universes = np.empty((17,17), dtype=openmc.Universe)
- universes[:,:] = univs['Fuel (3.1%) stack']
- universes[nonfuel_y, nonfuel_x] = [ gtu, gtu, gtu,
- gtu, gtu,
- bas, bas, bas, bas, gtu,
- bas, bas, cent, bas, gtu,
- bas, bas, bas, bas, gtu,
- bas, gtu,
- bas, bas, bas ]
- univs['Assembly (3.1%) 15BANE' + comment] = \
- make_assembly('Assembly (3.1%) 15BANE' + comment, universes)
+ # WITH 15 BURNABLE ABSORBERS NE
+ universes = np.empty((17,17), dtype=openmc.Universe)
+ universes[:,:] = pins['Fuel (3.1%) stack']
+ universes[nonfuel_y, nonfuel_x] = [ gtu, gtu, gtu,
+ gtu, gtu,
+ bas, bas, bas, bas, gtu,
+ bas, bas, cent, bas, gtu,
+ bas, bas, bas, bas, gtu,
+ bas, gtu,
+ bas, bas, bas ]
+ univs['Assembly (3.1%) 15BANE' + comment] = \
+ make_assembly('Assembly (3.1%) 15BANE' + comment, universes)
- # WITH 15 BURNABLE ABSORBERS SW
- universes = np.empty((17,17), dtype=openmc.Universe)
- universes[:,:] = univs['Fuel (3.1%) stack']
- universes[nonfuel_y, nonfuel_x] = [ bas, bas, bas,
- gtu, bas,
- gtu, bas, bas, bas, bas,
- gtu, bas, cent, bas, bas,
- gtu, bas, bas, bas, bas,
- gtu, gtu,
- gtu, gtu, gtu ]
- univs['Assembly (3.1%) 15BASW' + comment] = \
- make_assembly('Assembly (3.1%) 15BASW' + comment, universes)
+ # WITH 15 BURNABLE ABSORBERS SW
+ universes = np.empty((17,17), dtype=openmc.Universe)
+ universes[:,:] = pins['Fuel (3.1%) stack']
+ universes[nonfuel_y, nonfuel_x] = [ bas, bas, bas,
+ gtu, bas,
+ gtu, bas, bas, bas, bas,
+ gtu, bas, cent, bas, bas,
+ gtu, bas, bas, bas, bas,
+ gtu, gtu,
+ gtu, gtu, gtu ]
+ univs['Assembly (3.1%) 15BASW' + comment] = \
+ make_assembly('Assembly (3.1%) 15BASW' + comment, universes)
- # WITH 15 BURNABLE ABSORBERS SE
- universes = np.empty((17,17), dtype=openmc.Universe)
- universes[:,:] = univs['Fuel (3.1%) stack']
- universes[nonfuel_y, nonfuel_x] = [ bas, bas, bas,
- bas, gtu,
- bas, bas, bas, bas, gtu,
- bas, bas, cent, bas, gtu,
- bas, bas, bas, bas, gtu,
- gtu, gtu,
- gtu, gtu, gtu ]
- univs['Assembly (3.1%) 15BASE' + comment] = \
- make_assembly('Assembly (3.1%) 15BASE' + comment, universes)
+ # WITH 15 BURNABLE ABSORBERS SE
+ universes = np.empty((17,17), dtype=openmc.Universe)
+ universes[:,:] = pins['Fuel (3.1%) stack']
+ universes[nonfuel_y, nonfuel_x] = [ bas, bas, bas,
+ bas, gtu,
+ bas, bas, bas, bas, gtu,
+ bas, bas, cent, bas, gtu,
+ bas, bas, bas, bas, gtu,
+ gtu, gtu,
+ gtu, gtu, gtu ]
+ univs['Assembly (3.1%) 15BASE' + comment] = \
+ make_assembly('Assembly (3.1%) 15BASE' + comment, universes)
- # WITH 6 BURNABLE ABSORBERS N
- universes = np.empty((17,17), dtype=openmc.Universe)
- universes[:,:] = univs['Fuel (3.1%) stack']
- universes[nonfuel_y, nonfuel_x] = [ gtu, gtu, gtu,
- gtu, gtu,
- gtu, gtu, gtu, gtu, gtu,
- gtu, gtu, cent, gtu, gtu,
- bas, gtu, gtu, gtu, bas,
- bas, bas,
- bas, gtu, bas ]
- univs['Assembly (3.1%) 6BAN' + comment] = \
- make_assembly('Assembly (3.1%) 6BAN' + comment, universes)
+ # WITH 6 BURNABLE ABSORBERS N
+ universes = np.empty((17,17), dtype=openmc.Universe)
+ universes[:,:] = pins['Fuel (3.1%) stack']
+ universes[nonfuel_y, nonfuel_x] = [ gtu, gtu, gtu,
+ gtu, gtu,
+ gtu, gtu, gtu, gtu, gtu,
+ gtu, gtu, cent, gtu, gtu,
+ bas, gtu, gtu, gtu, bas,
+ bas, bas,
+ bas, gtu, bas ]
+ univs['Assembly (3.1%) 6BAN' + comment] = \
+ make_assembly('Assembly (3.1%) 6BAN' + comment, universes)
- # WITH 6 BURNABLE ABSORBERS S
- universes = np.empty((17,17), dtype=openmc.Universe)
- universes[:,:] = univs['Fuel (3.1%) stack']
- universes[nonfuel_y, nonfuel_x] = [ bas, gtu, bas,
- bas, bas,
- bas, gtu, gtu, gtu, bas,
- gtu, gtu, cent, gtu, gtu,
- gtu, gtu, gtu, gtu, gtu,
- gtu, gtu,
- gtu, gtu, gtu ]
- univs['Assembly (3.1%) 6BAS' + comment] = \
- make_assembly('Assembly (3.1%) 6BAS' + comment, universes)
+ # WITH 6 BURNABLE ABSORBERS S
+ universes = np.empty((17,17), dtype=openmc.Universe)
+ universes[:,:] = pins['Fuel (3.1%) stack']
+ universes[nonfuel_y, nonfuel_x] = [ bas, gtu, bas,
+ bas, bas,
+ bas, gtu, gtu, gtu, bas,
+ gtu, gtu, cent, gtu, gtu,
+ gtu, gtu, gtu, gtu, gtu,
+ gtu, gtu,
+ gtu, gtu, gtu ]
+ univs['Assembly (3.1%) 6BAS' + comment] = \
+ make_assembly('Assembly (3.1%) 6BAS' + comment, universes)
- # WITH 6 BURNABLE ABSORBERS W
- universes = np.empty((17,17), dtype=openmc.Universe)
- universes[:,:] = univs['Fuel (3.1%) stack']
- universes[nonfuel_y, nonfuel_x] = [ gtu, gtu, bas,
- gtu, bas,
- gtu, gtu, gtu, gtu, bas,
- gtu, gtu, cent, gtu, gtu,
- gtu, gtu, gtu, gtu, bas,
- gtu, bas,
- gtu, gtu, bas ]
- univs['Assembly (3.1%) 6BAW' + comment] = \
- make_assembly('Assembly (3.1%) 6BAW' + comment, universes)
+ # WITH 6 BURNABLE ABSORBERS W
+ universes = np.empty((17,17), dtype=openmc.Universe)
+ universes[:,:] = pins['Fuel (3.1%) stack']
+ universes[nonfuel_y, nonfuel_x] = [ gtu, gtu, bas,
+ gtu, bas,
+ gtu, gtu, gtu, gtu, bas,
+ gtu, gtu, cent, gtu, gtu,
+ gtu, gtu, gtu, gtu, bas,
+ gtu, bas,
+ gtu, gtu, bas ]
+ univs['Assembly (3.1%) 6BAW' + comment] = \
+ make_assembly('Assembly (3.1%) 6BAW' + comment, universes)
- # WITH 6 BURNABLE ABSORBERS E
- universes = np.empty((17,17), dtype=openmc.Universe)
- universes[:,:] = univs['Fuel (3.1%) stack']
- universes[nonfuel_y, nonfuel_x] = [ bas, gtu, gtu,
- bas, gtu,
- bas, gtu, gtu, gtu, gtu,
- gtu, gtu, cent, gtu, gtu,
- bas, gtu, gtu, gtu, gtu,
- bas, gtu,
- bas, gtu, gtu ]
- univs['Assembly (3.1%) 6BAE' + comment] = \
- make_assembly('Assembly (3.1%) 6BAE' + comment, universes)
+ # WITH 6 BURNABLE ABSORBERS E
+ universes = np.empty((17,17), dtype=openmc.Universe)
+ universes[:,:] = pins['Fuel (3.1%) stack']
+ universes[nonfuel_y, nonfuel_x] = [ bas, gtu, gtu,
+ bas, gtu,
+ bas, gtu, gtu, gtu, gtu,
+ gtu, gtu, cent, gtu, gtu,
+ bas, gtu, gtu, gtu, gtu,
+ bas, gtu,
+ bas, gtu, gtu ]
+ univs['Assembly (3.1%) 6BAE' + comment] = \
+ make_assembly('Assembly (3.1%) 6BAE' + comment, universes)
+
+ return univs
diff --git a/smr/smr/core.py b/smr/smr/core.py
index 2de0c6c..5352cf7 100644
--- a/smr/smr/core.py
+++ b/smr/smr/core.py
@@ -6,202 +6,204 @@ import openmc
from .materials import mats
from .surfaces import surfs, lattice_pitch
-from .reflector import univs
+from .reflector import reflector_universes
+from .assemblies import assembly_universes
#### CONSTRUCT MAIN CORE LATTICE
-core = openmc.RectLattice(name='Main core')
-core.lower_left = [-9*lattice_pitch/2, -9*lattice_pitch/2]
-core.pitch = [lattice_pitch, lattice_pitch]
-universes = np.tile(univs['heavy reflector'], (9,9))
+def core_lattice():
+ assembly = assembly_universes()
+ reflector = reflector_universes()
-universes[0, 2] = univs['heavy reflector 0,2']
-universes[0, 3] = univs['heavy reflector 0,3']
-universes[0, 4] = univs['heavy reflector 0,4']
-universes[0, 5] = univs['heavy reflector 0,5']
-universes[0, 6] = univs['heavy reflector 0,6']
+ core = openmc.RectLattice(name='Main core')
+ core.lower_left = (-9*lattice_pitch/2, -9*lattice_pitch/2)
+ core.pitch = (lattice_pitch, lattice_pitch)
+ universes = np.tile(reflector['solid'], (9,9))
-universes[1, 1] = univs['heavy reflector 1,1']
-universes[1, 2] = univs['heavy reflector NW']
-universes[1, 3] = univs['Assembly (3.1%) instr']
-universes[1, 4] = univs['Assembly (2.4%) CR D']
-universes[1, 5] = univs['Assembly (3.1%) instr']
-universes[1, 6] = univs['heavy reflector NE']
-universes[1, 7] = univs['heavy reflector 1,7']
+ universes[0, 2] = reflector['0,2']
+ universes[0, 3] = reflector['0,3']
+ universes[0, 4] = reflector['0,4']
+ universes[0, 5] = reflector['0,5']
+ universes[0, 6] = reflector['0,6']
-universes[2, 0] = univs['heavy reflector 2,0']
-universes[2, 1] = univs['heavy reflector NW']
-universes[2, 2] = univs['Assembly (3.1%) instr']
-universes[2, 3] = univs['Assembly (2.4%) CR D']
-universes[2, 4] = univs['Assembly (3.1%) 16BA']
-universes[2, 5] = univs['Assembly (2.4%) CR D']
-universes[2, 6] = univs['Assembly (3.1%) instr']
-universes[2, 7] = univs['heavy reflector NE']
-universes[2, 8] = univs['heavy reflector 2,8']
+ universes[1, 1] = reflector['1,1']
+ universes[1, 2] = reflector['NW']
+ universes[1, 3] = assembly['Assembly (3.1%) instr']
+ universes[1, 4] = assembly['Assembly (2.4%) CR D']
+ universes[1, 5] = assembly['Assembly (3.1%) instr']
+ universes[1, 6] = reflector['NE']
+ universes[1, 7] = reflector['1,7']
-universes[3, 0] = univs['heavy reflector 3,0']
-universes[3, 1] = univs['Assembly (3.1%) instr']
-universes[3, 2] = univs['Assembly (2.4%) CR D']
-universes[3, 3] = univs['Assembly (3.1%) 16BA']
-universes[3, 4] = univs['Assembly (2.4%) CR D']
-universes[3, 5] = univs['Assembly (3.1%) 16BA']
-universes[3, 6] = univs['Assembly (2.4%) CR D']
-universes[3, 7] = univs['Assembly (3.1%) instr']
-universes[3, 8] = univs['heavy reflector 3,8']
+ universes[2, 0] = reflector['2,0']
+ universes[2, 1] = reflector['NW']
+ universes[2, 2] = assembly['Assembly (3.1%) instr']
+ universes[2, 3] = assembly['Assembly (2.4%) CR D']
+ universes[2, 4] = assembly['Assembly (3.1%) 16BA']
+ universes[2, 5] = assembly['Assembly (2.4%) CR D']
+ universes[2, 6] = assembly['Assembly (3.1%) instr']
+ universes[2, 7] = reflector['NE']
+ universes[2, 8] = reflector['2,8']
-universes[4, 0] = univs['heavy reflector 4,0']
-universes[4, 1] = univs['Assembly (2.4%) CR D']
-universes[4, 2] = univs['Assembly (3.1%) 16BA']
-universes[4, 3] = univs['Assembly (2.4%) CR D']
-universes[4, 4] = univs['Assembly (1.6%) instr']
-universes[4, 5] = univs['Assembly (2.4%) CR D']
-universes[4, 6] = univs['Assembly (3.1%) 16BA']
-universes[4, 7] = univs['Assembly (2.4%) CR D']
-universes[4, 8] = univs['heavy reflector 4,8']
+ universes[3, 0] = reflector['3,0']
+ universes[3, 1] = assembly['Assembly (3.1%) instr']
+ universes[3, 2] = assembly['Assembly (2.4%) CR D']
+ universes[3, 3] = assembly['Assembly (3.1%) 16BA']
+ universes[3, 4] = assembly['Assembly (2.4%) CR D']
+ universes[3, 5] = assembly['Assembly (3.1%) 16BA']
+ universes[3, 6] = assembly['Assembly (2.4%) CR D']
+ universes[3, 7] = assembly['Assembly (3.1%) instr']
+ universes[3, 8] = reflector['3,8']
-universes[5, 0] = univs['heavy reflector 5,0']
-universes[5, 1] = univs['Assembly (3.1%) instr']
-universes[5, 2] = univs['Assembly (2.4%) CR D']
-universes[5, 3] = univs['Assembly (3.1%) 16BA']
-universes[5, 4] = univs['Assembly (2.4%) CR D']
-universes[5, 5] = univs['Assembly (3.1%) 16BA']
-universes[5, 6] = univs['Assembly (2.4%) CR D']
-universes[5, 7] = univs['Assembly (3.1%) instr']
-universes[5, 8] = univs['heavy reflector 5,8']
+ universes[4, 0] = reflector['4,0']
+ universes[4, 1] = assembly['Assembly (2.4%) CR D']
+ universes[4, 2] = assembly['Assembly (3.1%) 16BA']
+ universes[4, 3] = assembly['Assembly (2.4%) CR D']
+ universes[4, 4] = assembly['Assembly (1.6%) instr']
+ universes[4, 5] = assembly['Assembly (2.4%) CR D']
+ universes[4, 6] = assembly['Assembly (3.1%) 16BA']
+ universes[4, 7] = assembly['Assembly (2.4%) CR D']
+ universes[4, 8] = reflector['4,8']
-universes[6, 0] = univs['heavy reflector 6,0']
-universes[6, 1] = univs['heavy reflector SW']
-universes[6, 2] = univs['Assembly (3.1%) instr']
-universes[6, 3] = univs['Assembly (2.4%) CR D']
-universes[6, 4] = univs['Assembly (3.1%) 16BA']
-universes[6, 5] = univs['Assembly (2.4%) CR D']
-universes[6, 6] = univs['Assembly (3.1%) instr']
-universes[6, 7] = univs['heavy reflector SE']
-universes[6, 8] = univs['heavy reflector 6,8']
+ universes[5, 0] = reflector['5,0']
+ universes[5, 1] = assembly['Assembly (3.1%) instr']
+ universes[5, 2] = assembly['Assembly (2.4%) CR D']
+ universes[5, 3] = assembly['Assembly (3.1%) 16BA']
+ universes[5, 4] = assembly['Assembly (2.4%) CR D']
+ universes[5, 5] = assembly['Assembly (3.1%) 16BA']
+ universes[5, 6] = assembly['Assembly (2.4%) CR D']
+ universes[5, 7] = assembly['Assembly (3.1%) instr']
+ universes[5, 8] = reflector['5,8']
-universes[7, 1] = univs['heavy reflector 7,1']
-universes[7, 2] = univs['heavy reflector SW']
-universes[7, 3] = univs['Assembly (3.1%) instr']
-universes[7, 4] = univs['Assembly (2.4%) CR D']
-universes[7, 5] = univs['Assembly (3.1%) instr']
-universes[7, 6] = univs['heavy reflector SE']
-universes[7, 7] = univs['heavy reflector 7,7']
+ universes[6, 0] = reflector['6,0']
+ universes[6, 1] = reflector['SW']
+ universes[6, 2] = assembly['Assembly (3.1%) instr']
+ universes[6, 3] = assembly['Assembly (2.4%) CR D']
+ universes[6, 4] = assembly['Assembly (3.1%) 16BA']
+ universes[6, 5] = assembly['Assembly (2.4%) CR D']
+ universes[6, 6] = assembly['Assembly (3.1%) instr']
+ universes[6, 7] = reflector['SE']
+ universes[6, 8] = reflector['6,8']
-universes[8, 2] = univs['heavy reflector 8,2']
-universes[8, 3] = univs['heavy reflector 8,3']
-universes[8, 4] = univs['heavy reflector 8,4']
-universes[8, 5] = univs['heavy reflector 8,5']
-universes[8, 6] = univs['heavy reflector 8,6']
+ universes[7, 1] = reflector['7,1']
+ universes[7, 2] = reflector['SW']
+ universes[7, 3] = assembly['Assembly (3.1%) instr']
+ universes[7, 4] = assembly['Assembly (2.4%) CR D']
+ universes[7, 5] = assembly['Assembly (3.1%) instr']
+ universes[7, 6] = reflector['SE']
+ universes[7, 7] = reflector['7,7']
-core.universes = universes
+ universes[8, 2] = reflector['8,2']
+ universes[8, 3] = reflector['8,3']
+ universes[8, 4] = reflector['8,4']
+ universes[8, 5] = reflector['8,5']
+ universes[8, 6] = reflector['8,6']
+
+ core.universes = universes
+ return core
-#### CONSTRUCT ROOT UNIVERSE AND CELLS
+def core_geometry():
+ # Create core lattice
+ core = core_lattice()
-root_univ = openmc.Universe(universe_id=0, name='root universe')
+ root_univ = openmc.Universe(universe_id=0, name='root universe')
-cell = openmc.Cell(name='Main core')
-cell.fill = core
-cell.region = \
- -surfs['core barrel IR'] & +surfs['lower bound'] & -surfs['upper bound']
-root_univ.add_cell(cell)
+ # Cylinder filled with core lattice
+ cell = openmc.Cell(name='Main core')
+ cell.fill = core
+ cell.region = \
+ -surfs['core barrel IR'] & +surfs['lower bound'] & -surfs['upper bound']
+ root_univ.add_cell(cell)
+
+ # Core barrel
+ cell = openmc.Cell(name='core barrel')
+ cell.fill = mats['SS']
+ cell.region = (+surfs['core barrel IR'] & -surfs['core barrel OR'] &
+ +surfs['lower bound'] & -surfs['upper bound'])
+ root_univ.add_cell(cell)
-# CONSTRUCT CORE BARREL
+ # Neutron shield panels
+ cell = openmc.Cell(name='neutron shield panel NW')
+ cell.fill = mats['SS']
+ cell.region = (+surfs['core barrel OR'] & -surfs['neutron shield OR'] &
+ +surfs['neutron shield NWbot SEtop'] &
+ -surfs['neutron shield NWtop SEbot'] &
+ +surfs['lower bound'] & -surfs['upper bound'])
+ root_univ.add_cell(cell)
-cell = openmc.Cell(name='core barrel')
-cell.fill = mats['SS']
-cell.region = (+surfs['core barrel IR'] & -surfs['core barrel OR'] &
- +surfs['lower bound'] & -surfs['upper bound'])
-root_univ.add_cell(cell)
+ cell = openmc.Cell(name='neutron shield panel N')
+ cell.fill = mats['H2O']
+ cell.region = (+surfs['core barrel OR'] & -surfs['neutron shield OR'] &
+ +surfs['neutron shield NWtop SEbot'] &
+ -surfs['neutron shield NEtop SWbot'] &
+ +surfs['lower bound'] & -surfs['upper bound'])
+ root_univ.add_cell(cell)
+
+ cell = openmc.Cell(name='neutron shield panel SE')
+ cell.fill = mats['SS']
+ cell.region = (+surfs['core barrel OR'] & -surfs['neutron shield OR'] &
+ -surfs['neutron shield NWbot SEtop'] &
+ +surfs['neutron shield NWtop SEbot'] &
+ +surfs['lower bound'] & -surfs['upper bound'])
+ root_univ.add_cell(cell)
+
+ cell = openmc.Cell(name='neutron shield panel E')
+ cell.fill = mats['H2O']
+ cell.region = (+surfs['core barrel OR'] & -surfs['neutron shield OR'] &
+ +surfs['neutron shield NWbot SEtop'] &
+ +surfs['neutron shield NEbot SWtop'] &
+ +surfs['lower bound'] & -surfs['upper bound'])
+ root_univ.add_cell(cell)
+
+ cell = openmc.Cell(name='neutron shield panel NE')
+ cell.fill = mats['SS']
+ cell.region = (+surfs['core barrel OR'] & -surfs['neutron shield OR'] &
+ +surfs['neutron shield NEbot SWtop'] &
+ -surfs['neutron shield NEtop SWbot'] &
+ +surfs['lower bound'] & -surfs['upper bound'])
+ root_univ.add_cell(cell)
+
+ cell = openmc.Cell(name='neutron shield panel S')
+ cell.fill = mats['H2O']
+ cell.region = (+surfs['core barrel OR'] & -surfs['neutron shield OR'] &
+ -surfs['neutron shield NWtop SEbot'] &
+ +surfs['neutron shield NEtop SWbot'] &
+ +surfs['lower bound'] & -surfs['upper bound'])
+ root_univ.add_cell(cell)
+
+ cell = openmc.Cell(name='neutron shield panel SW')
+ cell.fill = mats['SS']
+ cell.region = (+surfs['core barrel OR'] & -surfs['neutron shield OR'] &
+ -surfs['neutron shield NEbot SWtop'] &
+ +surfs['neutron shield NEtop SWbot'] &
+ +surfs['lower bound'] & -surfs['upper bound'])
+ root_univ.add_cell(cell)
+
+ cell = openmc.Cell(name='neutron shield panel W')
+ cell.fill = mats['H2O']
+ cell.region = (+surfs['core barrel OR'] & -surfs['neutron shield OR'] &
+ -surfs['neutron shield NWbot SEtop'] &
+ -surfs['neutron shield NEbot SWtop'] &
+ +surfs['lower bound'] & -surfs['upper bound'])
+ root_univ.add_cell(cell)
-#### CONSTRUCT NEUTRON SHIELD PANELS
-
-cell = openmc.Cell(name='neutron shield panel NW')
-cell.fill = mats['SS']
-cell.region = (+surfs['core barrel OR'] & -surfs['neutron shield OR'] &
- +surfs['neutron shield NWbot SEtop'] &
- -surfs['neutron shield NWtop SEbot'] &
- +surfs['lower bound'] & -surfs['upper bound'])
-root_univ.add_cell(cell)
-
-cell = openmc.Cell(name='neutron shield panel N')
-cell.fill = mats['H2O']
-cell.region = (+surfs['core barrel OR'] & -surfs['neutron shield OR'] &
- +surfs['neutron shield NWtop SEbot'] &
- -surfs['neutron shield NEtop SWbot'] &
- +surfs['lower bound'] & -surfs['upper bound'])
-root_univ.add_cell(cell)
-
-cell = openmc.Cell(name='neutron shield panel SE')
-cell.fill = mats['SS']
-cell.region = (+surfs['core barrel OR'] & -surfs['neutron shield OR'] &
- -surfs['neutron shield NWbot SEtop'] &
- +surfs['neutron shield NWtop SEbot'] &
- +surfs['lower bound'] & -surfs['upper bound'])
-root_univ.add_cell(cell)
-
-cell = openmc.Cell(name='neutron shield panel E')
-cell.fill = mats['H2O']
-cell.region = (+surfs['core barrel OR'] & -surfs['neutron shield OR'] &
- +surfs['neutron shield NWbot SEtop'] &
- +surfs['neutron shield NEbot SWtop'] &
- +surfs['lower bound'] & -surfs['upper bound'])
-root_univ.add_cell(cell)
-
-cell = openmc.Cell(name='neutron shield panel NE')
-cell.fill = mats['SS']
-cell.region = (+surfs['core barrel OR'] & -surfs['neutron shield OR'] &
- +surfs['neutron shield NEbot SWtop'] &
- -surfs['neutron shield NEtop SWbot'] &
- +surfs['lower bound'] & -surfs['upper bound'])
-root_univ.add_cell(cell)
-
-cell = openmc.Cell(name='neutron shield panel S')
-cell.fill = mats['H2O']
-cell.region = (+surfs['core barrel OR'] & -surfs['neutron shield OR'] &
- -surfs['neutron shield NWtop SEbot'] &
- +surfs['neutron shield NEtop SWbot'] &
- +surfs['lower bound'] & -surfs['upper bound'])
-root_univ.add_cell(cell)
-
-cell = openmc.Cell(name='neutron shield panel SW')
-cell.fill = mats['SS']
-cell.region = (+surfs['core barrel OR'] & -surfs['neutron shield OR'] &
- -surfs['neutron shield NEbot SWtop'] &
- +surfs['neutron shield NEtop SWbot'] &
- +surfs['lower bound'] & -surfs['upper bound'])
-root_univ.add_cell(cell)
-
-cell = openmc.Cell(name='neutron shield panel W')
-cell.fill = mats['H2O']
-cell.region = (+surfs['core barrel OR'] & -surfs['neutron shield OR'] &
- -surfs['neutron shield NWbot SEtop'] &
- -surfs['neutron shield NEbot SWtop'] &
- +surfs['lower bound'] & -surfs['upper bound'])
-root_univ.add_cell(cell)
+ # Downcomer
+ cell = openmc.Cell(name='downcomer')
+ cell.fill = mats['H2O']
+ cell.region = (+surfs['neutron shield OR'] & -surfs['RPV IR'] &
+ +surfs['lower bound'] & -surfs['upper bound'])
+ root_univ.add_cell(cell)
-#### CONSTRUCT DOWNCOMER
+ # Reactor pressure vessel
+ cell = openmc.Cell(name='reactor pressure vessel')
+ cell.fill = mats['CS']
+ cell.region = (+surfs['RPV IR'] & -surfs['RPV OR'] &
+ +surfs['lower bound'] & -surfs['upper bound'])
+ root_univ.add_cell(cell)
-cell = openmc.Cell(name='downcomer')
-cell.fill = mats['H2O']
-cell.region = (+surfs['neutron shield OR'] & -surfs['RPV IR'] &
- +surfs['lower bound'] & -surfs['upper bound'])
-root_univ.add_cell(cell)
-
-
-#### CONSTRUCT REACTOR PRESSURE VESSEL
-
-cell = openmc.Cell(name='reactor pressure vessel')
-cell.fill = mats['CS']
-cell.region = (+surfs['RPV IR'] & -surfs['RPV OR'] &
- +surfs['lower bound'] & -surfs['upper bound'])
-root_univ.add_cell(cell)
-
-
-#### CONSTRUCT GEOMETRY
-
-geometry = openmc.Geometry(root_univ)
+ # Return geometry
+ return openmc.Geometry(root_univ)
diff --git a/smr/smr/reflector.py b/smr/smr/reflector.py
index 57ab0c0..ce2bf5e 100644
--- a/smr/smr/reflector.py
+++ b/smr/smr/reflector.py
@@ -12,8 +12,7 @@ converted to actual dimensions by scaling according to the width of an assembly.
import openmc
from .materials import mats
-from .surfaces import surfs, lattice_pitch
-from .assemblies import univs
+from .surfaces import lattice_pitch
def make_reflector(name, parameters):
@@ -27,6 +26,11 @@ def make_reflector(name, parameters):
Iterable containing tuple with the (x,y) coordinates of the center and
the radius of a Z-cylinder and the
+ Returns
+ -------
+ openmc.Universe
+ Universe containing reflector block
+
"""
water_holes = []
for x, y, r in parameters:
@@ -35,277 +39,176 @@ def make_reflector(name, parameters):
water_holes.append(hole)
ss_region = openmc.Intersection(~c.region for c in water_holes)
- ss_cell = openmc.Cell(name='{} SS'.format(name), fill=mats['SS'],
+ ss_cell = openmc.Cell(name='reflector {} SS'.format(name), fill=mats['SS'],
region=ss_region)
- univs[name] = openmc.Universe(name=name)
- univs[name].add_cells(water_holes)
- univs[name].add_cell(ss_cell)
+ univ = openmc.Universe(name='reflector {}'.format(name))
+ univ.add_cells(water_holes)
+ univ.add_cell(ss_cell)
+ return univ
-# Reflector at northwest corner (fuel assemblies to the right and below)
+def reflector_universes():
+ # Create dictionary to store universes
+ univs = {}
-width = 276
-p1 = 59
-p2 = 126
-p3 = 196
-p4 = 264
+ # Reflector at northwest corner (fuel assemblies to the right and below)
+ width = 276
+ p1 = 59
+ p2 = 126
+ p3 = 196
+ p4 = 264
-p5 = 105
+ p5 = 105
-p6 = 122
-p7 = 164
+ p6 = 122
+ p7 = 164
-p8 = 138
-p9 = 222
+ p8 = 138
+ p9 = 222
-p10 = 247
+ p10 = 247
-# There are 8 large water holes and all others appear to have the same, smaller
-# diameter
-d_small = 13
-d_large = 30
+ # There are 8 large water holes and all others appear to have the same, smaller
+ # diameter
+ d_small = 13
+ d_large = 30
-# All pixel widths are scaled according to the actual width of an assembly
-# divided by the width of an assembly in pixels
-scale = lattice_pitch/width
+ # All pixel widths are scaled according to the actual width of an assembly
+ # divided by the width of an assembly in pixels
+ scale = lattice_pitch/width
-# Physical positions
-x1 = -lattice_pitch/2 + scale*(width - p4)
-x2 = -lattice_pitch/2 + scale*(width - p3)
-x3 = -lattice_pitch/2 + scale*(width - p2)
-x4 = -lattice_pitch/2 + scale*(width - p1)
-y1 = -lattice_pitch/2 + scale*p1
-y2 = -lattice_pitch/2 + scale*p2
-y3 = -lattice_pitch/2 + scale*p3
-y4 = -lattice_pitch/2 + scale*p4
+ # Physical positions
+ x1 = -lattice_pitch/2 + scale*(width - p4)
+ x2 = -lattice_pitch/2 + scale*(width - p3)
+ x3 = -lattice_pitch/2 + scale*(width - p2)
+ x4 = -lattice_pitch/2 + scale*(width - p1)
+ y1 = -lattice_pitch/2 + scale*p1
+ y2 = -lattice_pitch/2 + scale*p2
+ y3 = -lattice_pitch/2 + scale*p3
+ y4 = -lattice_pitch/2 + scale*p4
-x5 = -lattice_pitch/2 + scale*(width - p5)
-y5 = -lattice_pitch/2 + scale*p5
-x6 = -lattice_pitch/2 + scale*(width - p7)
-y6 = -lattice_pitch/2 + scale*p6
-x7 = -lattice_pitch/2 + scale*(width - p6)
-y7 = -lattice_pitch/2 + scale*p7
-x8 = -lattice_pitch/2 + scale*(width - p9)
-y8 = -lattice_pitch/2 + scale*p8
-x9 = -lattice_pitch/2 + scale*(width - p8)
-y9 = -lattice_pitch/2 + scale*p9
+ x5 = -lattice_pitch/2 + scale*(width - p5)
+ y5 = -lattice_pitch/2 + scale*p5
+ x6 = -lattice_pitch/2 + scale*(width - p7)
+ y6 = -lattice_pitch/2 + scale*p6
+ x7 = -lattice_pitch/2 + scale*(width - p6)
+ y7 = -lattice_pitch/2 + scale*p7
+ x8 = -lattice_pitch/2 + scale*(width - p9)
+ y8 = -lattice_pitch/2 + scale*p8
+ x9 = -lattice_pitch/2 + scale*(width - p8)
+ y9 = -lattice_pitch/2 + scale*p9
-y10 = -lattice_pitch/2 + scale*p10
+ y10 = -lattice_pitch/2 + scale*p10
-# Radius of small/large water holes
-r1 = scale*d_small/2
-r2 = scale*d_large/2
+ # Radius of small/large water holes
+ r1 = scale*d_small/2
+ r2 = scale*d_large/2
-params = [
- (x1, y1, r1), (x2, y1, r1), (x3, y1, r1), (x4, y1, r2),
- (x4, y2, r1), (x4, y3, r1), (x4, y4, r1), (x5, y5, r1),
- (x6, y6, r1), (x7, y7, r1), (x8, y8, r1), (x9, y9, r1),
- (x1, y10, r1)
-]
+ params = [
+ (x1, y1, r1), (x2, y1, r1), (x3, y1, r1), (x4, y1, r2),
+ (x4, y2, r1), (x4, y3, r1), (x4, y4, r1), (x5, y5, r1),
+ (x6, y6, r1), (x7, y7, r1), (x8, y8, r1), (x9, y9, r1),
+ (x1, y10, r1)
+ ]
+ univs['NW'] = make_reflector('NW', params)
-make_reflector('heavy reflector NW', params)
+ # Reflector at (1, 1)
-# Reflector at (1, 1)
+ params = [
+ (x4, y1, r1),
+ (lattice_pitch/2 - scale*103, -lattice_pitch/2 + scale*156, r1),
+ (lattice_pitch/2 - scale*158, -lattice_pitch/2 + scale*103, r1)
+ ]
+ univs['1,1'] = make_reflector('1,1', params)
-params = [
- (x4, y1, r1),
- (lattice_pitch/2 - scale*103, -lattice_pitch/2 + scale*156, r1),
- (lattice_pitch/2 - scale*158, -lattice_pitch/2 + scale*103, r1)
-]
-make_reflector('heavy reflector 1,1', params)
+ # Left reflector (4,0)
-# Left reflector (4,0)
+ left1 = 58
+ left2 = 118
+ left3 = 173
+ up3 = 76
-left1 = 58
-left2 = 118
-left3 = 173
-up3 = 76
+ x1 = -lattice_pitch/2 + scale*(width - left1)
+ x2 = -lattice_pitch/2 + scale*(width - left2)
+ d_y = scale*67
+ x3 = -lattice_pitch/2 + scale*(width - left3)
+ y3 = scale*up3
-x1 = -lattice_pitch/2 + scale*(width - left1)
-x2 = -lattice_pitch/2 + scale*(width - left2)
-d_y = scale*67
-x3 = -lattice_pitch/2 + scale*(width - left3)
-y3 = scale*up3
+ params = [
+ (x1, 0, r1), (x1, d_y, r1), (x1, 2*d_y, r1), (x1, -d_y, r1), (x1, -2*d_y, r1),
+ (x2, d_y/2, r1), (x2, 3/2*d_y, r1), (x2, -d_y/2, r1), (x2, -3/2*d_y, r1),
+ (x3, y3, r1), (x3, -y3, r1)
+ ]
+ univs['4,0'] = make_reflector('4,0', params)
-params = [
- (x1, 0, r1), (x1, d_y, r1), (x1, 2*d_y, r1), (x1, -d_y, r1), (x1, -2*d_y, r1),
- (x2, d_y/2, r1), (x2, 3/2*d_y, r1), (x2, -d_y/2, r1), (x2, -3/2*d_y, r1),
- (x3, y3, r1), (x3, -y3, r1)
-]
+ # Reflector at (3,0)
-make_reflector('heavy reflector 4,0', params)
+ params = []
+ for i in range(2, 7):
+ params.append((x1, i*d_y - lattice_pitch, r1))
+ for i in (5, 7, 11):
+ params.append((x2, i*d_y/2 - lattice_pitch, r1))
-# Reflector at (3,0)
+ left3 = 140
+ left4 = 183
+ up3 = 159
+ up4 = 47
-params = []
-for i in range(2, 7):
- params.append((x1, i*d_y - lattice_pitch, r1))
-for i in (5, 7, 11):
- params.append((x2, i*d_y/2 - lattice_pitch, r1))
+ x3 = -lattice_pitch/2 + scale*(width - left3)
+ y3 = -lattice_pitch/2 + scale*up3
+ x4 = -lattice_pitch/2 + scale*(width - left4)
+ y4 = -lattice_pitch/2 + scale*up4
+ params += [(x3, y3, r1), (x4, y4, r1)]
-left3 = 140
-left4 = 183
-up3 = 159
-up4 = 47
+ univs['3,0'] = make_reflector('3,0', params)
-x3 = -lattice_pitch/2 + scale*(width - left3)
-y3 = -lattice_pitch/2 + scale*up3
-x4 = -lattice_pitch/2 + scale*(width - left4)
-y4 = -lattice_pitch/2 + scale*up4
-params += [(x3, y3, r1), (x4, y4, r1)]
+ # Reflector at (5,0)
+ params = [(x, -y, r) for x, y, r in params]
+ univs['5,0'] = make_reflector('5,0', params)
-make_reflector('heavy reflector 3,0', params)
+ # Reflector at (2, 0)
-# Reflector at (5,0)
+ params = [(-lattice_pitch/2 + scale*(width - 78),
+ -lattice_pitch/2 + scale*98, r1)]
+ univs['2,0'] = make_reflector('2,0', params)
-params = [(x, -y, r) for x, y, r in params]
-make_reflector('heavy reflector 5,0', params)
+ ################################################################################
+ # Beyond this point, all universes are just copies of the ones previously
+ # created with a rotation applied
-# Reflector at (2, 0)
+ # First define helper function to create new universe by rotating an
+ # existing one
+ def rotate_universe(univ, rotation, name):
+ cell = openmc.Cell(name='reflector {}'.format(name), fill=univ)
+ cell.rotation = rotation
+ return openmc.Universe(name=name, cells=[cell])
-params = [(-lattice_pitch/2 + scale*(width - 78),
- -lattice_pitch/2 + scale*98, r1)]
-make_reflector('heavy reflector 2,0', params)
+ univs['NE'] = rotate_universe(univs['NW'], (0, 0, -90), 'NE')
+ univs['SW'] = rotate_universe(univs['NW'], (0, 0, 90), 'SW')
+ univs['SE'] = rotate_universe(univs['NW'], (0, 0, 180), 'SE')
+ univs['0,2'] = rotate_universe(univs['2,0'], (0, 180, -90), '0,2')
+ univs['0,3'] = rotate_universe(univs['5,0'], (0, 0, -90), '0,3')
+ univs['0,4'] = rotate_universe(univs['4,0'], (0, 0, -90), '0,4')
+ univs['0,5'] = rotate_universe(univs['3,0'], (0, 0, -90), '0,5')
+ univs['0,6'] = rotate_universe(univs['2,0'], (0, 0, -90), '0,6')
+ univs['1,7'] = rotate_universe(univs['1,1'], (0, 0, -90), '1,7')
+ univs['2,8'] = rotate_universe(univs['2,0'], (0, 180, 0), '2,8')
+ univs['3,8'] = rotate_universe(univs['3,0'], (0, 180, 0), '3,8')
+ univs['4,8'] = rotate_universe(univs['4,0'], (0, 180, 0), '4,8')
+ univs['5,8'] = rotate_universe(univs['3,0'], (0, 0, 180), '5,8')
+ univs['6,0'] = rotate_universe(univs['2,0'], (180, 0, 0), '6,0')
+ univs['6,8'] = rotate_universe(univs['2,0'], (0, 0, 180), '6,8')
+ univs['7,1'] = rotate_universe(univs['1,1'], (180, 0, 0), '7,1')
+ univs['7,7'] = rotate_universe(univs['1,1'], (0, 0, 180), '7,7')
+ univs['8,2'] = rotate_universe(univs['2,0'], (0, 0, 90), '8,2')
+ univs['8,3'] = rotate_universe(univs['3,0'], (0, 0, 90), '8,3')
+ univs['8,4'] = rotate_universe(univs['4,0'], (0, 0, 90), '8,4')
+ univs['8,5'] = rotate_universe(univs['5,0'], (0, 0, 90), '8,5')
+ univs['8,6'] = rotate_universe(univs['2,0'], (0, 0, 180), '8,6')
-################################################################################
-# Beyond this point, all universes are just copies of the ones previously
-# created with a rotation applied
+ # Solid stainless steel universe
+ all_ss = openmc.Cell(name='heavy reflector', fill=mats['SS'])
+ univs['solid'] = openmc.Universe(name='solid', cells=[all_ss])
-# NE corner
-cell = openmc.Cell(name='heavy reflector NE', fill=univs['heavy reflector NW'])
-cell.rotation = (0, 0, -90)
-univs['heavy reflector NE'] = openmc.Universe(name='heavy reflector NE')
-univs['heavy reflector NE'].add_cell(cell)
-
-# SW corner
-cell = openmc.Cell(name='heavy reflector SW', fill=univs['heavy reflector NW'])
-cell.rotation = (0, 0, 90)
-univs['heavy reflector SW'] = openmc.Universe(name='heavy reflector SW')
-univs['heavy reflector SW'].add_cell(cell)
-
-# SE corner
-cell = openmc.Cell(name='heavy reflector SE', fill=univs['heavy reflector NW'])
-cell.rotation = (0, 0, 180)
-univs['heavy reflector SE'] = openmc.Universe(name='heavy reflector SE')
-univs['heavy reflector SE'].add_cell(cell)
-
-# Reflector at (0, 2)
-name = 'heavy reflector 0,2'
-cell = openmc.Cell(name=name, fill=univs['heavy reflector 2,0'])
-cell.rotation = (0, 180, -90)
-univs[name] = openmc.Universe(name=name, cells=[cell])
-
-# Reflector at (0, 3)
-name = 'heavy reflector 0,3'
-cell = openmc.Cell(name=name, fill=univs['heavy reflector 5,0'])
-cell.rotation = (0, 0, -90)
-univs[name] = openmc.Universe(name=name, cells=[cell])
-
-# Reflector at (0, 4)
-name = 'heavy reflector 0,4'
-cell = openmc.Cell(name=name, fill=univs['heavy reflector 4,0'])
-cell.rotation = (0, 0, -90)
-univs[name] = openmc.Universe(name=name, cells=[cell])
-
-# Reflector at (0, 5)
-name = 'heavy reflector 0,5'
-cell = openmc.Cell(name=name, fill=univs['heavy reflector 3,0'])
-cell.rotation = (0, 0, -90)
-univs[name] = openmc.Universe(name=name, cells=[cell])
-
-# Reflector at (0, 6)
-name = 'heavy reflector 0,6'
-cell = openmc.Cell(name=name, fill=univs['heavy reflector 2,0'])
-cell.rotation = (0, 0, -90)
-univs[name] = openmc.Universe(name=name, cells=[cell])
-
-# Reflector at (1, 7)
-name = 'heavy reflector 1,7'
-cell = openmc.Cell(name=name, fill=univs['heavy reflector 1,1'])
-cell.rotation = (0, 0, -90)
-univs[name] = openmc.Universe(name=name, cells=[cell])
-
-# Reflector at (2, 8)
-name = 'heavy reflector 2,8'
-cell = openmc.Cell(name=name, fill=univs['heavy reflector 2,0'])
-cell.rotation = (0, 180, 0)
-univs[name] = openmc.Universe(name=name, cells=[cell])
-
-# Reflector at (3, 8)
-name = 'heavy reflector 3,8'
-cell = openmc.Cell(name=name, fill=univs['heavy reflector 3,0'])
-cell.rotation = (0, 180, 0)
-univs[name] = openmc.Universe(name=name, cells=[cell])
-
-# Reflector at (4, 8)
-name = 'heavy reflector 4,8'
-cell = openmc.Cell(name=name, fill=univs['heavy reflector 4,0'])
-cell.rotation = (0, 180, 0)
-univs[name] = openmc.Universe(name=name, cells=[cell])
-
-# Reflector at (5, 8)
-name = 'heavy reflector 5,8'
-cell = openmc.Cell(name=name, fill=univs['heavy reflector 3,0'])
-cell.rotation = (0, 0, 180)
-univs[name] = openmc.Universe(name=name, cells=[cell])
-
-# Reflector at (6, 0)
-name = 'heavy reflector 6,0'
-cell = openmc.Cell(name=name, fill=univs['heavy reflector 2,0'])
-cell.rotation = (180, 0, 0)
-univs[name] = openmc.Universe(name=name, cells=[cell])
-
-# Reflector at (6, 8)
-name = 'heavy reflector 6,8'
-cell = openmc.Cell(name=name, fill=univs['heavy reflector 2,0'])
-cell.rotation = (0, 0, 180)
-univs[name] = openmc.Universe(name=name, cells=[cell])
-
-# Reflector at (7, 1)
-name = 'heavy reflector 7,1'
-cell = openmc.Cell(name=name, fill=univs['heavy reflector 1,1'])
-cell.rotation = (180, 0, 0)
-univs[name] = openmc.Universe(name=name, cells=[cell])
-
-# Reflector at (7, 7)
-name = 'heavy reflector 7,7'
-cell = openmc.Cell(name=name, fill=univs['heavy reflector 1,1'])
-cell.rotation = (0, 0, 180)
-univs[name] = openmc.Universe(name=name, cells=[cell])
-
-# Reflector at (8, 2)
-name = 'heavy reflector 8,2'
-cell = openmc.Cell(name=name, fill=univs['heavy reflector 2,0'])
-cell.rotation = (0, 0, 90)
-univs[name] = openmc.Universe(name=name, cells=[cell])
-
-# Reflector at (8, 3)
-name = 'heavy reflector 8,3'
-cell = openmc.Cell(name=name, fill=univs['heavy reflector 3,0'])
-cell.rotation = (0, 0, 90)
-univs[name] = openmc.Universe(name=name, cells=[cell])
-
-# Reflector at (8, 4)
-name = 'heavy reflector 8,4'
-cell = openmc.Cell(name=name, fill=univs['heavy reflector 4,0'])
-cell.rotation = (0, 0, 90)
-univs[name] = openmc.Universe(name=name, cells=[cell])
-
-# Reflector at (8, 5)
-name = 'heavy reflector 8,5'
-cell = openmc.Cell(name=name, fill=univs['heavy reflector 5,0'])
-cell.rotation = (0, 0, 90)
-univs[name] = openmc.Universe(name=name, cells=[cell])
-
-# Reflector at (8, 6)
-name = 'heavy reflector 8,6'
-cell = openmc.Cell(name=name, fill=univs['heavy reflector 2,0'])
-cell.rotation = (0, 0, 180)
-univs[name] = openmc.Universe(name=name, cells=[cell])
-
-# Solid stainless steel universe
-
-all_ss = openmc.Cell(name='heavy reflector', fill=mats['SS'])
-univs['heavy reflector'] = openmc.Universe(
- name='heavy reflector', cells=[all_ss])
+ return univs