diff --git a/src/physics.cpp b/src/physics.cpp index 018677a547..e8611dbd72 100644 --- a/src/physics.cpp +++ b/src/physics.cpp @@ -62,13 +62,15 @@ void collision(Particle* p) if (settings::verbosity >= 10 || simulation::trace) { std::stringstream msg; if (p->event_ == EVENT_KILL) { - msg << " " << " Killed. Energy = " << p->E_ << " eV."; + msg << " Killed. Energy = " << p->E_ << " eV."; } else if (p->type_ == Particle::Type::neutron) { msg << " " << reaction_name(p->event_mt_) << " with " << data::nuclides[p->event_nuclide_]->name_ << ". Energy = " << p->E_ << " eV."; - } else { + } else if (p->type_ == Particle::Type::photon) { msg << " " << reaction_name(p->event_mt_) << " with " << data::elements[p->event_nuclide_].name_ << ". Energy = " << p->E_ << " eV."; + } else { + msg << " Disappeared. Energy = " << p->E_ << " eV."; } write_message(msg, 1); } diff --git a/src/tallies/tally.cpp b/src/tallies/tally.cpp index d6ccff0f1b..2cb0945ab3 100644 --- a/src/tallies/tally.cpp +++ b/src/tallies/tally.cpp @@ -9,6 +9,7 @@ #include "openmc/mgxs_interface.h" #include "openmc/nuclide.h" #include "openmc/particle.h" +#include "openmc/reaction.h" #include "openmc/reaction_product.h" #include "openmc/settings.h" #include "openmc/simulation.h" @@ -772,7 +773,7 @@ void read_tallies_xml() case SCORE_PROMPT_NU_FISSION: case SCORE_DECAY_RATE: warning("Particle filter is not used with photon transport" - " on and " + std::to_string(score) + " score."); + " on and " + reaction_name(score) + " score."); break; } } diff --git a/src/tallies/tally_scoring.cpp b/src/tallies/tally_scoring.cpp index 3a759496ba..ea046ed042 100644 --- a/src/tallies/tally_scoring.cpp +++ b/src/tallies/tally_scoring.cpp @@ -1237,31 +1237,33 @@ score_general_ce(Particle* p, int i_tally, int start_index, score -= bank.E; } score *= p->wgt_last_ * flux; - } else if (p->type_ == Particle::Type::photon) { - // Calculate photon heating cross section on-the-fly - score = 0.; - if (i_nuclide >= 0) { - // Find the element corresponding to the nuclide - auto name = data::nuclides[i_nuclide]->name_; - int pos = name.find_first_of("0123456789"); - std::string element = name.substr(0, pos); - int i_element = data::element_map[element]; - auto& heating {data::elements[i_element].heating_}; - auto i_grid = p->photon_xs_[i_element].index_grid; - auto f = p->photon_xs_[i_element].interp_factor; - score = std::exp(heating(i_grid) + f * (heating(i_grid+1) - - heating(i_grid))) * atom_density * flux; - } else { - if (p->material_ != MATERIAL_VOID) { - const Material& material {*model::materials[p->material_]}; - for (auto i = 0; i < material.nuclide_.size(); ++i) { - auto i_element = material.element_[i]; - auto atom_density = material.atom_density_(i); - auto& heating {data::elements[i_element].heating_}; - auto i_grid = p->photon_xs_[i_element].index_grid; - auto f = p->photon_xs_[i_element].interp_factor; - score += std::exp(heating(i_grid) + f * (heating(i_grid+1) - - heating(i_grid))) * atom_density * flux; + } else { + if (p->type_ == Particle::Type::photon) { + // Calculate photon heating cross section on-the-fly + score = 0.; + if (i_nuclide >= 0) { + // Find the element corresponding to the nuclide + auto name = data::nuclides[i_nuclide]->name_; + int pos = name.find_first_of("0123456789"); + std::string element = name.substr(0, pos); + int i_element = data::element_map[element]; + auto& heating {data::elements[i_element].heating_}; + auto i_grid = p->photon_xs_[i_element].index_grid; + auto f = p->photon_xs_[i_element].interp_factor; + score = std::exp(heating(i_grid) + f * (heating(i_grid+1) - + heating(i_grid))) * atom_density * flux; + } else { + if (p->material_ != MATERIAL_VOID) { + const Material& material {*model::materials[p->material_]}; + for (auto i = 0; i < material.nuclide_.size(); ++i) { + auto i_element = material.element_[i]; + auto atom_density = material.atom_density_(i); + auto& heating {data::elements[i_element].heating_}; + auto i_grid = p->photon_xs_[i_element].index_grid; + auto f = p->photon_xs_[i_element].interp_factor; + score += std::exp(heating(i_grid) + f * (heating(i_grid+1) - + heating(i_grid))) * atom_density * flux; + } } } }