ecp-benchmarks/smr/smr/core.py
Paul Romano 2e1761c6fb Squashed commit of the following:
commit fea65f02928ed7b65b0aa88e16af0e9f308dc28e
Author: Paul Romano <paul.k.romano@gmail.com>
Date:   Mon Feb 5 09:20:20 2018 -0600

    Remove XML files and old models

commit 423b3ade32be620dab7ba6fe9c292a6ee4758e9e
Author: Paul Romano <paul.k.romano@gmail.com>
Date:   Mon Feb 5 09:10:54 2018 -0600

    Fix bug in ring generation

commit f5a3acd3d6d0eba7edf4b0c94e76aebdcaa2cd62
Author: Paul Romano <paul.k.romano@gmail.com>
Date:   Mon Feb 5 09:05:51 2018 -0600

    Add option to specify output directory

commit 0c4bca51b38bbb94fffe1d13157f693bee4dea03
Author: Paul Romano <paul.k.romano@gmail.com>
Date:   Tue Jan 23 14:50:09 2018 -0600

    Add plots for assembly

commit 2813d95ea694259bd50ae7fa19087f8652fc0bc5
Author: Paul Romano <paul.k.romano@gmail.com>
Date:   Sun Jan 21 16:08:45 2018 -0600

    Shared compositions when building assembly

commit 5ee50611df13f5df03144266d2c08f2890fdaf72
Author: Paul Romano <paul.k.romano@gmail.com>
Date:   Sun Jan 21 15:32:48 2018 -0600

    Fix build-core-fresh

commit e375ad22a7fb05def86664f5be8411ee822e23a2
Author: Paul Romano <paul.k.romano@gmail.com>
Date:   Fri Jan 19 15:51:51 2018 -0600

    Use pathlib in build-assembly and move assembly directory

commit 53d38a3b3711b44dd75313132c4122f2192df16c
Author: Paul Romano <paul.k.romano@gmail.com>
Date:   Fri Jan 19 14:39:09 2018 -0600

    Add an option to use depleted materials

commit 9c52f82bd0cd989b10938c85586caba331efa1f4
Author: Paul Romano <paul.k.romano@gmail.com>
Date:   Wed Jan 17 14:02:27 2018 -0600

    Add SMR assembly model

commit 82f60acfb3b8889d812e03eb4ee2007b2a5a501e
Author: Paul Romano <paul.k.romano@gmail.com>
Date:   Wed Jan 17 12:34:35 2018 -0600

    Add docstrings here and there

commit a957d442a8
Author: Paul Romano <paul.k.romano@gmail.com>
Date:   Wed Jan 17 12:18:11 2018 -0600

    Special treatment for a single radial/axial region in fuel pins

commit dac1af47ad
Author: Paul Romano <paul.k.romano@gmail.com>
Date:   Wed Jan 17 06:54:24 2018 -0600

    Add number of rings/axial segments as command-line options

commit c1082420e4
Author: Paul Romano <paul.k.romano@gmail.com>
Date:   Wed Jan 17 06:47:03 2018 -0600

    Use argparse in build-fresh.py

commit a20d15c0cb
Author: Paul Romano <paul.k.romano@gmail.com>
Date:   Wed Jan 17 06:27:01 2018 -0600

    Make number of rings configurable

commit 96b1ae8513
Author: Paul Romano <paul.k.romano@gmail.com>
Date:   Tue Jan 16 22:44:15 2018 -0600

    Generate pin universes within function

commit 0b1965e27f
Author: Paul Romano <paul.k.romano@gmail.com>
Date:   Tue Jan 16 22:28:44 2018 -0600

    Put geometry and reflector/assembly universes in functions

commit 337d4cff69
Author: Paul Romano <paul.k.romano@gmail.com>
Date:   Wed Nov 22 12:22:17 2017 -0600

    Make sure sleeve appears on fifth grid spacer

commit 46e379e169
Author: Paul Romano <paul.k.romano@gmail.com>
Date:   Tue Nov 14 14:54:14 2017 -0600

    Don't break up fuel region over multiple universes in z direction

commit 7e735bec85
Author: Paul Romano <paul.k.romano@gmail.com>
Date:   Fri Nov 10 11:49:36 2017 -0600

    Fix number of pellets in SMR

commit 186c525c8a
Author: Paul Romano <paul.k.romano@gmail.com>
Date:   Thu Nov 2 23:27:48 2017 -0500

    Add axial subdivision of fuel pins

commit 6762ab0237
Author: Paul Romano <paul.k.romano@gmail.com>
Date:   Fri Oct 20 07:54:57 2017 -0400

    Add ten rings in fuel
2018-02-05 09:26:05 -06:00

216 lines
8.3 KiB
Python

"""Instantiate the main core lattice."""
import numpy as np
import openmc
from .materials import mats
from .surfaces import surfs, lattice_pitch
from .reflector import reflector_universes
from .assemblies import assembly_universes
def core_geometry(num_rings, num_axial, depleted):
"""Generate full core SMR geometry.
Parameters
----------
num_rings : int
Number of annual regions in fuel
num_axial : int
Number of axial subdivisions in fuel
depleted : bool
Whether fuel should contain nuclides as though it were depleted
Returns
-------
openmc.Geometry
SMR full core geometry
"""
assembly = assembly_universes(num_rings, num_axial, depleted)
reflector = reflector_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(reflector['solid'], (9, 9))
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[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[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[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[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[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[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[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']
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
root_univ = openmc.Universe(universe_id=0, name='root universe')
# 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)
# 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)
# 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)
# Return geometry
return openmc.Geometry(root_univ)