You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When running a simulation with a heating score split by nuclides or not split by nuclides I am seeing different results in the total heat in the tally
I would expect the heat deposited in the tally is equal to the sum of the heat on all nuclides, this is what I see when I split up a score like '(n,Xt)' across nuclides. They sum to the same value as when there is no splitting by nuclides.
I notice this bug only when photon transport is enabled settings.photon_transport = True
Bug Description
minimal example, run this script, I have two tallies one with nuclides being split and the other without. The tally results are printed as a pandas dataframe and you can see that they don't have the same total heat
importopenmcmaterial=openmc.Material()
material.add_nuclide('Cu63', 1.0)
material.add_nuclide('Cu65', 1.0)
material.set_density('g/cm3', 8.96)
materials=openmc.Materials([material])
sphere=openmc.Sphere(r=10, boundary_type='vacuum')
region=-spherecell=openmc.Cell(region=region, fill=material)
geometry=openmc.Geometry([cell])
settings=openmc.Settings()
settings.particles=1000settings.batches=10settings.inactive=0settings.photon_transport=True# if this is set to False, then the heating tallies matchsettings.run_mode='fixed source'my_source=openmc.IndependentSource()
my_source.space=openmc.stats.Point((0, 0, 0))
my_source.angle=openmc.stats.Isotropic()
settings.source=my_sourceheat_tally=openmc.Tally(name='heating-with-nuclides')
heat_tally.filters= [openmc.CellFilter(cell)]
heat_tally.scores= ['heating']
heat_tally.nuclides= ['Cu63', 'Cu65']
heat_tally2=openmc.Tally(name='heating-without-nuclides')
heat_tally2.filters= [openmc.CellFilter(cell)]
heat_tally2.scores= ['heating']
my_tallies=openmc.Tallies([heat_tally, heat_tally2])
model=openmc.Model(geometry, materials, settings, my_tallies)
sp_filename=model.run()#apply_tally_results = True)sp_tally=openmc.StatePoint(sp_filename).get_tally(name='heating-with-nuclides')
df=sp_tally.get_pandas_dataframe()
print(df)
print()
sp_tally=openmc.StatePoint(sp_filename).get_tally(name='heating-without-nuclides')
df=sp_tally.get_pandas_dataframe()
print(df)
Environment
openmc develop, also tried with last stable release
ubuntu 24.04
The text was updated successfully, but these errors were encountered:
Ah I just realised this is perhaps because photon cross sections are by element not per nuclide. This makes it a bit harder to divide up the heating deposited by a photon to nuclides. Assuming we can find the element that gets the heat deposited then perhaps we could just divide up the heat according to the relative nuclide number density within the element.
When running a simulation with a heating score split by nuclides or not split by nuclides I am seeing different results in the total heat in the tally
I would expect the heat deposited in the tally is equal to the sum of the heat on all nuclides, this is what I see when I split up a score like '(n,Xt)' across nuclides. They sum to the same value as when there is no splitting by nuclides.
I notice this bug only when photon transport is enabled
settings.photon_transport = True
Bug Description
minimal example, run this script, I have two tallies one with nuclides being split and the other without. The tally results are printed as a pandas dataframe and you can see that they don't have the same total heat
Environment
openmc develop, also tried with last stable release
ubuntu 24.04
The text was updated successfully, but these errors were encountered: