From 70e9ecf68e22e047dc2042f818c3f0e452e3e00a Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Fri, 9 Dec 2011 16:13:44 -0500 Subject: [PATCH] Pre-calculate microscopic nu-fission cross sections. --- src/DEPENDENCIES | 1 + src/cross_section.F90 | 38 ++++++++++++++++++++++++++++++++++++ src/cross_section_header.F90 | 1 + src/physics.F90 | 5 ++--- 4 files changed, 42 insertions(+), 3 deletions(-) diff --git a/src/DEPENDENCIES b/src/DEPENDENCIES index 5290410fc1..c1a0c2c08f 100644 --- a/src/DEPENDENCIES +++ b/src/DEPENDENCIES @@ -5,6 +5,7 @@ cross_section.o: datatypes_header.o cross_section.o: endf.o cross_section.o: error.o cross_section.o: fileio.o +cross_section.o: fission.o cross_section.o: global.o cross_section.o: material_header.o cross_section.o: output.o diff --git a/src/cross_section.F90 b/src/cross_section.F90 index 48998170a0..86d15ef1d1 100644 --- a/src/cross_section.F90 +++ b/src/cross_section.F90 @@ -9,6 +9,7 @@ module cross_section use endf, only: reaction_name use error, only: fatal_error use fileio, only: read_line, skip_lines + use fission, only: nu_total use global use material_header, only: Material use output, only: write_message @@ -322,12 +323,20 @@ contains nuc % kT = kT nuc % zaid = NXS(2) + ! read all blocks call read_esz(nuc) call read_nu_data(nuc) call read_reactions(nuc) call read_angular_dist(nuc) call read_energy_dist(nuc) call read_unr_res(nuc) + + ! for fissionable nuclides, precalculate microscopic nu-fission cross + ! sections so that we don't need to call the nu_total function during + ! cross section lookups + + if (nuc % fissionable) call generate_nu_fission(nuc) + case (ACE_THERMAL) sab => sab_tables(index_table) sab % name = name @@ -366,6 +375,7 @@ contains allocate(nuc % total(NE)) allocate(nuc % elastic(NE)) allocate(nuc % fission(NE)) + allocate(nuc % nu_fission(NE)) allocate(nuc % absorption(NE)) allocate(nuc % heating(NE)) @@ -373,6 +383,7 @@ contains nuc % total = ZERO nuc % elastic = ZERO nuc % fission = ZERO + nuc % nu_fission = ZERO nuc % absorption = ZERO nuc % heating = ZERO @@ -1106,6 +1117,33 @@ contains end subroutine read_unr_res +!=============================================================================== +! GENERATE_NU_FISSION precalculates the microscopic nu-fission cross section for +! a given nuclide. This is done so that the nu_total function does not need to +! be called during cross section lookups. +!=============================================================================== + + subroutine generate_nu_fission(nuc) + + type(Nuclide), pointer :: nuc + + integer :: i ! index on nuclide energy grid + real(8) :: E ! energy + real(8) :: nu ! # of neutrons per fission + + do i = 1, nuc % n_grid + ! determine energy + E = nuc % energy(i) + + ! determine total nu at given energy + nu = nu_total(nuc, E) + + ! determine nu-fission microscopic cross section + nuc % nu_fission(i) = nu * nuc % fission(i) + end do + + end subroutine generate_nu_fission + !=============================================================================== ! READ_THERMAL_DATA reads elastic and inelastic cross sections and corresponding ! secondary energy/angle distributions derived from experimental S(a,b) diff --git a/src/cross_section_header.F90 b/src/cross_section_header.F90 index 2977231f50..f2a64e306f 100644 --- a/src/cross_section_header.F90 +++ b/src/cross_section_header.F90 @@ -81,6 +81,7 @@ module cross_section_header real(8), allocatable :: total(:) ! total cross section real(8), allocatable :: elastic(:) ! elastic scattering real(8), allocatable :: fission(:) ! fission + real(8), allocatable :: nu_fission(:) ! neutron production real(8), allocatable :: absorption(:) ! absorption (MT > 100) real(8), allocatable :: heating(:) ! heating diff --git a/src/physics.F90 b/src/physics.F90 index f27b67ef1d..04c829ff86 100644 --- a/src/physics.F90 +++ b/src/physics.F90 @@ -231,7 +231,6 @@ contains real(8) :: f_sab ! interp factor on S(a,b) energy grid real(8) :: inelastic ! S(a,b) inelastic cross section real(8) :: elastic ! S(a,b) elastic cross section - real(8) :: nu ! total # of neutrons emitted per fission type(Nuclide), pointer :: nuc => null() type(SAB_Table), pointer :: sab => null() @@ -274,8 +273,8 @@ contains (ONE-f) * nuc % fission(IE) + f * nuc % fission(IE+1) ! Calculate microscopic nuclide nu-fission cross section - nu = nu_total(nuc, p % E) - micro_xs(index_nuclide) % nu_fission = nu * micro_xs(index_nuclide) % fission + micro_xs(index_nuclide) % nu_fission = & + (ONE-f) * nuc % nu_fission(IE) + f * nuc % nu_fission(IE+1) end if ! If there is S(a,b) data for this nuclide, we need to do a few