I think I isolated a case where openmc systematically crashes with a segmentation fault when two materials are burnt (for instance: fuel, and moderator containing burnable absorber) and the temperature setting is set to “interpolation”. The segmentation fault appears just when launching the first flux calculation. If only one of the material is set to deplete, then the calculation proceeds. If the temperature setting is set to default, the calculation proceeds as well.
Attached is a simple PWR 2D pincell case reproducing the issue. depletion.py (1.7 KB)
Setting a temperature range is indeed a wise thing to do as @lorenzo suggests. That being said, OpenMC shouldn’t just flat out segfault in this situation so I’ll look into a smoother way of handling this. Thanks for reporting this @nicolas.martin!
So I looked into this a bit and what is happening the following:
At initialization, when the temperature mode is set to interpolation, OpenMC will scan through materials to see what temperatures are present for each nuclide and load the corresponding datasets for temperatures that bound the temperatures that are present
Nuclides that appear in the fuel but not in the moderator (e.g., U235) have cross sections loaded corresponding to the temperature of the fuel.
For depletion, all nuclides that are present in the depletion chain are added to every depletable material if they are not already present (at a very low concentration). So, this results in nuclides like U235 getting added to the moderator because it is marked at depletable.
However, those nuclides don’t have data loaded at the temperature of the moderator, which is what eventually causes the segfault (a temperature index goes out of bounds on an array)
Coming up with an appropriate solution for this will take a little more time, but I at least wanted to write this all down first while it’s still fresh in my mind.
I’ve noticed a slightly different issue as well with temperature interpolation and multi-group mode, see here. I wonder if these could be fixed in-tandem. I think if you know how, it would be good to make an official GitHub issue. You can even link this forum post in the issue. Then it is more likely a developer will see it and try to fix the problem.
@Justine.L Thanks for checking in on this (also, welcome to the forum!). I just posted a new issue on GitHub so that you can track any progress on this. Unfortunately, there hasn’t been any updates and this issue is indeed still present. The previous suggestion of setting a temperature range should at least give you a workaround for the time being.