mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-27 13:45:36 -04:00
Remove some multipole global variables
This commit is contained in:
parent
bfd6c808fe
commit
e29da0cf5b
6 changed files with 18 additions and 69 deletions
14
src/ace.F90
14
src/ace.F90
|
|
@ -12,7 +12,6 @@ module ace
|
|||
use list_header, only: ListInt
|
||||
use material_header, only: Material
|
||||
use multipole, only: multipole_read
|
||||
use multipole_header, only: max_L, max_poles, max_poly
|
||||
use nuclide_header
|
||||
use output, only: write_message
|
||||
use product_header, only: ReactionProduct
|
||||
|
|
@ -478,19 +477,6 @@ contains
|
|||
call multipole_read(filename, nuc % multipole, i_table)
|
||||
nuc % mp_present = .true.
|
||||
|
||||
! Update the maximum number of poles, l indices, and polynomial order
|
||||
if (nuc % multipole % max_w > max_poles) then
|
||||
max_poles = nuc % multipole % max_w
|
||||
end if
|
||||
|
||||
if (nuc % multipole % num_l > max_L) then
|
||||
max_L = nuc % multipole % num_l
|
||||
end if
|
||||
|
||||
if (nuc % multipole % fit_order + 1 > max_poly) then
|
||||
max_poly = nuc % multipole % fit_order + 1
|
||||
end if
|
||||
|
||||
! Recreate nu-fission tables
|
||||
if (nuc % fissionable) then
|
||||
call generate_nu_fission(nuc)
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ module cross_section
|
|||
use math, only: faddeeva, broaden_wmp_polynomials
|
||||
use multipole_header, only: FORM_RM, FORM_MLBW, MP_EA, RM_RT, RM_RA, RM_RF, &
|
||||
MLBW_RT, MLBW_RX, MLBW_RA, MLBW_RF, FIT_T, FIT_A,&
|
||||
FIT_F, MultipoleArray, max_poly, max_L, max_poles
|
||||
FIT_F, MultipoleArray
|
||||
use nuclide_header
|
||||
use particle_header, only: Particle
|
||||
use random_lcg, only: prn, future_prn, prn_set_stream
|
||||
|
|
@ -18,14 +18,6 @@ module cross_section
|
|||
|
||||
implicit none
|
||||
|
||||
! Allocatable arrays for multipole that are allocated once for speed purposes
|
||||
complex(8), allocatable :: sigT_factor(:)
|
||||
real(8), allocatable :: twophi(:)
|
||||
real(8), allocatable :: broadened_polynomials(:)
|
||||
logical :: mp_already_alloc = .false.
|
||||
|
||||
!$omp threadprivate(sigT_factor, twophi, broadened_polynomials, mp_already_alloc)
|
||||
|
||||
contains
|
||||
|
||||
!===============================================================================
|
||||
|
|
@ -558,19 +550,6 @@ contains
|
|||
|
||||
end function find_energy_index
|
||||
|
||||
!===============================================================================
|
||||
! MULTIPOLE_EVAL_ALLOCATE allocates fixed-length arrays that vary based on
|
||||
! what nuclides are loaded into the problem
|
||||
!===============================================================================
|
||||
|
||||
subroutine multipole_eval_allocate()
|
||||
allocate(sigT_factor(max_L))
|
||||
allocate(twophi(max_L))
|
||||
allocate(broadened_polynomials(max_poly))
|
||||
|
||||
mp_already_alloc = .true.
|
||||
end subroutine
|
||||
|
||||
!===============================================================================
|
||||
! MULTIPOLE_EVAL evaluates the windowed multipole equations for cross
|
||||
! sections in the resolved resonance regions
|
||||
|
|
@ -593,6 +572,8 @@ contains
|
|||
complex(8) :: c_temp ! complex temporary variable
|
||||
complex(8) :: w_val ! The faddeeva function evaluated at Z
|
||||
complex(8) :: Z ! sqrt(atomic weight ratio / kT) * (sqrt(E) - pole)
|
||||
complex(8) :: sigT_factor(multipole % num_l)
|
||||
real(8) :: broadened_polynomials(multipole % fit_order + 1)
|
||||
real(8) :: sqrtE ! sqrt(E), eV
|
||||
real(8) :: invE ! 1/E, eV
|
||||
real(8) :: dopp ! sqrt(atomic weight ratio / kT) = 1 / (2 sqrt(xi))
|
||||
|
|
@ -617,10 +598,6 @@ contains
|
|||
invE = ONE / E
|
||||
dopp = multipole % sqrtAWR / sqrtkT
|
||||
|
||||
if (.not. mp_already_alloc) then
|
||||
call multipole_eval_allocate()
|
||||
end if
|
||||
|
||||
! Locate us.
|
||||
i_window = floor((sqrtE - sqrt(multipole % start_E)) / multipole % spacing &
|
||||
+ ONE)
|
||||
|
|
@ -629,8 +606,7 @@ contains
|
|||
|
||||
! Fill in factors.
|
||||
if (startw <= endw) then
|
||||
call fill_factors(multipole, sqrtE, sigT_factor, twophi, &
|
||||
multipole % num_l)
|
||||
call compute_sigT_factor(multipole, sqrtE, sigT_factor)
|
||||
end if
|
||||
|
||||
! Initialize the ouptut cross sections.
|
||||
|
|
@ -705,25 +681,23 @@ contains
|
|||
end do
|
||||
end if
|
||||
end if
|
||||
end subroutine
|
||||
end subroutine multipole_eval
|
||||
|
||||
!===============================================================================
|
||||
! FILL_FACTORS calculates the value of phi, the hardsphere phase shift factor,
|
||||
! and sigT_factor, a factor inside of the sigT equation not present in the
|
||||
! sigA and sigF equations.
|
||||
! COMPUTE_SIGT_FACTOR calculates the sigT_factor, a factor inside of the sigT
|
||||
! equation not present in the sigA and sigF equations.
|
||||
!===============================================================================
|
||||
|
||||
subroutine fill_factors(multipole, sqrtE, sigT_factor, twophi, max_L)
|
||||
type(MultipoleArray), intent(in) :: multipole
|
||||
real(8), intent(in) :: sqrtE
|
||||
integer, intent(in) :: max_L
|
||||
complex(8), intent(out) :: sigT_factor(max_L)
|
||||
real(8), intent(out) :: twophi(max_L)
|
||||
subroutine compute_sigT_factor(multipole, sqrtE, sigT_factor)
|
||||
type(MultipoleArray), intent(in) :: multipole
|
||||
real(8), intent(in) :: sqrtE
|
||||
complex(8), intent(out) :: sigT_factor(multipole % num_l)
|
||||
|
||||
integer :: iL
|
||||
real(8) :: twophi(multipole % num_l)
|
||||
real(8) :: arg
|
||||
|
||||
do iL = 1, max_L
|
||||
do iL = 1, multipole % num_l
|
||||
twophi(iL) = multipole % pseudo_k0RS(iL) * sqrtE
|
||||
if (iL == 2) then
|
||||
twophi(iL) = twophi(iL) - atan(twophi(iL))
|
||||
|
|
@ -739,7 +713,7 @@ contains
|
|||
|
||||
twophi = 2.0_8 * twophi
|
||||
sigT_factor = cmplx(cos(twophi), -sin(twophi), KIND=8)
|
||||
end subroutine
|
||||
end subroutine compute_sigT_factor
|
||||
|
||||
!===============================================================================
|
||||
! 0K_ELASTIC_XS determines the microscopic 0K elastic cross section
|
||||
|
|
|
|||
|
|
@ -741,6 +741,8 @@ contains
|
|||
! For imag(z) > 0, w_int(z) = w_fun(z)
|
||||
! For imag(z) < 0, w_int(z) = -conjg(w_fun(conjg(z)))
|
||||
|
||||
! Note that faddeeva_w will interpret zero as machine epsilon
|
||||
|
||||
relerr = ZERO
|
||||
if (aimag(z) > ZERO) then
|
||||
wv = faddeeva_w(z, relerr)
|
||||
|
|
|
|||
|
|
@ -4,8 +4,8 @@ module multipole
|
|||
use global
|
||||
use hdf5
|
||||
use hdf5_interface
|
||||
use multipole_header, only: MultipoleArray, FIT_T, FIT_A, FIT_F, max_L, &
|
||||
max_poles, max_poly, MP_FISS, FORM_MLBW, FORM_RM
|
||||
use multipole_header, only: MultipoleArray, FIT_T, FIT_A, FIT_F, &
|
||||
MP_FISS, FORM_MLBW, FORM_RM
|
||||
|
||||
implicit none
|
||||
|
||||
|
|
|
|||
|
|
@ -32,12 +32,6 @@ module multipole_header
|
|||
! Value of 'true' when checking if nuclide is fissionable
|
||||
integer, parameter :: MP_FISS = 1
|
||||
|
||||
! These variables store the maximum value from every nuclide in order
|
||||
! to preallocate some arrays to improve performance.
|
||||
integer :: max_poly ! Maximum number of polynomials we expect
|
||||
integer :: max_poles ! Maximum number of poles in the problem for allocation
|
||||
integer :: max_L ! Maximum L value for allocation
|
||||
|
||||
!===============================================================================
|
||||
! MULTIPOLE contains all the components needed for the windowed multipole
|
||||
! temperature dependent cross section libraries for the resolved resonance
|
||||
|
|
|
|||
|
|
@ -1,7 +0,0 @@
|
|||
import openmc
|
||||
|
||||
|
||||
su = openmc.Summary('summary.h5')
|
||||
sp = openmc.StatePoint('statepoint.1.h5')
|
||||
sp.link_with_summary(su)
|
||||
print(sp.tallies[1].get_pandas_dataframe(summary=su))
|
||||
Loading…
Add table
Add a link
Reference in a new issue