mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-28 22:26:08 -04:00
Evaluate neutron xs once per reaction in sample_photon_product
This commit is contained in:
parent
c44bea2556
commit
5f90fe3a9d
1 changed files with 5 additions and 3 deletions
|
|
@ -551,12 +551,14 @@ void sample_photon_product(int i_nuclide, double E, int* i_rx, int* i_product)
|
|||
// if energy is below threshold for this reaction, skip it
|
||||
if (i_grid < threshold) continue;
|
||||
|
||||
// Evaluate neutron cross section
|
||||
double xs = ((1.0 - f) * rx->xs_[i_temp-1].value[i_grid - threshold]
|
||||
+ f*(rx->xs_[i_temp-1].value[i_grid - threshold + 1]));
|
||||
|
||||
for (int j = 0; j < rx->products_.size(); ++j) {
|
||||
if (rx->products_[j].particle_ == ParticleType::photon) {
|
||||
// add to cumulative probability
|
||||
double yield = (*rx->products_[j].yield_)(E);
|
||||
prob += ((1.0 - f) * rx->xs_[i_temp-1].value[i_grid - threshold]
|
||||
+ f*(rx->xs_[i_temp-1].value[i_grid - threshold + 1])) * yield;
|
||||
prob += (*rx->products_[j].yield_)(E) * xs;
|
||||
|
||||
*i_rx = i;
|
||||
*i_product = j;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue