Skip to content

Commit

Permalink
Allow source particles with energy below cutoff (will just deposit en…
Browse files Browse the repository at this point in the history
…ergy)
  • Loading branch information
paulromano committed Dec 5, 2022
1 parent d7fc8e5 commit 185920a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
5 changes: 2 additions & 3 deletions docs/source/usersguide/tallies.rst
Original file line number Diff line number Diff line change
Expand Up @@ -269,9 +269,8 @@ The following tables show all valid scores:
|heating |Total nuclear heating in units of eV per source |
| |particle. For neutrons, this corresponds to MT=301 |
| |produced by NJOY's HEATR module while for photons, |
| |this is tallied from either direct photon energy |
| |deposition (analog estimator) or pre-generated |
| |photon heating number. See :ref:`methods_heating` |
| |this is tallied from direct photon energy |
| |deposition. See :ref:`methods_heating`. |
+----------------------+---------------------------------------------------+
|heating-local |Total nuclear heating in units of eV per source |
| |particle assuming energy from secondary photons is |
Expand Down
7 changes: 2 additions & 5 deletions src/source.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -256,18 +256,15 @@ SourceSite IndependentSource::sample(uint64_t* seed) const
if (xt::any(energies > data::energy_max[p])) {
fatal_error("Source energy above range of energies of at least "
"one cross section table");
} else if (xt::any(energies < data::energy_min[p])) {
fatal_error("Source energy below range of energies of at least "
"one cross section table");
}
}

while (true) {
// Sample energy spectrum
site.E = energy_->sample(seed);

// Resample if energy falls outside minimum or maximum particle energy
if (site.E < data::energy_max[p] && site.E > data::energy_min[p])
// Resample if energy falls above maximum particle energy
if (site.E < data::energy_max[p])
break;

n_reject++;
Expand Down

0 comments on commit 185920a

Please sign in to comment.