openmc-dev / openmc

OpenMC Monte Carlo Code
https://docs.openmc.org
Other
729 stars 464 forks source link

Add helpful error message for when num_delayed_groups=0 but MDGXS present #2818

Open gridley opened 6 months ago

gridley commented 6 months ago

Description

When a delayed group tally such as 'decay-rate' is present in an mgxs.Library object, we rely on num_delayed_groups being greater than zero. When creating the tallies, a mysterious error arises if a user has forgot to set the number of delayed groups to the correct value:

  File "/home/gavin/.local/lib/python3.10/site-packages/openmc/mgxs/library.py", line 588, in add_to_tallies_file
    for tally in mgxs.tallies.values():
  File "/home/gavin/.local/lib/python3.10/site-packages/openmc/mgxs/mgxs.py", line 594, in tallies
    zip(self.scores, self.tally_keys, self.filters, estimators)
TypeError: 'NoneType' object is not iterable

We should explicitly check for this condition and raise a more useful message if so.

vanessalulla commented 3 months ago

Hi, is this issue still open?