RuntimeError: OpenMC aborted unexpectedly with .plot() error

I’m trying to run and plot the example for the SFR, I altered it a bit. but I’m having trouble running the .plot() function specifically for

main_in_u.plot(origin = (0,0,0), pixels=(500, 500), width = (30.,30.), color_by = ‘material’)

main_out_u.plot(origin = (0,0,0), pixels=(500, 500), width = (30.,30.), color_by = ‘material’)

main_u.plot(origin = (0,0,0), pixels=(1000, 1000), width = (660.,660.), color_by = ‘material’)

but I get the error code:

Traceback (most recent call last):
File “//Library/CloudStorage/OneDrive-/openMC - code research/openMC/SFR - openmc copy.py”, line 140, in
main_in_u.plot(origin= (0,0,0), pixels=(500,500), width=(30,30), color_by=‘material’)
File “//anaconda3/envs/openmc-env/lib/python3.12/site-packages/openmc/universe.py", line 446, in plot
model.plot_geometry(False, cwd=tmpdir, openmc_exec=openmc_exec)
File "/
/anaconda3/envs/openmc-env/lib/python3.12/site-packages/openmc/model/model.py”, line 828, in plot_geometry
openmc.plot_geometry(output=output, openmc_exec=openmc_exec)
File “//anaconda3/envs/openmc-env/lib/python3.12/site-packages/openmc/executor.py", line 154, in plot_geometry
_run(args, output, cwd)
File "/
/anaconda3/envs/openmc-env/lib/python3.12/site-packages/openmc/executor.py”, line 125, in _run
raise RuntimeError(error_msg)
RuntimeError: OpenMC aborted unexpectedly.

Process finished with exit code 1

Then, trying to fix the problem, I did:

geom_main_in = openmc.Geometry(main_in_u)

Export the geometry to XML

geom_main_in.export_to_xml()

Plot the geometry

openmc.plot_geometry()

but I got the same error code.

If I comment out these three plots, I am able to run the code fully through and get k values.

please help!! I have uploaded by code below.

SFR - openmc copy.py (8.7 KB)

1 Like

Could you come up with a solution?? Please let me know. I’m facing the same issue.

I’m not sure if this will solve the error as the error message doesn’t give much info, but perhaps it is worth trying to install libpng. You can see libpng is mentioned in the optional section of the install docs.

https://docs.openmc.org/en/stable/usersguide/install.html

I tired installing libpng using " sudo apt install libpng-dev " but I got this error
The operation couldn’t be completed. Unable to locate a Java Runtime.

Please visit http://www.java.com for information on installing Java.

I figured it was because I am using conda, so I activated the environment : openmc-env and implemented pip install libpng , where it said I already had it installed.

I jsut tried running the code again, and I got the same error again (the same one that Peshwah_Rafi has)

1 Like