RuntimeError: Macroscopic can not be used in continuous-energy mode

Hi everyone. I’m trying to run the C5G7 Benchmark model, however I am encountering this error. I understand the issue has something to do with multi-group/continuous energy modes but I don’t know how to resolve it at all.
Any help would be greatly appreciated.

Hi @IRaheel and welcome to the community. The problem you’re encountering is due to a known bug. I just submitted a fix that should resolve this once merged.

In the meantime, if you just want to run the C5G7 model, you can remove the plotting commands that are causing problems.

Hello @paulromano. Thats perfect, thank you for resolving the issue!

I’m afraid I cant seem to continue on with the model as I am also getting this error. Would you be able to offer any guidance on this? Thank you

You need to make sure that:

  1. A MGXSLibrary object was exported to c5g7.h5
  2. You either have set materials.cross_sections = 'c5g7.h5 or set the environment variable OPENMC_MG_CROSS_SECTIONS to the absolute path of that file.

If you’re following the Multigroup Mode Part 1 notebook, this should have been done (exporting the file and setting the materials.cross_sections attribute).

Hmm this is what is baffling me. I have followed the Multigroup Mode Part 1 notebook exactly as it is and ensured both the things you mentioned have been set. Could it be that there is a file load error for mgxs.h5 that states ‘/tasks/mgxs.h5 is not UTF-8 encoded’ if i try to open the file?

Many thanks

.h5 files (HDF5 files) are binary files so there shouldn’t be any issues related to character encoding (which would only affect text files).