Fixed bugs in assembly and core construction

This commit is contained in:
Will Boyd 2017-02-04 17:28:28 -05:00
parent ba45e818f0
commit 04f76cea47
3 changed files with 49 additions and 41 deletions

View file

@ -28,7 +28,7 @@ def make_assembly(name, universes):
universe = openmc.Universe(name=univ_name)
cell = openmc.Cell(name=univ_name)
cell.fill = lattice
cell.region = surfs['lat box inner']
cell.region = surfs['lat grid box inner']
universe.add_cell(cell)
# Make bottom axial cell for outside of assembly (without sleeve)
@ -123,7 +123,7 @@ for cent, comment in [(gti, ''), (ins, ' instr')]:
gtu, gtu, gtu, gtu, gtu,
gtu, gtu,
gtu, gtu, gtu ]
univs['Assembly (1.6\%) no BAs' + comment] = \
univs['Assembly (1.6\%)' + comment] = \
make_assembly('Assembly (1.6\%) no BAs' + comment, universes)
# WITH EACH CONTROL ROD BANK
@ -131,7 +131,7 @@ for cent, comment in [(gti, ''), (ins, ' instr')]:
(crSB, 'SB'), (crSC, 'SC'), (crSD, 'SD'), (crSE, 'SE')]:
universes = np.empty((17,17), dtype=openmc.Universe)
universes[:,:] = univs['Assembly (1.6\%) stack']
universes[:,:] = univs['Fuel (1.6\%) stack']
universes[nonfuel_y, nonfuel_x] = [ bank, bank, bank,
bank, bank,
bank, bank, bank, bank, bank,
@ -214,7 +214,7 @@ for cent, comment in [(gti, ''), (ins, ' instr')]:
gtu, gtu, gtu, gtu, gtu,
gtu, gtu,
gtu, gtu, gtu ]
univs['Assembly (3.1\%) no BAs' + comment] = \
univs['Assembly (3.1\%)' + comment] = \
make_assembly('Assembly (3.1\%) no BAs' + comment, universes)
# WITH CONTROL ROD SA BANK
@ -240,7 +240,7 @@ for cent, comment in [(gti, ''), (ins, ' instr')]:
bas, bas, gtu, bas, bas,
bas, bas,
bas, bas, bas ]
univs['Assembly (3,1\%) 20BA' + comment] = \
univs['Assembly (3.1\%) 20BA' + comment] = \
make_assembly('Assembly (3.1\%) 20BA' + comment, universes)
# WITH 16 BURNABLE ABSORBERS
@ -253,7 +253,7 @@ for cent, comment in [(gti, ''), (ins, ' instr')]:
bas, gtu, gtu, gtu, bas,
bas, bas,
bas, bas, bas ]
univs['Assembly (3,1\%) 16BA' + comment] = \
univs['Assembly (3.1\%) 16BA' + comment] = \
make_assembly('Assembly (3.1\%) 16BA' + comment, universes)
# WITH 15 BURNABLE ABSORBERS NW
@ -266,7 +266,7 @@ for cent, comment in [(gti, ''), (ins, ' instr')]:
gtu, bas, bas, bas, bas,
gtu, bas,
bas, bas, bas ]
univs['Assembly (3,1\%) 15BANW' + comment] = \
univs['Assembly (3.1\%) 15BANW' + comment] = \
make_assembly('Assembly (3.1\%) 15BANW' + comment, universes)
# WITH 15 BURNABLE ABSORBERS NE
@ -279,7 +279,7 @@ for cent, comment in [(gti, ''), (ins, ' instr')]:
bas, bas, bas, bas, gtu,
bas, gtu,
bas, bas, bas ]
univs['Assembly (3,1\%) 15BANE' + comment] = \
univs['Assembly (3.1\%) 15BANE' + comment] = \
make_assembly('Assembly (3.1\%) 15BANE' + comment, universes)
# WITH 15 BURNABLE ABSORBERS SW
@ -292,7 +292,7 @@ for cent, comment in [(gti, ''), (ins, ' instr')]:
gtu, bas, bas, bas, bas,
gtu, gtu,
gtu, gtu, gtu ]
univs['Assembly (3,1\%) 15BASW' + comment] = \
univs['Assembly (3.1\%) 15BASW' + comment] = \
make_assembly('Assembly (3.1\%) 15BASW' + comment, universes)
# WITH 15 BURNABLE ABSORBERS SE
@ -305,7 +305,7 @@ for cent, comment in [(gti, ''), (ins, ' instr')]:
bas, bas, bas, bas, gtu,
gtu, gtu,
gtu, gtu, gtu ]
univs['Assembly (3,1\%) 15BASE' + comment] = \
univs['Assembly (3.1\%) 15BASE' + comment] = \
make_assembly('Assembly (3.1\%) 15BASE' + comment, universes)
# WITH 6 BURNABLE ABSORBERS N
@ -318,7 +318,7 @@ for cent, comment in [(gti, ''), (ins, ' instr')]:
bas, gtu, gtu, gtu, bas,
bas, bas,
bas, gtu, bas ]
univs['Assembly (3,1\%) 6BAN' + comment] = \
univs['Assembly (3.1\%) 6BAN' + comment] = \
make_assembly('Assembly (3.1\%) 6BAN' + comment, universes)
# WITH 6 BURNABLE ABSORBERS S
@ -331,7 +331,7 @@ for cent, comment in [(gti, ''), (ins, ' instr')]:
gtu, gtu, gtu, gtu, gtu,
gtu, gtu,
gtu, gtu, gtu ]
univs['Assembly (3,1\%) 6BAS' + comment] = \
univs['Assembly (3.1\%) 6BAS' + comment] = \
make_assembly('Assembly (3.1\%) 6BAS' + comment, universes)
# WITH 6 BURNABLE ABSORBERS W
@ -344,7 +344,7 @@ for cent, comment in [(gti, ''), (ins, ' instr')]:
gtu, gtu, gtu, gtu, bas,
gtu, bas,
gtu, gtu, bas ]
univs['Assembly (3,1\%) 6BAW' + comment] = \
univs['Assembly (3.1\%) 6BAW' + comment] = \
make_assembly('Assembly (3.1\%) 6BAW' + comment, universes)
# WITH 6 BURNABLE ABSORBERS E
@ -357,5 +357,5 @@ for cent, comment in [(gti, ''), (ins, ' instr')]:
bas, gtu, gtu, gtu, gtu,
bas, gtu,
bas, gtu, gtu ]
univs['Assembly (3,1\%) 6BAE' + comment] = \
univs['Assembly (3.1\%) 6BAE' + comment] = \
make_assembly('Assembly (3.1\%) 6BAE' + comment, universes)

