Skip to content

Commit

Permalink
Merge commit 'mit-crpg/openmc/develop' into res_scat
Browse files Browse the repository at this point in the history
  • Loading branch information
walshjon committed Sep 10, 2014
2 parents 3a9f226 + 49f600e commit 15c7677
Show file tree
Hide file tree
Showing 7 changed files with 72 additions and 2 deletions.
6 changes: 6 additions & 0 deletions docs/source/usersguide/input.rst
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,12 @@ attributes/sub-elements:
parallelepiped and the last three of which specify the upper-right
corner. Source sites are sampled uniformly through that parallelepiped.

To filter a "box" spatial distribution by fissionable material, specify
"fission" tag instead of "box". The ``parameters`` should be given as six
real numbers, the first three of which specify the lower-left corner of a
parallelepiped and the last three of which specify the upper-right
corner. Source sites are sampled uniformly through that parallelepiped.

For a "point" spatial distribution, ``parameters`` should be given as
three real numbers which specify the (x,y,z) location of an isotropic
point source
Expand Down
19 changes: 19 additions & 0 deletions src/ace.F90
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,25 @@ subroutine read_xs()
! Avoid some valgrind leak errors
call already_read % clear()

! Loop around material
MATERIAL_LOOP3: do i = 1, n_materials

! Get material
mat => materials(i)

! Loop around nuclides in material
NUCLIDE_LOOP2: do j = 1, mat % n_nuclides

! Check for fission in nuclide
if (nuclides(mat % nuclide(j)) % fissionable) then
mat % fissionable = .true.
exit NUCLIDE_LOOP2
end if

end do NUCLIDE_LOOP2

end do MATERIAL_LOOP3

end subroutine read_xs

!===============================================================================
Expand Down
5 changes: 3 additions & 2 deletions src/constants.F90
Original file line number Diff line number Diff line change
Expand Up @@ -335,8 +335,9 @@ module constants

! Source spatial distribution types
integer, parameter :: &
SRC_SPACE_BOX = 1, & ! Source in a rectangular prism
SRC_SPACE_POINT = 2 ! Source at a single point
SRC_SPACE_BOX = 1, & ! Source in a rectangular prism
SRC_SPACE_POINT = 2, & ! Source at a single point
SRC_SPACE_FISSION = 3 ! Source in prism filtered by fissionable mats

! Source angular distribution types
integer, parameter :: &
Expand Down
1 change: 1 addition & 0 deletions src/initialize.F90
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ module initialize
use global
use input_xml, only: read_input_xml, read_cross_sections_xml, &
cells_in_univ_dict, read_plots_xml
use material_header, only: Material
use output, only: title, header, write_summary, print_version, &
print_usage, write_xs_summary, print_plot, &
write_message
Expand Down
3 changes: 3 additions & 0 deletions src/input_xml.F90
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,9 @@ subroutine read_settings_xml()
case ('box')
external_source % type_space = SRC_SPACE_BOX
coeffs_reqd = 6
case ('fission')
external_source % type_space = SRC_SPACE_FISSION
coeffs_reqd = 6
case ('point')
external_source % type_space = SRC_SPACE_POINT
coeffs_reqd = 3
Expand Down
4 changes: 4 additions & 0 deletions src/material_header.F90
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ module material_header
! Temporary names read during initialization
character(12), allocatable :: names(:) ! isotope names
character(12), allocatable :: sab_names(:) ! name of S(a,b) table

! Does this material contain fissionable nuclides?
logical :: fissionable = .false.

end type Material

end module material_header
36 changes: 36 additions & 0 deletions src/source.F90
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,42 @@ subroutine sample_external_source(site)
end do
call p % clear()

case (SRC_SPACE_FISSION)
! Repeat sampling source location until a good site has been found
found = .false.
do while (.not.found)
! Set particle defaults
call p % initialize()

! Coordinates sampled uniformly over a box
p_min = external_source % params_space(1:3)
p_max = external_source % params_space(4:6)
r = (/ (prn(), i = 1,3) /)
site % xyz = p_min + r*(p_max - p_min)

! Fill p with needed data
p % coord0 % xyz = site % xyz
p % coord0 % uvw = [ ONE, ZERO, ZERO ]

! Now search to see if location exists in geometry
call find_cell(p, found)
if (.not. found) then
num_resamples = num_resamples + 1
if (num_resamples == MAX_EXTSRC_RESAMPLES) then
message = "Maximum number of external source spatial resamples &
&reached!"
call fatal_error()
end if
cycle
end if
if (p % material == MATERIAL_VOID) then
found = .false.
cycle
end if
if (.not. materials(p % material) % fissionable) found = .false.
end do
call p % clear()

case (SRC_SPACE_POINT)
! Point source
site % xyz = external_source % params_space
Expand Down

0 comments on commit 15c7677

Please sign in to comment.