Good evening all,
I am experiencing an issue while using triggers on particle production scores, (e.g. ‘He3-production’)
The error is as follows
ERROR: Could not find the score “He3-production” in tally 1 but it was listed
in a trigger on that tally
He3-production is indeed the only score listed on that tally. These scores must be implemented differently than others, since if I omit passing a score the trigger, the trigger then works but it looks at the ‘(n,X3He)’ score (which is equivalent) https://www.oecd-nea.org/dbdata/data/manual-endf/endf102_MT.pdf.
This may be a bug I wasn’t able to find anything in the github issues, apologies if I missed it. Wanted to post here first to see if anyone else has ideas.
Here’s a brief example that will cause the issue (v0.14.0 & 0.14.1) (likely other version as well)
import openmc
# materials
Fe = openmc.Material()
Fe.set_density('g/cc', 10)
Fe.add_element('Fe', 1.0)
materials = openmc.Materials([Fe])
# geometry
inner_sphere = openmc.Sphere(r=10)
outer_sphere = openmc.Sphere(r=20, boundary_type='vacuum')
inner_region = -inner_sphere
outer_region = -outer_sphere &+inner_sphere
inner_cell = openmc.Cell(region=inner_region)
outer_cell = openmc.Cell(region=outer_region, fill = Fe)
geometry = openmc.Geometry([inner_cell, outer_cell])
# source
point_source = openmc.IndependentSource()
point_source.space = openmc.stats.Point((0,0,0))
point_source.angle = openmc.stats.Isotropic()
point_source.energy = openmc.stats.Discrete([14.1e6],[1])
# settings
settings = openmc.Settings()
settings.batches = 10
settings.particles = 100
settings.run_mode = 'fixed source'
settings.trigger_active = True
settings.trigger_batch_interval = 10
settings._trigger_max_batches = 30
settings.source = point_source
# tallies
outer_cell_filter = openmc.CellFilter(outer_cell)
he3_production_tally = openmc.Tally(name='he3 production tally')
he3_production_tally.filters = [outer_cell_filter]
he3_production_tally.scores = ['He3-production']
trigger = openmc.Trigger(trigger_type='rel_err', threshold=0.0001)
# this happens for He and H production scores, possibly other particle production scores as well
# other scores work as expected (e.g. flux)
trigger.scores = ['He3-production'] #commenting this out makes it run but changes the trigger to (n,X3He)
he3_production_tally.triggers = [trigger]
tallies = openmc.Tallies([he3_production_tally])
model = openmc.Model(materials=materials, geometry=geometry, settings=settings, tallies=tallies)
model.run()