Bug Description
I was staring at the section on photon heating today and noticed that we may be subtracting too much energy from photon heating tallies when weight windows are applied.
|
case HEATING: |
|
if (p.type() == Type::neutron) { |
|
score = score_neutron_heating( |
|
p, tally, flux, HEATING, i_nuclide, atom_density); |
|
} else { |
|
if (i_nuclide == -1 || 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; |
|
} |
|
|
|
score *= p.wgt_last(); |
|
} else { |
|
score = 0.0; |
|
} |
|
} |
|
break; |
Based on how the n_bank_second attribute is incremented in the Particle::create_secondary method and that this method is applied when splitting particles in weight window application, it seems particles split in application of weight windows will be incorporated into the correction, which I don't believe is correct.
|
for (int l = 0; l < i_split - 1; l++) { |
|
p.create_secondary(weight / n_split, p.u(), p.E(), p.type()); |
|
} |
I'll update this issue when I have more information.
Bug Description
I was staring at the section on photon heating today and noticed that we may be subtracting too much energy from photon heating tallies when weight windows are applied.
openmc/src/tallies/tally_scoring.cpp
Lines 958 to 981 in 2d988a6
Based on how the
n_bank_secondattribute is incremented in theParticle::create_secondarymethod and that this method is applied when splitting particles in weight window application, it seems particles split in application of weight windows will be incorporated into the correction, which I don't believe is correct.openmc/src/weight_windows.cpp
Lines 116 to 118 in 2d988a6
I'll update this issue when I have more information.