V 13.3 Setting of volume in cells manually doesn't work with .get_nuclides_densities

Hello!! I’m using a model in which the volume of a cell is going to change, more specifically it’s going to decrease, leading to a theoretical major concentration of Uranium in the cell (as it’s made of an homogeneous material with several nuclides in it). The thing is the results are not satisfactory, and when I try to compare the densities of the nuclides changing the cell’s volume, it raises an error:

/openmc/universe.py", line 485, in get_nuclide_densities
raise RuntimeError(

RuntimeError: Volume information is needed to calculate microscopic cross sections for universe 1. This can be done by running a stochastic volume calculation via the openmc.VolumeCalculation object

So in the documentation is said that we can add the volume manually, without stochastic calculation ,but when I do it using the variable of a cell openmc.Cell.volume it shows the same error. I could use this method, but I think it can be computationally expensive, anyone have some advice over this??

poison = openmc.Material(name='Boron')
poison.add_element('B', 1, 'ao')

  
U_nopoison = openmc.Material(name = 'Uranium')
U_nopoison.add_element('U', 1, 'ao')

U = openmc.Material.mix_materials([U_nopoison, poison], [1-poison_core_moy/1000000, poison_core_moy/1000000], 'ao')


a = 10 # cm (base)
b = 10 # cm (height, we would variate this)

left = openmc.XPlane(x0 = -a/2, boundary_type = 'vacuum')
right = openm.XPlane(x0 = a/2, boundary_type = 'vacuum')

top = openmc.YPlane(y0 = -a/2, boundary_type = 'vacuum')
bot = openm.YPlane(y0 = a/2, boundary_type = 'vacuum')

z1 = openmc.ZPlane(z0 = -b/2, boundary_type = 'vacuum')
z2 = openm.ZPlane(z0 = b/2, boundary_type = 'vacuum')

core_region = +left & -right & +bot & -top & +z1 & -z2

core = openmc.Cell(name = 'core', fill = U, region = core_region)
core.volume = a**2 * b


rt_universe = openmc.Universe(cells = [core, moderator])
print(rt_universe.get_nuclide_densities())

Hi @gwill704 and welcome to the community! The problem you’re running into is that you are calling universe.get_nuclide_densities(), which does indeed require information from a stochastic volume calculation. The reason is that a universe with multiple cells does not have a uniform composition throughout, and so in order to determine nuclide densities it needs to know both the absolute number of atoms of each nuclide and the volume. While you can set the volume manually, the number of atoms of each nuclide needs to be set from a stochastic volume calculation.

2 Likes

Hi Paul! Thank you for your quick response!
Okay, I understand. I have some questions if you could answer please.
So this call I was using for making sure the uranium is more concentrated, (is more dense) with the same volume proportion in a smaller volume. Is that true??
Because the calculation for the k_eff is lower decreasing the volume and it shouldn’t.

Thank you for your time, I’m glad to be part of this community!!

Materials are specified through number densities, which means if you don’t modify a material composition but decrease the volume, the density will not increase. You would have to manually increase the density of the material if you want to preserve the total mass.

Thank you so much!! You saved me a lot of time

1 Like