From d3750c185f03e5d1cf457ec3678e60a0e8c517d5 Mon Sep 17 00:00:00 2001 From: Sterling Harper Date: Thu, 3 Mar 2016 11:55:04 -0500 Subject: [PATCH 1/2] Correct another divide by zero error --- src/tally.F90 | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/tally.F90 b/src/tally.F90 index 4dea2e249f..019d2d69e2 100644 --- a/src/tally.F90 +++ b/src/tally.F90 @@ -2350,7 +2350,8 @@ contains case (SCORE_TOTAL) if (i_nuclide == -1 .and. & - materials(p % material) % id == deriv % diff_material) then + materials(p % material) % id == deriv % diff_material .and. & + material_xs % total /= ZERO) then score = score * (deriv % flux_deriv & + micro_xs(deriv % diff_nuclide) % total & / material_xs % total) @@ -2363,7 +2364,8 @@ contains case (SCORE_ABSORPTION) if (i_nuclide == -1 .and. & - materials(p % material) % id == deriv % diff_material) then + materials(p % material) % id == deriv % diff_material .and. & + material_xs % absorption /= ZERO) then score = score * (deriv % flux_deriv & + micro_xs(deriv % diff_nuclide) % absorption & / material_xs % absorption ) @@ -2376,7 +2378,8 @@ contains case (SCORE_FISSION) if (i_nuclide == -1 .and. & - materials(p % material) % id == deriv % diff_material) then + materials(p % material) % id == deriv % diff_material .and. & + material_xs % fission /= ZERO) then score = score * (deriv % flux_deriv & + micro_xs(deriv % diff_nuclide) % fission & / material_xs % fission) @@ -2389,7 +2392,9 @@ contains case (SCORE_NU_FISSION) if (i_nuclide == -1 .and. & - materials(p % material) % id == deriv % diff_material) then + materials(p % material) % id == deriv % diff_material .and. & + material_xs % nu_fission /= ZERO) then + write(*, *) micro_xs(deriv % diff_nuclide) % nu_fission score = score * (deriv % flux_deriv & + micro_xs(deriv % diff_nuclide) % nu_fission & / material_xs % nu_fission) From 4ec05c643fef40fd66b1681fe36771504eae8c85 Mon Sep 17 00:00:00 2001 From: Sterling Harper Date: Mon, 18 Apr 2016 14:41:22 -0400 Subject: [PATCH 2/2] Add collision-estimated scattering derivatives --- src/tally.F90 | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/src/tally.F90 b/src/tally.F90 index 9f2bdc4a3a..0a6603f39b 100644 --- a/src/tally.F90 +++ b/src/tally.F90 @@ -3068,6 +3068,16 @@ contains score = score * deriv % flux_deriv end if + case (SCORE_SCATTER) + if (materials(p % material) % id == deriv % diff_material & + .and. material_xs % total - material_xs % absorption /= ZERO) & + then + score = score * (deriv % flux_deriv + ONE & + / materials(p % material) % density_gpcc) + else + score = score * deriv % flux_deriv + end if + case (SCORE_ABSORPTION) if (materials(p % material) % id == deriv % diff_material & .and. material_xs % absorption /= ZERO) then @@ -3146,6 +3156,22 @@ contains score = score * deriv % flux_deriv end if + case (SCORE_SCATTER) + if (i_nuclide == -1 .and. & + materials(p % material) % id == deriv % diff_material .and. & + material_xs % total - material_xs % absorption /= ZERO) then + score = score * (deriv % flux_deriv & + + (micro_xs(deriv % diff_nuclide) % total & + - micro_xs(deriv % diff_nuclide) % absorption) & + / (material_xs % total - material_xs % absorption)) + else if (scoring_diff_nuclide .and. & + (micro_xs(deriv % diff_nuclide) % total & + - micro_xs(deriv % diff_nuclide) % absorption) /= ZERO) then + score = score * (deriv % flux_deriv + ONE / atom_density) + else + score = score * deriv % flux_deriv + end if + case (SCORE_ABSORPTION) if (i_nuclide == -1 .and. & materials(p % material) % id == deriv % diff_material .and. & @@ -3178,7 +3204,6 @@ contains if (i_nuclide == -1 .and. & materials(p % material) % id == deriv % diff_material .and. & material_xs % nu_fission /= ZERO) then - write(*, *) micro_xs(deriv % diff_nuclide) % nu_fission score = score * (deriv % flux_deriv & + micro_xs(deriv % diff_nuclide) % nu_fission & / material_xs % nu_fission)