mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-27 05:35:49 -04:00
Fixed per @paulromano comments
This commit is contained in:
parent
826d5a43d8
commit
dffb9858e8
10 changed files with 771 additions and 795 deletions
File diff suppressed because one or more lines are too long
|
|
@ -171,7 +171,9 @@ attributes/sub-elements required to describe the meta-data:
|
|||
provided via the ``scatt_type`` element above, is represented and thus used
|
||||
during the scattering process. Specifically, the options are to either
|
||||
convert the Legendre expansion to a tabular representation or leave it as
|
||||
a set of Legendre coefficients. Converting to a tabular representation will cost memory but can allow for a decrease in runtime compared to leaving as a set of Legendre coefficients. This element has the following
|
||||
a set of Legendre coefficients. Converting to a tabular representation
|
||||
will cost memory but can allow for a decrease in runtime compared to
|
||||
leaving as a set of Legendre coefficients. This element has the following
|
||||
attributes/sub-elements:
|
||||
|
||||
:enable:
|
||||
|
|
|
|||
|
|
@ -778,18 +778,18 @@ class Library(object):
|
|||
Scattering order for this data entry. Default is None,
|
||||
which will set the XSdata object to use the order of the
|
||||
Library.
|
||||
tabular_legendre : {None, bool}
|
||||
tabular_legendre : None or bool
|
||||
Flag to denote whether or not the Legendre expansion of the
|
||||
scattering angular distribution is to be converted to a tabular
|
||||
representation by OpenMC. A value of `True` means that it is to be
|
||||
converted while a value of 'False' means that it will not be.
|
||||
converted while a value of `False` means that it will not be.
|
||||
Defaults to `None` which leaves the default behavior of OpenMC in
|
||||
place (the distribution is converted to a tabular representation).
|
||||
tabular_points : {int}
|
||||
This parameter is not used unless the `tabular_legendre` is set to
|
||||
`True`. In this case, this parameter sets the number of
|
||||
equally-spaced points in the domain of [-1,1] to be used in
|
||||
building the tabular distribution. Default is `33`.
|
||||
tabular_points : int
|
||||
This parameter is not used unless the ``tabular_legendre``
|
||||
parameter is set to `True`. In this case, this parameter sets the
|
||||
number of equally-spaced points in the domain of [-1,1] to be used
|
||||
in building the tabular distribution. Default is `33`.
|
||||
|
||||
Returns
|
||||
-------
|
||||
|
|
@ -947,18 +947,18 @@ class Library(object):
|
|||
Cross section set identifier (i.e., '71c') for all
|
||||
data sets (if only str) or for each individual one
|
||||
(if iterable of str). Defaults to '1m'.
|
||||
tabular_legendre : {None, bool}
|
||||
tabular_legendre : None or bool
|
||||
Flag to denote whether or not the Legendre expansion of the
|
||||
scattering angular distribution is to be converted to a tabular
|
||||
representation by OpenMC. A value of `True` means that it is to be
|
||||
converted while a value of 'False' means that it will not be.
|
||||
converted while a value of `False` means that it will not be.
|
||||
Defaults to `None` which leaves the default behavior of OpenMC in
|
||||
place (the distribution is converted to a tabular representation).
|
||||
tabular_points : {int}
|
||||
This parameter is not used unless the `tabular_legendre` is set to
|
||||
`True`. In this case, this parameter sets the number of
|
||||
equally-spaced points in the domain of [-1,1] to be used in
|
||||
building the tabular distribution. Default is `33`.
|
||||
tabular_points : int
|
||||
This parameter is not used unless the ``tabular_legendre``
|
||||
parameter is set to `True`. In this case, this parameter sets the
|
||||
number of equally-spaced points in the domain of [-1,1] to be used
|
||||
in building the tabular distribution. Default is `33`.
|
||||
|
||||
Returns
|
||||
-------
|
||||
|
|
@ -1046,18 +1046,18 @@ class Library(object):
|
|||
Cross section set identifier (i.e., '71c') for all
|
||||
data sets (if only str) or for each individual one
|
||||
(if iterable of str). Defaults to '1m'.
|
||||
tabular_legendre : {None, bool}
|
||||
tabular_legendre : None or bool
|
||||
Flag to denote whether or not the Legendre expansion of the
|
||||
scattering angular distribution is to be converted to a tabular
|
||||
representation by OpenMC. A value of `True` means that it is to be
|
||||
converted while a value of 'False' means that it will not be.
|
||||
converted while a value of `False` means that it will not be.
|
||||
Defaults to `None` which leaves the default behavior of OpenMC in
|
||||
place (the distribution is converted to a tabular representation).
|
||||
tabular_points : {int}
|
||||
This parameter is not used unless the `tabular_legendre` is set to
|
||||
`True`. In this case, this parameter sets the number of
|
||||
equally-spaced points in the domain of [-1,1] to be used in
|
||||
building the tabular distribution. Default is `33`.
|
||||
tabular_points : int
|
||||
This parameter is not used unless the ``tabular_legendre``
|
||||
parameter is set to `True`. In this case, this parameter sets the
|
||||
number of equally-spaced points in the domain of [-1,1] to be used
|
||||
in building the tabular distribution. Default is `33`.
|
||||
|
||||
Returns
|
||||
-------
|
||||
|
|
|
|||
|
|
@ -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, p0, m, mu0
|
||||
real(8) :: dmu, mu, norm
|
||||
integer :: order, order_dim, gin, gout, l, arr_len
|
||||
integer :: legendre_mu_points, imu
|
||||
|
||||
|
|
@ -498,18 +498,6 @@ 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
|
||||
|
|
|
|||
|
|
@ -398,32 +398,18 @@ contains
|
|||
end do
|
||||
|
||||
! Re-normalize fmu for numerical integration issues and in case
|
||||
! the negative fix-up introduced un-normalized data
|
||||
! the negative fix-up introduced un-normalized data while
|
||||
! accruing the CDF
|
||||
norm = ZERO
|
||||
do imu = 2, order
|
||||
norm = norm + HALF * this % dmu * &
|
||||
(this % fmu(gin) % data(imu - 1, gout) + &
|
||||
this % fmu(gin) % data(imu, gout))
|
||||
this % dist(gin) % data(imu, gout) = norm
|
||||
end do
|
||||
if (norm > ZERO) then
|
||||
this % fmu(gin) % data(:, gout) = &
|
||||
this % fmu(gin) % data(:, gout) / norm
|
||||
end if
|
||||
|
||||
! Now create CDF from fmu with the analytical integral
|
||||
this % dist(gin) % data(1, gout) = ZERO
|
||||
do imu = 2, order
|
||||
p0 = this % fmu(gin) % data(imu - 1, gout)
|
||||
mu0 = this % mu(imu - 1)
|
||||
mu1 = this % mu(imu)
|
||||
m = (this % fmu(gin) % data(imu, gout) - p0) / (mu1 - mu0)
|
||||
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)
|
||||
if (norm > ZERO) then
|
||||
this % dist(gin) % data(:, gout) = &
|
||||
this % dist(gin) % data(:, gout) / norm
|
||||
end if
|
||||
|
|
|
|||
|
|
@ -1,2 +1,2 @@
|
|||
k-combined:
|
||||
1.003952E+00 4.160185E-02
|
||||
1.047136E+00 2.765964E-02
|
||||
|
|
|
|||
|
|
@ -1,2 +1,2 @@
|
|||
k-combined:
|
||||
1.026398E+00 7.824554E-02
|
||||
1.102093E+00 4.962190E-02
|
||||
|
|
|
|||
|
|
@ -1,2 +1,2 @@
|
|||
k-combined:
|
||||
1.003952E+00 4.160185E-02
|
||||
1.047136E+00 2.765964E-02
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -1,2 +1,2 @@
|
|||
k-combined:
|
||||
1.151644E+00 3.044607E-02
|
||||
1.140804E+00 2.937150E-02
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue