From aade6893b1ae0b5d2585753cff9aa5d5d8473031 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Fri, 15 Jun 2018 14:22:53 -0500 Subject: [PATCH 1/2] Update some comments, move setting zeros to (n,xn) elseif --- src/constants.F90 | 2 +- src/nuclide_header.F90 | 22 ++++++++++++---------- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/src/constants.F90 b/src/constants.F90 index e6dcfe7554..eff1196395 100644 --- a/src/constants.F90 +++ b/src/constants.F90 @@ -219,7 +219,7 @@ module constants N_3HEC = 799, N_A0 = 800, N_AC = 849, N_2N0 = 875, N_2NC = 891 ! Depletion reactions - integer, parameter :: DEPLETION_RX(6) = [N_GAMMA, N_P, N_A,N_2N, N_3N,N_4N] + integer, parameter :: DEPLETION_RX(6) = [N_GAMMA, N_P, N_A, N_2N, N_3N, N_4N] ! ACE table types integer, parameter :: & diff --git a/src/nuclide_header.F90 b/src/nuclide_header.F90 index 33ad2abb62..9406f8b06e 100644 --- a/src/nuclide_header.F90 +++ b/src/nuclide_header.F90 @@ -978,12 +978,10 @@ contains end if end associate - !Depletion-related reactions + ! Depletion-related reactions if (need_depletion_rx) then - !Initialize entire array to zero in case we skip - !any threshold reaction. - micro_xs % reaction(:) = ZERO - !there shouldn't be a threshold check for (n,gamma). + ! Physics says that (n,gamma) is not a threshold reaction, so we don't + ! need to specifically check its threshold index i_rxn = this % reaction_index(DEPLETION_RX(1)) if (i_rxn > 0) then associate (xs => this % reactions(i_rxn) % xs(i_temp)) @@ -992,10 +990,11 @@ contains f * xs % value(i_grid - xs % threshold + 2) end associate end if - !looping from element 2 to element 6. + + ! Loop over remaining depletion reactions do j = 2, 6 - !If reaction is present and energy is greater than threshold, set - !the reaction xs appropriately + ! If reaction is present and energy is greater than threshold, set the + ! reaction xs appropriately i_rxn = this % reaction_index(DEPLETION_RX(j)) if (i_rxn > 0) then associate (xs => this % reactions(i_rxn) % xs(i_temp)) @@ -1003,9 +1002,12 @@ contains micro_xs % reaction(j) = (ONE - f) * & xs % value(i_grid - xs % threshold + 1) + & f * xs % value(i_grid - xs % threshold + 2) - !Check if we are below the (n,2n) and/or (n,3n) reaction thresholds to - !skip remaining depletion-xs construction. elseif (j >= 4) then + ! One can show that the the threshold for (n,(x+1)n) is always + ! higher than the threshold for (n,xn). Thus, if we are below + ! the threshold for, e.g., (n,2n), there is no reason to check + ! the threshold for (n,3n) and (n,4n). + micro_xs % reaction(j:6) = ZERO exit end if end associate From edb4eefbc30444820aec18a3857d8b474a8d76f1 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Fri, 15 Jun 2018 16:02:25 -0500 Subject: [PATCH 2/2] Fix initialization of depletion reaction xs --- src/nuclide_header.F90 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/nuclide_header.F90 b/src/nuclide_header.F90 index 9406f8b06e..5d046dbcc0 100644 --- a/src/nuclide_header.F90 +++ b/src/nuclide_header.F90 @@ -980,6 +980,9 @@ contains ! Depletion-related reactions if (need_depletion_rx) then + ! Initialize all reaction cross sections to zero + micro_xs % reaction(:) = ZERO + ! Physics says that (n,gamma) is not a threshold reaction, so we don't ! need to specifically check its threshold index i_rxn = this % reaction_index(DEPLETION_RX(1)) @@ -1007,7 +1010,6 @@ contains ! higher than the threshold for (n,xn). Thus, if we are below ! the threshold for, e.g., (n,2n), there is no reason to check ! the threshold for (n,3n) and (n,4n). - micro_xs % reaction(j:6) = ZERO exit end if end associate