Merge remote-tracking branch 'origin/delayed-tallies' into velocity-tally

This commit is contained in:
Sam Shaner 2015-10-23 17:44:36 -04:00
commit 8ff4866020
11 changed files with 36 additions and 35 deletions

View file

@ -1355,7 +1355,7 @@ The ``<tally>`` element accepts the following sub-elements:
<filter type="delayedgroup" bins="1 2 3 4 5 6" />
:nuclides:
:nuclides:
If specified, the scores listed will be for particular nuclides, not the
summation of reactions from all nuclides. The format for nuclides should be
[Atomic symbol]-[Mass number], e.g. "U-235". The reaction rate for all

View file

@ -271,7 +271,7 @@ class Filter(object):
merged_filter = copy.deepcopy(self)
# Merge unique filter bins
merged_bins = list(set(self.bins + filter.bins))
merged_bins = list(set(np.concatenate((self.bins, filter.bins))))
merged_filter.bins = merged_bins
merged_filter.num_bins = len(merged_bins)

View file

@ -432,10 +432,8 @@ class StatePoint(object):
score = score.decode()
# If this is a moment, use generic moment order
regexp = re.compile(r'-n$|-pn$|-yn$')
if regexp.search(score) is not None:
score = score.strip(regexp.findall(score)[0])
score += '-' + moments[j].decode()
pattern = r'-n$|-pn$|-yn$'
score = re.sub(pattern, '-' + moments[j].decode(), score)
tally.add_score(score)

View file

@ -565,6 +565,21 @@ class Tally(object):
if len(self.filters) != len(tally.filters):
return False
# Check if only one tally contains a delayed group filter
tally1_dg = False
for filter1 in self.filters:
if filter1.type == 'delayedgroup':
tally1_dg = True
tally2_dg = False
for filter2 in tally.filters:
if filter2.type == 'delayedgroup':
tally2_dg = True
# Return False if only one tally has a delayed group filter
if (tally1_dg or tally2_dg) and not (tally1_dg and tally2_dg):
return False
# Look to see if all filters are the same, or one or more can be merged
for filter1 in self.filters:
mergeable_filter = False

View file

@ -640,8 +640,8 @@ contains
! of delayed groups
if (NPCR > MAX_DELAYED_GROUPS) then
call fatal_error("Encountered nuclide with " // trim(to_str(NPCR)) &
&// " delayed groups while the maximum number of delayed groups " &
&// "set in constants.F90 is " // trim(to_str(MAX_DELAYED_GROUPS)))
// " delayed groups while the maximum number of delayed groups &
&set in constants.F90 is " // trim(to_str(MAX_DELAYED_GROUPS)))
end if
nuc % n_precursor = NPCR
@ -681,7 +681,7 @@ contains
else
nuc % nu_d_type = NU_NONE
nuc % n_precursor = ZERO
nuc % n_precursor = 0
end if
end subroutine read_nu_data

View file

@ -89,9 +89,9 @@ contains
function nu_delayed(nuc, E) result(nu)
type(Nuclide), pointer :: nuc ! nuclide from which to find nu
real(8), intent(in) :: E ! energy of incoming neutron
real(8) :: nu ! number of delayed neutrons emitted per fission
type(Nuclide), intent(in) :: nuc ! nuclide from which to find nu
real(8), intent(in) :: E ! energy of incoming neutron
real(8) :: nu ! number of delayed neutrons emitted per fission
if (nuc % nu_d_type == NU_NONE) then
! since no prompt or delayed data is present, this means all neutron

View file

@ -2937,7 +2937,7 @@ contains
! Check if delayed group filter is used with any score besides
! delayed-nu-fission
if (trim(score_name) /= 'delayed-nu-fission' .and. &
if (score_name /= 'delayed-nu-fission' .and. &
t % find_filter(FILTER_DELAYEDGROUP) > 0) then
call fatal_error("Cannot tally " // trim(score_name) // " with a &
&delayedgroup filter.")

View file

@ -106,7 +106,6 @@ contains
subroutine initialize_particle(this)
class(Particle) :: this
integer :: d
! Clear coordinate lists
call this % clear()

View file

@ -1063,7 +1063,6 @@ contains
integer, intent(in) :: i_nuclide
integer, intent(in) :: i_reaction
integer :: d ! delayed group index
integer :: nu_d(MAX_DELAYED_GROUPS) ! number of delayed neutrons born
integer :: i ! loop index
integer :: nu ! actual number of neutrons produced

View file

@ -506,14 +506,8 @@ contains
cycle SCORE_LOOP
else
score = ZERO
! Loop over all delayed groups and accumulate the contribution
! from each group
do d = 1, nuclides(p % event_nuclide) % n_precursor
score = score + keff * p % wgt_bank / p % n_bank * &
p % n_delayed_bank(d)
end do
! Add the contribution from all delayed groups
score = keff * p % wgt_bank / p % n_bank * sum(p % n_delayed_bank)
end if
end if
else
@ -600,12 +594,9 @@ contains
! Get index in nuclides array
i_nuc = mat % nuclide(l)
! Get the current nuclide
nuc => nuclides(i_nuc)
! Accumulate the contribution from each nuclide
score = score + micro_xs(i_nuc) % fission &
* nu_delayed(nuc, p % E) * atom_density_ * flux
* nu_delayed(nuclides(i_nuc), p % E) * atom_density_ * flux
end do
end if
end if
@ -1070,9 +1061,9 @@ contains
subroutine score_fission_delayed_eout(p, t, i_score)
type(Particle), intent(in) :: p
type(TallyObject), intent(in) :: t
integer, intent(in) :: i_score ! index for score
type(Particle), intent(in) :: p
type(TallyObject), intent(inout) :: t
integer, intent(in) :: i_score ! index for score
integer :: i ! index of outgoing energy filter
integer :: j ! index of delayedgroup filter
@ -1084,7 +1075,7 @@ contains
integer :: bin_energyout ! original outgoing energy bin
real(8) :: score ! actual score
real(8) :: E_out ! energy of fission bank site
logical :: d_found = .FALSE. ! bool to inidicate if delayed group was found
logical :: d_found = .false. ! bool to inidicate if delayed group was found
! save original outgoing energy and delayed group bins
i = t % find_filter(FILTER_ENERGYOUT)
@ -1153,9 +1144,9 @@ contains
subroutine score_fission_delayed_dg(t, d_bin, score, score_index)
type(TallyObject) :: t
integer, intent(in) :: score_index ! index for score
integer, intent(in) :: d_bin ! delayed group bin index
type(TallyObject), intent(inout) :: t
integer, intent(in) :: score_index ! index for score
integer, intent(in) :: d_bin ! delayed group bin index
integer :: bin_original ! original bin index
integer :: filter_index ! index for matching filter bin combination

View file

@ -29,7 +29,6 @@ contains
type(Particle), intent(inout) :: p
integer :: d ! delayed group index
integer :: j ! coordinate level
integer :: next_level ! next coordinate level to check
integer :: surface_crossed ! surface which particle is on