From 441fd4f00dfb3cd6f79abc0ad2887b04dd5dbfd8 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Fri, 30 Oct 2015 15:47:01 -0500 Subject: [PATCH] Don't pre-compute kappa-fission cross sections. This also fixes a bug in the kappa-fission score. Before, kappa-fission was computed as Q*fission, but this was done before URR cross sections were determined. Thus, if fission changed in calculate_urr_xs, this wasn't reflected in the kappa-fission score. Now, since it is all done at tally-time, there is no inconsistency. --- src/ace_header.F90 | 2 - src/cross_section.F90 | 13 --- src/tally.F90 | 86 ++++++++++--------- tests/test_many_scores/results_true.dat | 4 +- .../test_score_kappafission/results_true.dat | 20 ++--- 5 files changed, 59 insertions(+), 66 deletions(-) diff --git a/src/ace_header.F90 b/src/ace_header.F90 index 9eadca594..6c27747d8 100644 --- a/src/ace_header.F90 +++ b/src/ace_header.F90 @@ -258,7 +258,6 @@ module ace_header real(8) :: absorption ! microscopic absorption xs real(8) :: fission ! microscopic fission xs real(8) :: nu_fission ! microscopic production xs - real(8) :: kappa_fission ! microscopic energy-released from fission ! Information for S(a,b) use integer :: index_sab ! index in sab_tables (zero means no table) @@ -281,7 +280,6 @@ module ace_header real(8) :: absorption ! macroscopic absorption xs real(8) :: fission ! macroscopic fission xs real(8) :: nu_fission ! macroscopic production xs - real(8) :: kappa_fission ! macroscopic energy-released from fission end type MaterialMacroXS contains diff --git a/src/cross_section.F90 b/src/cross_section.F90 index 03bcefca8..969a397f0 100644 --- a/src/cross_section.F90 +++ b/src/cross_section.F90 @@ -41,7 +41,6 @@ contains material_xs % absorption = ZERO material_xs % fission = ZERO material_xs % nu_fission = ZERO - material_xs % kappa_fission = ZERO ! Exit subroutine if material is void if (p % material == MATERIAL_VOID) return @@ -125,10 +124,6 @@ contains ! Add contributions to material macroscopic nu-fission cross section material_xs % nu_fission = material_xs % nu_fission + & atom_density * micro_xs(i_nuclide) % nu_fission - - ! Add contributions to material macroscopic energy release from fission - material_xs % kappa_fission = material_xs % kappa_fission + & - atom_density * micro_xs(i_nuclide) % kappa_fission end do end subroutine calculate_xs @@ -216,7 +211,6 @@ contains ! Initialize nuclide cross-sections to zero micro_xs(i_nuclide) % fission = ZERO micro_xs(i_nuclide) % nu_fission = ZERO - micro_xs(i_nuclide) % kappa_fission = ZERO ! Calculate microscopic nuclide total cross section micro_xs(i_nuclide) % total = (ONE - f) * nuc % total(i_grid) & @@ -238,13 +232,6 @@ contains ! Calculate microscopic nuclide nu-fission cross section micro_xs(i_nuclide) % nu_fission = (ONE - f) * nuc % nu_fission( & i_grid) + f * nuc % nu_fission(i_grid+1) - - ! Calculate microscopic nuclide kappa-fission cross section - ! The ENDF standard (ENDF-102) states that MT 18 stores - ! the fission energy as the Q_value (fission(1)) - micro_xs(i_nuclide) % kappa_fission = & - nuc % reactions(nuc % index_fission(1)) % Q_value * & - micro_xs(i_nuclide) % fission end if ! If there is S(a,b) data for this nuclide, we need to do a few diff --git a/src/tally.F90 b/src/tally.F90 index 4790a9900..c4ca2028b 100644 --- a/src/tally.F90 +++ b/src/tally.F90 @@ -527,19 +527,11 @@ contains d = t % filters(dg_filter) % int_bins(d_bin) ! Compute the yield for this delayed group -<<<<<<< HEAD - yield = yield_delayed(nuc, E, d) + yield = yield_delayed(nuclides(i_nuclide), E, d) ! Compute the score and tally to bin score = micro_xs(i_nuclide) % fission * yield & - * nu_delayed(nuc, E) * atom_density * flux -======= - yield = yield_delayed(nuclides(i_nuclide), p % E, d) - - ! Compute the score and tally to bin - score = micro_xs(i_nuclide) % fission * yield & - * nu_delayed(nuclides(i_nuclide), p % E) * atom_density * flux ->>>>>>> Make Nuclide%reactions allocatable by using associate constructs + * nu_delayed(nuclides(i_nuclide), E) * atom_density * flux call score_fission_delayed_dg(t, d_bin, score, score_index) end do cycle SCORE_LOOP @@ -547,13 +539,8 @@ contains ! If the delayed group filter is not present, compute the score ! by multiplying the delayed-nu-fission macro xs by the flux -<<<<<<< HEAD - score = micro_xs(i_nuclide) % fission * nu_delayed(nuc, E)& - * atom_density * flux -======= score = micro_xs(i_nuclide) % fission * & - nu_delayed(nuclides(i_nuclide), p % E) * atom_density * flux ->>>>>>> Make Nuclide%reactions allocatable by using associate constructs + nu_delayed(nuclides(i_nuclide), E) * atom_density * flux end if ! Tally is on total nuclides @@ -578,19 +565,11 @@ contains d = t % filters(dg_filter) % int_bins(d_bin) ! Get the yield for the desired nuclide and delayed group -<<<<<<< HEAD - yield = yield_delayed(nuc, E, d) + yield = yield_delayed(nuclides(i_nuc), E, d) ! Compute the score and tally to bin score = micro_xs(i_nuc) % fission * yield & - * nu_delayed(nuc, E) * atom_density_ * flux -======= - yield = yield_delayed(nuclides(i_nuc), p % E, d) - - ! Compute the score and tally to bin - score = micro_xs(i_nuc) % fission * yield & - * nu_delayed(nuclides(i_nuc), p % E) * atom_density_ * flux ->>>>>>> Make Nuclide%reactions allocatable by using associate constructs + * nu_delayed(nuclides(i_nuc), E) * atom_density_ * flux call score_fission_delayed_dg(t, d_bin, score, score_index) end do end do @@ -618,38 +597,67 @@ contains case (SCORE_KAPPA_FISSION) + ! Determine kappa-fission cross section on the fly. The ENDF standard + ! (ENDF-102) states that MT 18 stores the fission energy as the Q_value + ! (fission(1)) + + score = ZERO + if (t % estimator == ESTIMATOR_ANALOG) then if (survival_biasing) then ! No fission events occur if survival biasing is on -- need to ! calculate fraction of absorptions that would have resulted in ! fission scale by kappa-fission - if (micro_xs(p % event_nuclide) % absorption > ZERO) then - score = p % absorb_wgt * & - micro_xs(p % event_nuclide) % kappa_fission / & - micro_xs(p % event_nuclide) % absorption - else - score = ZERO - end if + associate (nuc => nuclides(p % event_nuclide)) + if (micro_xs(p % event_nuclide) % absorption > ZERO .and. & + nuc % fissionable) then + score = p % absorb_wgt * & + nuc%reactions(nuc%index_fission(1))%Q_value * & + micro_xs(p % event_nuclide) % fission / & + micro_xs(p % event_nuclide) % absorption + end if + end associate else ! Skip any non-absorption events if (p % event == EVENT_SCATTER) cycle SCORE_LOOP ! All fission events will contribute, so again we can use ! particle's weight entering the collision as the estimate for ! the fission energy production rate - score = p % last_wgt * & - micro_xs(p % event_nuclide) % kappa_fission / & - micro_xs(p % event_nuclide) % absorption + associate (nuc => nuclides(p % event_nuclide)) + if (nuc % fissionable) then + score = p % last_wgt * & + nuc%reactions(nuc%index_fission(1))%Q_value * & + micro_xs(p % event_nuclide) % fission / & + micro_xs(p % event_nuclide) % absorption + end if + end associate end if else if (i_nuclide > 0) then - score = micro_xs(i_nuclide) % kappa_fission * atom_density * flux + associate (nuc => nuclides(i_nuclide)) + if (nuc % fissionable) then + score = nuc%reactions(nuc%index_fission(1))%Q_value * & + micro_xs(i_nuclide)%fission * atom_density * flux + end if + end associate else - score = material_xs % kappa_fission * flux + do l = 1, materials(p%material)%n_nuclides + ! Determine atom density and index of nuclide + atom_density_ = materials(p%material)%atom_density(l) + i_nuc = materials(p%material)%nuclide(l) + + ! If nuclide is fissionable, accumulate kappa fission + associate(nuc => nuclides(i_nuc)) + if (nuc % fissionable) then + score = score + nuc%reactions(nuc%index_fission(1))%Q_value * & + micro_xs(i_nuc)%fission * atom_density_ * flux + end if + end associate + end do end if end if - case (SCORE_EVENTS) ! Simply count number of scoring events score = ONE diff --git a/tests/test_many_scores/results_true.dat b/tests/test_many_scores/results_true.dat index 9309d0964..0d5dd6e32 100644 --- a/tests/test_many_scores/results_true.dat +++ b/tests/test_many_scores/results_true.dat @@ -33,8 +33,8 @@ tally 1: 7.620560E-01 1.816851E+00 1.102658E+00 -1.338067E+02 -5.986137E+03 +1.337996E+02 +5.985519E+03 2.247257E+01 1.683779E+02 1.512960E-01 diff --git a/tests/test_score_kappafission/results_true.dat b/tests/test_score_kappafission/results_true.dat index 75d37cd87..976eefa36 100644 --- a/tests/test_score_kappafission/results_true.dat +++ b/tests/test_score_kappafission/results_true.dat @@ -1,17 +1,17 @@ k-combined: 9.903196E-01 4.279617E-02 tally 1: -2.266048E+02 -1.049833E+04 +2.266169E+02 +1.049923E+04 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -1.366139E+02 -3.859561E+03 +1.366590E+02 +3.861651E+03 tally 2: -2.402814E+02 -1.174003E+04 +2.403775E+02 +1.175130E+04 0.000000E+00 0.000000E+00 0.000000E+00 @@ -19,11 +19,11 @@ tally 2: 1.270420E+02 3.297537E+03 tally 3: -2.217075E+02 -1.003168E+04 +2.217588E+02 +1.003581E+04 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -1.375693E+02 -3.872389E+03 +1.376303E+02 +3.875598E+03