Skip to content

Commit 4d7223b

Browse files
committed
wip
1 parent 93767c8 commit 4d7223b

1 file changed

Lines changed: 8 additions & 5 deletions

File tree

src/tallies/tally_scoring.cpp

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2808,14 +2808,16 @@ void score_point_tally(
28082808
p.E(), mu, E_cm, p.current_seed());
28092809
Direction v_out = std::sqrt(E_cm) * u_cm + v_cm;
28102810
E = std::pow(v_out.norm(), 2);
2811-
return pdf0 *
2812-
(std::sqrt(E / E_cm) / (1 - mu / (awr + 1) * std::sqrt(E_in / E)));
2811+
double jac =
2812+
std::sqrt(E / E_cm) / (1 - mu / (awr + 1) * std::sqrt(E_in / E));
2813+
return pdf0 * std::abs(jac) / (2.0 * PI);
28132814
};
28142815
score_point_tally_impl(p.r(), p.type(), p.time(), pdf);
28152816
} else {
28162817
auto pdf = [&](Direction u, double& E) {
28172818
return rx.products_[i_product].sample_energy_and_pdf(
2818-
p.E(), u.dot(p.u()), E, p.current_seed());
2819+
p.E(), u.dot(p.u()), E, p.current_seed()) /
2820+
(2.0 * PI);
28192821
};
28202822
score_point_tally_impl(p.r(), p.type(), p.time(), pdf);
28212823
}
@@ -2840,8 +2842,9 @@ void score_point_tally(Particle& p, int i_nuclide, const ThermalData& sab,
28402842
sab.sample_energy_and_pdf(micro, p.E(), mu, E_cm, p.current_seed());
28412843
Direction v_out = std::sqrt(E_cm) * u_cm + v_cm;
28422844
E = std::pow(v_out.norm(), 2);
2843-
return pdf0 *
2844-
(std::sqrt(E / E_cm) / (1 - mu / (awr + 1) * std::sqrt(E_in / E)));
2845+
double jac =
2846+
std::sqrt(E / E_cm) / (1 - mu / (awr + 1) * std::sqrt(E_in / E));
2847+
return pdf0 * std::abs(jac) / (2.0 * PI);
28452848
};
28462849

28472850
score_point_tally_impl(p.r(), p.type(), p.time(), pdf);

0 commit comments

Comments
 (0)