From 7d285b418690e97673033aa9446aa8e975a550aa Mon Sep 17 00:00:00 2001 From: Adam G Nelson Date: Tue, 12 Nov 2019 04:50:21 -0600 Subject: [PATCH] Minor comments for delayed group filters --- src/physics_mg.cpp | 6 ++++-- src/tallies/tally_scoring.cpp | 12 ++++++------ 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/physics_mg.cpp b/src/physics_mg.cpp index 9243564312..8808adbb20 100644 --- a/src/physics_mg.cpp +++ b/src/physics_mg.cpp @@ -136,12 +136,14 @@ create_fission_sites(Particle* p, std::vector& bank) site.u.y = std::sqrt(1. - mu * mu) * std::cos(phi); site.u.z = std::sqrt(1. - mu * mu) * std::sin(phi); - // Sample secondary energy distribution for the fission reaction and set - // the energy in the fission bank + // Sample secondary energy distribution for the fission reaction int dg; int gout; data::mg.macro_xs_[p->material_].sample_fission_energy(p->g_, dg, gout); + // Store the energy and delayed groups on the fission bank site.E = gout; + // We add 1 to the delayed_group bc in MG, -1 is prompt, but in the rest + // of the code, 0 is prompt. site.delayed_group = dg + 1; // Set the delayed group on the particle as well diff --git a/src/tallies/tally_scoring.cpp b/src/tallies/tally_scoring.cpp index bbbd5411a8..1d23ebb686 100644 --- a/src/tallies/tally_scoring.cpp +++ b/src/tallies/tally_scoring.cpp @@ -1869,18 +1869,18 @@ score_general_mg(const Particle* p, int i_tally, int start_index, for (auto i = 0; i < p->n_bank_; ++i) { auto i_bank = simulation::fission_bank.size() - p->n_bank_ + i; const auto& bank = simulation::fission_bank[i_bank]; - auto g = bank.delayed_group - 1; - if (g != -1) { + auto d = bank.delayed_group - 1; + if (d != -1) { if (i_nuclide >= 0) { score += simulation::keff * atom_density * bank.wgt * flux * nuc_xs->get_xs(MG_GET_XS_DECAY_RATE, p_g, nullptr, nullptr, - &g) + &d) * nuc_xs->get_xs(MG_GET_XS_FISSION, p_g) / macro_xs->get_xs(MG_GET_XS_FISSION, p_g); } else { score += simulation::keff * bank.wgt * flux * macro_xs->get_xs(MG_GET_XS_DECAY_RATE, p_g, nullptr, - nullptr, &g); + nullptr, &d); } if (tally.delayedgroup_filter_ != C_NONE) { auto i_dg_filt = tally.filters()[tally.delayedgroup_filter_]; @@ -1889,8 +1889,8 @@ score_general_mg(const Particle* p, int i_tally, int start_index, model::tally_filters[i_dg_filt].get())}; // Find the corresponding filter bin and then score for (auto d_bin = 0; d_bin < filt.n_bins(); ++d_bin) { - auto d = filt.groups()[d_bin]; - if (d == g + 1) + auto dg = filt.groups()[d_bin]; + if (dg == d + 1) score_fission_delayed_dg(i_tally, d_bin, score, score_index); }