OpenMC in Google Colaboratory

Hi all,

I prepared this Google Colaboratory notebook that installs OpenMC from Github.

https://colab.research.google.com/drive/1jS-C2RoXmnv0Pmped8WHMSo5Bj79FyOg

Installing OpenMC and the ENDF/B-VII.1 nuclear data files takes about 6 minutes. It can be reduced to 2.5 minutes if the preprocessed HDF5 nuclear data files are downloaded from Google Drive.

If you are unfamiliar with Colaboratory, it’s a cloud service to run Python notebooks on Google computers. The notebooks are saved on Google Drive, but the files are not permanent (if you want to save the output, you have to either download it to your computer or upload it to your Drive). To run the notebook save it first to your drive with “File -> Save a copy in Drive…” and then run it with “Runtime -> Run all”.

Perhaps it is not for everyday use, but for workshops or classes it is much easier to deploy than installing on each computer or sharing a VM.

Have fun,
Ignacio

1 Like

Thanks for sharing this Ignacio! Definitely a great option for workshops.

Excellent!
Tested and working perfectly!!!

Add these line for linking cross sections
materials_file.cross_sections=’/content/openmc/build/nndc_hdf5/cross_sections.xml’

Thanks to point that out!

I forgot to add the line:

%cd /content

after make install to return to the base directory. Now the data files are installed in the correct place.

One possible improvement is to make a deb file for OpenMC and the HDF5 files. That would make installation much simpler (although I am not sure what are the limits of space in lauchpad to distribute the nuclear data there).

Best,
Ignacio