mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-28 06:05:58 -04:00
Fixed a bug where a score requested after a scatter-Pn score was not being accessed by score_analog_tally. Prett sure this bad boy is ready for a pull request.
This commit is contained in:
parent
1dd562c335
commit
8164b888e1
2 changed files with 4 additions and 248 deletions
|
|
@ -1895,253 +1895,6 @@ contains
|
|||
trim(tally_(i) % scores(l))
|
||||
call fatal_error()
|
||||
end select
|
||||
|
||||
|
||||
!~ select case (tally_(i) % scores(l))
|
||||
!~ case ('flux')
|
||||
!~ ! Prohibit user from tallying flux for an individual nuclide
|
||||
!~ if (.not. (t % n_nuclide_bins == 1 .and. &
|
||||
!~ t % nuclide_bins(1) == -1)) then
|
||||
!~ message = "Cannot tally flux for an individual nuclide."
|
||||
!~ call fatal_error()
|
||||
!~ end if
|
||||
!~
|
||||
!~ t % score_bins(j) = SCORE_FLUX
|
||||
!~ if (t % find_filter(FILTER_ENERGYOUT) > 0) then
|
||||
!~ message = "Cannot tally flux with an outgoing energy filter."
|
||||
!~ call fatal_error()
|
||||
!~ end if
|
||||
!~ case ('total')
|
||||
!~ t % score_bins(j) = SCORE_TOTAL
|
||||
!~ if (t % find_filter(FILTER_ENERGYOUT) > 0) then
|
||||
!~ message = "Cannot tally total reaction rate with an &
|
||||
!~ &outgoing energy filter."
|
||||
!~ call fatal_error()
|
||||
!~ end if
|
||||
!~ case ('scatter')
|
||||
!~ t % score_bins(j) = SCORE_SCATTER
|
||||
!~ case ('nu-scatter')
|
||||
!~ t % score_bins(j) = SCORE_NU_SCATTER
|
||||
!~
|
||||
!~ ! Set tally estimator to analog
|
||||
!~ t % estimator = ESTIMATOR_ANALOG
|
||||
!~ case ('scatter-0')
|
||||
!~ ! Does the same as 'scatter', for convenience
|
||||
!~ t % score_bins(j) = SCORE_SCATTER
|
||||
!~ case ('scatter-1')
|
||||
!~ t % score_bins(j) = SCORE_SCATTER_N
|
||||
!~ t % scatt_order(j) = 1
|
||||
!~
|
||||
!~ ! Set tally estimator to analog
|
||||
!~ t % estimator = ESTIMATOR_ANALOG
|
||||
!~ case ('scatter-2')
|
||||
!~ t % score_bins(j) = SCORE_SCATTER_N
|
||||
!~ t % scatt_order(j) = 2
|
||||
!~
|
||||
!~ ! Set tally estimator to analog
|
||||
!~ t % estimator = ESTIMATOR_ANALOG
|
||||
!~ case ('scatter-3')
|
||||
!~ t % score_bins(j) = SCORE_SCATTER_N
|
||||
!~ t % scatt_order(j) = 3
|
||||
!~
|
||||
!~ ! Set tally estimator to analog
|
||||
!~ t % estimator = ESTIMATOR_ANALOG
|
||||
!~ case ('scatter-4')
|
||||
!~ t % score_bins(j) = SCORE_SCATTER_N
|
||||
!~ t % scatt_order(j) = 4
|
||||
!~
|
||||
!~ ! Set tally estimator to analog
|
||||
!~ t % estimator = ESTIMATOR_ANALOG
|
||||
!~ case ('scatter-5')
|
||||
!~ t % score_bins(j) = SCORE_SCATTER_N
|
||||
!~ t % scatt_order(j) = 5
|
||||
!~
|
||||
!~ ! Set tally estimator to analog
|
||||
!~ t % estimator = ESTIMATOR_ANALOG
|
||||
!~
|
||||
!~ case ('scatter-p0')
|
||||
!~ ! Same as a scatter-0 or scatter
|
||||
!~ t % score_bins(j) = SCORE_SCATTER
|
||||
!~ case ('scatter-p1')
|
||||
!~ ! Setup each of P0 and P1
|
||||
!~ t % estimator = ESTIMATOR_ANALOG
|
||||
!~ t % score_bins(j) = SCORE_SCATTER_PN
|
||||
!~ t % scatt_order(j) = 1
|
||||
!~ j = j + 1
|
||||
!~ t % score_bins(j) = SCORE_SCATTER_PN
|
||||
!~ t % scatt_order(j) = 1
|
||||
!~
|
||||
!~ case ('scatter-p2')
|
||||
!~ ! Setup each of P0:P2
|
||||
!~ t % estimator = ESTIMATOR_ANALOG
|
||||
!~ t % score_bins(j) = SCORE_SCATTER_PN
|
||||
!~ t % scatt_order(j) = 2
|
||||
!~ j = j + 1
|
||||
!~ t % score_bins(j) = SCORE_SCATTER_PN
|
||||
!~ t % scatt_order(j) = 2
|
||||
!~ j = j + 1
|
||||
!~ t % score_bins(j) = SCORE_SCATTER_PN
|
||||
!~ t % scatt_order(j) = 2
|
||||
!~
|
||||
!~ case ('scatter-p3')
|
||||
!~ ! Setup each of P0:P3
|
||||
!~ t % estimator = ESTIMATOR_ANALOG
|
||||
!~ t % score_bins(j) = SCORE_SCATTER_PN
|
||||
!~ t % scatt_order(j) = 3
|
||||
!~ j = j + 1
|
||||
!~ t % score_bins(j) = SCORE_SCATTER_PN
|
||||
!~ t % scatt_order(j) = 3
|
||||
!~ j = j + 1
|
||||
!~ t % score_bins(j) = SCORE_SCATTER_PN
|
||||
!~ t % scatt_order(j) = 3
|
||||
!~ j = j + 1
|
||||
!~ t % score_bins(j) = SCORE_SCATTER_PN
|
||||
!~ t % scatt_order(j) = 3
|
||||
!~
|
||||
!~ case ('scatter-p4')
|
||||
!~ ! Setup each of P0:P4
|
||||
!~ t % estimator = ESTIMATOR_ANALOG
|
||||
!~ t % score_bins(j) = SCORE_SCATTER_PN
|
||||
!~ t % scatt_order(j) = 4
|
||||
!~ j = j + 1
|
||||
!~ t % score_bins(j) = SCORE_SCATTER_PN
|
||||
!~ t % scatt_order(j) = 4
|
||||
!~ j = j + 1
|
||||
!~ t % score_bins(j) = SCORE_SCATTER_PN
|
||||
!~ t % scatt_order(j) = 4
|
||||
!~ j = j + 1
|
||||
!~ t % score_bins(j) = SCORE_SCATTER_PN
|
||||
!~ t % scatt_order(j) = 4
|
||||
!~ j = j + 1
|
||||
!~ t % score_bins(j) = SCORE_SCATTER_PN
|
||||
!~ t % scatt_order(j) = 4
|
||||
!~
|
||||
!~ case ('scatter-p5')
|
||||
!~ ! Setup each of P0:P5
|
||||
!~ t % estimator = ESTIMATOR_ANALOG
|
||||
!~ t % score_bins(j) = SCORE_SCATTER_PN
|
||||
!~ t % scatt_order(j) = 5
|
||||
!~ j = j + 1
|
||||
!~ t % score_bins(j) = SCORE_SCATTER_PN
|
||||
!~ t % scatt_order(j) = 5
|
||||
!~ j = j + 1
|
||||
!~ t % score_bins(j) = SCORE_SCATTER_PN
|
||||
!~ t % scatt_order(j) = 5
|
||||
!~ j = j + 1
|
||||
!~ t % score_bins(j) = SCORE_SCATTER_PN
|
||||
!~ t % scatt_order(j) = 5
|
||||
!~ j = j + 1
|
||||
!~ t % score_bins(j) = SCORE_SCATTER_PN
|
||||
!~ t % scatt_order(j) = 5
|
||||
!~ j = j + 1
|
||||
!~ t % score_bins(j) = SCORE_SCATTER_PN
|
||||
!~ t % scatt_order(j) = 5
|
||||
!~
|
||||
!~ case('transport')
|
||||
!~ t % score_bins(j) = SCORE_TRANSPORT
|
||||
!~
|
||||
!~ ! Set tally estimator to analog
|
||||
!~ t % estimator = ESTIMATOR_ANALOG
|
||||
!~ case ('diffusion')
|
||||
!~ t % score_bins(j) = SCORE_DIFFUSION
|
||||
!~
|
||||
!~ ! Set tally estimator to analog
|
||||
!~ t % estimator = ESTIMATOR_ANALOG
|
||||
!~ case ('n1n')
|
||||
!~ t % score_bins(j) = SCORE_N_1N
|
||||
!~
|
||||
!~ ! Set tally estimator to analog
|
||||
!~ t % estimator = ESTIMATOR_ANALOG
|
||||
!~ case ('n2n')
|
||||
!~ t % score_bins(j) = SCORE_N_2N
|
||||
!~
|
||||
!~ ! Set tally estimator to analog
|
||||
!~ t % estimator = ESTIMATOR_ANALOG
|
||||
!~ case ('n3n')
|
||||
!~ t % score_bins(j) = SCORE_N_3N
|
||||
!~
|
||||
!~ ! Set tally estimator to analog
|
||||
!~ t % estimator = ESTIMATOR_ANALOG
|
||||
!~ case ('n4n')
|
||||
!~ t % score_bins(j) = SCORE_N_4N
|
||||
!~
|
||||
!~ ! Set tally estimator to analog
|
||||
!~ t % estimator = ESTIMATOR_ANALOG
|
||||
!~ case ('absorption')
|
||||
!~ t % score_bins(j) = SCORE_ABSORPTION
|
||||
!~ if (t % find_filter(FILTER_ENERGYOUT) > 0) then
|
||||
!~ message = "Cannot tally absorption rate with an outgoing &
|
||||
!~ &energy filter."
|
||||
!~ call fatal_error()
|
||||
!~ end if
|
||||
!~ case ('fission')
|
||||
!~ t % score_bins(j) = SCORE_FISSION
|
||||
!~ if (t % find_filter(FILTER_ENERGYOUT) > 0) then
|
||||
!~ message = "Cannot tally fission rate with an outgoing &
|
||||
!~ &energy filter."
|
||||
!~ call fatal_error()
|
||||
!~ end if
|
||||
!~ case ('nu-fission')
|
||||
!~ t % score_bins(j) = SCORE_NU_FISSION
|
||||
!~ case ('current')
|
||||
!~ t % score_bins(j) = SCORE_CURRENT
|
||||
!~ t % type = TALLY_SURFACE_CURRENT
|
||||
!~
|
||||
!~ ! Check to make sure that current is the only desired response
|
||||
!~ ! for this tally
|
||||
!~ if (n_words > 1) then
|
||||
!~ message = "Cannot tally other scoring functions in the same &
|
||||
!~ &tally as surface currents. Separate other scoring &
|
||||
!~ &functions into a distinct tally."
|
||||
!~ call fatal_error()
|
||||
!~ end if
|
||||
!~
|
||||
!~ ! Since the number of bins for the mesh filter was already set
|
||||
!~ ! assuming it was a volume tally, we need to adjust the number
|
||||
!~ ! of bins
|
||||
!~
|
||||
!~ ! Get index of mesh filter
|
||||
!~ k = t % find_filter(FILTER_MESH)
|
||||
!~
|
||||
!~ ! Get pointer to mesh
|
||||
!~ i_mesh = t % filters(k) % int_bins(1)
|
||||
!~ m => meshes(i_mesh)
|
||||
!~
|
||||
!~ ! We need to increase the dimension by one since we also need
|
||||
!~ ! currents coming into and out of the boundary mesh cells.
|
||||
!~ t % filters(k) % n_bins = product(m % dimension + 1)
|
||||
!~
|
||||
!~ ! Copy filters to temporary array
|
||||
!~ allocate(filters(t % n_filters + 1))
|
||||
!~ filters(1:t % n_filters) = t % filters
|
||||
!~
|
||||
!~ ! Move allocation back -- filters becomes deallocated during
|
||||
!~ ! this call
|
||||
!~ call move_alloc(FROM=filters, TO=t%filters)
|
||||
!~
|
||||
!~ ! Add surface filter
|
||||
!~ t % n_filters = t % n_filters + 1
|
||||
!~ t % filters(t % n_filters) % type = FILTER_SURFACE
|
||||
!~ t % filters(t % n_filters) % n_bins = 2 * m % n_dimension
|
||||
!~ allocate(t % filters(t % n_filters) % int_bins(&
|
||||
!~ 2 * m % n_dimension))
|
||||
!~ if (m % n_dimension == 2) then
|
||||
!~ t % filters(t % n_filters) % int_bins = (/ IN_RIGHT, &
|
||||
!~ OUT_RIGHT, IN_FRONT, OUT_FRONT /)
|
||||
!~ elseif (m % n_dimension == 3) then
|
||||
!~ t % filters(t % n_filters) % int_bins = (/ IN_RIGHT, &
|
||||
!~ 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: " // &
|
||||
!~ trim(tally_(i) % scores(l))
|
||||
!~ call fatal_error()
|
||||
!~ end select
|
||||
end do
|
||||
t % n_score_bins = n_scores
|
||||
t % n_nonPN_score_bins = n_words
|
||||
|
|
|
|||
|
|
@ -181,7 +181,10 @@ contains
|
|||
|
||||
case (SCORE_SCATTER_PN)
|
||||
! Skip any event where the particle didn't scatter
|
||||
if (p % event /= EVENT_SCATTER) cycle SCORE_LOOP
|
||||
if (p % event /= EVENT_SCATTER) then
|
||||
j = j + t % scatt_order(j)
|
||||
cycle SCORE_LOOP
|
||||
end if
|
||||
score_index = score_index - 1
|
||||
! Find the scattering order for a collection of requested moments
|
||||
! and store the moment contribution of each
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue