From 5c5d120220cdf26eb555a8affbbce957f535f886 Mon Sep 17 00:00:00 2001 From: Bryan Herman Date: Sat, 14 Jan 2012 16:54:19 -0500 Subject: [PATCH] added zero flux trap --- src/cmfd_execute.F90 | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/cmfd_execute.F90 b/src/cmfd_execute.F90 index 01b10a73dc..9bb137274a 100644 --- a/src/cmfd_execute.F90 +++ b/src/cmfd_execute.F90 @@ -129,6 +129,21 @@ contains flux = t % scores(score_index,1) % val cmfd % flux(h,i,j,k) = flux + ! detect zero flux + if ((flux - 0.0D0) < 1.0D-10) then + if (.not. allocated(cmfd%coremap)) then + write(*,*) 'Fatal: detected zero flux without coremap' + stop + else + write(*,*) 'Warning: detected zero flux at:',i,j,k + flux = 99999.0D0 + if (.not. cmfd%coremap(i,j,k) == 99999) then + write(*,*) 'Fatal: need to check core map with zero flux' + stop + end if + end if + end if + ! get total rr and convert to total xs cmfd % totalxs(h,i,j,k) = t % scores(score_index,2) % val / flux