Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 26 additions & 1 deletion src/tallies/tally.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -535,6 +535,7 @@ void Tally::set_scores(const vector<std::string>& 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;
Expand All @@ -555,6 +556,8 @@ void Tally::set_scores(const vector<std::string>& scores)
surface_present = true;
} else if (filt->type() == FilterType::MESH_SURFACE) {
meshsurface_present = true;
} else if (filt->type() == FilterType::PARTICLE) {
particle_present = true;
}
}

Expand Down Expand Up @@ -624,8 +627,30 @@ void Tally::set_scores(const vector<std::string>& scores)
break;

case HEATING:
if (settings::photon_transport)
if (settings::photon_transport) {
estimator_ = TallyEstimator::COLLISION;
if (particle_present) {
const auto particles = get_filter<ParticleFilter>()->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) {
if (!electron_present)
warning(fmt::format(
"Tally {} contains heating score with photon bin but "
"without electron bin.",
id_));
if (!positron_present)
warning(fmt::format(
"Tally {} contains heating score with photon bin but "
"without positron bin.",
id_));
warning("Forgetting to specify charged particles in particle "
"filter when using heating score is a common gotcha.");
}
}
}
}
break;

case SCORE_PULSE_HEIGHT:
Expand Down
Loading