Skip to content
Snippets Groups Projects
Commit f5ac1cc8 authored by Dave Whipp's avatar Dave Whipp
Browse files

Modified nonlinear iteration convergence criterion to calculate the maximum...

Modified nonlinear iteration convergence criterion to calculate the maximum velocity difference between iterations over the maximum vector length from the previous iteration
parent c8062e0b
No related branches found
No related tags found
No related merge requests found
......@@ -16,9 +16,9 @@
!------------------------------------------------------------------------------|
!------------------------------------------------------------------------------|
subroutine compute_convergence_criterion (osolve,ov,vo,params,istep,iter,iter_nl, &
refine_level, &
velocity_converged)
subroutine compute_convergence_criterion (osolve,ov,vo,params,istep,iter, &
iter_nl,refine_level, &
velocity_converged)
!------------------------------------------------------------------------------|
!(((((((((((((((( Purpose of the routine ))))))))))))))))))))))))))))))))))))))
......@@ -50,7 +50,7 @@ logical velocity_converged
integer err,ierr,iproc,nproc,i
double precision dduvw,duvw,uvw,time1,time2
double precision velocity_diff_norm
double precision velocity_diff_norm,maxdiff,oldmax
character*72 shift
!------------------------------------------------------------------------------|
......@@ -67,25 +67,33 @@ uvw=0.d0
maxu=0.d0
maxv=0.d0
maxw=0.d0
oldmax= 0.d0
maxdiff=0.d0
do i=1,osolve%nnode
if (vo%influid(i)) then
dduvw=(osolve%u(i)-ov%unode(i))**2&
+(osolve%v(i)-ov%vnode(i))**2&
+(osolve%w(i)-ov%wnode(i))**2
duvw=duvw+dduvw
uvw=uvw+(ov%unode(i))**2+(ov%vnode(i))**2+(ov%wnode(i))**2
maxu=max(maxu,abs(osolve%u(i)-ov%unode(i)))
maxv=max(maxv,abs(osolve%v(i)-ov%vnode(i)))
maxw=max(maxw,abs(osolve%w(i)-ov%wnode(i)))
!duvw=duvw+dduvw
!uvw=uvw+(ov%unode(i))**2+(ov%vnode(i))**2+(ov%wnode(i))**2
uvw=(ov%unode(i))**2+(ov%vnode(i))**2+(ov%wnode(i))**2
!maxu=max(maxu,abs(osolve%u(i)-ov%unode(i)))
!maxv=max(maxv,abs(osolve%v(i)-ov%vnode(i)))
!maxw=max(maxw,abs(osolve%w(i)-ov%wnode(i)))
oldmax=max(oldmax,uvw)
maxdiff=max(maxdiff,dduvw)
endif
enddo
! Uncommented for testing - dwhipp 12/10
!velocity_diff_norm=sqrt(duvw)/sqrt(uvw)
velocity_diff_norm=max(maxu,maxv,maxw)/2.d0
! New convergence criterion - dwhipp 12/10
velocity_diff_norm=sqrt(maxdiff)/sqrt(oldmax)
! Commented out for testing - dwhipp 12/10
!velocity_diff_norm=max(maxu,maxv,maxw)/2.d0
!velocity_converged=(velocity_diff_norm<params%tol)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment