From daf7bc4955d5d52dd426dd6caa88e324dc37eb82 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Thu, 2 Jun 2022 14:48:16 -0500 Subject: [PATCH] Break up photon heating by nuclide --- src/tallies/tally_scoring.cpp | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/src/tallies/tally_scoring.cpp b/src/tallies/tally_scoring.cpp index c9930ee39..7decf58a4 100644 --- a/src/tallies/tally_scoring.cpp +++ b/src/tallies/tally_scoring.cpp @@ -963,18 +963,23 @@ void score_general_ce_nonanalog(Particle& p, int i_tally, int start_index, score = score_neutron_heating( p, tally, flux, HEATING, i_nuclide, atom_density); } else { - // The energy deposited is the difference between the pre-collision and - // post-collision energy... - score = E - p.E(); + if (i_nuclide < 0 || i_nuclide == p.event_nuclide()) { + // The energy deposited is the difference between the pre-collision + // and post-collision energy... + score = E - p.E(); - // ...less the energy of any secondary particles since they will be - // transported individually later - const auto& bank = p.secondary_bank(); - for (auto it = bank.end() - p.n_bank_second(); it < bank.end(); ++it) { - score -= it->E; + // ...less the energy of any secondary particles since they will be + // transported individually later + const auto& bank = p.secondary_bank(); + for (auto it = bank.end() - p.n_bank_second(); it < bank.end(); + ++it) { + score -= it->E; + } + + score *= p.wgt_last(); + } else { + score = 0.0; } - - score *= p.wgt_last(); } break;