Can anyone tell me why openmc is aborting and how do i fix this?
RuntimeError Traceback (most recent call last)
in
177
178 settings_file.export_to_xml()
→ 179 openmc.run()
~/miniconda3/lib/python3.9/site-packages/openmc/executor.py in run(particles, threads, geometry_debug, restart_file, tracks, output, cwd, openmc_exec, mpi_args, event_based)
225 args = mpi_args + args
226
→ 227 _run(args, output, cwd)
~/miniconda3/lib/python3.9/site-packages/openmc/executor.py in _run(args, output, cwd)
36 error_msg = ’ '.join(error_msg.split())
37
—> 38 raise RuntimeError(error_msg)
39
40
RuntimeError: OpenMC aborted unexpectedly.
The code is given below
%matplotlib inline
import openmc
import math
import openmc.deplete
###############################################################################
#Simulation Input File Parameters
###############################################################################
#OpenMC simulation parameters
batches = 100
inactive = 10
particles = 1000
###############################################################################
#Exporting to OpenMC materials.xml file
###############################################################################
#Instantiate some Materials and register the appropriate Nuclides
#uranium oxycarbide composition
uco=openmc.Material()
uco.add_nuclide( ‘U235’,13.86, ‘wo’)
uco.add_nuclide(‘U238’,75.59,‘wo’)
uco.add_nuclide(‘C12’,5.275,‘wo’)
uco.add_nuclide(‘O16’,5.275,‘wo’)
uco.set_density(‘g/cm3’, 10.4)
uco.deplete = True
uco.volume = 4.02e-5
#uraniom dioxide composition
uo2=openmc.Material()
uo2.add_nuclide(‘U235’,13.66,‘wo’)
uo2.add_nuclide(‘U238’,74.47,‘wo’)
uo2.add_nuclide(‘O16’,11.87, ‘wo’)
uo2.set_density(‘g/cm3’, 10.4)
uo2.deplete = True
uo2.volume = 4.02e-5
#buffer composition
buffer = openmc.Material()
buffer.add_element(‘C’, 1.0)
buffer.set_density(‘g/cm3’, 1.05)
buffer.temperature=297.0
buffer.add_s_alpha_beta(‘c_Graphite’)
#pyrolytic carbon layer composition
PyC = openmc.Material()
PyC.add_element(‘C’, 1.0)
PyC.set_density(‘g/cm3’, 1.9)
PyC.temperature=297.0
PyC.add_s_alpha_beta(‘c_Graphite’)
#silicon carbide composition
SiC = openmc.Material()
SiC.add_element(‘Si’, 1.0)
SiC.add_element(‘C’, 1.0)
SiC.set_density(‘g/cm3’, 3.2)
#helium gas coolant composition
helium = openmc.Material()
helium.add_element(‘He’, 1.0)
helium.set_density(‘g/cm3’, 0.000178)
#graphite moderator composition
graphite = openmc.Material(name=‘Graphite’)
graphite.add_element(‘C’, 1.0)
graphite.set_density(‘g/cm3’, 5)
graphite.temperature=297.0
graphite.add_s_alpha_beta(‘c_Graphite’)
materials_file = openmc.Materials([uco, uo2, buffer, PyC, SiC, helium,graphite])
materials_file.export_to_xml()
###############################################################################
#Exporting to OpenMC geometry.xml file
###############################################################################
#Instantiate fuel spheres
kernel_sph = openmc.Sphere(r=212.5e-4)
buffer_sph = openmc.Sphere(r=312.5e-4)
IPyC = openmc.Sphere(r=352.5e-4)
siC = openmc.Sphere(r=387.5e-4)
OPyC = openmc.Sphere(r=427.5e-4)
#Instantiate Cells
#Use surface half-spaces to define regions
#Register Materials with Cells
kernel = openmc.Cell(fill = uco,region = -kernel_sph)
buffer = openmc.Cell(fill = buffer,region = +kernel_sph & -buffer_sph)
innerPyC = openmc.Cell(fill = PyC,region = +buffer_sph & -IPyC)
siliconCarbide = openmc.Cell(fill = SiC,region = +IPyC & -siC)
outerPyC = openmc.Cell(fill= PyC,region = +siC & -OPyC)
#Instantiate Universe
triso_universe = openmc.Universe()
#Register Cells with Universe
triso_universe.add_cells([kernel,buffer,innerPyC,siliconCarbide,outerPyC])
triso_colors = {kernel: ‘white’, buffer: ‘gray’, innerPyC: ‘black’, siliconCarbide: ‘turquoise’, outerPyC: ‘black’}
triso_universe.plot(width = (0.1, 0.1), colors = triso_colors)
#Generating TRISO particle sphere in spherical pin cell
particleSurf = openmc.Sphere(r=2.75)
triso_outer_radius = 427.5e-4
centers = openmc.model.pack_spheres(radius=triso_outer_radius, region=-particleSurf, pf=0.0714)
triso_particles = [openmc.model.TRISO(triso_outer_radius, fill=triso_universe, center=c) for c in centers]
len(triso_particles)
lattice_cell = openmc.Cell(region=-particleSurf)
lower_left, upp_right = lattice_cell.region.bounding_box
shape = (4, 4, 4)
pitch = (upp_right - lower_left)/shape
triso_latt = openmc.model.create_triso_lattice(triso_particles, lower_left, pitch, shape, graphite)
lattice_cell.fill = triso_latt
lattice_universe = openmc.Universe(cells=[lattice_cell])
#lattice_universe.plot(width=(7,7), color_by=‘material’, colors = {graphite: (0.08, 0.09, 0.26)})
sphereSurf = openmc.Sphere(r=3.0)
outer_pin_cell = openmc.Cell(fill=graphite, region = +particleSurf & -sphereSurf)
left = openmc.XPlane(x0=-5, boundary_type=‘reflective’)
right = openmc.XPlane(x0=5, boundary_type=‘reflective’)
top = openmc.YPlane(y0=-5, boundary_type=‘reflective’)
bottom = openmc.YPlane(y0=5, boundary_type=‘reflective’)
front = openmc.ZPlane(z0=-5, boundary_type=‘reflective’)
back = openmc.ZPlane(z0=5, boundary_type=‘reflective’)
region = +left & -right & +top & -bottom & +front & -back
coolant = openmc.Cell(fill=helium, region = region & +sphereSurf)
pin_cell_universe = openmc.Universe(cells=[lattice_cell, outer_pin_cell,coolant])
pin_cell_universe.plot(width=(7, 7), color_by=‘cell’, colors = {outer_pin_cell: (0.08, 0.09, 0.26), coolant:‘orange’})
geom = openmc.Geometry(pin_cell_universe)
geom.export_to_xml()
###############################################################################
#Exporting to OpenMC plots.xml file
###############################################################################
plot_xy = openmc.Plot()
plot_xy.basis =‘xz’
plot_xy.origin = [0, 0, 0]
plot_xy.width = [7, 7]
plot_xy.pixels = [300, 300]
plot_xy.color_by=‘material’
plot_xy.colors={graphite: ‘black’, helium:‘orange’}
#Instantiate a Plots collection, add plots, and export to XML
plot_file = openmc.Plots()
plot_file.append(plot_xy)
plot_file.export_to_xml()
#OpenMC simulation parameters
###############################################################################
#Exporting to OpenMC settings.xml file
###############################################################################
#Instantiate a Settings object, set all runtime parameters, and export to XML
settings_file = openmc.Settings()
settings_file.batches = batches
settings_file.inactive = inactive
settings_file.particles = particles
settings_file.temperature = {‘method’:‘interpolation’}
settings_file.output = {‘tallies’: True}
#Create an initial uniform spatial source distribution over fissionable zones
bounds = [-5, -5, -5, 5, 5, 5]
uniform_dist = openmc.stats.Box(bounds[:3], bounds[3:], only_fissionable=True)
settings_file.source = openmc.Source(space=uniform_dist)
settings_file.export_to_xml()
openmc.run()