Bug Description
Hello. I found a problem with Material.get_photon_contact_dose_rate() after depletion.
Steps to Reproduce
This small example depletes UO2 for one day and then calculates the contact dose rate:
import openmc
import openmc.deplete
fuel = openmc.Material()
fuel.set_density("g/cm3", 10.5)
fuel.add_nuclide("U235", 0.05)
fuel.add_nuclide("U238", 0.95)
fuel.add_nuclide("O16", 2.0)
fuel.volume = 1000.0
fuel.depletable = True
flux = [1.0]
micros = openmc.deplete.MicroXS.from_multigroup_flux(
[0.0, 20.0e6], flux, nuclides=["U235", "U238"], reactions=["fission"]
)
operator = openmc.deplete.IndependentOperator([fuel], [flux], [micros])
integrator = openmc.deplete.PredictorIntegrator(
operator, [1.0], power=1.0e6, timestep_units="d"
)
integrator.integrate(path="depletion_results.h5")
depleted_fuel = openmc.deplete.Results("depletion_results.h5")[-1].get_material(
fuel.id
)
print(depleted_fuel.get_photon_contact_dose_rate())
The last line fails with ValueError: No mass attenuation data available for Z=104.
After depletion, the material contains very small amounts of Rf265 (Z=104), Sg269 (Z=106), and Hs273 (Z=108). For example, Rf265 has density around 2.6e-36 atom/b-cm in this case. get_photon_contact_dose_rate() tries to get mass attenuation data for every nuclide before it checks if the nuclide has a decay-photon source. The bundled attenuation data stops at Z=100, so the calculation crashes because of these trace nuclides.
I think the CDR calculation should still work for the rest of the material in this case, for example by skipping nuclides with no decay-photon source before requesting attenuation data, or by handling missing attenuation data in another way.
Tested with OpenMC 0.16.1.dev8+g7ecd3a961.
Bug Description
Hello. I found a problem with
Material.get_photon_contact_dose_rate()after depletion.Steps to Reproduce
This small example depletes UO2 for one day and then calculates the contact dose rate:
The last line fails with
ValueError: No mass attenuation data available for Z=104.After depletion, the material contains very small amounts of
Rf265(Z=104),Sg269(Z=106), andHs273(Z=108). For example,Rf265has density around2.6e-36 atom/b-cmin this case.get_photon_contact_dose_rate()tries to get mass attenuation data for every nuclide before it checks if the nuclide has a decay-photon source. The bundled attenuation data stops at Z=100, so the calculation crashes because of these trace nuclides.I think the CDR calculation should still work for the rest of the material in this case, for example by skipping nuclides with no decay-photon source before requesting attenuation data, or by handling missing attenuation data in another way.
Tested with OpenMC
0.16.1.dev8+g7ecd3a961.