openmc-dev / openmc

OpenMC Monte Carlo Code
https://docs.openmc.org
Other
729 stars 464 forks source link

Generation of MGXS libraries for material cells fails because tallies for all cells are required #1700

Open GiudGiud opened 3 years ago

GiudGiud commented 3 years ago

When generating per-cell MGXS libraries for heterogeneous transport calculations, it's normal to assume that you only need to specify all the material cells for the list of domains of a mgxs, and not all the cells. For a PWR, all the cells would create a lot of redundancy, you would have the homogenized cross sections at every level: fuel, fuel pin, assembly, lattice of assemblies, full core. Arguably, you could be using distribcells for that purpose instead.

However, with the changes (number 2) in #1557, when loading the mgxs, the code will try finding tallies for every cell, starting by the root cell. I understand the need for homogenization capabilities at the (universe filled) cell level. It adds a little flexibility to essentially tallying MGXS by universes, and it's more convenient to have both homogenized and heterogeneous XS in the same library.

I think we should consider adding a "material-cell" option for MGXS libraries, to keep the generation of heterogeneous libraries simple. An alternative option would be to disallow setting a domain type (here, cells) and an inconsistent list of domains (here, material cells) at the MGXS library (tally) creation time. Also I think the "unable to find tally" log should be clearer, it probably should give out all the information about the tally it was searching for. @nelsonag what do you think?

nelsonag commented 3 years ago

@GiudGiud I think both are pretty good ideas. We'd just need to make sure the documentation is clear on what a "material-cell" is since its new terminology.