Custom cross section files

Hi,

I was trying to use a custom cross section file in a simulation, but I can’t get it to work. It’s an ACE file (it’s supposed to be an ideal 1/v absorber) and I used the openmc-ace-to-hdf5 script to convert it to a h5 file. (in the first line of the file I specified 40096.71c, which is Zr96 nuclide), so what I did then was change the cross_sections.xml file so that Zr96 points to my custom xs file (I named it test.h5).

I then ran a simple simulation in OpenMC 0.9 (latest version). The geometry was simple - a cube, and I only used one material. Now, when I run the simulation, with verbosity set to 10, it starts, but no reactions happen. (the neutrons only enter the cell and get reflected around, and from time to time I get
(n,disappear) with Zr96. Energy = 2.50000E+06 eV, which is the energy it started with).

I attached the Jupyter notebook with my simulation and the ideal xs ACE file. Does anyone know why this happens? Is the ACE incorrectly defined or is the problem with OpenMC?

Also, another question that I have is how to create a new custom nuclide. Now, I only changed the cross section data of Zr96, but I guess it still uses the mass and other data from Zr96. Is there a way to define a nuclide with custom mass and other parameters (and which parameters could be specified for it)?

Infinite+slab.pdf (91.2 KB)

ace_a1v (81.8 KB)

I turns out that the way I connected the custom xs file was correct. I just misinterpreted the results that I obtained.

However, there are still a couple of questions on this topic.

  1. How is the cutoff parameter in the settings file implemented? I created a custom xs file, where the only possible reaction for the neutrons is elastic scattering. Now, when I run, the neutron keep getting elastically scattered until they undergo maximum number of events. I tried specifying the cutoff energy, so that neutrons are killed when the energy is low, but it doesn’t work. Does the cutoff energy paramter work in this case? Or do I also need to specify some absorption cross section so that the neutrons can also get absorbed.

  2. As I understand it, OpenMC automatically calculats the mass of the nuclide, when given an xs file (because you need to specify a valid header i.e. 40096.71c for Zr96). Is it possible and how difficult would it be to make a work around in the source, so that you could specify your own mass?

Hi Juan,

From the Python API, you would do:

settings = openmc.Settings()
settings.cutoff = {‘energy’: X}

where X is the energy in eV.

It wouldn’t be terribly difficult to make a workaround in the source to change the mass of a nuclide, especially if you wanted to do it only for a single nuclide. You could also change the mass in the HDF5 nuclear data file directly. The mass is stored as an attribute called ‘atomic_weight_ratio’ on the main group in a file. For example, if you wanted to change the mass of U235, you’d have to change that attribute on the /U235 group in the HDF5 file. You could either make that change through HDF5 directly, or via the Python API with something like:

u235 = openmc.data.IncidentNeutron.from_hdf5(‘U235.h5’)
u235.atomic_weight_ratio = 100.0
u235.export_to_hdf5(‘U235_new.h5’)

Best,
Paul

Hi Paul,

Thanks for the quick reply.

I’ve been using the cutoff parameter in the settings file, but it didn’t work because I had {energy: X} instead of {‘energy’: X}. Now it works correctly.
I think that the IncidentNeutron class is just what I need - I can import xs data from ACE, edit it, and then export it to HDF5.

I still have one question. Currently, I am editing the cross_sections.xml the following way:

I am assigning my custom xs file (ztest.h5) to actual nuclide names (i.e. Zr96). If I try to create another entry in the cross_sections.xml file, like:

and I specify call the nuclide from the python API:

zr = openmc.Nuclide(“Zr96_test”)

I get the following error, when starting OpenMC

ERROR: The group ‘Zr96_test’ does not exist.

Is there a way to do this, without getting errors?

Best regards,
Juan

There has to be a one-to-one correspondence between 1) the name that you use in the Nuclide class, 2) the name listed in cross_sections.xml, and 3) the name that actually appears in the HDF5 file. Right now, you have the first two consistent, but the name in the HDF5 file is still Zr96, which is why it fails saying it can’t find a Zr96_test group. To change the name in the file, once again you can use the IncidentNeutron class:

zr96_test = openmc.data.IncidentNeutron.from_hdf5(‘zr96.h5’)
zr96_test.name = ‘Zr96_test’

zr96_test.export_to_hdf5(‘zr96_test.h5’)

Hope that helps!

I just tried it and using custom cross sections now works.
Thank you!

Best regards,
Juan