Fixed calculation of URR probability table cross sections with smooth factors.

This commit is contained in:
Paul Romano 2012-01-04 14:58:33 -05:00
parent df8ca9f47c
commit e07414a529
3 changed files with 34 additions and 28 deletions

View file

@ -197,6 +197,7 @@ module ace_header
! Information for URR probability table use
logical :: use_ptable ! in URR range with probability tables?
logical :: recalculate ! indicate whether we need to recalculate ptables
end type NuclideMicroXS
!===============================================================================

View file

@ -168,9 +168,11 @@ contains
! probability tables, we need to determine cross sections from the table
if (urr_ptables_on .and. nuc % urr_present) then
if (p % E > nuc % urr_data % energy(1) .and. &
p % E < nuc % urr_data % energy(nuc % urr_data % n_energy)) then
call calculate_urr_xs(p, index_nuclide)
if (micro_xs(index_nuclide) % recalculate) then
if (p % E > nuc % urr_data % energy(1) .and. &
p % E < nuc % urr_data % energy(nuc % urr_data % n_energy)) then
call calculate_urr_xs(p, index_nuclide)
end if
end if
end if
@ -277,21 +279,16 @@ contains
integer :: i_table ! index for table
real(8) :: f ! interpolation factor
real(8) :: r ! pseudo-random number
real(8) :: elastic ! smooth elastic cross section
real(8) :: absorption ! smooth absorption cross section
real(8) :: fission ! smooth fission cross section
real(8) :: inelastic ! smooth inelastic cross section
real(8) :: elastic ! elastic cross section
real(8) :: capture ! (n,gamma) cross section
real(8) :: fission ! fission cross section
real(8) :: inelastic ! inelastic cross section
type(UrrData), pointer :: urr => null()
type(Nuclide), pointer :: nuc => null()
type(Reaction), pointer :: rxn => null()
micro_xs(index_nuclide) % use_ptable = .true.
! copy cross-sections already calculated
elastic = micro_xs(index_nuclide) % elastic
absorption = micro_xs(index_nuclide) % absorption
fission = micro_xs(index_nuclide) % fission
! get pointer to probability table
nuc => nuclides(index_nuclide)
urr => nuc % urr_data
@ -318,15 +315,11 @@ contains
! determine elastic, fission, and capture cross sections from probability
! table
if (urr % interp == LINEAR_LINEAR) then
micro_xs(index_nuclide) % elastic = &
(ONE - f) * urr % prob(i_energy, URR_ELASTIC, i_table) + &
elastic = (ONE - f) * urr % prob(i_energy, URR_ELASTIC, i_table) + &
f * urr % prob(i_energy + 1, URR_ELASTIC, i_table)
micro_xs(index_nuclide) % fission = &
(ONE - f) * urr % prob(i_energy, URR_FISSION, i_table) + &
fission = (ONE - f) * urr % prob(i_energy, URR_FISSION, i_table) + &
f * urr % prob(i_energy + 1, URR_FISSION, i_table)
micro_xs(index_nuclide) % absorption = &
micro_xs(index_nuclide) % fission + &
(ONE - f) * urr % prob(i_energy, URR_N_GAMMA, i_table) + &
capture = (ONE - f) * urr % prob(i_energy, URR_N_GAMMA, i_table) + &
f * urr % prob(i_energy + 1, URR_N_GAMMA, i_table)
elseif (urr % interp == LOG_LOG) then
message = "Log-log interpolation on probability table not yet supported."
@ -352,23 +345,28 @@ contains
! Multiply by smooth cross-section if needed
if (urr % multiply_smooth) then
micro_xs(index_nuclide) % elastic = elastic * &
micro_xs(index_nuclide) % elastic
micro_xs(index_nuclide) % absorption = absorption * &
micro_xs(index_nuclide) % absorption
micro_xs(index_nuclide) % fission = fission * &
micro_xs(index_nuclide) % fission
elastic = elastic * micro_xs(index_nuclide) % elastic
capture = capture * micro_xs(index_nuclide) % absorption
fission = fission * micro_xs(index_nuclide) % fission
end if
! Set elastic, absorption, fission, and total cross sections. Note that the
! total cross section is calculated as sum of partials rather than using the
! table-provided value
micro_xs(index_nuclide) % elastic = elastic
micro_xs(index_nuclide) % absorption = capture + fission
micro_xs(index_nuclide) % fission = fission
micro_xs(index_nuclide) % total = elastic + inelastic + capture + fission
! Determine nu-fission cross section
if (nuc % fissionable) then
micro_xs(index_nuclide) % nu_fission = nu_total(nuc, p % E) * &
micro_xs(index_nuclide) % fission
end if
! Calculate total cross section as sum of partials
micro_xs(index_nuclide) % total = micro_xs(index_nuclide) % elastic + &
inelastic + micro_xs(index_nuclide) % absorption
! As long as the energy of the neutron doesn't change, we don't need to
! recalculate probability table data
micro_xs(index_nuclide) % recalculate = .false.
end subroutine calculate_urr_xs

View file

@ -66,6 +66,9 @@ contains
! Initialize number of events to zero
n_event = 0
! Set recalculate ptables to true by default
micro_xs(:) % recalculate = .true.
! find energy index, interpolation factor
do while (p % alive)
@ -197,6 +200,10 @@ contains
! Reset number of particles banked during collision
p % n_bank = 0
! Since a collision has occurred, we need to recalculate probability tables
! for any nuclide
micro_xs(:) % recalculate = .true.
end subroutine collision
!===============================================================================