How does OpenMC's renormalization of densities work?

I’m trying to understand how OpenMC handles density inputs when the density units are set before adding nuclides/elements. For example, we define the fuel for a fuel pin below:

# 1.6 enriched fuel
fuel = openmc.Material(name='1.6% Fuel')
fuel.set_density('g/cm3', 10.31341)
fuel.add_nuclide('U235', 3.7503e-4)
fuel.add_nuclide('U238', 2.2625e-2)
fuel.add_nuclide('O16', 4.6007e-2)

When I look at the documentation for openMC.material.add_nuclide, it says that the default unit for the second input of add_nuclide will be atom percent, so if we input the densities as above, does OpenMC sum those three floats, and their densities will be the relative percentages to the total for each nuclide input, and then that proportion of the total will be the nuclide density in g/cm3?

e.g. U235 density in g/cm3 would be calculated as 10.313 * 3.74e^-4/(sum of nuclide density inputs)?

What you said is almost correct. The values that are provided in the add_nuclide method are interpreted as relative values that are normalized by the total density. The one exception is if you use ‘sum’ units (fuel.set_density('sum')) in which case the values given in add_nuclide are interpreted as absolute atom/b-cm values. In your case, 3.7503e-4/(sum of nuclide density inputs) of the atoms will be U235, but that is different than saying that the density of U235 is 10.313 times that percentage. If you specify the nuclide densities in weight percent (fuel.add_nuclide('U235', value, 'wo'), then the U235 density would be 10.313 times the corresponding fraction. If you don’t specify ‘wo’, the default is ‘ao’ which is atom fraction.