From 409798260fb31c10d8a0d67033c220be1fdc5f09 Mon Sep 17 00:00:00 2001 From: Joffrey Dorville Date: Mon, 22 Sep 2025 10:48:43 -0500 Subject: [PATCH 1/7] Store the delayed group number of the neutron that created the fission event --- include/openmc/ifp.h | 7 +++---- include/openmc/particle_data.h | 1 + src/ifp.cpp | 4 ++-- src/physics.cpp | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/include/openmc/ifp.h b/include/openmc/ifp.h index 633a262d5f9..01904d13c94 100644 --- a/include/openmc/ifp.h +++ b/include/openmc/ifp.h @@ -68,15 +68,14 @@ vector _ifp(const T& value, const vector& 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(); diff --git a/include/openmc/particle_data.h b/include/openmc/particle_data.h index 1a22f583798..afcd5647674 100644 --- a/include/openmc/particle_data.h +++ b/include/openmc/particle_data.h @@ -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 diff --git a/src/ifp.cpp b/src/ifp.cpp index 1f81f26f6ea..cc4a76538b1 100644 --- a/src/ifp.cpp +++ b/src/ifp.cpp @@ -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 = diff --git a/src/physics.cpp b/src/physics.cpp index f667fd586d7..eec7ac0c4a4 100644 --- a/src/physics.cpp +++ b/src/physics.cpp @@ -246,7 +246,7 @@ 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); From 7c08b9ab81ed2d8cdc714dce5cf75c8275a25fc8 Mon Sep 17 00:00:00 2001 From: Joffrey Dorville Date: Mon, 22 Sep 2025 11:15:35 -0500 Subject: [PATCH 2/7] Update regression tests --- tests/regression_tests/ifp/results_true.dat | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/regression_tests/ifp/results_true.dat b/tests/regression_tests/ifp/results_true.dat index 1d8f69e1251..19780fa987c 100644 --- a/tests/regression_tests/ifp/results_true.dat +++ b/tests/regression_tests/ifp/results_true.dat @@ -3,7 +3,7 @@ k-combined: tally 1: 9.109384E-08 5.667165E-16 -6.500000E-02 -6.710000E-04 +3.800000E-02 +2.820000E-04 1.489000E+01 1.480036E+01 From 002ae2ddd473265a3bab2b41493bea8e2f37cc83 Mon Sep 17 00:00:00 2001 From: Joffrey Dorville Date: Mon, 22 Sep 2025 15:28:30 -0500 Subject: [PATCH 3/7] Make sure to pass the correct delayed group info to particles from source --- src/particle.cpp | 1 + src/physics.cpp | 7 ++----- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/particle.cpp b/src/particle.cpp index f5ad45d80fe..402af2498a5 100644 --- a/src/particle.cpp +++ b/src/particle.cpp @@ -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) { diff --git a/src/physics.cpp b/src/physics.cpp index eec7ac0c4a4..e947fecbb9c 100644 --- a/src/physics.cpp +++ b/src/physics.cpp @@ -252,12 +252,9 @@ void create_fission_sites(Particle& p, int i_nuclide, const Reaction& rx) 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 From f7e2a04b5254ebed95df28e850698f96a71516e2 Mon Sep 17 00:00:00 2001 From: Joffrey Dorville Date: Mon, 22 Sep 2025 15:29:56 -0500 Subject: [PATCH 4/7] Update regression tests --- tests/regression_tests/ifp/results_true.dat | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/regression_tests/ifp/results_true.dat b/tests/regression_tests/ifp/results_true.dat index 19780fa987c..466ca1f015e 100644 --- a/tests/regression_tests/ifp/results_true.dat +++ b/tests/regression_tests/ifp/results_true.dat @@ -3,7 +3,7 @@ k-combined: tally 1: 9.109384E-08 5.667165E-16 -3.800000E-02 -2.820000E-04 +5.200000E-02 +5.420000E-04 1.489000E+01 1.480036E+01 From eb6628a2d0f7f9aaab08adea15ae12bb935f1847 Mon Sep 17 00:00:00 2001 From: Joffrey Dorville Date: Wed, 24 Sep 2025 14:07:05 -0500 Subject: [PATCH 5/7] Update surface source write regression tests because of the new way to initialize the delayed group --- .../case-03/surface_source_true.h5 | Bin 33344 -> 33344 bytes .../case-04/surface_source_true.h5 | Bin 33344 -> 33344 bytes .../case-05/surface_source_true.h5 | Bin 33344 -> 33344 bytes .../case-07/surface_source_true.h5 | Bin 33344 -> 33344 bytes .../case-08/surface_source_true.h5 | Bin 33344 -> 33344 bytes .../case-09/surface_source_true.h5 | Bin 33344 -> 33344 bytes .../case-10/surface_source_true.h5 | Bin 33344 -> 33344 bytes .../case-12/surface_source_true.h5 | Bin 33344 -> 33344 bytes .../case-13/surface_source_true.h5 | Bin 33344 -> 33344 bytes .../case-14/surface_source_true.h5 | Bin 33344 -> 33344 bytes .../case-a01/surface_source_true.h5 | Bin 6720 -> 6720 bytes 11 files changed, 0 insertions(+), 0 deletions(-) diff --git a/tests/regression_tests/surface_source_write/case-03/surface_source_true.h5 b/tests/regression_tests/surface_source_write/case-03/surface_source_true.h5 index 4dd5f821af92dd98395a8df31af2a81fab8a8ba4..228f5a7d0a462f38a1cb0b4274dd40d4307b5a12 100644 GIT binary patch delta 42 ycmX@m!gQd8X@dwmbDaH^&Eo8yDU2+W6SL1VvTZiZaTj7_nw%&gzj;R83T6N=*$u}4 delta 48 zcmX@m!gQd8X@dwm^EJ&=o5k5ZQzln%3QR7@J}|k1S75V4j)f42F}XlMVDpT+70dv* Csu83B diff --git a/tests/regression_tests/surface_source_write/case-04/surface_source_true.h5 b/tests/regression_tests/surface_source_write/case-04/surface_source_true.h5 index ee00af3895c349d60d786af1aedef39e05e24d20..c276af40f4302f4e0feff883bc3c472bc4df7ca1 100644 GIT binary patch delta 38 ucmX@m!gQd8X@dwmbDaH^&Eo8xzKkrB7lxc?WZPUAI-ie`X|rI8z8nArx(svx delta 44 xcmX@m!gQd8X@dwm^L5Qro5k5XeJ59N3QXP*a$vFtm%!$R&|0h5VN3AkPef$3?Q>mU+^N7 CA`&M6 diff --git a/tests/regression_tests/surface_source_write/case-12/surface_source_true.h5 b/tests/regression_tests/surface_source_write/case-12/surface_source_true.h5 index ca5eda8e2f347a1fc88b05db6690ad5b6d3a2a51..6c6925daba145c5db52a281023dd017f066e0732 100644 GIT binary patch delta 117 zcmX@m!gQd8X@dwmbAtVq&Eo8lQj<>z2yAXpOweRx+5FH;oYOG=2mfb3*B|@WHpD(y z^yT0FTL*$W*`i%Qt;HW$zbo>Udt8lS9X5&5&?bMwZEqk?BA) UUPkiE0XaX*)4?VeR9xT$0J0-9HUIzs delta 124 zcmV-?0E7R)gaW{X0a}p%0E$1%ExYoLO_SJDO6Vllc)#~laN_h elc)#~qxe}KlPD=5lYkHilOT9N0RppOc;5**VKsyR diff --git a/tests/regression_tests/surface_source_write/case-13/surface_source_true.h5 b/tests/regression_tests/surface_source_write/case-13/surface_source_true.h5 index ca5eda8e2f347a1fc88b05db6690ad5b6d3a2a51..6c6925daba145c5db52a281023dd017f066e0732 100644 GIT binary patch delta 117 zcmX@m!gQd8X@dwmbAtVq&Eo8lQj<>z2yAXpOweRx+5FH;oYOG=2mfb3*B|@WHpD(y z^yT0FTL*$W*`i%Qt;HW$zbo>Udt8lS9X5&5&?bMwZEqk?BA) UUPkiE0XaX*)4?VeR9xT$0J0-9HUIzs delta 124 zcmV-?0E7R)gaW{X0a}p%0E$1%ExYoLO_SJDO6Vllc)#~laN_h elc)#~qxe}KlPD=5lYkHilOT9N0RppOc;5**VKsyR diff --git a/tests/regression_tests/surface_source_write/case-14/surface_source_true.h5 b/tests/regression_tests/surface_source_write/case-14/surface_source_true.h5 index c9900bd9c0469d3b171f863f0518d6c94e966027..6c6925daba145c5db52a281023dd017f066e0732 100644 GIT binary patch delta 117 zcmX@m!gQd8X@dwmbAtVq&Eo8lQj<>z2yAXpOweRx+5FH;oYOG=2mfb3*B|@WHpD(y z^yT0FTL*$W*`i%Qt;HW$zbo>Udt8lS9X5&5&?bMwZEqk?BA) UUPkiE0XaX*)4?VeR9xT$0J0-9HUIzs delta 124 zcmV-?0E7R)gaW{X0a}p%0E$1%ExYoLO_SJDO6Vllc)#~laN_h elc)#~qxe}KlPD=5lYkHilOT9N0RppOc;5**(=~+v diff --git a/tests/regression_tests/surface_source_write/case-a01/surface_source_true.h5 b/tests/regression_tests/surface_source_write/case-a01/surface_source_true.h5 index 8dc148ee07eb33d6374387e557b35914f5fa2003..da36fc505eb67f3da0ce48511464b699a4fb16e3 100644 GIT binary patch delta 70 zcmX?La=>JR2s?9<{gut)?19XaFK}f{&fv<}Y{8wtJxM%c@(i(z$rph10tuivkhTEQ W1(F$)IV3$8StcLklb?J;G6MjFG#L5- delta 68 zcmX?La=>JR2s`s*%~PAj*#ns;U*O7^oWYf`*@8QPdy;s@ Date: Wed, 24 Sep 2025 14:20:25 -0500 Subject: [PATCH 6/7] Update surface source write regression tests - event mode --- .../case-e01/surface_source_true.h5 | Bin 33344 -> 33344 bytes .../case-e02/surface_source_true.h5 | Bin 33344 -> 33344 bytes .../case-e03/surface_source_true.h5 | Bin 33344 -> 33344 bytes 3 files changed, 0 insertions(+), 0 deletions(-) diff --git a/tests/regression_tests/surface_source_write/case-e01/surface_source_true.h5 b/tests/regression_tests/surface_source_write/case-e01/surface_source_true.h5 index 0dda15ed2192739435e8f50e126831021d620f53..bbfbd152bc6543871750cb9bd4cc55fe0899754a 100644 GIT binary patch delta 39 vcmX@m!gQd8X@dwm^L6Jdo5k5Vtr*!hD>|xkF|us-^iEf2WZJy3sGlDI{ml#e delta 45 zcmV+|0Mh@!gaW{X0|xkF|us-^iEf2WZJy3sGlDI{ml#e delta 45 zcmV+|0Mh@!gaW{X0|fgu z`(V+RfBSD82<~KyeqpaT&*);s!pHXSSC}u~^zD?rU%;v3d2LP(9h)bH)H5-%Y!(bR wXPmsFL|}77#0D`CW3ohk#N->+5}P~ne=vh(CKPKhf^3?6!Bk-Ljgkyr09VyO4FCWD delta 148 zcmX@m!gQd8X@dwm^Bj*eo5k5BRTx<|8*2A+P4 Date: Wed, 24 Sep 2025 14:27:44 -0500 Subject: [PATCH 7/7] Update surface source write regression tests - DAGMC --- .../case-d07/surface_source_true.h5 | Bin 33344 -> 33344 bytes .../case-d08/surface_source_true.h5 | Bin 33344 -> 33344 bytes 2 files changed, 0 insertions(+), 0 deletions(-) diff --git a/tests/regression_tests/surface_source_write/case-d07/surface_source_true.h5 b/tests/regression_tests/surface_source_write/case-d07/surface_source_true.h5 index 7ab2e2c807b2f2080745d6cd48db84e75f9a21b0..fd9f0dc572af098b9d8a53fd7c1311f3bf4dd28f 100644 GIT binary patch delta 242 zcmX@m!gQd8X@dwmGo#y;&Eo7og)PGbBCg9+i90axa|q4m=RCjw24)US+`6a5+%D{Y z{BY@Q**UNFr<}|)+&t^P{T2SR7Ip5*j(aD2O6zmoH+?WoO;XI^xBlcNX+6d(lQ#kd zmpu;m&foCG{?fh4ucYX>K%LUYL4oBy*u_xg7`DD%%1Q6vVXpy?7Ij1?@Ya&Zg=K`&foCGUf}-ZSJHay^ESNO9MxAl*L;*XO>X>K%KZYL4oBy*u{Hg7`DD%%1Q6ynnu+?7Ij1?@Ya&ZgX>K%LUYL4oBy*u_xg7`DD%%1Q6vVXpy?7Ij1?@Ya&Zg=K`&foCGUf}-ZSJHay^ESNO9MxAl*L;*XO>X>K%KZYL4oBy*u{Hg7`DD%%1Q6ynnu+?7Ij1?@Ya&ZgLSiQX