mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-28 22:26:08 -04:00
Merge pull request #1911 from paulromano/lost-particle-fix
Ensure particles lost during event_calculate_xs are terminated
This commit is contained in:
commit
3e195382e1
2 changed files with 3 additions and 3 deletions
|
|
@ -95,13 +95,11 @@ void run_particle_restart()
|
|||
int64_t particle_seed;
|
||||
switch (previous_run_mode) {
|
||||
case RunMode::EIGENVALUE:
|
||||
case RunMode::FIXED_SOURCE:
|
||||
particle_seed = (simulation::total_gen + overall_generation() - 1) *
|
||||
settings::n_particles +
|
||||
p.id();
|
||||
break;
|
||||
case RunMode::FIXED_SOURCE:
|
||||
particle_seed = p.id();
|
||||
break;
|
||||
default:
|
||||
throw std::runtime_error {
|
||||
"Unexpected run mode: " +
|
||||
|
|
|
|||
|
|
@ -679,6 +679,8 @@ void transport_history_based_single_particle(Particle& p)
|
|||
{
|
||||
while (true) {
|
||||
p.event_calculate_xs();
|
||||
if (!p.alive())
|
||||
break;
|
||||
p.event_advance();
|
||||
if (p.collision_distance() > p.boundary().distance) {
|
||||
p.event_cross_surface();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue