From b3a4779e6efa145ce385486525aed77fb463aaac Mon Sep 17 00:00:00 2001 From: Bryan Herman Date: Tue, 27 Nov 2012 06:01:41 -0800 Subject: [PATCH] reactivated use of inactive flushes for user input, and now cmfd weights are held on the batch right after tally flush --- src/cmfd_execute.F90 | 9 ++++++--- src/cmfd_input.F90 | 3 ++- src/templates/cmfd_t.xml | 2 ++ 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/cmfd_execute.F90 b/src/cmfd_execute.F90 index e0069b1e45..af7cab6685 100644 --- a/src/cmfd_execute.F90 +++ b/src/cmfd_execute.F90 @@ -66,6 +66,7 @@ contains if (cmfd_hold_weights) then message = 'Not Modifying Weights - Albedo estimate not good, increase batch size.' call warning() + cmfd_hold_weights = .false. if (cmfd_feedback) call cmfd_reweight(.false.) leave_cmfd = .true. end if @@ -144,7 +145,7 @@ contains use global, only: cmfd_begin, cmfd_on, & cmfd_tally_on, n_inactive, & cmfd_inact_flush, cmfd_act_flush, cmfd_run, & - current_batch + current_batch, cmfd_hold_weights ! check to activate CMFD diffusion and possible feedback ! this guarantees that when cmfd begins at least one batch of tallies are @@ -152,6 +153,8 @@ contains if (cmfd_run .and. cmfd_begin == current_batch) then cmfd_on = .true. cmfd_tally_on = .true. + cmfd_hold_weights = .true. + call cmfd_tally_reset() end if ! check to flush cmfd tallies for active batches, no more inactive flush @@ -167,8 +170,8 @@ contains ! if (cmfd_run .and. current_batch < n_inactive .and. mod(current_batch-1,cmfd_inact_flush(1)) & ! == 0 .and. cmfd_inact_flush(2) >= 0) then if (cmfd_run .and. mod(current_batch,cmfd_inact_flush(1)) & - == 0 .and. cmfd_inact_flush(2) > 0) then - + == 0 .and. cmfd_inact_flush(2) > 0 .and. cmfd_begin < current_batch) then + cmfd_hold_weights = .true. call cmfd_tally_reset() cmfd_inact_flush(2) = cmfd_inact_flush(2) - 1 end if diff --git a/src/cmfd_input.F90 b/src/cmfd_input.F90 index fbb018802b..60c0f6d834 100644 --- a/src/cmfd_input.F90 +++ b/src/cmfd_input.F90 @@ -137,7 +137,8 @@ contains cmfd_tally_on = inactive_ ! inactive batch flush window -! cmfd_inact_flush = inactive_flush_ + cmfd_inact_flush(1) = inactive_flush_ + cmfd_inact_flush(2) = num_flushes_ ! last flush before active batches cmfd_act_flush = active_flush_ diff --git a/src/templates/cmfd_t.xml b/src/templates/cmfd_t.xml index 8d3cf9812a..0f87169004 100644 --- a/src/templates/cmfd_t.xml +++ b/src/templates/cmfd_t.xml @@ -33,5 +33,7 @@ + +