forked from crp/ecp-benchmarks
Allow configurable fuel in ring radii
This commit is contained in:
parent
314331f275
commit
5481118862
5 changed files with 37 additions and 24 deletions
|
|
@ -9,7 +9,7 @@ from tqdm import tqdm
|
|||
|
||||
import openmc
|
||||
from smr.materials import materials
|
||||
from smr.surfaces import surfs, lattice_pitch, bottom_fuel_stack, top_active_core
|
||||
from smr.surfaces import surfs, lattice_pitch, bottom_fuel_stack, top_active_core, pellet_OR
|
||||
from smr.assemblies import assembly_universes
|
||||
from smr.plots import assembly_plots
|
||||
from smr import inlet_temperature
|
||||
|
|
@ -41,7 +41,8 @@ else:
|
|||
directory.mkdir(exist_ok=True)
|
||||
|
||||
# Define geometry with a single assembly
|
||||
assembly = assembly_universes(args.rings, args.axial, args.depleted)
|
||||
ring_radii = np.sqrt(np.arange(1, args.rings)*pellet_OR**2 / args.rings)
|
||||
assembly = assembly_universes(ring_radii, args.axial, args.depleted)
|
||||
lattice_sides = openmc.model.get_rectangular_prism(lattice_pitch, lattice_pitch,
|
||||
boundary_type='reflective')
|
||||
main_cell = openmc.Cell(
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ import numpy as np
|
|||
import openmc
|
||||
from smr.materials import materials
|
||||
from smr.plots import core_plots
|
||||
from smr.surfaces import lattice_pitch, bottom_fuel_stack, top_active_core
|
||||
from smr.surfaces import lattice_pitch, bottom_fuel_stack, top_active_core, pellet_OR
|
||||
from smr.core import core_geometry
|
||||
from smr import inlet_temperature
|
||||
|
||||
|
|
@ -48,7 +48,8 @@ else:
|
|||
directory = args.output_dir
|
||||
directory.mkdir(exist_ok=True)
|
||||
|
||||
geometry = core_geometry(args.rings, args.axial, args.depleted)
|
||||
ring_radii = np.sqrt(np.arange(1, args.rings)*pellet_OR**2 / args.rings)
|
||||
geometry = core_geometry(ring_radii, args.axial, args.depleted)
|
||||
|
||||
#### "Differentiate" the geometry if using distribmats
|
||||
if args.tallies == 'mat':
|
||||
|
|
|
|||
|
|
@ -120,13 +120,14 @@ def make_assembly(name, universes):
|
|||
return universe
|
||||
|
||||
|
||||
def assembly_universes(num_rings, num_axial, depleted):
|
||||
def assembly_universes(ring_radii, num_axial, depleted):
|
||||
"""Generate universes for SMR fuel assemblies.
|
||||
|
||||
Parameters
|
||||
----------
|
||||
num_rings : int
|
||||
Number of annual regions in fuel
|
||||
ring_radii : iterable of float
|
||||
Radii of rings in fuel (note that this doesn't need to include the
|
||||
full fuel pin radius)
|
||||
num_axial : int
|
||||
Number of axial subdivisions in fuel
|
||||
depleted : bool
|
||||
|
|
@ -138,7 +139,7 @@ def assembly_universes(num_rings, num_axial, depleted):
|
|||
Dictionary mapping a universe name to a openmc.Universe object
|
||||
|
||||
"""
|
||||
pins = pin_universes(num_rings, num_axial, depleted)
|
||||
pins = pin_universes(ring_radii, num_axial, depleted)
|
||||
|
||||
# Create dictionary to store assembly universes
|
||||
univs = {}
|
||||
|
|
|
|||
|
|
@ -10,13 +10,14 @@ from .reflector import reflector_universes
|
|||
from .assemblies import assembly_universes
|
||||
|
||||
|
||||
def core_geometry(num_rings, num_axial, depleted):
|
||||
def core_geometry(ring_radii, num_axial, depleted):
|
||||
"""Generate full core SMR geometry.
|
||||
|
||||
Parameters
|
||||
----------
|
||||
num_rings : int
|
||||
Number of annual regions in fuel
|
||||
ring_radii : iterable of float
|
||||
Radii of rings in fuel (note that this doesn't need to include the
|
||||
full fuel pin radius)
|
||||
num_axial : int
|
||||
Number of axial subdivisions in fuel
|
||||
depleted : bool
|
||||
|
|
@ -28,7 +29,7 @@ def core_geometry(num_rings, num_axial, depleted):
|
|||
SMR full core geometry
|
||||
|
||||
"""
|
||||
assembly = assembly_universes(num_rings, num_axial, depleted)
|
||||
assembly = assembly_universes(ring_radii, num_axial, depleted)
|
||||
reflector = reflector_universes()
|
||||
|
||||
# Construct main core lattice
|
||||
|
|
|
|||
|
|
@ -142,13 +142,14 @@ def make_pin_stack(name, zsurfaces, universes, boundary, fuel_fill):
|
|||
return universe
|
||||
|
||||
|
||||
def pin_universes(num_rings=10, num_axial=196, depleted=False):
|
||||
def pin_universes(ring_radii=None, num_axial=196, depleted=False):
|
||||
"""Generate universes for SMR fuel pins.
|
||||
|
||||
Parameters
|
||||
----------
|
||||
num_rings : int
|
||||
Number of annual regions in fuel
|
||||
ring_radii : iterable of float
|
||||
Radii of rings in fuel (note that this doesn't need to include the
|
||||
full fuel pin radius)
|
||||
num_axial : int
|
||||
Number of axial subdivisions in fuel
|
||||
depleted : bool
|
||||
|
|
@ -706,12 +707,11 @@ def pin_universes(num_rings=10, num_axial=196, depleted=False):
|
|||
axial_splits = np.linspace(bottom_fuel_stack, top_active_core, num_axial + 1)[1:-1]
|
||||
axial_surfs = [openmc.ZPlane(z0=z) for z in axial_splits]
|
||||
|
||||
if num_rings > 1:
|
||||
if ring_radii is not None:
|
||||
# Get z-cylinder surfaces for each ring
|
||||
rings = []
|
||||
for i in range(1, num_rings):
|
||||
R = sqrt(i*pellet_OR**2/num_rings)
|
||||
cyl = openmc.ZCylinder(r=R, name='fuel ring {}'.format(i))
|
||||
for i, r in enumerate(ring_radii):
|
||||
cyl = openmc.ZCylinder(r=r, name='fuel ring {}'.format(i))
|
||||
rings.append(cyl)
|
||||
|
||||
def subdivided_fuel(fill):
|
||||
|
|
@ -719,14 +719,14 @@ def pin_universes(num_rings=10, num_axial=196, depleted=False):
|
|||
uo2_cells = []
|
||||
if num_axial > 1:
|
||||
for axial_region in subdivide(axial_surfs):
|
||||
if num_rings > 1:
|
||||
if ring_radii is not None:
|
||||
for ring_region in subdivide(rings):
|
||||
cell = openmc.Cell(fill=fill, region=axial_region & ring_region)
|
||||
uo2_cells.append(cell)
|
||||
else:
|
||||
uo2_cells.append(openmc.Cell(fill=fill, region=axial_region))
|
||||
else:
|
||||
if num_rings > 1:
|
||||
if ring_radii is not None:
|
||||
for ring_region in subdivide(rings):
|
||||
cell = openmc.Cell(fill=fill, region=ring_region)
|
||||
uo2_cells.append(cell)
|
||||
|
|
@ -737,7 +737,7 @@ def pin_universes(num_rings=10, num_axial=196, depleted=False):
|
|||
|
||||
# If rings/axial segments are present, create a universe for the subdivided
|
||||
# fuel. Otherwise just use a plain material.
|
||||
if num_rings > 1 or num_axial > 1:
|
||||
if ring_radii is not None or num_axial > 1:
|
||||
fuel_fill = subdivided_fuel(mats['UO2 1.6 {}'.format(fuel)])
|
||||
else:
|
||||
fuel_fill = mats['UO2 1.6 {}'.format(fuel)]
|
||||
|
|
@ -829,7 +829,7 @@ def pin_universes(num_rings=10, num_axial=196, depleted=False):
|
|||
|
||||
# If rings/axial segments are present, create a universe for the subdivided
|
||||
# fuel. Otherwise just use a plain material.
|
||||
if num_rings > 1 or num_axial > 1:
|
||||
if ring_radii is not None or num_axial > 1:
|
||||
fuel_fill = subdivided_fuel(mats['UO2 2.4 {}'.format(fuel)])
|
||||
else:
|
||||
fuel_fill = mats['UO2 2.4 {}'.format(fuel)]
|
||||
|
|
@ -875,11 +875,20 @@ def pin_universes(num_rings=10, num_axial=196, depleted=False):
|
|||
|
||||
# If rings/axial segments are present, create a universe for the subdivided
|
||||
# fuel. Otherwise just use a plain material.
|
||||
if num_rings > 1 or num_axial > 1:
|
||||
if ring_radii is not None or num_axial > 1:
|
||||
fuel_fill = subdivided_fuel(mats['UO2 3.1 {}'.format(fuel)])
|
||||
else:
|
||||
fuel_fill = mats['UO2 3.1 {}'.format(fuel)]
|
||||
|
||||
if num_axial > 1:
|
||||
water_cells = []
|
||||
for i, r in enumerate(subdivide(axial_surfs)):
|
||||
cell = openmc.Cell(fill=mats['H2O'], region=r, name=f'Water ({i})')
|
||||
water_cells.append(cell)
|
||||
water_fill = openmc.Universe(cells=water_cells)
|
||||
else:
|
||||
water_fill = mats['H2O']
|
||||
|
||||
# Stack all axial pieces of 3.1% enriched fuel pin cell
|
||||
|
||||
univs['Fuel pin (3.1%) stack'] = make_pin_stack(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue