mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-26 21:25:36 -04:00
Apply Max Number of Events Check to Random Rays (#3438)
Co-authored-by: Jonathan Shimwell <drshimwell@gmail.com>
This commit is contained in:
parent
f571be87c5
commit
2eeba89992
1 changed files with 6 additions and 0 deletions
|
|
@ -265,6 +265,12 @@ uint64_t RandomRay::transport_history_based_single_ray()
|
|||
if (!alive())
|
||||
break;
|
||||
event_cross_surface();
|
||||
// If ray has too many events, display warning and kill it
|
||||
if (n_event() >= settings::max_particle_events) {
|
||||
warning("Ray " + std::to_string(id()) +
|
||||
" underwent maximum number of events, terminating ray.");
|
||||
wgt() = 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
return n_event();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue