mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-27 13:45:36 -04:00
If source rate is 0, don't run OpenMC transport solve
This commit is contained in:
parent
fe12fb1e96
commit
0a3c4e489a
1 changed files with 10 additions and 1 deletions
|
|
@ -276,6 +276,16 @@ class Operator(TransportOperator):
|
|||
Eigenvalue and reaction rates resulting from transport operator
|
||||
|
||||
"""
|
||||
# Reset results in OpenMC
|
||||
openmc.lib.reset()
|
||||
|
||||
# If the source rate is zero, return zero reaction rates without running
|
||||
# a transport solve
|
||||
if power == 0.0:
|
||||
rates = self.reaction_rates.copy()
|
||||
rates.fill(0.0)
|
||||
return OperatorResult(ufloat(0.0, 0.0), rates)
|
||||
|
||||
# Prevent OpenMC from complaining about re-creating tallies
|
||||
openmc.reset_auto_ids()
|
||||
|
||||
|
|
@ -290,7 +300,6 @@ class Operator(TransportOperator):
|
|||
self._yield_helper.update_tally_nuclides(nuclides)
|
||||
|
||||
# Run OpenMC
|
||||
openmc.lib.reset()
|
||||
openmc.lib.run()
|
||||
openmc.lib.reset_timers()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue