Hey guys,
I have made a model of a reactor in CAD, and my project is to explore the dagmc/cubit toolchain in order to simulate the neutronics on the cad geometry in OpenMC.
To start, I am only trying to import one fuel volume. I’ve separated this volume from the rest of the model, exported it as a .sat file, and followed the openmc-specific steps (found here: Code-Specific steps for OpenMC — DAGMC) and then the pre-processing steps for cubit (found here: Cubit basics — DAGMC). The result is my fuel volume surrounded by a cuboid of finite thickness. First I save the model as a .h5m file, then using the command below, I exported this file as dagmc.h5m:
export dagmc dagmc.h5m
This starts a faceting process which takes a few minutes, then I move this file into the same directoy as my .py file for the openmc simulation. Using the code below, I only want to check that the geometry was created correctly:
import matplotlib
import openmc
u235 = openmc.Material(name="fuel")
u235.add_nuclide('U235', 1.0, 'ao')
u235.set_density('g/cc', 11)
mats = openmc.Materials([u235])
mats.export_to_xml()
settings = openmc.Settings()
settings.dagmc = True
settings.batches = 10
settings.inactive = 2
settings.particles = 5000
settings.export_to_xml()
p = openmc.Plot()
p.width = (25.0, 25.0)
p.pixels = (400, 400)
p.color_by = 'material'
p.colors = {u235: 'yellow'}
openmc.plot_geometry()
Running this .py file gives the following output:
| The OpenMC Monte Carlo Code
Copyright | 2011-2021 MIT and OpenMC contributors
License | https://docs.openmc.org/en/latest/license.html
Version | 0.12.1
Git SHA1 | 36913589c4f43b7f843332181645241f0f10ae9e
Date/Time | 2021-08-10 14:25:16
OpenMP Threads | 6
Reading settings XML file...
Reading cross sections XML file...
Reading materials XML file...
Reading DAGMC geometry...
Using the DOUBLE-DOWN interface to Embree.
Loading file dagmc.h5m
Initializing the GeomQueryTool...
Using faceting tolerance: 0.001
Building acceleration data structures...
Traceback (most recent call last):
File "salt.py", line 27, in <module>
openmc.plot_geometry()
File "/opt/conda/lib/python3.7/site-packages/openmc/executor.py", line 59, in plot_geometry
_run([openmc_exec, '-p'], output, cwd)
File "/opt/conda/lib/python3.7/site-packages/openmc/executor.py", line 38, in _run
raise RuntimeError(error_msg)
RuntimeError: OpenMC aborted unexpectedly.
Looking at the documentation here (openmc.plot_geometry — OpenMC Documentation), it seems like a RuntimeError from plot_geometry() means “openmc executable returns a non-zero status”. Feedback/thoughts on my approach to dagmc and on what might be going wrong would be appreciated.
Thanks for your time,
Luke