"Volume not specified for material ID=2" even after assigning volume to mix material

Hello, everyone.

I am also facing the same problem but my problem is that I’m using mix_materials command. Here is a glimpse of my code:

Fuel Element [UO2 - 3.6 wt% U-235]

FE_Z36 = openmc.Material(name = “FE-Z36”, temperature = 1073 )
FE_Z36.add_nuclide(‘U235’, 0.036)
FE_Z36.add_nuclide(‘U238’, 0.964)
FE_Z36.add_nuclide(‘O16’, 2.0)
FE_Z36.set_density(‘g/cc’, 10.2)

Fuel Element [UO2 - 4.4 wt% U-235]

FE_Z44 = openmc.Material(name = “FE-Z44”, temperature = 1073 )
FE_Z44.add_nuclide(‘U235’, 0.044,‘wo’)
FE_Z44.add_nuclide(‘U238’, 0.956, ‘wo’)
FE_Z44.add_nuclide(‘O16’, 2.0, ‘wo’)
FE_Z44.set_density(‘g/cc’, 10.2)

Gadolina Gd2O3

GD = openmc.Material(name = “Gadolina”, temperature = 1073 )
GD.add_element(‘Gd’, 2.0,‘wo’)
GD.add_element(‘O’, 3.0, ‘wo’)
GD.set_density(‘g/cc’, 7.407)

Mixture [3.6wt% U235 and 5wt% Gd2O3]

FUG_Z36G5 = openmc.Material.mix_materials([FE_Z36, GD], [0.95, 0.05], ‘wo’)

As I am trying to deplete these materials in a hexagonal assembly, “Volume not specified for material ID=2” (FE_Z36) keeps on coming. I understand that its a depletable material but I am using it as a part of a mixture and I am defining “FUG_Z36G5” volume. If I define FE_Z36 volume as well, won’t there be an error in the result as the same material will be depleted twice?

I have seen the problem “Volume not specified for depletable material with ID=2 - #5 by hhhnain” but my problem is very much different than this one.

I tend to assign volumes to all the cells.

Then i fill the cells with any material, these can be single materials used on multiple cells or mixed made from other materials, but they should be depletable=True

Then i make the model and call this method on the model to make sure each cell has a single depletable material.

model.differentiate_depletable_mats(diff_volume_method=‘match cells’)

Thank you for your reply. So I should just assign volume to all depletable material and it should not affect my burnup results? As I have only used the mixed material in my geometry?

I would have thought that if you are only making use of FUG_Z36G5 then you would just need to set the volume for FUG_Z36G5.

Yes, I was doing so, thinking the same, however, openMC keeps on saying that all these materials need volume. I solved this issue by removing the mix material command and defining the mixed material with their atom densities directly. Although I’m not getting my desired Keff graph till now.

Are you able to share the full script