Repeated the more analytic integration in the conversion of Legendre to Tabular data

This commit is contained in:
Adam Nelson 2016-06-06 05:19:56 -04:00
parent f747bb4fbd
commit 80ecd2406b
3 changed files with 13 additions and 4 deletions

View file

@ -277,7 +277,7 @@ module mgxs_header
real(8), allocatable :: scatt_coeffs(:, :, :)
real(8), allocatable :: input_scatt(:, :, :)
real(8), allocatable :: temp_scatt(:, :, :)
real(8) :: dmu, mu, norm
real(8) :: dmu, mu, norm, p0, m, mu0
integer :: order, order_dim, gin, gout, l, arr_len
integer :: legendre_mu_points, imu
@ -496,6 +496,18 @@ module mgxs_header
(scatt_coeffs(imu - 1, gout, gin) + &
scatt_coeffs(imu, gout, gin))
end if
! Now create CDF from fmu with the analytical integral of a
! piecewise linear function
if (imu > 1) then
p0 = scatt_coeffs(imu - 1, gout, gin)
mu0 = mu - dmu
m = (scatt_coeffs(imu, gout, gin) - &
scatt_coeffs(imu - 1, gout, gin)) / dmu
norm = norm + &
HALF * m * mu * mu + &
(p0 - m * mu0) * mu + &
(HALF * m * mu0 * mu0 - p0 * mu0)
end if
end do
! Now that we have the integral, lets ensure that the distribution
! is normalized such that it preserves the original scattering xs

View file

@ -420,7 +420,6 @@ contains
this % dist(gin) % data(imu, gout) = HALF * m * mu1 * mu1 + &
(p0 - m * mu0) * mu1 + &
(HALF * m * mu0 * mu0 - p0 * mu0)
end do
! Ensure we normalize to 1 still
norm = this % dist(gin) % data(order, gout)

View file

@ -107,8 +107,6 @@ contains
real(8) :: atom_density_ ! atom/b-cm
real(8) :: f ! interpolation factor
real(8) :: score ! analog tally score
real(8) :: macro_total ! material macro total xs
real(8) :: macro_scatt ! material macro scatt xs
real(8) :: E ! particle energy
i = 0