12 DO 100 ifield=1,nfield
13 IF (ifadvc(ifield)) iadv = 1
15 IF (.NOT.iftran.AND.(iadv.EQ.1)) isss = 1
16 IF (isss.EQ.1.AND.nfield.GT.4.AND.nid.EQ.0)
THEN
18 WRITE (6,*)
'Trying to activate the steady state solver'
19 WRITE (6,*)
'using NFIELD =',nfield
20 WRITE (6,*)
'Maximum number of fields is 4'
47 IF (.NOT.ifflow) mfield=2
48 DO 10 ifield=mfield,nfield
49 diffus = avdiff(ifield)/avtran(ifield)
50 tauss(ifield) = 1./(eigaa*diffus)
51 txnext(ifield) = tauss(ifield)
52 IF (tauss(ifield).LT.taumin) taumin = tauss(ifield)
67 IF (ifsplit) prelax = 1.e-4
92 REAL H1NRM1 (LDIMT1), H1NRM2(LDIMT1)
94 CALL rzero (h1nrm1,nfield)
98 h1nrm1(ifield) = vnrmh1
100 DO 10 ifield=2,nfield
102 h1nrm1(ifield) = tnrmh1(ifield-1)
108 CALL rzero (h1nrm2,nfield)
112 h1nrm2(ifield) = vnrmh1
114 DO 20 ifield=2,nfield
116 h1nrm2(ifield) = tnrmh1(ifield-1)
122 rdlim = .5*tolrel+1.e-4
125 rdiff = abs((h1nrm2(ifield)-h1nrm1(ifield))/h1nrm1(ifield))
126 IF (rdiff.GT.rdmax) rdmax = rdiff
127 IF (nio.EQ.0)
WRITE (6,*)
' ifield, rdiff ',ifield,rdiff
128 IF (rdiff.GT.xlim) ifaccx = .false.
130 DO 100 ifield=2,nfield
131 rdiff = abs((h1nrm2(ifield)-h1nrm1(ifield))/h1nrm1(ifield))
132 IF (rdiff.GT.rdmax) rdmax = rdiff
133 IF (nio.EQ.0)
WRITE (6,*)
' ifield, rdiff ',ifield,rdiff
134 IF (rdiff.GT.xlim) ifaccx = .false.
137 IF (.NOT.ifaccx)
THEN
140 write (6,*)
'Extrapolation attempt rejected'
147 write (6,*)
'Extrapolation accepted'
150 IF (rdmax.LT.rdlim) ifssvt = .true.
168 DO 100 ifield=2,nfield
188 IF (itest.EQ.0.AND.ifssvt)
GOTO 1001
189 IF (itest.EQ.1.AND.(ifssvt.OR.ifexvt))
GOTO 1001
208 IF (.NOT.ifskip) njstep=1
209 IF ( ifskip) njstep=nsskip
211 DO 9000 jstep=1,njstep
224 IF (ifflow)
CALL fluid (igeom)
225 IF (ifheat)
CALL heat (igeom)
226 IF (ifmvbd)
CALL meshv (igeom)
248 IF (.NOT.ifskip) njstep=1
249 IF ( ifskip) njstep=nsskip
251 DO 9000 jstep=1,njstep
264 IF (ifflow)
CALL fluid (igeom)
265 IF (ifheat)
CALL heat (igeom)
266 IF (ifmvbd)
CALL meshv (igeom)
291 IF (.NOT.ifflow) mfield=2
292 DO 100 ifield=mfield,nfield
293 ntot = lx1*ly1*lz1*nelfld(ifield)
294 tau = .02*tauss(ifield)
295 decay = 1.+99.*exp(-time/tau)
296 CALL cmult (vdiff(1,1,1,1,ifield),decay,ntot)
316 ntotv = lx1*ly1*lz1*nelv
323 x(i+ntotv) = vy(i,1,1,1)
328 x(i+ioff) = vz(i,1,1,1)
335 DO 401 ifield=2,nfield
336 ntot = lx1*ly1*lz1*nelfld(ifield)
338 x(i+ioff) = t(i,1,1,1,ifield-1)
359 ntotv = lx1*ly1*lz1*nelv
366 vy(i,1,1,1) = x(i+ntotv)
371 vz(i,1,1,1) = x(i+ioff)
378 DO 41 ifield=2,nfield
379 ntot = lx1*ly1*lz1*nelfld(ifield)
381 t(i,1,1,1,ifield-1) = x(i+ioff)
407 IF (ifsplit) prelax = 1.e-5
410 IF (ifsplit) ctarg = 1.
413 IF (ifsplit) ctarg = 2.
425 IF (ifsplit) prelax = 1.e-5
428 IF (ifsplit) ctarg = 1.
431 IF (ifsplit) ctarg = 2.
464 DO 100 ifield=2,nfield
471 IF (.NOT.ifflow) mfield=2
472 DO 200 ifield=mfield,nfield
473 IF(.NOT.ifstst(ifield)) ifssvt = .false.
474 IF(.NOT.ifextr(ifield)) ifexvt = .false.
492 COMMON /ctolpr/ divex
493 COMMON /cprint/ ifprint
496 COMMON /scrss2/ dv1(lx1,ly1,lz1,lelv)
497 $ , dv2(lx1,ly1,lz1,lelv)
498 $ , dv3(lx1,ly1,lz1,lelv)
499 COMMON /scruz/ w1(lx1,ly1,lz1,lelv)
500 $ , w2(lx1,ly1,lz1,lelv)
501 $ , w3(lx1,ly1,lz1,lelv)
502 $ , bdivv(lx2,ly2,lz2,lelv)
503 COMMON /scrmg/ t1(lx1,ly1,lz1,lelv)
504 $ , t2(lx1,ly1,lz1,lelv)
505 $ , t3(lx1,ly1,lz1,lelv)
506 $ , divv(lx2,ly2,lz2,lelv)
507 COMMON /scrvh/ h1(lx1,ly1,lz1,lelv)
508 $ , h2(lx1,ly1,lz1,lelv)
510 CALL opsub3 (dv1,dv2,dv3,vx,vy,vz,vxlag,vylag,vzlag)
511 CALL normvc (dvnnh1,dvnnsm,dvnnl2,dvnnl8,dv1,dv2,dv3)
513 CALL sethlm (h1,h2,intype)
514 CALL ophx (w1,w2,w3,dv1,dv2,dv3,h1,h2)
517 CALL opcolv3(t1,t2,t3,w1,w2,w3,binvm1)
518 CALL ophx (w1,w2,w3,t1,t2,t3,h1,h2)
519 CALL opcol2 (w1,w2,w3,dv1,dv2,dv3)
520 ntot1 = lx1*ly1*lz1*nelv
521 usnrm1 =
glsum(w1,ntot1)
522 usnrm2 =
glsum(w2,ntot1)
524 IF (ldim.EQ.3) usnrm3 =
glsum(w3,ntot1)
525 usnorm = sqrt( (usnrm1+usnrm2+usnrm3)/volvm1 )
527 ntot2 = lx2*ly2*lz2*nelv
528 CALL opdiv (bdivv,vx,vy,vz)
529 CALL col3 (divv,bdivv,bm2inv,ntot2)
530 dnorm = sqrt(
glsc2(divv,bdivv,ntot2)/volvm2)
534 tolhv3 = tolhv*(ldim)
535 IF (ifstrs) tolhv3 = tolhv
536 IF (nio.EQ.0 .AND. ifprint)
THEN
537 WRITE (6,*)
'USNORM, TOLHV',usnorm,tolhv3
538 WRITE (6,*)
'DNORM, TOLPS',dnorm,tolps
540 IF (dnorm.GT.(1.1*divex).AND.divex.GT.0.
541 $ .AND.tolpdf.EQ.0.) tolpdf = 5.*dnorm
542 usrel = usnorm/tolhv3
545 IF (tolrel.GT.0.)
THEN
548 WRITE (6,*)
'WARNING: TOLREL=0. Please modify *.rea'
551 ifextr(ifield) = .false.
554 IF (usrel.LT.exfac) ifextr(ifield) = .true.
555 if (nio.eq.0 .and. ifprint)
556 $
WRITE (6,*)
'Tau, Txnext ',ifield,tauss(ifield),txnext(ifield)
558 ifstst(ifield) = .false.
561 IF (usnorm.LT.uslim.AND.dnorm.LT.dlim .AND. .NOT.ifsplit)
562 $ ifstst(ifield) = .true.
563 IF (usnorm.LT.uslim .AND. ifsplit)
564 $ ifstst(ifield) = .true.
580 COMMON /scruz/ deltat(lx1,ly1,lz1,lelt)
581 $ , wa(lx1,ly1,lz1,lelt)
582 $ , wb(lx1,ly1,lz1,lelt)
583 COMMON /scrvh/ h1(lx1,ly1,lz1,lelt)
584 $ , h2(lx1,ly1,lz1,lelt)
585 COMMON /cprint/ ifprint
588 ntot = lx1*ly1*lz1*nelt
589 CALL sub3 (deltat(1,1,1,1),t(1,1,1,1,ifield-1),
590 $ tlag(1,1,1,1,1,ifield-1),ntot)
591 CALL normsc (dvnnh1,dvnnsm,dvnnl2,dvnnl8,deltat,imesh)
594 CALL sethlm (h1,h2,intype)
595 CALL axhelm (wa,deltat,h1,h2,imesh,isd)
596 CALL dssum (wa,lx1,ly1,lz1)
597 CALL col2 (wa,tmask(1,1,1,1,ifield-1),ntot)
598 CALL col3 (wb,wa,bintm1,ntot)
599 CALL axhelm (wa,wb,h1,h2,imesh,isd)
600 CALL col2 (wa,deltat,ntot)
601 usnorm = sqrt(
glsum(wa,ntot)/voltm1)
604 IF (nio.EQ.0 .AND. ifprint)
605 $
WRITE (6,*)
'USNORM, TOLHT',usnorm,tolht(ifield)
606 usrel = usnorm/tolht(ifield)
608 IF (tolrel.GT.0.)
THEN
611 WRITE (6,*)
'WARNING: TOLREL=0. Please modify *.rea'
614 ifextr(ifield) = .false.
617 IF (usrel.LT.exfac) ifextr(ifield) = .true.
618 IF(nio.EQ.0 .AND. ifprint)
619 $
WRITE (6,*)
'Tau, Txnext ',ifield,tauss(ifield),txnext(ifield)
621 ifstst(ifield) = .false.
622 uslim = 2.*tolht(ifield)
623 IF (usnorm.LT.uslim) ifstst(ifield) = .true.
633 REAL DV1(1),DV2(1),DV3(1)
634 CALL normvc (dvdfh1,dvdfsm,dvdfl2,dvdfl8,dv1,dv2,dv3)
642 REAL DV1(1),DV2(1),DV3(1)
643 CALL normvc (dvprh1,dvprsm,dvprl2,dvprl8,dv1,dv2,dv3)
661 ntot = lx1*ly1*lz1*nelfld(ifield)
662 avvisc =
glmin(vdiff(1,1,1,1,ifield),ntot)
663 avdens =
glmax(vtrans(1,1,1,1,ifield),ntot)
666 IF (istep.EQ.1) vnorm = vnrml8
667 IF (istep.GT.1) vnorm = vnrmsm
668 IF (vnorm.EQ.0.) vnorm = tolabs
669 factor = 1.+(avdens/(eigaa*avvisc*dt))
672 IF (vnorm.EQ.0.) vnorm = tolabs
676 tolps = tolrel*vnorm * sqrt(eigas)/(4.*factor)
677 tolhv = tolrel*vnorm * sqrt(eigaa)*avvisc/2.
679 IF (.NOT.iftran .AND. .NOT.ifnav) tolhv = tolhv/10.
687 IF (tolpdf.NE.0.) tolps = tolpdf
706 ntot = lx1*ly1*lz1*nelfld(ifield)
707 avcond =
glmin(vdiff(1,1,1,1,ifield),ntot)
710 IF (istep.EQ.1)
tnorm = tnrml8(ifield-1)
711 IF (istep.GT.1)
tnorm = tnrmsm(ifield-1)
714 tnorm = tnrml8(ifield-1)
718 tolht(ifield) = tolrel*
tnorm * sqrt(eigaa)*avcond
728 COMMON /scrmg/ divfld(lx2,ly2,lz2,lelv)
729 $ , work(lx2,ly2,lz2,lelv)
730 ntot2 = lx2*ly2*lz2*nelv
731 CALL opdiv (divfld,vx,vy,vz)
732 CALL col3 (work,divfld,bm2inv,ntot2)
733 CALL col2 (work,divfld,ntot2)
734 divv = sqrt(
glsum(work,ntot2)/volvm2)
739 IF (tolmin.LT.tolps) tolmin = tolps
757 DATA max_cfl_rk4 /2.0/
760 ict = max(int(ctarg/max_cfl_rk4),1)
762 dct = ctarg - ict*max_cfl_rk4
763 IF (dct.GT.0.1) ntaubd = ntaubd+1
764 IF (nio.EQ.0)
write(6,*)
'RK4 substeps:', ntaubd
767 IF (ctarg.GT.0.5)
THEN
769 $
WRITE (6,*)
'Reset the target Courant number to .5'
785 COMMON /scrns/ w1(lx1,ly1,lz1,lelv)
786 $ , w2(lx1,ly1,lz1,lelv)
787 $ , w3(lx1,ly1,lz1,lelv)
788 $ , dv1(lx1,ly1,lz1,lelv)
789 $ , dv2(lx1,ly1,lz1,lelv)
790 $ , dv3(lx1,ly1,lz1,lelv)
791 $ , respr(lx2,ly2,lz2,lelv)
792 COMMON /scrvh/ h1(lx1,ly1,lz1,lelv)
793 $ , h2(lx1,ly1,lz1,lelv)
795 IF (nio.EQ.0)
WRITE(6,5)
796 5
FORMAT(/,
' Project',/)
798 ntot1 = lx1*ly1*lz1*nelv
799 ntot2 = lx2*ly2*lz2*nelv
801 CALL rzero (h1,ntot1)
803 CALL opdiv (respr,vx,vy,vz)
806 CALL uzawa (respr,h1,h2,intype,icg)
808 CALL opbinv (dv1,dv2,dv3,w1,w2,w3,h2)
809 CALL opadd2 (vx,vy,vz,dv1,dv2,dv3)
subroutine gengeom(igeom)
subroutine dssum(u, nx, ny, nz)
subroutine axhelm(au, u, helm1, helm2, imesh, isd)
subroutine col3(a, b, c, n)
subroutine sub3(a, b, c, n)
subroutine cmult(a, const, n)
subroutine opgradt(outx, outy, outz, inpfld)
subroutine uzawa(rcg, h1, h2, h2inv, intype, iter)
subroutine opdssum(a, b, c)
subroutine opcol2(a1, a2, a3, b1, b2, b3)
subroutine opbinv(out1, out2, out3, inp1, inp2, inp3, h2inv)
subroutine opdiv(outfld, inpx, inpy, inpz)
subroutine opcolv3(a1, a2, a3, b1, b2, b3, c)
subroutine opmask(res1, res2, res3)
subroutine normvc(h1, semi, l2, linf, x1, x2, x3)
subroutine ophx(out1, out2, out3, inp1, inp2, inp3, h1, h2)
subroutine opadd2(a1, a2, a3, b1, b2, b3)
subroutine opsub3(a1, a2, a3, b1, b2, b3, c1, c2, c3)
subroutine normsc(h1, semi, l2, linf, x, imesh)
subroutine prepost(ifdoin, prefin)
subroutine ssnormd(DV1, DV2, DV3)
subroutine ssnormp(DV1, DV2, DV3)
subroutine chktolp(TOLMIN)
subroutine go1step(X, Y, NVEC)
subroutine gonstep(N, ITEST)
subroutine ssparam(KMAX, L)
subroutine chkext(IFACCX, Z, S)
subroutine sethlm(h1, h2, intloc)