View file

@ -2,7 +2,7 @@ import openmc
from materials import mats
from surfaces import surfs, lattice_pitch
from pins import univs
from assemblies import univs
# FIXME: is this necessary??
@ -260,7 +260,7 @@ latts['baffle southeast'].universes = [
[univs['water pin'], univs['baffle east dummy']],
[univs['baffle south dummy'], univs['baffle southeast dummy']]]
univs['baffle southwest'] = openmc.Universe(name='baffle southeast')
univs['baffle southeast'] = openmc.Universe(name='baffle southeast')
cell = openmc.Cell(name='baffle southeast')
cell.fill = latts['baffle southeast']
@ -330,7 +330,7 @@ latts['baffle northeast corner'] = openmc.RectLattice(name='baffle northeast cor
latts['baffle northeast corner'].lower_left = [-lattice_pitch/2., -lattice_pitch/2.]
latts['baffle northeast corner'].pitch = [lattice_pitch/2., lattice_pitch/2.]
latts['baffle northeast corner'].universes = [
[univs['water pin'], univs['baffle northweast corner dummy']],
[univs['water pin'], univs['baffle northeast corner dummy']],
[univs['water pin'], univs['water pin']]]
univs['baffle northeast corner'] = \

View file

@ -4,7 +4,7 @@ import openmc
from materials import mats
from surfaces import surfs, lattice_pitch
from assemblies import univs
from baffle import univs
# CONSTRUCT MAIN CORE LATTICE
@ -12,8 +12,9 @@ from assemblies import univs
core = openmc.RectLattice(name='Main core')
core.lower_left = [-19.*lattice_pitch/2., -19.*lattice_pitch/2.]
core.width = [lattice_pitch, lattice_pitch]
core.universes = np.empty((19,19), dtype=openmc.Universe)
core.universes[:, :] = univs['water pin']
universes = np.empty((19,19), dtype=openmc.Universe)
universes[:,:] = univs['water pin']
core.universes = universes
core.universes[5, 7] = univs['baffle northwest']
core.universes[5, 8] = univs['baffle north']
@ -50,7 +51,7 @@ core.universes[8, 12] = univs['Assembly (3.1\%) instr']
core.universes[8, 13] = univs['baffle east']
core.universes[9, 5] = univs['baffle west']
core.universes[9, 6] = univs['Assembly (3.1\%) CR B']
core.universes[9, 6] = univs['Assembly (1.6\%) CR B']
core.universes[9, 7] = univs['Assembly (3.1\%) 16BA']
core.universes[9, 8] = univs['Assembly (2.4\%) CR D']
core.universes[9, 9] = univs['Assembly (1.6\%) instr']
@ -63,7 +64,7 @@ core.universes[10, 5] = univs['baffle west']
core.universes[10, 6] = univs['Assembly (3.1\%) instr']
core.universes[10, 7] = univs['Assembly (1.6\%) CR B']
core.universes[10, 8] = univs['Assembly (3.1\%) 16BA']
core.universes[10, 9] = univs['Assembly (2,4\%) CR D']
core.universes[10, 9] = univs['Assembly (2.4\%) CR D']
core.universes[10, 10] = univs['Assembly (3.1\%) 16BA']
core.universes[10, 11] = univs['Assembly (1.6\%) CR B']
core.universes[10, 12] = univs['Assembly (3.1\%) instr']
@ -109,7 +110,7 @@ root_univ.add_cell(cell)
cell = openmc.Cell(name='core barrel')
cell.material = mats['SS']
cell.region = (surfs['core barrel IR'] & surfs['core barrel OR'] &
cell.region = (+surfs['core barrel IR'] & -surfs['core barrel OR'] &
+surfs['lower bound'] & -surfs['upper bound'])
root_univ.add_cell(cell)
@ -118,65 +119,65 @@ root_univ.add_cell(cell)
cell = openmc.Cell(name='neutron shield panel NW')
cell.material = mats['SS']
cell.region = (+surfs['core barrel OR'] & -surfs['neut shield OR'] &
cell.region = (+surfs['core barrel OR'] & -surfs['neutron shield OR'] &
+surfs['neutron shield NWbot SEtop'] &
-surfs['neutron shield NWtop SEbot']
-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.material = mats['H2O']
cell.region = (+surfs['core barrel OR'] & -surfs['neut shield OR'] &
cell.region = (+surfs['core barrel OR'] & -surfs['neutron shield OR'] &
+surfs['neutron shield NWtop SEbot'] &
-surfs['neutron shield NEtop SWbot']
-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.material = mats['SS']
cell.region = (+surfs['core barrel OR'] & -surfs['neut shield OR'] &
cell.region = (+surfs['core barrel OR'] & -surfs['neutron shield OR'] &
+surfs['neutron shield NWbot SEtop'] &
-surfs['neutron shield NWtop SWbot']
-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.material = mats['H2O']
cell.region = (+surfs['core barrel OR'] & -surfs['neut shield OR'] &
cell.region = (+surfs['core barrel OR'] & -surfs['neutron shield OR'] &
+surfs['neutron shield NWbot SEtop'] &
-surfs['neutron shield NEbot SWtop']
-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.material = mats['SS']
cell.region = (+surfs['core barrel OR'] & -surfs['neut shield OR'] &
cell.region = (+surfs['core barrel OR'] & -surfs['neutron shield OR'] &
+surfs['neutron shield NEbot SWtop'] &
-surfs['neutron shield NEtop SWbot']
-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.material = mats['H2O']
cell.region = (+surfs['core barrel OR'] & -surfs['neut shield OR'] &
cell.region = (+surfs['core barrel OR'] & -surfs['neutron shield OR'] &
+surfs['neutron shield NWtop SEbot'] &
-surfs['neutron shield NEtop SWbot']
-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.material = mats['SS']
cell.region = (+surfs['core barrel OR'] & -surfs['neut shield OR'] &
cell.region = (+surfs['core barrel OR'] & -surfs['neutron shield OR'] &
+surfs['neutron shield NEbot SWtop'] &
-surfs['neutron shield NEtop SWbot']
-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.material = mats['H2O']
cell.region = (+surfs['core barrel OR'] & -surfs['neut shield OR'] &
cell.region = (+surfs['core barrel OR'] & -surfs['neutron shield OR'] &
+surfs['neutron shield NWbot SEtop'] &
-surfs['neutron shield NEbot SWtop']
-surfs['neutron shield NEbot SWtop'] &
+surfs['lower bound'] & -surfs['upper bound'])
root_univ.add_cell(cell)
@ -185,7 +186,7 @@ root_univ.add_cell(cell)
cell = openmc.Cell(name='downcomer')
cell.material = mats['H2O']
cell.region = (+surfs['neut shield OR'] & -surfs['RPV IR'] &
cell.region = (+surfs['neutron shield OR'] & -surfs['RPV IR'] &
+surfs['lower bound'] & -surfs['upper bound'])
root_univ.add_cell(cell)
@ -196,4 +197,11 @@ cell = openmc.Cell(name='reactor pressure vessel')
cell.material = mats['CS']
cell.region = (+surfs['RPV IR'] & -surfs['RPV OR'] &
+surfs['lower bound'] & -surfs['upper bound'])
root_univ.add_cell(cell)
root_univ.add_cell(cell)
# CONSTRUCT GEOMETRY
geometry = openmc.Geometry()
geometry.root_universe = root_univ
geometry.export_to_xml()