Modification of "differentiate_burnable_mats" in depletion

Hi @andrewjohnson,

I found that _differentiate_burnable_mats method cannot calculate material volume correctly, if different cells contain the same material. For example, in the following case, volume of a depletable material will be divided multiple times by its num_instances and those cells that appears only once will not be assigned a new cloned material even this material appears multiple times. (some cell ids are shown in this figure colored by material)

I recommend the following modification which assigns correct material volume to all the cells containing the same burnable material. And then users only need to know that in openmc depletion, the volume of a depletable material will be evenly distributed to all cell instances filled by it, which can avoid misunderstanding and unexpected depletion results.

2 Likes

Hi @kingyue. This change seems to make sense to me. Are you able to make a pull request with this change? If not, let us know and either @andrewjohnson or I can submit a PR on your behalf.

Thanks, Paul. I’ve opened a pull request