Add number of rings/axial segments as command-line options
This commit is contained in:
parent
c1082420e4
commit
dac1af47ad
4 changed files with 11 additions and 14 deletions
|
|
@ -20,10 +20,14 @@ parser.add_argument('-m', '--multipole', action='store_true',
|
|||
help='Whether to use multipole cross sections')
|
||||
parser.add_argument('-t', '--tallies', choices=('cell', 'mat'), default='cell',
|
||||
help='Whether to use distribmats or distribcells for tallies')
|
||||
parser.add_argument('-r', '--rings', type=int, default=10,
|
||||
help='Number of annular regions in fuel')
|
||||
parser.add_argument('-a', '--axial', type=int, default=196,
|
||||
help='Number of axial subdivisions in fuel')
|
||||
args = parser.parse_args()
|
||||
|
||||
|
||||
geometry = core_geometry()
|
||||
geometry = core_geometry(args.rings, args.axial)
|
||||
|
||||
#### "Differentiate" the geometry if using distribmats
|
||||
if args.tallies == 'mat':
|
||||
|
|
|
|||
|
|
@ -120,8 +120,8 @@ def make_assembly(name, universes):
|
|||
return universe
|
||||
|
||||
|
||||
def assembly_universes():
|
||||
pins = pin_universes()
|
||||
def assembly_universes(num_rings=10, num_axial=196):
|
||||
pins = pin_universes(num_rings, num_axial)
|
||||
|
||||
# Create dictionary to store assembly universes
|
||||
univs = {}
|
||||
|
|
|
|||
|
|
@ -12,8 +12,8 @@ from .assemblies import assembly_universes
|
|||
|
||||
#### CONSTRUCT MAIN CORE LATTICE
|
||||
|
||||
def core_lattice():
|
||||
assembly = assembly_universes()
|
||||
def core_geometry(num_rings=10, num_axial=196):
|
||||
assembly = assembly_universes(num_rings, num_axial)
|
||||
reflector = reflector_universes()
|
||||
|
||||
core = openmc.RectLattice(name='Main core')
|
||||
|
|
@ -100,12 +100,6 @@ def core_lattice():
|
|||
universes[8, 6] = reflector['8,6']
|
||||
|
||||
core.universes = universes
|
||||
return core
|
||||
|
||||
|
||||
def core_geometry():
|
||||
# Create core lattice
|
||||
core = core_lattice()
|
||||
|
||||
root_univ = openmc.Universe(universe_id=0, name='root universe')
|
||||
|
||||
|
|
|
|||
|
|
@ -142,7 +142,7 @@ def make_pin_stack(name, zsurfaces, universes, boundary, pin_universe):
|
|||
return universe
|
||||
|
||||
|
||||
def pin_universes(num_rings=10):
|
||||
def pin_universes(num_rings=10, num_axial=196):
|
||||
# Create dictionary to store pin universes
|
||||
univs = {}
|
||||
|
||||
|
|
@ -683,8 +683,7 @@ def pin_universes(num_rings=10):
|
|||
|
||||
# Determine z position between each fuel pellet, omitting the surfaces
|
||||
# corresponding to the very bottom and top of the active fuel length
|
||||
n_pellets = 196
|
||||
axial_splits = np.linspace(bottom_fuel_rod, top_active_core, n_pellets + 1)[1:-1]
|
||||
axial_splits = np.linspace(bottom_fuel_rod, top_active_core, num_axial + 1)[1:-1]
|
||||
axial_surfs = [openmc.ZPlane(z0=z) for z in axial_splits]
|
||||
|
||||
# Get z-cylinder surfaces for each ring
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue