Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions include/openmc/ifp.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,15 +68,14 @@ vector<T> _ifp(const T& value, const vector<T>& data)
//!
//! Add the IFP information in the IFP banks using the same index
//! as the one used to append the fission site to the fission bank.
//! The information stored are the delayed group number and lifetime
//! of the neutron that created the fission event.
//! Multithreading protection is guaranteed by the index returned by the
//! thread_safe_append call in physics.cpp.
//!
//! Needs to be done after the delayed group is found.
//!
//! \param[in] p Particle
//! \param[in] site Fission site
//! \param[in] idx Bank index from the thread_safe_append call in physics.cpp
void ifp(const Particle& p, const SourceSite& site, int64_t idx);
void ifp(const Particle& p, int64_t idx);

//! Resize the IFP banks used in the simulation
void resize_simulation_ifp_banks();
Expand Down
1 change: 1 addition & 0 deletions include/openmc/particle_data.h
Original file line number Diff line number Diff line change
Expand Up @@ -631,6 +631,7 @@ class ParticleData : public GeometryState {
int& event_mt() { return event_mt_; } // MT number of collision
const int& event_mt() const { return event_mt_; }
int& delayed_group() { return delayed_group_; } // delayed group
const int& delayed_group() const { return delayed_group_; }
const int& parent_nuclide() const { return parent_nuclide_; }
int& parent_nuclide() { return parent_nuclide_; } // Parent nuclide

Expand Down
4 changes: 2 additions & 2 deletions src/ifp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ bool is_generation_time_or_both()
return false;
}

void ifp(const Particle& p, const SourceSite& site, int64_t idx)
void ifp(const Particle& p, int64_t idx)
{
if (is_beta_effective_or_both()) {
const auto& delayed_groups =
simulation::ifp_source_delayed_group_bank[p.current_work() - 1];
simulation::ifp_fission_delayed_group_bank[idx] =
_ifp(site.delayed_group, delayed_groups);
_ifp(p.delayed_group(), delayed_groups);
}
if (is_generation_time_or_both()) {
const auto& lifetimes =
Expand Down
1 change: 1 addition & 0 deletions src/particle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ void Particle::from_source(const SourceSite* src)
time() = src->time;
time_last() = src->time;
parent_nuclide() = src->parent_nuclide;
delayed_group() = src->delayed_group;

// Convert signed surface ID to signed index
if (src->surf_id != SURFACE_NONE) {
Expand Down
9 changes: 3 additions & 6 deletions src/physics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -246,18 +246,15 @@ void create_fission_sites(Particle& p, int i_nuclide, const Reaction& rx)
}
// Iterated Fission Probability (IFP) method
if (settings::ifp_on) {
ifp(p, site, idx);
ifp(p, idx);
}
} else {
p.secondary_bank().push_back(site);
}

// Set the delayed group on the particle as well
p.delayed_group() = site.delayed_group;

// Increment the number of neutrons born delayed
if (p.delayed_group() > 0) {
nu_d[p.delayed_group() - 1]++;
if (site.delayed_group > 0) {
nu_d[site.delayed_group - 1]++;
}

// Write fission particles to nuBank
Expand Down
4 changes: 2 additions & 2 deletions tests/regression_tests/ifp/results_true.dat
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ k-combined:
tally 1:
9.109384E-08
5.667165E-16
6.500000E-02
6.710000E-04
5.200000E-02
5.420000E-04
1.489000E+01
1.480036E+01
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.