96 INTEGER :: ditersystem
98 REAL(RFREAL) :: dtimesystem
100 TYPE(t_region
),
POINTER :: regions(:)
106 INTEGER,
SAVE :: iter = 0
108 LOGICAL :: stopexists, finished, ftermnew, residfterm, &
109 doprint, dowrite, doprobe, dothrust, movegrid
111 REAL(RFREAL),
SAVE :: timeprint=0._rfreal, timewrite =0._rfreal, &
112 timeprobe=0._rfreal, timethrust=0._rfreal
113 REAL(RFREAL) :: time, totalmass
117 INTEGER :: original_format
121 global => regions(1)%global
124 'RFLO_TimeStepping.F90' )
129 IF (global%predCorrIter)
THEN
131 global%predCorrIter = .false.
135 IF (global%myProcid==masterproc .AND. global%verbLevel/=verbose_none)
THEN
136 WRITE(stdout,
'(A)') solver_name
137 IF (global%flowType == flow_steady) &
138 WRITE(stdout,1010) solver_name,solver_name
139 IF (global%flowType == flow_unsteady) &
140 WRITE(stdout,1015) solver_name,solver_name
147 global%stopRun = 0._rfreal
157 DO ireg=1,global%nRegions
158 IF (regions(ireg)%mixtInput%moveGrid) movegrid = .true.
167 IF (global%flowType == flow_unsteady)
THEN
168 global%dtMin = 1.e+30_rfreal
169 DO ireg=1,global%nRegions
170 IF (regions(ireg)%procid==global%myProcid .AND. &
171 regions(ireg)%active==active)
THEN
172 IF (regions(ireg)%mixtInput%flowModel == flow_euler)
THEN
178 IF (global%peulUsed) &
182 IF (regions(ireg)%mixtInput%turbModel /= turb_model_none) &
188 IF (time+global%dtMin > dtimesystem)
THEN
189 global%dtMin = dtimesystem - time
196 IF (global%flowType==flow_unsteady .AND. movegrid)
THEN
197 IF (global%moveGridScheme == movegrid_blocks)
THEN
199 ELSEIF (global%moveGridScheme == movegrid_global)
THEN
201 ELSEIF (global%moveGridScheme == movegrid_frame .OR. &
202 global%moveGridScheme == movegrid_foms)
THEN
204 ELSEIF (global%moveGridScheme == movegrid_elglobal)
THEN
206 ELSEIF (global%moveGridScheme == movegrid_elframe)
THEN
215 IF (global%flowType==flow_unsteady .AND. movegrid)
THEN
221 IF (global%flowType==flow_unsteady .AND. movegrid)
THEN
232 IF (global%flowType == flow_unsteady)
THEN
234 DO ireg=1,global%nRegions
235 IF (regions(ireg)%procid==global%myProcid .AND. &
236 regions(ireg)%active==active .AND. &
237 regions(ireg)%mixtInput%moveGrid)
THEN
242 IF (global%solverType == solv_explicit)
THEN
246 CALL
errorstop( global,err_unknown_option,__line__ )
253 DO ireg=1,global%nRegions
254 IF (regions(ireg)%procid==global%myProcid .AND. &
255 regions(ireg)%active==active)
THEN
256 IF ( regions(ireg)%periInput%flowKind /= off )
THEN
257 CALL peri_comeancorrection( regions(ireg) )
272 IF (global%flowType == flow_unsteady)
THEN
273 global%currentTime = global%currentTime + global%dtMin
274 time = time + global%dtMin
277 global%currentIter = global%currentIter + 1
284 IF (global%flowType==flow_unsteady .AND. iter==1)
THEN
285 timeprint = global%timeStamp + global%printTime
286 timewrite = global%timeStamp + global%writeTime
287 timeprobe = global%timeStamp + global%probeSaveTime
288 timethrust = global%timeStamp + global%thrustSaveTime
297 IF (global%flowType == flow_unsteady)
THEN
308 IF (abs(timeprint-global%currentTime)<global%dtMin/10._rfreal .OR. &
309 timeprint<global%currentTime .OR. iter==1)
THEN
311 IF (iter > 1) timeprint = timeprint + global%printTime
313 IF (abs(timewrite-global%currentTime)<global%dtMin/10._rfreal .OR. &
314 timewrite<global%currentTime)
THEN
316 timewrite = timewrite + global%writeTime
318 IF (abs(timeprobe-global%currentTime)<global%dtMin/10._rfreal .OR. &
319 timeprobe<global%currentTime .OR. iter==1)
THEN
321 IF (iter > 1) timeprobe = timeprobe + global%probeSaveTime
323 IF (abs(timethrust-global%currentTime)<global%dtMin/10._rfreal .OR. &
324 timethrust<global%currentTime .OR. iter==1)
THEN
326 IF (iter > 1) timethrust = timethrust + global%thrustSaveTime
329 doprint = (mod(global%currentIter,global%printIter ) == 0)
330 dowrite = (mod(global%currentIter,global%writeIter ) == 0)
331 doprobe = (mod(global%currentIter,global%probeSaveIter ) == 0)
332 dothrust = (mod(global%currentIter,global%thrustSaveIter) == 0)
338 INQUIRE(file=
"STOP",exist=stopexists)
339 IF (stopexists) global%stopRun = 1.1_rfreal
344 IF (global%flowType == flow_unsteady)
THEN
345 IF (time>=dtimesystem) finished = .true.
349 IF (iter==ditersystem .OR. &
350 global%residual/global%resInit<=global%resTol) finished = .true.
357 global%forceX = 0._rfreal
358 global%forceY = 0._rfreal
359 global%forceZ = 0._rfreal
360 global%massIn = 0._rfreal
361 global%massOut = 0._rfreal
362 global%thrustMom = 0._rfreal
363 global%thrustPress = 0._rfreal
364 totalmass = 0._rfreal
367 DO ireg=1,global%nRegions
368 IF (regions(ireg)%procid==global%myProcid .AND. &
369 regions(ireg)%active==active)
THEN
373 IF (global%nProbes>0 .AND. (doprobe .eqv. .true.)) &
376 IF (global%aeroCoeffs==active .AND. (doprobe .eqv. .true.)) &
379 IF (global%thrustType/=thrust_none .AND. (dothrust .eqv. .true.)) &
382 IF (global%nProbes>0 .AND. ((doprobe.eqv..true.).OR.(finished.eqv..true.))) &
385 IF (global%aeroCoeffs==active .AND. (doprobe.OR.finished)) &
388 IF (global%thrustType/=thrust_none .AND. (dothrust.OR.finished)) &
393 IF ((doprint .eqv. .true.) .OR. (finished .eqv. .true.))
THEN
402 IF (global%aeroCoeffs==active .AND. (doprobe .eqv. .true.))
THEN
407 IF (global%aeroCoeffs==active .AND. ((doprobe .eqv. .true.).OR.(finished.eqv..true.)))
THEN
415 IF (global%thrustType/=thrust_none .AND. (dothrust .eqv. .true.)) &
418 IF (global%thrustType/=thrust_none .AND. ((dothrust .eqv. .true.).OR.(finished .eqv. .true.))) &
424 IF ((doprint .eqv. .true.) .OR. (finished .eqv. .true.))
THEN
427 WRITE(stdout,*)
'Total mass = ',global%totalMass
431 IF (global%stopRun > 1._rfreal)
THEN
440 IF ((dowrite .eqv. .true.) .OR. (finished .eqv. .true.))
THEN
442 IF (global%myProcid==masterproc .AND. &
443 global%verbLevel/=verbose_none)
THEN
444 WRITE(stdout,
'(/,A)') solver_name//
' Saving grid ...'
448 IF (global%myProcid==masterproc .AND. &
449 global%verbLevel/=verbose_none)
THEN
450 WRITE(stdout,
'(/,A)') solver_name//
' Saving flow solution ...'
452 IF (global%myProcid==masterproc .AND. &
453 global%verbLevel>=verbose_high)
THEN
454 WRITE(stdout,
'(A)') solver_name//
' - mixture'
459 IF (global%aeroCoeffs == active)
THEN
460 IF (global%myProcid==masterproc .AND. &
461 global%verbLevel>=verbose_high)
THEN
462 WRITE(stdout,
'(A)') solver_name//
' - patch ac'
467 IF (global%doStat==active)
THEN
468 IF (global%myProcid==masterproc .AND. &
469 global%verbLevel/=verbose_none)
THEN
470 WRITE(stdout,
'(/,A)') solver_name,
' Saving statistics ...'
479 IF (dowrite .eqv. .true.)
THEN
480 original_format = global%solutFormat
481 global%gridFormat = format_ascii
482 global%solutFormat = format_ascii
484 IF (global%myProcid==masterproc .AND. &
485 global%verbLevel/=verbose_none)
THEN
486 WRITE(stdout,
'(/,A)') solver_name,
' Saving Lagrangian particle solution ...'
494 IF (global%radiActive)
THEN
495 IF (global%myProcid==masterproc .AND. &
496 global%verbLevel/=verbose_none)
THEN
497 WRITE(stdout,
'(/,A)') solver_name,
' Saving radiation solution ...'
503 CALL spec_writesolution( regions )
506 IF (global%turbActive)
THEN
507 IF (global%myProcid==masterproc .AND. &
508 global%verbLevel/=verbose_none)
THEN
509 WRITE(stdout,
'(/,A)') solver_name,
' Saving turbulence solution ...'
514 global%gridFormat = original_format
515 global%solutFormat = original_format
517 #endif ! NATIVE_MP_IO
528 IF (global%radiActive)
THEN
529 IF (global%myProcid==masterproc .AND. &
530 global%verbLevel/=verbose_none)
THEN
531 WRITE(stdout,
'(/,A)') solver_name,
' Saving radiation solution ...'
537 CALL spec_writesolution( regions )
540 IF (global%turbActive)
THEN
541 IF (global%myProcid==masterproc .AND. &
542 global%verbLevel/=verbose_none)
THEN
543 WRITE(stdout,
'(/,A)') solver_name,
' Saving turbulence solution ...'
552 #endif ! NOT PROPONLY
556 DO ireg=1,global%nRegions
557 IF (regions(ireg)%procid==global%myProcid .AND. &
558 regions(ireg)%active==active)
THEN
562 global%timeStamp = global%currentTime
568 IF (global%flowType==flow_steady .AND. mod(iter,global%refineIter)==0)
THEN
569 DO ireg=1,global%nRegions
570 regions(ireg)%currLevel = regions(ireg)%currLevel - 1
579 1010
FORMAT(
a,
' iter',4
x,
'res-norm',5
x,
'force-x',6
x,
'force-y',6
x,
'force-z', &
580 6
x,
'mass-in',6
x,
'mass-out',/,
a,1
x,84(
'-'))
581 1015
FORMAT(
a,
' time',10
x,
'delta-t',6
x,
'force-x',6
x,
'force-y',6
x,
'force-z', &
582 6
x,
'mass-in',6
x,
'mass-out'/,
a,1
x,90(
'-'))
subroutine rflo_writerandomstate(regions)
subroutine, public rflo_movegridelliptfra(regions)
subroutine plag_rflo_setmetrics(regions)
subroutine peul_spectralradii(region)
subroutine, public rflo_writeintegralforcemomco(global)
subroutine turb_rflo_ransspectralradii(region)
subroutine peul_writesolution(regions)
subroutine rflo_calcforces(region)
subroutine rflo_residualnorm(regions)
subroutine registerfunction(global, funName, fileName)
subroutine, public rflo_movegridframe(regions)
subroutine, public rflo_writerestartinfo(global)
subroutine rflo_calcmassflow(region)
subroutine rflo_newgrid(regions)
subroutine, public rflo_computepatchforcemomco(region)
subroutine explicitmultistage(regions, ftermNew, residFterm)
subroutine, public rflo_writepatchaerocoeffs(regions)
subroutine, public rflo_computeintegralforcemomco(global)
subroutine rflo_timestepping(dTimeSystem, dIterSystem, regions)
subroutine writeprobe(regions, iReg)
subroutine rflo_computeintegralvalues(regions)
subroutine, public getstatistics(regions)
subroutine rungekuttamp(regions)
subroutine turb_rflo_writesolution(regions)
subroutine rflo_minimumtimestep(regions)
subroutine, public statwritemp(regions)
subroutine turb_calcmetrics(regions, isInit)
subroutine radi_rflo_writesolution(regions)
subroutine rflo_sendboundaryvalues(region, initialize)
subroutine rflo_writegrid(regions)
subroutine rflo_interpoltofinerlevel(region)
subroutine, public rflo_movegridelliptglo(regions)
subroutine rflo_movegridglobal(regions)
subroutine rflo_writesolution(regions)
subroutine rflo_timestepviscous(region)
subroutine errorstop(global, errorCode, errorLine, addMessage)
subroutine plag_writesolution(regions)
subroutine writeconvergence(global)
subroutine, public rflo_movegridvms(regions)
subroutine deregisterfunction(global)
subroutine descalegridspeeds(region)
subroutine rflo_calcthrust(region)
subroutine rflo_timestepinviscid(region)
subroutine rflo_movegridblocks(regions)
subroutine writethrust(global)