98 REAL(RFREAL) :: dtimesystem
100 TYPE(t_region
),
POINTER :: regions(:)
103 INTEGER :: ireg, subiter
106 INTEGER,
SAVE :: iter=0
107 INTEGER,
ALLOCATABLE :: timescheme(:)
109 LOGICAL :: stopexists, finished, ftermnew, residfterm, &
110 doprint, dowrite, doprobe, dothrust, movegrid
112 REAL(RFREAL),
SAVE :: timeprint=0._rfreal, timewrite =0._rfreal, &
113 timeprobe=0._rfreal, timethrust=0._rfreal
114 REAL(RFREAL) :: time, subtime, timebc, alphabc, residrat
115 REAL(RFREAL),
ALLOCATABLE :: cfl(:), smoocf(:)
116 REAL(RFREAL),
POINTER :: cv(:,:), cvn(:,:), cvn1(:,:), cvn2(:,:)
122 global => regions(1)%global
125 'RFLO_DualTimeStepping.F90' )
130 IF (global%predCorrIter)
THEN
132 global%predCorrIter = .false.
138 IF (global%dtFixed)
THEN
139 IF (global%currentTime <= epsilon( 1._rfreal ))
THEN
140 global%dtMin = global%dtImposed
143 global%dtMin = global%dtImposed
147 global%stopRun = 0._rfreal
157 DO ireg=1,global%nRegions
158 IF (regions(ireg)%mixtInput%moveGrid) movegrid = .true.
165 global%dualTstSource = .false.
173 ALLOCATE( timescheme(global%nRegions) )
174 ALLOCATE( cfl(global%nRegions) )
175 ALLOCATE( smoocf(global%nRegions) )
176 DO ireg=1,global%nRegions
179 timescheme(ireg) = regions(ireg)%mixtInput%timeScheme
180 cfl(ireg) = regions(ireg)%mixtInput%cfl
181 smoocf(ireg) = regions(ireg)%mixtInput%smoocf
182 regions(ireg)%mixtInput%timeScheme = tst_std4rk
183 regions(ireg)%mixtInput%cfl = 3._rfreal
193 global%dtMin = 1.e+30_rfreal
194 DO ireg=1,global%nRegions
195 IF (regions(ireg)%procid==global%myProcid .AND. &
196 regions(ireg)%active==active)
THEN
197 IF (regions(ireg)%mixtInput%flowModel == flow_euler)
THEN
205 IF (time+global%dtMin > dtimesystem)
THEN
206 global%dtMin = dtimesystem - time
214 global%currentTime = global%currentTime + global%dtMin
215 time = time + global%dtMin
216 subtime = subtime + global%dtMin
221 DO ireg=1,global%nRegions
222 IF (regions(ireg)%procid==global%myProcid .AND. &
223 regions(ireg)%active==active)
THEN
224 regions(ireg)%mixtInput%timeScheme = timescheme(ireg)
225 regions(ireg)%mixtInput%cfl = cfl(ireg)
226 regions(ireg)%mixtInput%smoocf = smoocf(ireg)
230 DEALLOCATE( timescheme )
236 IF (global%dtImposed <= subtime)
THEN
237 global%dtMin = 0._rfreal
239 global%dtMin = global%dtMin + global%dtImposed
240 IF (global%dtMin > subtime)
EXIT
242 global%dtMin = global%dtMin - subtime
244 global%dtMin = global%dtImposed - subtime
246 global%dualTstSource = .true.
254 IF (global%dtFixed)
THEN
257 IF (iter > 0) global%dtMin = global%dtImposed
262 residrat = global%residual/(global%resInit*global%tolSubIter)
264 global%dtMin = 0.01_rfreal * global%dtMin
265 ELSEIF (iter == 1)
THEN
266 IF (global%currentTime < global%dtImposed) &
267 global%dtMin = global%dtImposed
268 ELSEIF (iter > 1)
THEN
269 IF (residrat > 1._rfreal)
THEN
270 global%dtMin = 0.75_rfreal*global%dtMin
272 IF (global%dtMin < global%dtImposed) &
273 global%dtMin =
min( 1.25_rfreal*global%dtMin, global%dtImposed )
279 IF (time+global%dtMin > dtimesystem)
THEN
280 global%dtMin = dtimesystem - time
287 IF (global%moveGridScheme == movegrid_blocks)
THEN
289 ELSEIF (global%moveGridScheme == movegrid_global)
THEN
291 ELSEIF (global%moveGridScheme == movegrid_frame .OR. &
292 global%moveGridScheme == movegrid_foms)
THEN
294 ELSEIF (global%moveGridScheme == movegrid_elglobal)
THEN
296 ELSEIF (global%moveGridScheme == movegrid_elframe)
THEN
319 DO ireg=1,global%nRegions
320 IF (regions(ireg)%procid==global%myProcid .AND. &
321 regions(ireg)%active==active)
THEN
323 IF (global%predictSol .OR. iter==0) &
331 global%flowType = flow_steady
334 subiter = subiter + 1
335 global%currentIter = subiter
338 IF (global%myProcid==masterproc .AND. global%verbLevel>=verbose_high)
THEN
339 WRITE(stdout,
'(A,1X,2I6,1PE13.4,E13.4)') &
340 solver_name,iter,subiter,global%residual/global%resInit,global%residual
342 IF (subiter==global%maxSubIter .OR. &
343 global%residual/global%resInit<=global%tolSubIter .OR. &
344 global%residual<100._rfreal*epsilon(1.0_rfreal))
EXIT
346 IF (global%myProcid == masterproc .AND. global%verbLevel>=verbose_low)
THEN
347 WRITE(stdout,
'(A,1X,I6,1PE13.4,E13.4)') &
348 solver_name,subiter,global%residual/global%resInit,global%residual
351 global%flowType = flow_unsteady
355 DO ireg=1,global%nRegions
356 IF (regions(ireg)%procid==global%myProcid .AND. &
357 regions(ireg)%active==active)
THEN
365 DO ireg=1,global%nRegions
366 IF (regions(ireg)%procid==global%myProcid .AND. &
367 regions(ireg)%active==active)
THEN
368 IF ( regions(ireg)%periInput%flowKind /= off )
THEN
369 CALL peri_comeancorrection( regions(ireg) )
383 global%currentTime = global%currentTime + global%dtMin
384 time = time + global%dtMin
390 timeprint = global%timeStamp + global%printTime
391 timewrite = global%timeStamp + global%writeTime
392 timeprobe = global%timeStamp + global%probeSaveTime
393 timethrust = global%timeStamp + global%thrustSaveTime
400 IF (abs(timeprint-global%currentTime)<global%dtMin/10._rfreal .OR. &
401 timeprint<global%currentTime .OR. iter==1)
THEN
403 IF (iter > 1) timeprint = timeprint + global%printTime
405 IF (abs(timewrite-global%currentTime)<global%dtMin/10._rfreal .OR. &
406 timewrite<global%currentTime)
THEN
408 timewrite = timewrite + global%writeTime
410 IF (abs(timeprobe-global%currentTime)<global%dtMin/10._rfreal .OR. &
411 timeprobe<global%currentTime .OR. iter==1)
THEN
413 IF (iter > 1) timeprobe = timeprobe + global%probeSaveTime
415 IF (abs(timethrust-global%currentTime)<global%dtMin/10._rfreal .OR. &
416 timethrust<global%currentTime .OR. iter==1)
THEN
418 IF (iter > 1) timethrust = timethrust + global%thrustSaveTime
424 INQUIRE(file=
"STOP",exist=stopexists)
425 IF (stopexists) global%stopRun = 1.1_rfreal
430 IF (time >= dtimesystem) finished = .true.
435 global%forceX = 0._rfreal
436 global%forceY = 0._rfreal
437 global%forceZ = 0._rfreal
438 global%massIn = 0._rfreal
439 global%massOut = 0._rfreal
440 global%thrustMom = 0._rfreal
441 global%thrustPress = 0._rfreal
443 DO ireg=1,global%nRegions
444 IF (regions(ireg)%procid==global%myProcid .AND. &
445 regions(ireg)%active==active)
THEN
449 IF (global%nProbes>0 .AND. doprobe) &
452 IF (global%aeroCoeffs==active .AND. doprobe) &
455 IF (global%thrustType/=thrust_none .AND. dothrust) &
458 IF (global%nProbes>0 .AND. (doprobe.OR.finished)) &
461 IF (global%aeroCoeffs==active .AND. (doprobe.OR.finished)) &
464 IF (global%thrustType/=thrust_none .AND. (dothrust.OR.finished)) &
469 IF (doprint .OR. finished)
THEN
478 IF (global%aeroCoeffs==active .AND. doprobe)
THEN
483 IF (global%aeroCoeffs==active .AND. (doprobe.OR.finished))
THEN
491 IF (global%thrustType/=thrust_none .AND. dothrust) &
494 IF (global%thrustType/=thrust_none .AND. (dothrust.OR.finished)) &
501 IF (doprint .OR. finished)
THEN
504 WRITE(stdout,*)
'Total mass = ',global%totalMass
508 IF (global%stopRun > 1._rfreal)
THEN
517 IF (dowrite .OR. finished)
THEN
519 IF (global%myProcid==masterproc .AND. &
520 global%verbLevel/=verbose_none)
THEN
521 WRITE(stdout,
'(/,A)') solver_name//
' Saving grid ...'
525 IF (global%myProcid==masterproc .AND. &
526 global%verbLevel/=verbose_none)
THEN
527 WRITE(stdout,
'(/,A)') solver_name//
' Saving flow solution ...'
529 IF (global%myProcid==masterproc .AND. &
530 global%verbLevel>=verbose_high)
THEN
531 WRITE(stdout,
'(A)') solver_name//
' - mixture'
536 IF (global%aeroCoeffs == active)
THEN
537 IF (global%myProcid==masterproc .AND. &
538 global%verbLevel>=verbose_high)
THEN
539 WRITE(stdout,
'(A)') solver_name//
' - patch ac'
544 IF (global%doStat==active)
THEN
545 IF (global%myProcid==masterproc .AND. &
546 global%verbLevel/=verbose_none)
THEN
547 WRITE(stdout,
'(/,A)') solver_name,
' Saving statistics ...'
560 IF (global%radiActive)
THEN
561 IF (global%myProcid==masterproc .AND. &
562 global%verbLevel/=verbose_none)
THEN
563 WRITE(stdout,
'(/,A)') solver_name,
' Saving radiation solution ...'
569 CALL spec_writesolution( regions )
572 IF (global%turbActive)
THEN
573 IF (global%myProcid==masterproc .AND. &
574 global%verbLevel/=verbose_none)
THEN
575 WRITE(stdout,
'(/,A)') solver_name,
' Saving turbulence solution ...'
588 DO ireg=1,global%nRegions
589 IF (regions(ireg)%procid==global%myProcid .AND. &
590 regions(ireg)%active==active)
THEN
594 global%timeStamp = global%currentTime
subroutine rflo_writerandomstate(regions)
subroutine rflo_dualtststerm(region)
subroutine, public rflo_movegridelliptfra(regions)
subroutine, public rflo_writeintegralforcemomco(global)
subroutine peul_writesolution(regions)
subroutine rflo_calcforces(region)
subroutine rflo_residualnorm(regions)
subroutine registerfunction(global, funName, fileName)
subroutine rflo_dualtstpredict(region)
subroutine, public rflo_movegridframe(regions)
subroutine, public rflo_writerestartinfo(global)
subroutine rflo_calcmassflow(region)
subroutine rflo_writestat(regions)
subroutine rflo_newgrid(regions)
subroutine, public rflo_statboundaryconditionsset(regions)
subroutine rflo_setmstagecoeffs(global, input, nrkSteps)
subroutine, public rflo_computepatchforcemomco(region)
subroutine explicitmultistage(regions, ftermNew, residFterm)
subroutine, public rflo_writepatchaerocoeffs(regions)
subroutine, public rflo_computeintegralforcemomco(global)
subroutine writeprobe(regions, iReg)
subroutine rflo_computeintegralvalues(regions)
subroutine, public getstatistics(regions)
subroutine rungekuttamp(regions)
subroutine rflo_dualtstshift(region)
subroutine turb_rflo_writesolution(regions)
subroutine rflo_minimumtimestep(regions)
subroutine turb_calcmetrics(regions, isInit)
subroutine radi_rflo_writesolution(regions)
subroutine rflo_sendboundaryvalues(region, initialize)
subroutine rflo_writegrid(regions)
subroutine rflo_dualtstinit(regions, timeLevel)
Vector_n min(const Array_n_const &v1, const Array_n_const &v2)
subroutine, public rflo_movegridelliptglo(regions)
subroutine rflo_movegridglobal(regions)
subroutine rflo_writesolution(regions)
subroutine rflo_timestepviscous(region)
subroutine plag_writesolution(regions)
subroutine writeconvergence(global)
subroutine, public rflo_movegridvms(regions)
subroutine deregisterfunction(global)
subroutine rflo_dualtimestepping(dTimeSystem, regions)
subroutine rflo_calcthrust(region)
subroutine rflo_timestepinviscid(region)
subroutine rflo_movegridblocks(regions)
subroutine writethrust(global)