Difference between sum and atom/b-cm when setting density

Hi all,

so i’m struggling to understand how the density should be set. so i have a set of number densities for the elements in my fuel and i set them up like this
fuel.add_nuclide(‘U234’,1.6447E-06)
fuel.add_nuclide(‘U235’,2.2148E-05)
fuel.add_nuclide(‘U236’,2.7420E-06)
fuel.add_nuclide(‘U238’,1.5602E-02) etc.
so when setting the density
do i say
fuel.set_density(‘atom/b-m’,sum of number density)
or
fuel.set_density(‘sum’,num of number densities)

1 Like

Hi,

The first parameter set_density of should be units, which you can choose from ‘g/cm3’ , ‘kg/m3’ , ‘atom/b-cm’ , ‘sum’ *, etc.
When you use ‘sum’, there’s no need to add the second parameter, density.

You may check openmc.Material — OpenMC Documentation for more info.

Best regards,
Chelsea

1 Like

To further clarify, when ‘sum’ is used, the values that you enter are for add_nuclide are assumed to be in units of atom/b-cm.

1 Like

what if i don’t specify the density? and just say ‘fuel.add_nuclide(‘U234’,1.6447E-06)…etc’ does it take the number as atom/b-cm? cause i have used density numbers not typical concentration

Yes, by default if you don’t specify density it assumes the ‘sum’ option where the individual values for nuclides are atom/b-cm.

1 Like

Taking advantage of this trend, I like to ask if defining a material like this is ok (e.g. meaning putting the material density in g/cc, and the nuclides in atom/b-cm?) Thanks!

fuel1.set_density(‘g/cm3’, 10.30166)
fuel1.add_nuclide(‘O16’, 4.5853e-02)
fuel1.add_nuclide(‘O17’, 1.7420e-05)
fuel1.add_nuclide(‘O18’, 9.1942e-05)
fuel1.add_nuclide(‘U234’, 5.7987e-06)
fuel1.add_nuclide(‘U235’, 7.2175e-04)
fuel1.add_nuclide(‘U238’, 2.2253e-02)

@augusto_vib Yes, that is completely ok. When you specify a material density in g/cm³, the individual values for each nuclide will be renormalized at runtime. This means there may be a small difference between the atom/b-cm values you provided and what’s actually used. If you want to see what would be used, you can call fuel1.get_nuclide_atom_densities().