RuntimeError: Could not find cell 0 specified on tally filter

Hello. I am typing the following program for a very simple criticality calculation:

import openmc
import openmc.deplete
import matplotlib.pyplot as plt

fissile = openmc.Material(1,“fissile”)
fissile.add_element(‘U’, 1.0, enrichment=15.0)
fissile.add_element(‘O’, 2.0)
fissile.add_element(‘Na’,0.5)
fissile.set_density(‘g/cm3’,6.0)
fissile.temperature = 900

materials_file = openmc.Materials([fissile,])
materials_file.export_to_xml()

fissile_z0 = openmc.ZPlane(z0=-50, boundary_type = ‘vacuum’)
fissile_z1 = openmc.ZPlane(z0=50, boundary_type = ‘vacuum’)
fissile_r = openmc.ZCylinder(r=150, boundary_type = ‘vacuum’)

fissile_cell = openmc.Cell(fill= fissile)
fissile_cell.region = -fissile_r & -fissile_z1 & +fissile_z0
fissile_u = openmc.Universe(cells=[fissile_cell,])

geometry = openmc.Geometry(fissile_u)
geometry.export_to_xml()

OpenMC simulation parameters

lower_left = [-150, -150, -50]
upper_right = [150, 150, 50]

space = openmc.stats.Box(lower_left, upper_right)
source = openmc.IndependentSource(space=space, constraints={‘fissionable’: True})
settings = openmc.Settings()
settings.space= space
settings.source = source
settings.batches = 100
settings.inactive = 10
settings.particles = 1000
settings.temperature = {‘method’: ‘interpolation’}

model = openmc.Model(geometry=geometry, settings=settings)

settings.export_to_xml()

openmc.run()

However when I run it, it replies:
RuntimeError: Could not find cell 0 specified on tally filter.

Maybe it is something about the new edition of OpenMC, maybe it need a few additions. Can someone help me?

Hi Nick,
Have you tried to run those scripts on a new working directory? I didn’t see any tally declaration in your input, so I think the problem is there is a tally.xml file in your current working directory that might have come from another openmc input script you have done before or it may come from another model.xml file exist in your current folder. Try those scripts in a clean fresh folder. I hope it can help you to localize the problem if it exists on your openmc input script.

You are right! I deleted some some junk tally files and other junk files from previous simulations from the container and now it works! Thank you wahidluthfi! Problem solved!

1 Like