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
30 changes: 29 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,33 @@ 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) {
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:
Expand Down
Loading