Removed n_events from TallyScore and added 'events' score type.

This commit is contained in:
Paul Romano 2012-11-20 15:41:12 -05:00
parent 842bbe9121
commit 9f527f04cd
7 changed files with 28 additions and 6 deletions

View file

@ -17,6 +17,7 @@ the problem at hand (mostly on the number of nuclides in the problem).
New Features
------------
- Added 'events' score that returns number of events that scored to a tally.
- Restructured tally filter implementation and user input.
- Source convergence acceleration via CMFD (implemented with PETSC).
- Ability to read source files in parallel when number of particles is greater

View file

@ -824,6 +824,9 @@ The following responses can be tallied.
:nu-fission:
Total production of neutrons due to fission
:events:
Number of scoring events
``<mesh>`` Element
------------------

View file

@ -251,7 +251,7 @@ module constants
EVENT_FISSION = 3
! Tally score type
integer, parameter :: N_SCORE_TYPES = 17
integer, parameter :: N_SCORE_TYPES = 18
integer, parameter :: &
SCORE_FLUX = -1, & ! flux
SCORE_TOTAL = -2, & ! total reaction rate
@ -269,7 +269,8 @@ module constants
SCORE_ABSORPTION = -14, & ! absorption rate
SCORE_FISSION = -15, & ! fission rate
SCORE_NU_FISSION = -16, & ! neutron production rate
SCORE_CURRENT = -17 ! partial current
SCORE_CURRENT = -17, & ! partial current
SCORE_EVENTS = -18 ! number of events
! Tally map bin finding
integer, parameter :: NO_BIN_FOUND = -1

View file

@ -213,7 +213,7 @@ contains
! CREATE MPI_TALLYSCORE TYPE
! Determine displacements for MPI_BANK type
call MPI_GET_ADDRESS(ts % n_events, score_base_disp, mpi_err)
call MPI_GET_ADDRESS(ts % value, score_base_disp, mpi_err)
call MPI_GET_ADDRESS(ts % sum, score_disp(1), mpi_err)
! Adjust displacements

View file

@ -1764,6 +1764,9 @@ contains
OUT_RIGHT, IN_FRONT, OUT_FRONT, IN_TOP, OUT_TOP /)
end if
t % find_filter(FILTER_SURFACE) = t % n_filters
case ('events')
t % score_bins(j) = SCORE_EVENTS
case default
message = "Unknown scoring function: " // &

View file

@ -304,6 +304,10 @@ contains
end if
case (SCORE_EVENTS)
! Simply count number of scoring events
score = ONE
case default
message = "Invalid score type on tally " // to_str(t % id) // "."
call fatal_error()
@ -505,6 +509,8 @@ contains
case (SCORE_NU_FISSION)
score = micro_xs(i_nuclide) % nu_fission * &
atom_density * flux
case (SCORE_EVENTS)
score = ONE
case default
message = "Invalid score type on tally " // to_str(t % id) // "."
call fatal_error()
@ -525,6 +531,8 @@ contains
score = material_xs % fission * flux
case (SCORE_NU_FISSION)
score = material_xs % nu_fission * flux
case (SCORE_EVENTS)
score = ONE
case default
message = "Invalid score type on tally " // to_str(t % id) // "."
call fatal_error()
@ -617,6 +625,8 @@ contains
score = micro_xs(i_nuclide) % fission * atom_density * flux
case (SCORE_NU_FISSION)
score = micro_xs(i_nuclide) % nu_fission * atom_density * flux
case (SCORE_EVENTS)
score = ONE
case default
message = "Invalid score type on tally " // to_str(t % id) // "."
call fatal_error()
@ -655,6 +665,8 @@ contains
score = material_xs % fission * flux
case (SCORE_NU_FISSION)
score = material_xs % nu_fission * flux
case (SCORE_EVENTS)
score = ONE
case default
message = "Invalid score type on tally " // to_str(t % id) // "."
call fatal_error()
@ -917,6 +929,8 @@ contains
case (SCORE_NU_FISSION)
score = micro_xs(i_nuclide) % nu_fission * &
atom_density * flux
case (SCORE_EVENTS)
score = ONE
case default
message = "Invalid score type on tally " // &
to_str(t % id) // "."
@ -938,6 +952,8 @@ contains
score = material_xs % fission * flux
case (SCORE_NU_FISSION)
score = material_xs % nu_fission * flux
case (SCORE_EVENTS)
score = ONE
case default
message = "Invalid score type on tally " // &
to_str(t % id) // "."
@ -1614,6 +1630,7 @@ contains
score_name(abs(SCORE_ABSORPTION)) = "Absorption Rate"
score_name(abs(SCORE_FISSION)) = "Fission Rate"
score_name(abs(SCORE_NU_FISSION)) = "Nu-Fission Rate"
score_name(abs(SCORE_EVENTS)) = "Events"
! Create filename for tally output
if (run_mode == MODE_TALLIES) then
@ -2037,7 +2054,6 @@ contains
type(TallyScore), intent(inout) :: score
real(8), intent(in) :: val
score % n_events = score % n_events + 1
score % value = score % value + val
end subroutine add_to_score
@ -2095,7 +2111,6 @@ contains
type(TallyScore), intent(inout) :: score
score % n_events = 0
score % value = ZERO
score % sum = ZERO
score % sum_sq = ZERO

View file

@ -39,7 +39,6 @@ module tally_header
!===============================================================================
type TallyScore
integer :: n_events = 0
real(8) :: value = 0.
real(8) :: sum = 0.
real(8) :: sum_sq = 0.