diff --git a/src/tallies/tally.cpp b/src/tallies/tally.cpp index 2432f5c2f18..465ac643493 100644 --- a/src/tallies/tally.cpp +++ b/src/tallies/tally.cpp @@ -535,6 +535,7 @@ void Tally::set_scores(const vector& scores) bool legendre_present = false; bool cell_present = false; bool cellfrom_present = false; + bool particle_present = false; bool surface_present = false; bool meshsurface_present = false; bool non_cell_energy_present = false; @@ -555,6 +556,8 @@ void Tally::set_scores(const vector& scores) surface_present = true; } else if (filt->type() == FilterType::MESH_SURFACE) { meshsurface_present = true; + } else if (filt->type() == FilterType::PARTICLE) { + particle_present = true; } } @@ -624,8 +627,33 @@ void Tally::set_scores(const vector& scores) break; case HEATING: - if (settings::photon_transport) + if (settings::photon_transport) { estimator_ = TallyEstimator::COLLISION; + if (particle_present) { + const auto particles = get_filter()->particles(); + if (contains(particles, ParticleType::photon())) { + bool electron_present = + contains(particles, ParticleType::electron()); + bool positron_present = + contains(particles, ParticleType::positron()); + if (!positron_present || !electron_present) { + std::string missing_bins; + if (!electron_present) { + missing_bins += "electron bin"; + if (!positron_present) + missing_bins += " and positron bin"; + } else { + missing_bins += "positron bin"; + } + warning(fmt::format( + "Tally {} contains heating score with photon bin but " + "without {}. A significant heating contribution might be " + "missing!", + id_, missing_bins)); + } + } + } + } break; case SCORE_PULSE_HEIGHT: