From 80ecd2406ba6a2c6cef901e9a1c8a5db69b7456f Mon Sep 17 00:00:00 2001 From: Adam Nelson Date: Mon, 6 Jun 2016 05:19:56 -0400 Subject: [PATCH] Repeated the more analytic integration in the conversion of Legendre to Tabular data --- src/mgxs_header.F90 | 14 +++++++++++++- src/scattdata_header.F90 | 1 - src/tally.F90 | 2 -- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/src/mgxs_header.F90 b/src/mgxs_header.F90 index 750a8df98..fd909ca00 100644 --- a/src/mgxs_header.F90 +++ b/src/mgxs_header.F90 @@ -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 diff --git a/src/scattdata_header.F90 b/src/scattdata_header.F90 index 06e052eec..6fca89190 100644 --- a/src/scattdata_header.F90 +++ b/src/scattdata_header.F90 @@ -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) diff --git a/src/tally.F90 b/src/tally.F90 index 0c41b6f98..b40a39ce0 100644 --- a/src/tally.F90 +++ b/src/tally.F90 @@ -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