Added option to use non-unionized energy grid.

This commit is contained in:
Paul Romano 2012-03-18 16:53:56 -04:00
parent 1e70be6f9b
commit 47364fae97
6 changed files with 56 additions and 14 deletions

View file

@ -312,6 +312,12 @@ module constants
integer, parameter :: ERROR_INT = -huge(0)
real(8), parameter :: ERROR_REAL = -huge(0.0_8) * 0.917826354_8
! Energy grid methods
integer, parameter :: &
GRID_NUCLIDE = 1, & ! non-unionized energy grid (MCNP)
GRID_UNION = 2, & ! union grid with pointers
GRID_LETHARGY = 3 ! lethargy mapping (MC21)
! Source types
integer, parameter :: &
SRC_BOX = 1, & ! Source in a rectangular prism

View file

@ -37,7 +37,7 @@ contains
mat => materials(p % material)
! Find energy index on unionized grid
call find_energy_index()
if (grid_method == GRID_UNION) call find_energy_index()
! Check if there's an S(a,b) table for this material
if (mat % has_sab_table) then
@ -107,11 +107,28 @@ contains
! Set pointer to nuclide
nuc => nuclides(index_nuclide)
! TODO: If not using unionized energy grid, we need to find the index on the
! nuclide energy grid using lethargy mapping or whatever other technique
! Determine index on nuclide energy grid
select case (grid_method)
case (GRID_UNION)
! If we're using the unionized grid with pointers, finding the index on
! the nuclide energy grid is as simple as looking up the pointer
! get index on nuclide energy grid
IE = nuc % grid_index(p % IE)
IE = nuc % grid_index(p % IE)
case (GRID_NUCLIDE)
! If we're not using the unionized grid, we have to do a binary search on
! the nuclide energy grid in order to determine which points to
! interpolate between
if (p % E < nuc % energy(1)) then
IE = 1
elseif (p % E > nuc % energy(nuc % n_grid)) then
IE = nuc % n_grid - 1
else
IE = binary_search(nuc % energy, nuc % n_grid, p % E)
end if
end select
! check for rare case where two energy points are the same
if (nuc % energy(IE) == nuc % energy(IE+1)) IE = IE + 1

View file

@ -82,7 +82,8 @@ module global
type(DictionaryCI), pointer :: xs_listing_dict => null()
! Unionized energy grid
integer :: n_grid ! number of points on unionized grid
integer :: grid_method ! how to treat the energy grid
integer :: n_grid ! number of points on unionized grid
real(8), allocatable :: e_grid(:) ! energies on unionized grid
! Unreoslved resonance probablity tables

View file

@ -106,9 +106,11 @@ contains
call timer_stop(time_read_xs)
! Construct unionized energy grid from cross-sections
call timer_start(time_unionize)
call unionized_grid()
call timer_stop(time_unionize)
if (grid_method == GRID_UNION) then
call timer_start(time_unionize)
call unionized_grid()
call timer_stop(time_unionize)
end if
! Create tally map
call create_tally_map()

View file

@ -67,6 +67,7 @@ contains
! Initialize XML scalar variables
cross_sections_ = ""
verbosity_ = 0
energy_grid_ = "union"
! Parse settings.xml file
call read_xml_file_settings_t(filename)
@ -111,6 +112,20 @@ contains
call fatal_error()
end if
! Energy grid methods
select case (energy_grid_)
case ('nuclide')
grid_method = GRID_NUCLIDE
case ('union')
grid_method = GRID_UNION
case ('lethargy')
message = "Lethargy mapped energy grid not yet supported."
call fatal_error()
case default
message = "Unknown energy grid method: " // energy_grid_
call fatal_error()
end select
! Verbosity
if (verbosity_ > 0) verbosity = verbosity_

View file

@ -27,13 +27,14 @@
</typedef>
<variable name="criticality" type="criticality_xml" />
<variable name="verbosity_" tag="verbosity" type="integer" />
<variable name="cross_sections_" tag="cross_sections" type="word" length="255" />
<variable name="cutoff_" tag="cutoff" type="cutoff_xml" dimension="1" />
<variable name="energy_grid_" tag="energy_grid" type="word" length="7" />
<variable name="entropy_" tag="entropy" type="entropy_xml" dimension="1" />
<variable name="ptables_" tag="ptables" type="word" length="3" />
<variable name="source_" tag="source" type="source_xml" />
<variable name="survival_" tag="survival_biasing" type="word" length="3" />
<variable name="ptables_" tag="ptables" type="word" length="3" />
<variable name="cutoff_" tag="cutoff" type="cutoff_xml" dimension="1" />
<variable name="cross_sections_" tag="cross_sections" type="word" length="255" />
<variable name="verbosity_" tag="verbosity" type="integer" />
<variable name="trace_" tag="trace" type="integer-array" />
<variable name="entropy_" tag="entropy" type="entropy_xml" dimension="1" />
</template>