diff --git a/smr/cells.py b/smr/cells.py
deleted file mode 100644
index 3198e8d..0000000
--- a/smr/cells.py
+++ /dev/null
@@ -1,54 +0,0 @@
-from materials import *
-from surfaces import surfs
-from grids import grids
-
-import openmc
-
-# FIXME: Put materials in a dictionary
-
-cells = {}
-
-cells['water pin'] = openmc.Cell(name='water pin 1')
-cells['water pin'].fill = mat_h2o
-cells['water pin'].region = -surfs['dummy outer']
-
-water_univ = openmc.Universe(name='Empty water pin cell universe')
-water_univ.add_cell(cells['water pin 1'])
-
-
-
-def make_pin(name, section, cells, surfaces, materials, grid=None):
-
- universe = openmc.Universe(name=name)
-
- # Create cell for interior of innermost ZCylinder
- cell_name = name + ' (0)'
- cells[cell_name] = openmc.Cell(name=cell_name)
- cells[cell_name].fill = materials[0]
- cells[cell_name].region = -surfaces[0]
- universe.add_cell(cells[cell_name])
-
- # Create cells between two ZCylinders
- for i, (mat, surf) in enumerate(zip(materials[1:-1], surfaces[:-1])):
- cell_name = name + '({})'.format(i+1)
- cells[cell_name] = openmc.Cell(name=cell_name)
- cells[cell_name].material = mat
- cells[cell_name].region = +surf & -surfaces[i+1]
- universe.add_cell([cells[cell_name]])
-
- # Create cell for exterior of outermost ZCylinder
- cell_name = name + ' (last)'
- cells[cell_name] = openmc.Cell(name=cell_name)
- cells[cell_name].material = materials[-1]
- cells[cell_name].region = +surfaces[-1]
- universe.add_cell([cells[cell_name]])
-
- # Add spacer grid cells if specified
- if grid:
- inner_grid_name = 'inner {}'.format(grid)
- outer_grid_name = 'outer {}'.format(grid)
-
- # FIXME: Does this work???
- cells[name + ' (last)'].region += grids[inner_grid_name]
- cells[name + ' (grid)'].region = grids[outer_grid_name]
- universe.add_cell(cells[name + '(grid)'])
\ No newline at end of file
diff --git a/smr/grids.py b/smr/grids.py
index 62b3085..6260d27 100644
--- a/smr/grids.py
+++ b/smr/grids.py
@@ -1,6 +1,7 @@
from surfaces import surfs
-import openmc
+# FIXME: Add docstring explanation
+# FIXME: Put this in surface.py??
grids = {}
diff --git a/smr/materials.py b/smr/materials.py
index 9799f4b..f25c6cd 100644
--- a/smr/materials.py
+++ b/smr/materials.py
@@ -1,11 +1,82 @@
-import re
-
import openmc
from openmc.data import atomic_weight, atomic_mass
+# FIXME: Write docstrings
+mats = {}
-# Parameters
+# Create He gas material for fuel pin gap
+mats['He'] = openmc.Material(hame='Helium')
+mats['He'].temperature = 300
+mats['He'].set_density('g/cc', 0.0015981)
+mats['He'].add_element('He', 1.0, 'ao')
+
+# Create air material for instrument tubes
+mats['Air'] = openmc.Material(name='Air')
+mats['Air'].temperature = 300
+mats['Air'].set_density('g/cc', 000616)
+mats['Air'].add_element('O', 0.2095, 'ao')
+mats['Air'].add_element('N', 0.7809, 'ao')
+mats['Air'].add_element('Ar', 0.00933, 'ao')
+mats['Air'].add_element('C', 0.00027, 'ao')
+
+# Create inconel 718 material
+mats['In'] = openmc.Material(name='Inconel')
+mats['In'].temperature = 300
+mats['In'].set_density('g/cc', 8.2)
+mats['In'].add_lement('Si', 0.0035, 'wo')
+mats['In'].add_element('Cr', 0.1896, 'wo')
+mats['In'].add_element('Mn', 0.0087, 'wo')
+mats['In'].add_element('Fe', 0.2863, 'wo')
+mats['In'].add_element('Ni', 0.5119, 'wo')
+
+# Create stainless steel material
+mats['SS'] = openmc.Material(name='SS304')
+mats['SS'].temperature = 300
+mats['SS'].set_density('g/cc', 8.03)
+mats['SS'].add_element('Si', 0.0060, 'wo')
+mats['SS'].add_element('Cr', 0.1900, 'wo')
+mats['SS'].add_element('Mn', 0.0200, 'wo')
+mats['SS'].add_element('Fe', 0.6840, 'wo')
+mats['SS'].add_element('Ni', 0.1000, 'wo')
+
+# Create carbon steel material
+mats['CS'] = openmc.Material(name='Carbon Steel')
+mats['CS'].temperature = 300
+mats['CS'].set_density('g/cc', 7.8)
+mats['CS'].add_element('C', 0.00270, 'wo')
+mats['CS'].add_element('Mn', 0.00750, 'wo')
+mats['CS'].add_element('P', 0.00025, 'wo')
+mats['CS'].add_element('S', 0.00025, 'wo')
+mats['CS'].add_element('Si', 0.00400, 'wo')
+mats['CS'].add_element('Ni', 0.00750, 'wo')
+mats['CS'].add_element('Cr', 0.00350, 'wo')
+mats['CS'].add_element('Mo', 0.00625, 'wo')
+mats['CS'].add_element('V', 0.00050, 'wo')
+mats['CS'].add_element('Nb', 0.00010, 'wo')
+mats['CS'].add_element('Cu', 0.00200, 'wo')
+mats['CS'].add_element('Ca', 0.00015, 'wo')
+mats['CS'].add_element('B', 0.00003, 'wo')
+mats['CS'].add_element('Ti', 0.00015, 'wo')
+mats['CS'].add_element('Al', 0.00025, 'wo')
+mats['CS'].add_element('Fe', 0.96487, 'wo')
+
+# Create zircaloy 4 material
+mats['Zr'] = openmc.Material(name='Zircaloy-4')
+mats['Zr'].temperature = 300
+mats['Zr'].set_density('g/cc', 6.55)
+mats['Zr'].add_element('O', 0.00125, 'wo')
+mats['Zr'].add_element('Cr', 0.0010, 'wo')
+mats['Zr'].add_element('Fe', 0.0021, 'wo')
+mats['Zr'].add_element('Zr', 0.98115, 'wo')
+mats['Zr'].add_element('Sn', 0.0145, 'wo')
+
+# Create Ag-In-Cd control rod material
+mats['AIC'] = openmc.Material(name='aic_rod')
+mats['AIC'].temperature = 300
+mats['AIC'].set_density('g/cc', 10.16)
+mats['AIC'].add_element('Ag', 0.80, 'wo')
+mats['AIC'].add_element('In', 0.15, 'wo')
########## Borated Water #################
@@ -39,87 +110,13 @@ ah_Bh2o = 2.0 * ah2o_Bh2o
aho_Bh2o = ah2o_Bh2o
# Create borated water for coolant / moderator
-mat_h2o = openmc.Material(name='Borated Water')
-mat_h2o.temperature = 300
-mat_h2o.set_density('g/cc', rho_Bh2o)
-mat_h2o.add_element('B', aB_Bh2o, 'ao')
-mat_h2o.add_element('H', ah_Bh2o, 'ao')
-mat_h2o.add_element('O', aho_Bh2o, 'ao')
-mat_h2o.add_s_alpha_beta(name='lwtr', xs='15t')
-
-# Create He gas material for fuel pin gap
-mat_he = openmc.Material(hame='Helium')
-mat_he.temperature = 300
-mat_he.set_density('g/cc', 0.0015981)
-mat_he.add_element('He', 1.0, 'ao')
-
-# Create air material for instrument tubes
-mat_air = openmc.Material(name='Air')
-mat_air.temperature = 300
-mat_air.set_density('g/cc', 000616)
-mat_air.add_element('O', 0.2095, 'ao')
-mat_air.add_element('N', 0.7809, 'ao')
-mat_air.add_element('Ar', 0.00933, 'ao')
-mat_air.add_element('C', 0.00027, 'ao')
-
-# Create inconel 718 material
-mat_in = openmc.Material(name='Inconel')
-mat_in.temperature = 300
-mat_in.set_density('g/cc', 8.2)
-mat_in.add_lement('Si', 0.0035, 'wo')
-mat_in.add_element('Cr', 0.1896, 'wo')
-mat_in.add_element('Mn', 0.0087, 'wo')
-mat_in.add_element('Fe', 0.2863, 'wo')
-mat_in.add_element('Ni', 0.5119, 'wo')
-
-# Create stainless steel material
-mat_ss = openmc.Material(name='SS304')
-mat_ss.temperature = 300
-mat_ss.set_density('g/cc', 8.03)
-mat_ss.add_element('Si', 0.0060, 'wo')
-mat_ss.add_element('Cr', 0.1900, 'wo')
-mat_ss.add_element('Mn', 0.0200, 'wo')
-mat_ss.add_element('Fe', 0.6840, 'wo')
-mat_ss.add_element('Ni', 0.1000, 'wo')
-
-# Create carbon steel material
-mat_cs = openmc.Material(name='Carbon Steel')
-mat_cs.temperature = 300
-mat_cs.set_density('g/cc', 7.8)
-mat_cs.add_element('C', 0.00270, 'wo')
-mat_cs.add_element('Mn', 0.00750, 'wo')
-mat_cs.add_element('P', 0.00025, 'wo')
-mat_cs.add_element('S', 0.00025, 'wo')
-mat_cs.add_element('Si', 0.00400, 'wo')
-mat_cs.add_element('Ni', 0.00750, 'wo')
-mat_cs.add_element('Cr', 0.00350, 'wo')
-mat_cs.add_element('Mo', 0.00625, 'wo')
-mat_cs.add_element('V', 0.00050, 'wo')
-mat_cs.add_element('Nb', 0.00010, 'wo')
-mat_cs.add_element('Cu', 0.00200, 'wo')
-mat_cs.add_element('Ca', 0.00015, 'wo')
-mat_cs.add_element('B', 0.00003, 'wo')
-mat_cs.add_element('Ti', 0.00015, 'wo')
-mat_cs.add_element('Al', 0.00025, 'wo')
-mat_cs.add_element('Fe', 0.96487, 'wo')
-
-# Create zircaloy 4 material
-mat_zr = openmc.Material(name='Zircaloy-4')
-mat_zr.temperature = 300
-mat_zr.set_density('g/cc', 6.55)
-mat_zr.add_element('O', 0.00125, 'wo')
-mat_zr.add_element('Cr', 0.0010, 'wo')
-mat_zr.add_element('Fe', 0.0021, 'wo')
-mat_zr.add_element('Zr', 0.98115, 'wo')
-mat_zr.add_element('Sn', 0.0145, 'wo')
-
-# Create Ag-In-Cd control rod material
-mat_aic = openmc.Material(name='aic_rod')
-mat_aic.temperature = 300
-mat_aic.set_density('g/cc', 10.16)
-mat_aic.add_element('Ag', 0.80, 'wo')
-mat_aic.add_element('In', 0.15, 'wo')
-mat_aic.add_element('Cd', 0.05, 'wo')
+mats['H2O'] = openmc.Material(name='Borated Water')
+mats['H2O'].temperature = 300
+mats['H2O'].set_density('g/cc', rho_Bh2o)
+mats['H2O'].add_element('B', aB_Bh2o, 'ao')
+mats['H2O'].add_element('H', ah_Bh2o, 'ao')
+mats['H2O'].add_element('O', aho_Bh2o, 'ao')
+mats['H2O'].add_s_alpha_beta(name='lwtr', xs='15t')
########## Borosilicate Glass #################
@@ -149,42 +146,41 @@ aB10_B = aB10_bsg / (aB10_bsg + aB11_bsg)
aB11_B = 1.0 - aB10_B
# Create borosilicate glass material
-mat_bsg = openmc.Material(name='Borosilicate Glass')
-mat_bsg.temperature = 300
-mat_bsg.set_density('g/cc', 2.26)
-mat_bsg.add_element('O', aO_bsg, 'ao')
-mat_bsg.add_element('Si', aSi_bsg, 'ao')
-mat_bsg.add_element('Al', aAl_bsg, 'ao')
-mat_bsg.add_nuclide('B10', aB10_B, 'ao')
-mat_bsg.add_nuclide('B11', aB11_B, 'ao')
-
+mats['BSG'] = openmc.Material(name='Borosilicate Glass')
+mats['BSG'].temperature = 300
+mats['BSG'].set_density('g/cc', 2.26)
+mats['BSG'].add_element('O', aO_bsg, 'ao')
+mats['BSG'].add_element('Si', aSi_bsg, 'ao')
+mats['BSG'].add_element('Al', aAl_bsg, 'ao')
+mats['BSG'].add_nuclide('B10', aB10_B, 'ao')
+mats['BSG'].add_nuclide('B11', aB11_B, 'ao')
########## Enriched UO2 Fuel #################
# Create 1.6% enriched UO2 fuel material
a_U234, a_U235, a_U238, a_U, a_O = get_fuel_aos(0.0161006)
-mat_fuel16 = openmc.Material(name='1.6\% Enr. UO2 Fuel')
-mat_fuel16.temperature = 300
-mat_fuel16.set_density('g/cc', 10.31341)
-mat_fuel16.add_element('O', a_O, 'ao')
-mat_fuel16.add_element('U', a_U, 'ao', enrichment=0.0161006)
+mats['UO2 1.6'] = openmc.Material(name='1.6\% Enr. UO2 Fuel')
+mats['UO2 1.6'].temperature = 300
+mats['UO2 1.6'].set_density('g/cc', 10.31341)
+mats['UO2 1.6'].add_element('O', a_O, 'ao')
+mats['UO2 1.6'].add_element('U', a_U, 'ao', enrichment=0.0161006)
# Create 2.4% enriched UO2 fuel material
a_U234, a_U235, a_U238, a_U, a_O = get_fuel_aos(0.0239993)
-mat_fuel16 = openmc.Material(name='2.4\% Enr. UO2 Fuel')
-mat_fuel16.temperature = 300
-mat_fuel16.set_density('g/cc', 10.29748)
-mat_fuel16.add_element('O', a_O, 'ao')
-mat_fuel16.add_element('U', a_U, 'ao', enrichment=0.0239993)
+mats['UO2 2.4'] = openmc.Material(name='2.4\% Enr. UO2 Fuel')
+mats['UO2 2.4'].temperature = 300
+mats['UO2 2.4'].set_density('g/cc', 10.29748)
+mats['UO2 2.4'].add_element('O', a_O, 'ao')
+mats['UO2 2.4'].add_element('U', a_U, 'ao', enrichment=0.0239993)
# Create 3.1% enriched UO2 fuel material
a_U234, a_U235, a_U238, a_U. a_O = get_fuel_aos(0.0310221)
-mat_fuel16 = openmc.Material(name='3.1\% Enr. UO2 Fuel')
-mat_fuel16.temperature = 300
-mat_fuel16.set_density('g/cc', 10.30166)
-mat_fuel16.add_element('O', a_O, 'ao')
-mat_fuel16.add_element('U', a_U, 'ao', enrichment=0.0310221)
+mats['UO2 3.1'] = openmc.Material(name='3.1\% Enr. UO2 Fuel')
+mats['UO2 3.1'].temperature = 300
+mats['UO2 3.1'].set_density('g/cc', 10.30166)
+mats['UO2 3.1'].add_element('O', a_O, 'ao')
+mats['UO2 3.1'].add_element('U', a_U, 'ao', enrichment=0.0310221)
def get_fuel_aos(enr_U235):
diff --git a/smr/pins.py b/smr/pins.py
new file mode 100644
index 0000000..e638f2f
--- /dev/null
+++ b/smr/pins.py
@@ -0,0 +1,158 @@
+import openmc
+
+from materials import mats
+from surfaces import surfs
+from grids import grids
+
+# FIXME: Put materials in a dictionary
+
+def make_pin(name, surfaces, materials, grid=None):
+
+ universe = openmc.Universe(name=name)
+
+ # Create cell for interior of innermost ZCylinder
+ cell_name = name + ' (0)'
+ cell = openmc.Cell(name=cell_name)
+ cell.fill = materials[0]
+ cell.region = -surfaces[0]
+ universe.add_cell(cell)
+
+ # Create cells between two ZCylinders
+ for i, (mat, surf) in enumerate(zip(materials[1:-1], surfaces[:-1])):
+ cell_name = name + '({})'.format(i+1)
+ cell = openmc.Cell(name=cell_name)
+ cell.material = mat
+ cell.region = +surf & -surfaces[i+1]
+ universe.add_cell(cell)
+
+ # Create cell for exterior of outermost ZCylinder
+ cell_name = name + ' (last)'
+ cell = openmc.Cell(name=cell_name)
+ cell.material = materials[-1]
+ cell.region = +surfaces[-1]
+ universe.add_cell(cell)
+
+ # Add spacer grid cells if specified
+ if grid:
+ inner_grid_name = 'inner {}'.format(grid)
+ outer_grid_name = 'outer {}'.format(grid)
+
+ # FIXME: Does this work???
+ cells[name + ' (last)'].region += grids[inner_grid_name]
+ cells[name + ' (grid)'].region = grids[outer_grid_name]
+ universe.add_cell(cells[name + '(grid)'])
+
+ return universe
+
+cells = {}
+
+cells['water pin'] = openmc.Cell(name='water pin 1')
+cells['water pin'].fill = mats['H2O']
+cells['water pin'].region = -surfs['dummy outer']
+
+water_univ = openmc.Universe(name='Empty water pin cell universe')
+water_univ.add_cell(cells['water pin 1'])
+
+# FIXME: Is this a good idea???
+univs = {}
+
+
+# GUIDE TUBE PIN CELLS
+
+univs['GT empty'] = make_pin(
+ 'GT empty', [surfs['GT IR'], surfs['GT OR']],
+ [mats['H2O'], mats['Zr'], mats['H2O']])
+univs['GT empty grid (top/bottom)'] = make_pin(
+ 'GT empty grid (top/bottom)', [surfs['GT IR'], surfs['GT OR']],
+ [mats['H2O'], mats['Zr'], mats['H2O']], grid='(top/bottom)')
+univs['GT empty grid (intermediate)'] = make_pin(
+ 'GT empty grid (intermediate)', [surfs['GT IR'], surfs['GT OR']],
+ [mats['H2O'], mats['Zr'], mats['H2O']], grid='(intermediate)')
+univs['GT empty nozzle'] = make_pin(
+ 'GT empty nozzle', [surfs['GT IR'], surfs['GT OR']],
+ [mats['H2O'], mats['Zr'], mats['H2O']])
+
+univs['GTd empty'] = make_pin(
+ 'GT empty at dashpot', [surfs['GT dashpot IR'], surfs['GT dashpot OR']],
+ [mats['H2O'], mats['Zr'], mats['H2O']])
+univs['GTd empty grid (top/bottom)'] = make_pin(
+ 'GT empty at dashpot grid (top/bottom)',
+ [surfs['GT dashpot IR'], surfs['GT dashpot OR']],
+ [mats['H2O'], mats['Zr'], mats['H2O']], grid='(top/bottom)')
+univs['GTd empty grid (intermediate)'] = make_pin(
+ 'GT empty at dashpot grid (intermediate)',
+ [surfs['GT dashpot IR'], surfs['GT dashpot OR']],
+ [mats['H2O'], mats['Zr'], mats['H2O']], grid='(intermediate)')
+univs['GTd empty nozzle'] = make_pin(
+ 'GT empty nozzle', [surfs['GT dashpot IR'], surfs['GT dashpot OR']],
+ [mats['H2O'], mats['Zr'], mats['H2O']])
+
+# FIXME: Stack all axial pieces of guide tube together
+
+
+# INSTRUMENT TUBE PIN CELL
+
+univs['IT'] = make_pin(
+ 'IT', [surfs['IT IR'], surfs['IT OR'], surfs['GT IR'], surfs['GT OR']],
+ [mats['Air'], mats['Zr'], mats['H2O'], mats['Zr'], mats['H2O']])
+univs['IT grid (top/bottom)'] = make_pin(
+ 'IT grid (top/bottom)',
+ [surfs['IT IR'], surfs['IT OR'], surfs['GT IR'], surfs['GT OR']],
+ [mats['Air'], mats['Zr'], mats['H2O'], mats['Zr'], mats['H2O']],
+ grid='top/bottom')
+univs['IT grid (intermediate)'] = make_pin(
+ 'IT grid (intermediate)',
+ [surfs['IT IR'], surfs['IT OR'], surfs['GT IR'], surfs['GT OR']],
+ [mats['Air'], mats['Zr'], mats['H2O'], mats['Zr'], mats['H2O']],
+ grid='intermediate')
+
+univs['IT nozzle'] = make_pin(
+ 'IT nozzle',
+ [surfs['IT IR'], surfs['IT OR'], surfs['GT IR'], surfs['GT OR']],
+ [mats['Air'], mats['Zr'], mats['H2O'], mats['Zr'], mats['SS']])
+univs['IT dashpot'] = make_pin(
+ 'IT dashpot', [surfs['IT IR'], surfs['IT OR']],
+ [mats['Air'], mats['Zr'], mats['H2O']])
+
+
+# CONTROL ROD PIN CELLS
+
+univs['CR'] = make_pin(
+ 'CR', [surfs['CP OR'], surfs['CR IR'], surfs['GT IR'], surfs['GT OR']],
+ [mats['AIC'], mats['Air'], mats['SS'], mats['H2O'], mats['Zr'], mats['H2O']])
+univs['CR grid (top/bottom)'] = make_pin(
+ 'CR grid (top/bottom)', [surfs['CP OR'], surfs['CR IR'], surfs['GT IR'], surfs['GT OR']],
+ [mats['AIC'], mats['Air'], mats['SS'], mats['H2O'], mats['Zr'], mats['H2O']],
+ grid='(top/bottom)')
+univs['CR grid (intermediate)'] = make_pin(
+ 'CR grid (intermediate)',
+ [surfs['CP OR'], surfs['CR IR'], surfs['GT IR'], surfs['GT OR']],
+ [mats['AIC'], mats['Air'], mats['SS'], mats['H2O'], mats['Zr'], mats['H2O']],
+ grid='(intermediate)')
+univs['CR nozzle'] = make_pin(
+ 'CR nozzle', [surfs['CP OR'], surfs['CR IR'], surfs['CR OR']],
+ [mats['AIC'], mats['Air'], mats['SS'], mats['H2O']])
+
+univs['CR blank'] = make_pin(
+ 'CR blank',
+ [surfs['CP OR'], surfs['CR IR'], surfs['CR OR'], surfs['GT IR'], surfs['GT OR']],
+ [mats['SS'], mats['Air'], mats['SS'], mats['H2O'], mats['Zr'], mats['H2O']])
+univs['CR blank grid (top/bottom)'] = make_pin(
+ 'CR blank grid (top/bottom)',
+ [surfs['CP OR'], surfs['CR IR'], surfs['CR OR'], surfs['GT IR'], surfs['GT OR']],
+ [mats['SS'], mats['Air'], mats['SS'], mats['H2O'], mats['Zr'], mats['H2O']],
+ grid='top/bottom')
+univs['CR blank grid (intermediate)'] = make_pin(
+ 'CR blank grid (intermediate)',
+ [surfs['CP OR'], surfs['CR IR'], surfs['CR OR'], surfs['GT IR'], surfs['GT OR']],
+ [mats['SS'], mats['Air'], mats['SS'], mats['H2O'], mats['Zr'], mats['H2O']],
+ grid='intermediate')
+univs['CR blank nozzle'] = make_pin(
+ 'CR blank nozzle', [surfs['CP OR'], surfs['CR IR'], surfs['CR OR']],
+ [mats['SS'], mats['Air'], mats['SS'], mats['H2O']])
+univs['CR blank bare'] = make_pin(
+ 'CR blank bare', [surfs['CP OR'], surfs['CR IR'], surfs['CR OR']],
+ [mats['SS'], mats['Air'], mats['SS'], mats['H2O']])
+univs['CR bare'] = make_pin(
+ 'CR bare', [surfs['CP OR'], surfs['CR IR'], surfs['CR OR']],
+ [mats['AIC'], mats['Air'], mats['SS'], mats['H2O']])
diff --git a/smr/smr.py b/smr/smr.py
index 06ff4ab..a56e21a 100644
--- a/smr/smr.py
+++ b/smr/smr.py
@@ -52,64 +52,6 @@ def init_data():
################## cells ##################
- # (if not a fill cell, set 'fill': None. if not None, 'mat' is ignored)
-
- # GUIDE TUBE PIN CELLS
-
-
- make_pin('GT empty',"Guide tube pincell universes",co,cells,new_id(univIDs),cellIDs,
- [surfs['guide tube IR']['id'],
- surfs['guide tube OR']['id']],
- [(mats['water-nominal']['id'],"empty guide tube"),
- (mats['zirc']['id'],""),
- (mats['water-nominal']['id'],""),])
- make_pin('GT empty grid_tb',"",co,cells,new_id(univIDs),cellIDs,
- [surfs['guide tube IR']['id'],
- surfs['guide tube OR']['id'],],
- [(mats['water-nominal']['id'],"empty guide tube with top/bottom grid"),
- (mats['zirc']['id'],""),
- (mats['water-nominal']['id'],""),],
- grid=True, surfs=surfs, gridMat=mats['inconel']['id'], gridType='tb')
- make_pin('GT empty grid_i',"",co,cells,new_id(univIDs),cellIDs,
- [surfs['guide tube IR']['id'],
- surfs['guide tube OR']['id'],],
- [(mats['water-nominal']['id'],"empty guide tube with intermediate grid"),
- (mats['zirc']['id'],""),
- (mats['water-nominal']['id'],""),],
- grid=True, surfs=surfs, gridMat=mats['zirc']['id'], gridType='i')
- make_pin('GT empty nozzle',"",co,cells,new_id(univIDs),cellIDs,
- [surfs['guide tube IR']['id'],
- surfs['guide tube OR']['id'],],
- [(mats['water-nominal']['id'],"empty guide tube SS304 penetration"),
- (mats['zirc']['id'],""),
- (mats['water-nominal']['id'],""),])
- make_pin('GTd empty',"",co,cells,new_id(univIDs),cellIDs,
- [surfs['GT dashpot IR']['id'],
- surfs['GT dashpot OR']['id'],],
- [(mats['water-nominal']['id'],"empty guide tube at dashpot"),
- (mats['zirc']['id'],""),
- (mats['water-nominal']['id'],""),])
- make_pin('GTd empty grid_tb',"",co,cells,new_id(univIDs),cellIDs,
- [surfs['GT dashpot IR']['id'],
- surfs['GT dashpot OR']['id'],],
- [(mats['water-nominal']['id'],"empty guide tube at dashpot with top/bottom grid"),
- (mats['zirc']['id'],""),
- (mats['water-nominal']['id'],""),],
- grid=True, surfs=surfs, gridMat=mats['inconel']['id'], gridType='tb')
- make_pin('GTd empty grid_i',"",co,cells,new_id(univIDs),cellIDs,
- [surfs['GT dashpot IR']['id'],
- surfs['GT dashpot OR']['id'],],
- [(mats['water-nominal']['id'],"empty guide tube at dashpot with intermediate grid"),
- (mats['zirc']['id'],""),
- (mats['water-nominal']['id'],""),],
- grid=True, surfs=surfs, gridMat=mats['zirc']['id'], gridType='i')
- make_pin('GTd empty nozzle',"",co,cells,new_id(univIDs),cellIDs,
- [surfs['GT dashpot IR']['id'],
- surfs['GT dashpot OR']['id'],],
- [(mats['water-nominal']['id'],"empty GTd SS304 penetration"),
- (mats['zirc']['id'],""),
- (mats['water-nominal']['id'],""),])
-
# final combination of all axial pieces for empty guide tube
stackSurfs = [surfs['bot support plate']['id'],
@@ -203,57 +145,6 @@ def init_data():
# cells['GT empty nozzle']['univ'], # upper nozzle
cells['water pin']['univ']]) # upper plenum
- # INSTRUMENT TUBE PIN CELL
-
- make_pin('GT instr',"Instrument tube pincell universes",co,cells,new_id(univIDs),cellIDs,
- [surfs['instr tube IR']['id'],
- surfs['instr tube OR']['id'],
- surfs['guide tube IR']['id'],
- surfs['guide tube OR']['id']],
- [(mats['air']['id'],"instr guide tube above dashpot"),
- (mats['zirc']['id'],""),
- (mats['water-nominal']['id'],""),
- (mats['zirc']['id'],""),
- (mats['water-nominal']['id'],""),])
- make_pin('GT instr grid_tb',"",co,cells,new_id(univIDs),cellIDs,
- [surfs['instr tube IR']['id'],
- surfs['instr tube OR']['id'],
- surfs['guide tube IR']['id'],
- surfs['guide tube OR']['id'],],
- [(mats['air']['id'],"instr guide tube at dashpot with top/bottom grid"),
- (mats['zirc']['id'],""),
- (mats['water-nominal']['id'],""),
- (mats['zirc']['id'],""),
- (mats['water-nominal']['id'],""),],
- grid=True, surfs=surfs, gridMat=mats['inconel']['id'], gridType='tb')
- make_pin('GT instr grid_i',"",co,cells,new_id(univIDs),cellIDs,
- [surfs['instr tube IR']['id'],
- surfs['instr tube OR']['id'],
- surfs['guide tube IR']['id'],
- surfs['guide tube OR']['id'],],
- [(mats['air']['id'],"instr guide tube at dashpot with intermediate grid"),
- (mats['zirc']['id'],""),
- (mats['water-nominal']['id'],""),
- (mats['zirc']['id'],""),
- (mats['water-nominal']['id'],""),],
- grid=True, surfs=surfs, gridMat=mats['zirc']['id'], gridType='i')
- make_pin('GT instr nozzle',"",co,cells,new_id(univIDs),cellIDs,
- [surfs['instr tube IR']['id'],
- surfs['instr tube OR']['id'],
- surfs['guide tube IR']['id'],
- surfs['guide tube OR']['id'],],
- [(mats['air']['id'],"instr guide tube SS304 penetration"),
- (mats['zirc']['id'],""),
- (mats['water-nominal']['id'],""),
- (mats['zirc']['id'],""),
- (mats['SS304']['id'],""),])
- make_pin('bare instr',"",co,cells,new_id(univIDs),cellIDs,
- [surfs['instr tube IR']['id'],
- surfs['instr tube OR']['id'],],
- [(mats['air']['id'],"instr guide tube at dashpot"),
- (mats['zirc']['id'],""),
- (mats['water-nominal']['id'],""),])
-
# final combination of all axial pieces for instrument tube
make_stack('GT instr stack',co,cells,new_id(univIDs),cellIDs,
@@ -290,118 +181,6 @@ def init_data():
cells['water pin']['univ']]) # upper plenum
- # CONTROL ROD PIN CELLS
-
- make_pin('control rod',"Control rod bank pincell universes",co,cells,new_id(univIDs),cellIDs,
- [surfs['control poison OR']['id'],
- surfs['control rod IR']['id'],
- surfs['control rod OR']['id'],
- surfs['guide tube IR']['id'],
- surfs['guide tube OR']['id'],],
- [(mats['control rod']['id'],"guide tube above dashpot with control rod"),
- (mats['air']['id'],""),
- (mats['SS304']['id'],""),
- (mats['water-nominal']['id'],""),
- (mats['zirc']['id'],""),
- (mats['water-nominal']['id'],""),])
- make_pin('control rod grid_tb',"",co,cells,new_id(univIDs),cellIDs,
- [surfs['control poison OR']['id'],
- surfs['control rod IR']['id'],
- surfs['control rod OR']['id'],
- surfs['guide tube IR']['id'],
- surfs['guide tube OR']['id'],],
- [(mats['control rod']['id'],"guide tube above dashpot with control rod, with top/bottom grid"),
- (mats['air']['id'],""),
- (mats['SS304']['id'],""),
- (mats['water-nominal']['id'],""),
- (mats['zirc']['id'],""),
- (mats['water-nominal']['id'],""),],
- grid=True, surfs=surfs, gridMat=mats['inconel']['id'], gridType='tb')
- make_pin('control rod grid_i',"",co,cells,new_id(univIDs),cellIDs,
- [surfs['control poison OR']['id'],
- surfs['control rod IR']['id'],
- surfs['control rod OR']['id'],
- surfs['guide tube IR']['id'],
- surfs['guide tube OR']['id'],],
- [(mats['control rod']['id'],"guide tube above dashpot with control rod, with intermediate grid"),
- (mats['air']['id'],""),
- (mats['SS304']['id'],""),
- (mats['water-nominal']['id'],""),
- (mats['zirc']['id'],""),
- (mats['water-nominal']['id'],""),],
- grid=True, surfs=surfs, gridMat=mats['zirc']['id'], gridType='i')
- make_pin('control rod nozzle',"",co,cells,new_id(univIDs),cellIDs,
- [surfs['control poison OR']['id'],
- surfs['control rod IR']['id'],
- surfs['control rod OR']['id'],],
- [(mats['control rod']['id'],"guide tube above dashpot with control rod, with nozzle"),
- (mats['air']['id'],""),
- (mats['SS304']['id'],""),
- (mats['water-nominal']['id'],""),])
- make_pin('control rod blank',"",co,cells,new_id(univIDs),cellIDs,
- [surfs['control poison OR']['id'],
- surfs['control rod IR']['id'],
- surfs['control rod OR']['id'],
- surfs['guide tube IR']['id'],
- surfs['guide tube OR']['id'],],
- [(mats['SS304']['id'],"blank control rod above active region, above nozzle"),
- (mats['air']['id'],""),
- (mats['SS304']['id'],""),
- (mats['water-nominal']['id'],""),
- (mats['zirc']['id'],""),
- (mats['water-nominal']['id'],""),])
- make_pin('control rod blank grid_tb',"",co,cells,new_id(univIDs),cellIDs,
- [surfs['control poison OR']['id'],
- surfs['control rod IR']['id'],
- surfs['control rod OR']['id'],
- surfs['guide tube IR']['id'],
- surfs['guide tube OR']['id'],],
- [(mats['SS304']['id'],"guide tube above dashpot with blank control rod, with top/bottom grid"),
- (mats['air']['id'],""),
- (mats['SS304']['id'],""),
- (mats['water-nominal']['id'],""),
- (mats['zirc']['id'],""),
- (mats['water-nominal']['id'],""),],
- grid=True, surfs=surfs, gridMat=mats['inconel']['id'], gridType='tb')
- make_pin('control rod blank grid_i',"",co,cells,new_id(univIDs),cellIDs,
- [surfs['control poison OR']['id'],
- surfs['control rod IR']['id'],
- surfs['control rod OR']['id'],
- surfs['guide tube IR']['id'],
- surfs['guide tube OR']['id'],],
- [(mats['SS304']['id'],"guide tube above dashpot with blank control rod, with intermediate grid"),
- (mats['air']['id'],""),
- (mats['SS304']['id'],""),
- (mats['water-nominal']['id'],""),
- (mats['zirc']['id'],""),
- (mats['water-nominal']['id'],""),],
- grid=True, surfs=surfs, gridMat=mats['zirc']['id'], gridType='i')
- make_pin('control rod blank nozzle',"",co,cells,new_id(univIDs),cellIDs,
- [surfs['control poison OR']['id'],
- surfs['control rod IR']['id'],
- surfs['control rod OR']['id'],],
- [(mats['SS304']['id'],"blank control rod above active region, within nozzle"),
- (mats['air']['id'],""),
- (mats['SS304']['id'],""),
- (mats['water-nominal']['id'],""),])
- make_pin('control rod blank bare',"",co,cells,new_id(univIDs),cellIDs,
- [surfs['control poison OR']['id'],
- surfs['control rod IR']['id'],
- surfs['control rod OR']['id'],],
- [(mats['SS304']['id'],"blank control rod above active region, within nozzle"),
- (mats['air']['id'],""),
- (mats['SS304']['id'],""),
- (mats['water-nominal']['id'],""),])
- make_pin('control rod bare',"",co,cells,new_id(univIDs),cellIDs,
- [surfs['control poison OR']['id'],
- surfs['control rod IR']['id'],
- surfs['control rod OR']['id'],],
- [(mats['control rod']['id'],"guide tube above dashpot with control rod"),
- (mats['air']['id'],""),
- (mats['SS304']['id'],""),
- (mats['water-nominal']['id'],""),])
-
-
# for the control rods, we make the axial universe three times, once with the
# grid everywhere, once without, and once with the nozzle everywhere. Then
# we can alternate with them as appropriate in the final axial stack
diff --git a/smr/surfaces.py b/smr/surfaces.py
index 0ebe34b..a3e4579 100644
--- a/smr/surfaces.py
+++ b/smr/surfaces.py
@@ -3,6 +3,22 @@ import math
import openmc
+# FIXME: Add back parameters for pin cell radial surfaces
+# FIXME: Cleanup parameters
+# FIXME: Add docstring explanation
+
+
+# Notation
+# GT: Guide Tube
+# BA: Burnable Absorber
+# CP: Control Poison
+# FR: Fuel Rod
+# IR: Inner Radius
+# OR: Outer Radius
+# IT: Instrument Tube
+# FA: Fuel Assembly
+# RPV: Reactor Pressure Vessel
+
# Parameters
rod_grid_side_tb = 1.24416
rod_grid_side_i = 1.21962
@@ -71,16 +87,6 @@ neutron_shield_NEbot_SWtop = math.tan(-math.pi/3)
neutron_shield_NEtop_SWbot = math.tan(-math.pi/6)
-# Notation
-# GT: Guide Tube
-# BA: Burnable Absorber
-# FR: Fuel Rod
-# IR: Inner Radius
-# OR: Outer Radius
-# IT: Instrument Tube
-# FA: Fuel Assembly
-# RPV: Reactor Pressure Vessel
-
surfs = {}
# FIXME: Is this a good idea???
@@ -104,7 +110,7 @@ surfs['GT dashpot IR'] = openmc.ZCylinder(
x0=0., y0=0., R=0.50419, name='GT IR (at dashpot)')
surfs['GT dashpot OR'] = openmc.ZCylinder(
x0=0., y0=0., R=0.54610, name='GT OR (at dashpot)')
-surfs['control poison OR'] = openmc.ZCylinder(
+surfs['CP OR'] = openmc.ZCylinder(
x0=0., y0=0., R=0.43310, name='Control Poison OR')
surfs['CR IR'] = openmc.ZCylinder(
x0=0., y0=0., R=0.43688, name='CR Clad IR')
@@ -206,13 +212,13 @@ surfs['grid4top'] = openmc.ZPlane(
z0=grid4_top, name='top grid 4')
grid_surfaces = [surfs['grid1bot']['id'],
- surfs['grid1top']['id'],
- surfs['grid2bot']['id'],
- surfs['grid2top']['id'],
- surfs['grid3bot']['id'],
- surfs['grid3top']['id'],
- surfs['grid4bot']['id'],
- surfs['grid4top']['id']]
+ surfs['grid1top']['id'],
+ surfs['grid2bot']['id'],
+ surfs['grid2top']['id'],
+ surfs['grid3bot']['id'],
+ surfs['grid3top']['id'],
+ surfs['grid4bot']['id'],
+ surfs['grid4top']['id']]
surfs['top pin plenum'] = openmc.ZPlane(
z0=top_plenum, name='top pin plenum')
@@ -259,13 +265,17 @@ surfs['neutron shield OR'] = openmc.ZPlane(
# neutron shield planes
surfs['neutron shield NWbot SEtop'] = openmc.Plane(
- A=1., B=neutron_shield_NWbot_SEtop, C=0., D=0., name='neutron shield NWbot SEtop')
+ A=1., B=neutron_shield_NWbot_SEtop, C=0., D=0.,
+ name='neutron shield NWbot SEtop')
surfs['neutron shield NWtop SEbot'] = openmc.Plane(
- A=1., B=neutron_shield_NWtop_SEbot, C=0., D=0., name='neutron shield NWtop SEbot')
+ A=1., B=neutron_shield_NWtop_SEbot, C=0., D=0.,
+ name='neutron shield NWtop SEbot')
surfs['neutron shield NEbot SWtop'] = openmc.Plane(
- A=1., B=neutron_shield_NEbot_SWtop, C=0., D=0., name='neutron shield NEbot SWtop')
+ A=1., B=neutron_shield_NEbot_SWtop, C=0., D=0.,
+ name='neutron shield NEbot SWtop')
surfs['neutron shield NEtop SWbot'] = openmc.Plane(
- A=1., B=neutron_shield_NEtop_SWbot, C=0., D=0., name='neutron shield NEtop SWbot')
+ A=1., B=neutron_shield_NEtop_SWbot, C=0., D=0.,
+ name='neutron shield NEtop SWbot')
# outer radial surfaces
surfs['RPV IR'] = openmc.ZCylinder(
diff --git a/smr/templates2.py b/smr/templates2.py
index 35cf5fa..7840dfa 100644
--- a/smr/templates2.py
+++ b/smr/templates2.py
@@ -1,4 +1,4 @@
-# openmc templates
+c# openmc templates
comm_t = """ """
surf_t = """ {comm}\n"""
surf_t_bc = """ {comm}\n"""