66 CHARACTER(CHRLEN) :: RCSIdentString = &
67 '$RCSfile: RFLU_ModReadWriteFlow.F90,v $ $Revision: 1.13 $'
110 TYPE(t_region
),
POINTER :: pregion
116 LOGICAL :: fileexists
117 CHARACTER(CHRLEN) :: errorstring,ifilename,ifilenameold,sectionstring, &
118 timestring1,timestring2
119 INTEGER :: cvmixtdens,cvmixtener,cvmixtpres,cvmixtxmom,cvmixtxvel, &
120 cvmixtymom,cvmixtyvel,cvmixtzmom,cvmixtzvel,errorflag,
i, &
121 ifile,ivars,
j,loopcounter,ncellstot,ncellsexpected,nvars, &
122 nvarsexpected,precactual,precexpected,rangeactual, &
124 REAL(RFREAL) :: currenttime
125 REAL(RFREAL),
DIMENSION(:,:),
POINTER :: pcv
126 TYPE(t_grid),
POINTER :: pgrid
133 global => pregion%global
136 'RFLU_ModReadWriteFlow.F90')
138 IF ( global%myProcid == masterproc .AND. &
139 global%verbLevel > verbose_none )
THEN
140 WRITE(stdout,
'(A,1X,A)') solver_name,
'Reading ASCII flow file...'
143 IF ( global%flowType == flow_unsteady )
THEN
145 pregion%iRegionGlobal,global%currentTime, &
148 pregion%iRegionGlobal,global%currentTime, &
151 IF ( global%myProcid == masterproc .AND. &
152 global%verbLevel > verbose_none )
THEN
153 WRITE(stdout,
'(A,3X,A,1X,I5.5)') solver_name,
'Global region:', &
154 pregion%iRegionGlobal
155 WRITE(stdout,
'(A,3X,A,1X,1PE11.5)') solver_name,
'Current time:', &
160 pregion%iRegionGlobal,global%currentIter, &
163 pregion%iRegionGlobal,global%currentIter, &
166 IF ( global%myProcid == masterproc .AND. &
167 global%verbLevel > verbose_none )
THEN
168 WRITE(stdout,
'(A,3X,A,1X,I5.5)') solver_name,
'Global region:', &
169 pregion%iRegionGlobal
170 WRITE(stdout,
'(A,3X,A,1X,I6.6)') solver_name,
'Current iteration '// &
171 'number:',global%currentIter
177 INQUIRE(file=ifilename,exist=fileexists)
179 IF ( fileexists .EQV. .true. )
THEN
180 OPEN(ifile,file=ifilename,
form=
"FORMATTED",
status=
"OLD", &
182 global%error = errorflag
183 IF ( global%error /= err_none )
THEN
184 CALL
errorstop(global,err_file_open,__line__,ifilename)
187 OPEN(ifile,file=ifilenameold,
form=
"FORMATTED",
status=
"OLD", &
189 global%error = errorflag
190 IF ( global%error /= err_none )
THEN
191 CALL
errorstop(global,err_file_open,__line__,ifilenameold)
199 SELECT CASE ( pregion%mixtInput%fluidModel )
200 CASE ( fluid_model_comp )
201 pregion%mixt%cvState = cv_mixt_state_cons
202 CASE ( fluid_model_incomp )
203 pregion%mixt%cvState = cv_mixt_state_prim
205 CALL
errorstop(global,err_reached_default,__line__)
212 IF ( global%myProcid == masterproc .AND. &
213 global%verbLevel > verbose_low )
THEN
214 WRITE(stdout,
'(A,3X,A)') solver_name,
'Header information...'
217 READ(ifile,
'(A)') sectionstring
218 IF ( trim(sectionstring) /=
'# ROCFLU flow file' )
THEN
219 CALL
errorstop(global,err_invalid_marker,__line__,sectionstring)
226 READ(ifile,
'(A)') sectionstring
227 IF ( trim(sectionstring) /=
'# Precision and range' )
THEN
228 CALL
errorstop(global,err_invalid_marker,__line__,sectionstring)
232 rangeexpected = range(1.0_rfreal)
234 READ(ifile,
'(2(I8))') precactual,rangeactual
235 IF ( precactual < precexpected .OR. rangeactual < rangeexpected )
THEN
236 CALL
errorstop(global,err_prec_range,__line__)
243 READ(ifile,
'(A)') sectionstring
244 IF ( trim(sectionstring) /=
'# Initial residual' )
THEN
245 CALL
errorstop(global,err_invalid_marker,__line__,ifilename)
248 READ(ifile,
'(E23.16)') global%resInit
250 READ(ifile,
'(A)') sectionstring
251 IF ( trim(sectionstring) /=
'# Physical time' )
THEN
252 CALL
errorstop(global,err_invalid_marker,__line__,ifilename)
255 READ(ifile,
'(E23.16)') currenttime
257 IF ( global%flowType == flow_unsteady )
THEN
258 IF ( global%currentTime < 0.0_rfreal )
THEN
259 global%currentTime = currenttime
261 WRITE(timestring1,
'(1PE11.5)') global%currentTime
262 WRITE(timestring2,
'(1PE11.5)') currenttime
264 IF ( trim(timestring1) /= trim(timestring2) )
THEN
265 WRITE(stdout,
'(A,4(1X,A))') solver_name, &
266 '*** WARNING *** Time mismatch:', &
267 trim(timestring1),
'vs.',trim(timestring2)
269 global%warnCounter = global%warnCounter + 1
278 pgrid => pregion%grid
280 nvarsexpected = pregion%mixtInput%nCv
281 ncellsexpected = pgrid%nCellsTot
283 READ(ifile,
'(A)') sectionstring
284 IF ( trim(sectionstring) /=
'# Dimensions' )
THEN
285 CALL
errorstop(global,err_invalid_marker,__line__,sectionstring)
288 READ(ifile,
'(2(I8))') ncellstot,nvars
289 IF ( ncellstot /= ncellsexpected )
THEN
290 WRITE(errorstring,
'(A,1X,I6,1X,A,1X,I6)')
'Specified:',ncellstot, &
291 'but expected:',ncellsexpected
292 CALL
errorstop(global,err_invalid_ncells,__line__,errorstring)
295 IF ( nvars /= nvarsexpected )
THEN
296 WRITE(errorstring,
'(A,1X,I6,1X,A,1X,I6)')
'Specified:',nvars, &
297 'but expected:',nvarsexpected
298 CALL
errorstop(global,err_invalid_nvars,__line__)
309 loopcounter = loopcounter + 1
311 READ(ifile,
'(A)') sectionstring
313 SELECT CASE ( trim(sectionstring) )
319 CASE (
'# Mixture density' )
320 IF ( global%myProcid == masterproc .AND. &
321 global%verbLevel > verbose_low )
THEN
322 WRITE(stdout,
'(A,3X,A)') solver_name,
'Mixture density...'
325 pcv => pregion%mixt%cv
329 cvmixtdens =
rflu_getcvloc(global,fluid_model_comp,cv_mixt_dens)
331 READ(ifile,
'(5(E23.16))') (pcv(cvmixtdens,
j),
j=1,pgrid%nCellsTot)
337 CASE (
'# Mixture x-momentum' )
338 IF ( global%myProcid == masterproc .AND. &
339 global%verbLevel > verbose_low )
THEN
340 WRITE(stdout,
'(A,3X,A)') solver_name,
'Mixture x-momentum...'
343 pcv => pregion%mixt%cv
347 cvmixtxmom =
rflu_getcvloc(global,fluid_model_comp,cv_mixt_xmom)
349 READ(ifile,
'(5(E23.16))') (pcv(cvmixtxmom,
j),
j=1,pgrid%nCellsTot)
355 CASE (
'# Mixture x-velocity' )
356 IF ( global%myProcid == masterproc .AND. &
357 global%verbLevel > verbose_low )
THEN
358 WRITE(stdout,
'(A,3X,A)') solver_name,
'Mixture x-velocity...'
361 pcv => pregion%mixt%cv
365 cvmixtxvel =
rflu_getcvloc(global,fluid_model_incomp,cv_mixt_xvel)
367 READ(ifile,
'(5(E23.16))') (pcv(cvmixtxvel,
j),
j=1,pgrid%nCellsTot)
373 CASE (
'# Mixture y-momentum' )
374 IF ( global%myProcid == masterproc .AND. &
375 global%verbLevel > verbose_low )
THEN
376 WRITE(stdout,
'(A,3X,A)') solver_name,
'Mixture y-momentum...'
379 pcv => pregion%mixt%cv
383 cvmixtymom =
rflu_getcvloc(global,fluid_model_comp,cv_mixt_ymom)
385 READ(ifile,
'(5(E23.16))') (pcv(cvmixtymom,
j),
j=1,pgrid%nCellsTot)
391 CASE (
'# Mixture y-velocity' )
392 IF ( global%myProcid == masterproc .AND. &
393 global%verbLevel > verbose_low )
THEN
394 WRITE(stdout,
'(A,3X,A)') solver_name,
'Mixture y-velocity...'
397 pcv => pregion%mixt%cv
401 cvmixtyvel =
rflu_getcvloc(global,fluid_model_incomp,cv_mixt_yvel)
403 READ(ifile,
'(5(E23.16))') (pcv(cvmixtyvel,
j),
j=1,pgrid%nCellsTot)
409 CASE (
'# Mixture z-momentum' )
410 IF ( global%myProcid == masterproc .AND. &
411 global%verbLevel > verbose_low )
THEN
412 WRITE(stdout,
'(A,3X,A)') solver_name,
'Mixture z-momentum...'
415 pcv => pregion%mixt%cv
419 cvmixtzmom =
rflu_getcvloc(global,fluid_model_comp,cv_mixt_zmom)
421 READ(ifile,
'(5(E23.16))') (pcv(cvmixtzmom,
j),
j=1,pgrid%nCellsTot)
427 CASE (
'# Mixture z-velocity' )
428 IF ( global%myProcid == masterproc .AND. &
429 global%verbLevel > verbose_low )
THEN
430 WRITE(stdout,
'(A,3X,A)') solver_name,
'Mixture z-velocity...'
433 pcv => pregion%mixt%cv
437 cvmixtzvel =
rflu_getcvloc(global,fluid_model_incomp,cv_mixt_zvel)
439 READ(ifile,
'(5(E23.16))') (pcv(cvmixtzvel,
j),
j=1,pgrid%nCellsTot)
445 CASE (
'# Mixture total internal energy' )
446 IF ( global%myProcid == masterproc .AND. &
447 global%verbLevel > verbose_low )
THEN
448 WRITE(stdout,
'(A,3X,A)') solver_name,
'Mixture total internal '// &
452 pcv => pregion%mixt%cv
456 cvmixtener =
rflu_getcvloc(global,fluid_model_comp,cv_mixt_ener)
458 READ(ifile,
'(5(E23.16))') (pcv(cvmixtener,
j),
j=1,pgrid%nCellsTot)
464 CASE (
'# Mixture pressure' )
465 IF ( global%myProcid == masterproc .AND. &
466 global%verbLevel > verbose_low )
THEN
467 WRITE(stdout,
'(A,3X,A)') solver_name,
'Mixture pressure...'
470 pcv => pregion%mixt%cv
474 cvmixtpres =
rflu_getcvloc(global,fluid_model_incomp,cv_mixt_pres)
476 READ(ifile,
'(5(E23.16))') (pcv(cvmixtpres,
j),
j=1,pgrid%nCellsTot)
483 IF ( global%myProcid == masterproc .AND. &
484 global%verbLevel > verbose_low )
THEN
485 WRITE(stdout,
'(A,3X,A)') solver_name,
'End marker...'
495 IF ( global%verbLevel > verbose_low )
THEN
496 WRITE(stdout,
'(A,3X,A)') solver_name,sectionstring
499 CALL
errorstop(global,err_invalid_marker,__line__,sectionstring)
507 IF ( loopcounter >= limit_infinite_loop )
THEN
508 CALL
errorstop(global,err_infinite_loop,__line__)
516 IF ( ivars /= nvars )
THEN
517 CALL
errorstop(global,err_invalid_nvars,__line__)
524 CLOSE(ifile,iostat=errorflag)
525 global%error = errorflag
526 IF ( global%error /= err_none )
THEN
527 CALL
errorstop(global,err_file_close,__line__,ifilename)
534 IF ( global%myProcid == masterproc .AND. &
535 global%verbLevel > verbose_none )
THEN
536 WRITE(stdout,
'(A,1X,A)') solver_name,
'Reading ASCII flow file done.'
579 TYPE(t_region
),
POINTER :: pregion
585 LOGICAL :: fileexists
586 CHARACTER(CHRLEN) :: errorstring,ifilename,ifilenameold,sectionstring, &
587 timestring1,timestring2
588 INTEGER :: cvmixtdens,cvmixtener,cvmixtpres,cvmixtxmom,cvmixtxvel, &
589 cvmixtymom,cvmixtyvel,cvmixtzmom,cvmixtzvel,errorflag,
i, &
590 ifile,ivars,
j,loopcounter,ncellstot,ncellsexpected,nvars, &
591 nvarsexpected,precactual,precexpected,rangeactual, &
593 REAL(RFREAL) :: currenttime
594 REAL(RFREAL),
DIMENSION(:,:),
POINTER :: pcv
595 TYPE(t_grid),
POINTER :: pgrid
602 global => pregion%global
605 'RFLU_ModReadWriteFlow.F90')
607 IF ( global%myProcid == masterproc .AND. &
608 global%verbLevel > verbose_none )
THEN
609 WRITE(stdout,
'(A,1X,A)') solver_name,
'Reading binary flow file...'
612 IF ( global%flowType == flow_unsteady )
THEN
614 pregion%iRegionGlobal,global%currentTime, &
617 pregion%iRegionGlobal,global%currentTime, &
620 IF ( global%myProcid == masterproc .AND. &
621 global%verbLevel > verbose_none )
THEN
622 WRITE(stdout,
'(A,3X,A,1X,I5.5)') solver_name,
'Global region:', &
623 pregion%iRegionGlobal
624 WRITE(stdout,
'(A,3X,A,1X,1PE11.5)') solver_name,
'Current time:', &
629 pregion%iRegionGlobal,global%currentIter, &
632 pregion%iRegionGlobal,global%currentIter, &
635 IF ( global%myProcid == masterproc .AND. &
636 global%verbLevel > verbose_none )
THEN
637 WRITE(stdout,
'(A,3X,A,1X,I5.5)') solver_name,
'Global region:', &
638 pregion%iRegionGlobal
639 WRITE(stdout,
'(A,3X,A,1X,I6.6)') solver_name,
'Current iteration '// &
640 'number:',global%currentIter
646 INQUIRE(file=ifilename,exist=fileexists)
648 IF ( fileexists .EQV. .true. )
THEN
649 OPEN(ifile,file=ifilename,
form=
"UNFORMATTED",
status=
"OLD", &
651 global%error = errorflag
652 IF ( global%error /= err_none )
THEN
653 CALL
errorstop(global,err_file_open,__line__,ifilename)
656 OPEN(ifile,file=ifilenameold,
form=
"UNFORMATTED",
status=
"OLD", &
658 global%error = errorflag
659 IF ( global%error /= err_none )
THEN
660 CALL
errorstop(global,err_file_open,__line__,ifilenameold)
668 SELECT CASE ( pregion%mixtInput%fluidModel )
669 CASE ( fluid_model_incomp )
670 pregion%mixt%cvState = cv_mixt_state_prim
671 CASE ( fluid_model_comp )
672 pregion%mixt%cvState = cv_mixt_state_cons
674 CALL
errorstop(global,err_reached_default,__line__)
681 IF ( global%myProcid == masterproc .AND. &
682 global%verbLevel > verbose_low )
THEN
683 WRITE(stdout,
'(A,3X,A)') solver_name,
'Header information...'
686 READ(ifile) sectionstring
687 IF ( trim(sectionstring) /=
'# ROCFLU flow file' )
THEN
688 CALL
errorstop(global,err_invalid_marker,__line__,sectionstring)
695 READ(ifile) sectionstring
696 IF ( trim(sectionstring) /=
'# Precision and range' )
THEN
697 CALL
errorstop(global,err_invalid_marker,__line__,sectionstring)
701 rangeexpected = range(1.0_rfreal)
703 READ(ifile) precactual,rangeactual
704 IF ( precactual < precexpected .OR. rangeactual < rangeexpected )
THEN
705 CALL
errorstop(global,err_prec_range,__line__)
712 READ(ifile) sectionstring
713 IF ( trim(sectionstring) /=
'# Initial residual' )
THEN
714 CALL
errorstop(global,err_invalid_marker,__line__,ifilename)
717 READ(ifile) global%resInit
719 READ(ifile) sectionstring
720 IF ( trim(sectionstring) /=
'# Physical time' )
THEN
721 CALL
errorstop(global,err_invalid_marker,__line__,ifilename)
724 READ(ifile) currenttime
726 IF ( global%flowType == flow_unsteady )
THEN
727 IF ( global%currentTime < 0.0_rfreal )
THEN
728 global%currentTime = currenttime
730 WRITE(timestring1,
'(1PE11.5)') global%currentTime
731 WRITE(timestring2,
'(1PE11.5)') currenttime
733 IF ( trim(timestring1) /= trim(timestring2) )
THEN
734 WRITE(stdout,
'(A,4(1X,A))') solver_name, &
735 '*** WARNING *** Time mismatch:', &
736 trim(timestring1),
'vs.',trim(timestring2)
738 global%warnCounter = global%warnCounter + 1
747 pgrid => pregion%grid
749 nvarsexpected = pregion%mixtInput%nCv
750 ncellsexpected = pgrid%nCellsTot
752 READ(ifile) sectionstring
753 IF ( trim(sectionstring) /=
'# Dimensions' )
THEN
754 CALL
errorstop(global,err_invalid_marker,__line__,sectionstring)
757 READ(ifile) ncellstot,nvars
759 IF ( ncellstot /= ncellsexpected )
THEN
760 WRITE(errorstring,
'(A,1X,I6,1X,A,1X,I6)')
'Specified:',ncellstot, &
761 'but expected:',ncellsexpected
762 CALL
errorstop(global,err_invalid_ncells,__line__,errorstring)
765 IF ( nvars /= nvarsexpected )
THEN
766 WRITE(errorstring,
'(A,1X,I6,1X,A,1X,I6)')
'Specified:',nvars, &
767 'but expected:',nvarsexpected
768 CALL
errorstop(global,err_invalid_nvars,__line__)
779 loopcounter = loopcounter + 1
781 READ(ifile) sectionstring
783 SELECT CASE ( trim(sectionstring) )
789 CASE (
'# Mixture density' )
790 IF ( global%myProcid == masterproc .AND. &
791 global%verbLevel > verbose_low )
THEN
792 WRITE(stdout,
'(A,3X,A)') solver_name,
'Mixture density...'
795 pcv => pregion%mixt%cv
799 cvmixtdens =
rflu_getcvloc(global,fluid_model_comp,cv_mixt_dens)
801 READ(ifile) (pcv(cvmixtdens,
j),
j=1,pgrid%nCellsTot)
807 CASE (
'# Mixture x-momentum' )
808 IF ( global%myProcid == masterproc .AND. &
809 global%verbLevel > verbose_low )
THEN
810 WRITE(stdout,
'(A,3X,A)') solver_name,
'Mixture x-momentum...'
813 pcv => pregion%mixt%cv
817 cvmixtxmom =
rflu_getcvloc(global,fluid_model_comp,cv_mixt_xmom)
819 READ(ifile) (pcv(cvmixtxmom,
j),
j=1,pgrid%nCellsTot)
825 CASE (
'# Mixture x-velocity' )
826 IF ( global%myProcid == masterproc .AND. &
827 global%verbLevel > verbose_low )
THEN
828 WRITE(stdout,
'(A,3X,A)') solver_name,
'Mixture x-velocity...'
831 pcv => pregion%mixt%cv
835 cvmixtxvel =
rflu_getcvloc(global,fluid_model_incomp,cv_mixt_xvel)
837 READ(ifile) (pcv(cvmixtxvel,
j),
j=1,pgrid%nCellsTot)
843 CASE (
'# Mixture y-momentum' )
844 IF ( global%myProcid == masterproc .AND. &
845 global%verbLevel > verbose_low )
THEN
846 WRITE(stdout,
'(A,3X,A)') solver_name,
'Mixture y-momentum...'
849 pcv => pregion%mixt%cv
853 cvmixtymom =
rflu_getcvloc(global,fluid_model_comp,cv_mixt_ymom)
855 READ(ifile) (pcv(cvmixtymom,
j),
j=1,pgrid%nCellsTot)
861 CASE (
'# Mixture y-velocity' )
862 IF ( global%myProcid == masterproc .AND. &
863 global%verbLevel > verbose_low )
THEN
864 WRITE(stdout,
'(A,3X,A)') solver_name,
'Mixture y-velocity...'
867 pcv => pregion%mixt%cv
871 cvmixtyvel =
rflu_getcvloc(global,fluid_model_incomp,cv_mixt_yvel)
873 READ(ifile) (pcv(cvmixtyvel,
j),
j=1,pgrid%nCellsTot)
879 CASE (
'# Mixture z-momentum' )
880 IF ( global%myProcid == masterproc .AND. &
881 global%verbLevel > verbose_low )
THEN
882 WRITE(stdout,
'(A,3X,A)') solver_name,
'Mixture z-momentum...'
885 pcv => pregion%mixt%cv
889 cvmixtzmom =
rflu_getcvloc(global,fluid_model_comp,cv_mixt_zmom)
891 READ(ifile) (pcv(cvmixtzmom,
j),
j=1,pgrid%nCellsTot)
897 CASE (
'# Mixture z-velocity' )
898 IF ( global%myProcid == masterproc .AND. &
899 global%verbLevel > verbose_low )
THEN
900 WRITE(stdout,
'(A,3X,A)') solver_name,
'Mixture z-velocity...'
903 pcv => pregion%mixt%cv
907 cvmixtzvel =
rflu_getcvloc(global,fluid_model_incomp,cv_mixt_zvel)
909 READ(ifile) (pcv(cvmixtzvel,
j),
j=1,pgrid%nCellsTot)
915 CASE (
'# Mixture total internal energy' )
916 IF ( global%myProcid == masterproc .AND. &
917 global%verbLevel > verbose_low )
THEN
918 WRITE(stdout,
'(A,3X,A)') solver_name,
'Mixture total internal '// &
922 pcv => pregion%mixt%cv
926 cvmixtener =
rflu_getcvloc(global,fluid_model_comp,cv_mixt_ener)
928 READ(ifile) (pcv(cvmixtener,
j),
j=1,pgrid%nCellsTot)
934 CASE (
'# Mixture pressure' )
935 IF ( global%myProcid == masterproc .AND. &
936 global%verbLevel > verbose_low )
THEN
937 WRITE(stdout,
'(A,3X,A)') solver_name,
'Mixture pressure...'
940 pcv => pregion%mixt%cv
944 cvmixtpres =
rflu_getcvloc(global,fluid_model_incomp,cv_mixt_pres)
946 READ(ifile) (pcv(cvmixtpres,
j),
j=1,pgrid%nCellsTot)
953 IF ( global%myProcid == masterproc .AND. &
954 global%verbLevel > verbose_low )
THEN
955 WRITE(stdout,
'(A,3X,A)') solver_name,
'End marker...'
965 IF ( global%verbLevel > verbose_low )
THEN
966 WRITE(stdout,
'(A,3X,A)') solver_name,sectionstring
969 CALL
errorstop(global,err_invalid_marker,__line__,sectionstring)
977 IF ( loopcounter >= limit_infinite_loop )
THEN
978 CALL
errorstop(global,err_infinite_loop,__line__)
987 IF ( ivars /= nvars )
THEN
988 CALL
errorstop(global,err_invalid_nvars,__line__)
995 CLOSE(ifile,iostat=errorflag)
996 global%error = errorflag
997 IF ( global%error /= err_none )
THEN
998 CALL
errorstop(global,err_file_close,__line__,ifilename)
1005 IF ( global%myProcid == masterproc .AND. &
1006 global%verbLevel > verbose_none )
THEN
1007 WRITE(stdout,
'(A,1X,A)') solver_name,
'Reading binary flow file done.'
1074 TYPE(t_region
),
POINTER :: pregion
1086 global => pregion%global
1089 'RFLU_ModReadWriteFlow.F90')
1098 IF ( global%solutFormat == format_ascii )
THEN
1100 ELSE IF ( global%solutFormat == format_binary )
THEN
1103 CALL
errorstop(global,err_reached_default,__line__)
1120 IF ( global%plagUsed .EQV. .true. )
THEN
1121 IF ( global%solutFormat == format_ascii )
THEN
1123 ELSE IF ( global%solutFormat == format_binary )
THEN
1126 CALL
errorstop(global,err_reached_default,__line__)
1136 IF ( global%specUsed .EQV. .true. )
THEN
1137 IF ( global%solutFormat == format_ascii )
THEN
1140 IF ( global%moduleType == module_type_postproc )
THEN
1141 IF ( pregion%specInput%nSpeciesEE > 0 )
THEN
1145 ELSE IF ( global%solutFormat == format_binary )
THEN
1148 IF ( global%moduleType == module_type_postproc )
THEN
1149 IF ( pregion%specInput%nSpeciesEE > 0 )
THEN
1154 CALL
errorstop(global,err_reached_default,__line__)
1164 IF ( pregion%mixtInput%flowModel == flow_navst .AND. &
1165 pregion%mixtInput%turbModel /= turb_model_none )
THEN
1166 IF ( (global%flowType == flow_unsteady .AND. &
1167 global%currentTime > 0._rfreal) .OR. &
1168 (global%flowType == flow_steady .AND. &
1169 global%currentIter > 0) )
THEN
1171 IF ( global%solutFormat == format_ascii )
THEN
1173 ELSE IF ( global%solutFormat == format_binary )
THEN
1176 CALL
errorstop(global,err_reached_default,__line__)
1231 TYPE(t_region
),
POINTER :: pregion
1237 CHARACTER(CHRLEN) :: ifilename,sectionstring
1238 INTEGER :: cvmixtdens,cvmixtener,cvmixtpres,cvmixtxmom,cvmixtxvel, &
1239 cvmixtymom,cvmixtyvel,cvmixtzmom,cvmixtzvel,errorflag,
i,ifile,
j
1240 REAL(RFREAL),
DIMENSION(:,:),
POINTER :: pcv
1241 TYPE(t_grid),
POINTER :: pgrid
1248 global => pregion%global
1251 'RFLU_ModReadWriteFlow.F90')
1253 IF ( global%myProcid == masterproc .AND. &
1254 global%verbLevel > verbose_none )
THEN
1255 WRITE(stdout,
'(A,1X,A)') solver_name,
'Writing ASCII flow file...'
1258 IF ( global%flowType == flow_unsteady )
THEN
1260 pregion%iRegionGlobal,global%currentTime, &
1263 IF ( global%myProcid == masterproc .AND. &
1264 global%verbLevel > verbose_none )
THEN
1265 WRITE(stdout,
'(A,3X,A,1X,I5.5)') solver_name,
'Global region:', &
1266 pregion%iRegionGlobal
1267 WRITE(stdout,
'(A,3X,A,1X,1PE11.5)') solver_name,
'Current time:', &
1272 pregion%iRegionGlobal,global%currentIter, &
1275 IF ( global%myProcid == masterproc .AND. &
1276 global%verbLevel > verbose_none )
THEN
1277 WRITE(stdout,
'(A,3X,A,1X,I5.5)') solver_name,
'Global region:', &
1278 pregion%iRegionGlobal
1279 WRITE(stdout,
'(A,3X,A,1X,I6.6)') solver_name,
'Current iteration '// &
1280 'number:',global%currentIter
1285 OPEN(ifile,file=ifilename,
form=
"FORMATTED",
status=
"UNKNOWN", &
1287 global%error = errorflag
1288 IF ( global%error /= err_none )
THEN
1289 CALL
errorstop(global,err_file_open,__line__,ifilename)
1296 IF ( global%myProcid == masterproc .AND. &
1297 global%verbLevel > verbose_low )
THEN
1298 WRITE(stdout,
'(A,3X,A)') solver_name,
'Header information...'
1301 sectionstring =
'# ROCFLU flow file'
1302 WRITE(ifile,
'(A)') sectionstring
1304 sectionstring =
'# Precision and range'
1305 WRITE(ifile,
'(A)') sectionstring
1306 WRITE(ifile,
'(2(I8))')
precision(1.0_rfreal),range(1.0_rfreal)
1308 sectionstring =
'# Initial residual'
1309 WRITE(ifile,
'(A)') sectionstring
1310 WRITE(ifile,
'(E23.16)') global%resInit
1312 sectionstring =
'# Physical time'
1313 WRITE(ifile,
'(A)') sectionstring
1314 WRITE(ifile,
'(E23.16)') global%currentTime
1320 pgrid => pregion%grid
1322 sectionstring =
'# Dimensions'
1323 WRITE(ifile,
'(A)') sectionstring
1324 WRITE(ifile,
'(2(I8))') pgrid%nCellsTot,pregion%mixtInput%nCv
1330 pcv => pregion%mixt%cv
1332 SELECT CASE ( pregion%mixtInput%fluidModel )
1338 CASE ( fluid_model_comp )
1342 IF ( global%myProcid == masterproc .AND. &
1343 global%verbLevel > verbose_low )
THEN
1344 WRITE(stdout,
'(A,3X,A)') solver_name,
'Mixture density...'
1347 cvmixtdens =
rflu_getcvloc(global,fluid_model_comp,cv_mixt_dens)
1349 sectionstring =
'# Mixture density'
1350 WRITE(ifile,
'(A)') sectionstring
1351 WRITE(ifile,
'(5(E23.16))') (pcv(cvmixtdens,
j),
j=1,pgrid%nCellsTot)
1355 IF ( global%myProcid == masterproc .AND. &
1356 global%verbLevel > verbose_low )
THEN
1357 WRITE(stdout,
'(A,3X,A)') solver_name,
'Mixture x-momentum...'
1360 cvmixtxmom =
rflu_getcvloc(global,fluid_model_comp,cv_mixt_xmom)
1362 sectionstring =
'# Mixture x-momentum'
1363 WRITE(ifile,
'(A)') sectionstring
1364 WRITE(ifile,
'(5(E23.16))') (pcv(cvmixtxmom,
j),
j=1,pgrid%nCellsTot)
1368 IF ( global%myProcid == masterproc .AND. &
1369 global%verbLevel > verbose_low )
THEN
1370 WRITE(stdout,
'(A,3X,A)') solver_name,
'Mixture y-momentum...'
1373 cvmixtymom =
rflu_getcvloc(global,fluid_model_comp,cv_mixt_ymom)
1375 sectionstring =
'# Mixture y-momentum'
1376 WRITE(ifile,
'(A)') sectionstring
1377 WRITE(ifile,
'(5(E23.16))') (pcv(cvmixtymom,
j),
j=1,pgrid%nCellsTot)
1381 IF ( global%myProcid == masterproc .AND. &
1382 global%verbLevel > verbose_low )
THEN
1383 WRITE(stdout,
'(A,3X,A)') solver_name,
'Mixture z-momentum...'
1386 cvmixtzmom =
rflu_getcvloc(global,fluid_model_comp,cv_mixt_zmom)
1388 sectionstring =
'# Mixture z-momentum'
1389 WRITE(ifile,
'(A)') sectionstring
1390 WRITE(ifile,
'(5(E23.16))') (pcv(cvmixtzmom,
j),
j=1,pgrid%nCellsTot)
1394 IF ( global%myProcid == masterproc .AND. &
1395 global%verbLevel > verbose_low )
THEN
1396 WRITE(stdout,
'(A,3X,A)') solver_name, &
1397 'Mixture total internal energy...'
1400 cvmixtener =
rflu_getcvloc(global,fluid_model_comp,cv_mixt_ener)
1402 sectionstring =
'# Mixture total internal energy'
1403 WRITE(ifile,
'(A)') sectionstring
1404 WRITE(ifile,
'(5(E23.16))') (pcv(cvmixtener,
j),
j=1,pgrid%nCellsTot)
1410 CASE ( fluid_model_incomp )
1414 IF ( global%myProcid == masterproc .AND. &
1415 global%verbLevel > verbose_low )
THEN
1416 WRITE(stdout,
'(A,3X,A)') solver_name,
'Mixture x-velocity...'
1419 cvmixtxvel =
rflu_getcvloc(global,fluid_model_incomp,cv_mixt_xvel)
1421 sectionstring =
'# Mixture x-velocity'
1422 WRITE(ifile,
'(A)') sectionstring
1423 WRITE(ifile,
'(5(E23.16))') (pcv(cvmixtxvel,
j),
j=1,pgrid%nCellsTot)
1427 IF ( global%myProcid == masterproc .AND. &
1428 global%verbLevel > verbose_low )
THEN
1429 WRITE(stdout,
'(A,3X,A)') solver_name,
'Mixture y-velocity...'
1432 cvmixtyvel =
rflu_getcvloc(global,fluid_model_incomp,cv_mixt_yvel)
1434 sectionstring =
'# Mixture y-velocity'
1435 WRITE(ifile,
'(A)') sectionstring
1436 WRITE(ifile,
'(5(E23.16))') (pcv(cvmixtyvel,
j),
j=1,pgrid%nCellsTot)
1440 IF ( global%myProcid == masterproc .AND. &
1441 global%verbLevel > verbose_low )
THEN
1442 WRITE(stdout,
'(A,3X,A)') solver_name,
'Mixture z-velocity...'
1445 cvmixtzvel =
rflu_getcvloc(global,fluid_model_incomp,cv_mixt_zvel)
1447 sectionstring =
'# Mixture z-velocity'
1448 WRITE(ifile,
'(A)') sectionstring
1449 WRITE(ifile,
'(5(E23.16))') (pcv(cvmixtzvel,
j),
j=1,pgrid%nCellsTot)
1453 IF ( global%myProcid == masterproc .AND. &
1454 global%verbLevel > verbose_low )
THEN
1455 WRITE(stdout,
'(A,3X,A)') solver_name, &
1456 'Mixture pressure...'
1459 cvmixtpres =
rflu_getcvloc(global,fluid_model_incomp,cv_mixt_pres)
1461 sectionstring =
'# Mixture pressure'
1462 WRITE(ifile,
'(A)') sectionstring
1463 WRITE(ifile,
'(5(E23.16))') (pcv(cvmixtpres,
j),
j=1,pgrid%nCellsTot)
1470 CALL
errorstop(global,err_reached_default,__line__)
1477 IF ( global%myProcid == masterproc .AND. &
1478 global%verbLevel > verbose_low )
THEN
1479 WRITE(stdout,
'(A,3X,A)') solver_name,
'End marker...'
1482 sectionstring =
'# End'
1483 WRITE(ifile,
'(A)') sectionstring
1489 CLOSE(ifile,iostat=errorflag)
1490 global%error = errorflag
1491 IF ( global%error /= err_none )
THEN
1492 CALL
errorstop(global,err_file_close,__line__,ifilename)
1499 IF ( global%myProcid == masterproc .AND. &
1500 global%verbLevel > verbose_none )
THEN
1501 WRITE(stdout,
'(A,1X,A)') solver_name,
'Writing ASCII flow file done.'
1544 CHARACTER(CHRLEN) :: ifilename,sectionstring
1545 INTEGER :: cvmixtdens,cvmixtener,cvmixtpres,cvmixtxmom,cvmixtxvel, &
1546 cvmixtymom,cvmixtyvel,cvmixtzmom,cvmixtzvel,errorflag,
i,ifile,
j
1547 REAL(RFREAL),
DIMENSION(:,:),
POINTER :: pcv
1548 TYPE(t_grid),
POINTER :: pgrid
1555 TYPE(t_region
),
POINTER :: pregion
1561 global => pregion%global
1564 'RFLU_ModReadWriteFlow.F90')
1566 IF ( global%myProcid == masterproc .AND. &
1567 global%verbLevel > verbose_none )
THEN
1568 WRITE(stdout,
'(A,1X,A)') solver_name,
'Writing binary flow file...'
1571 IF ( global%flowType == flow_unsteady )
THEN
1573 pregion%iRegionGlobal,global%currentTime, &
1576 IF ( global%myProcid == masterproc .AND. &
1577 global%verbLevel > verbose_none )
THEN
1578 WRITE(stdout,
'(A,3X,A,1X,I5.5)') solver_name,
'Global region:', &
1579 pregion%iRegionGlobal
1580 WRITE(stdout,
'(A,3X,A,1X,1PE11.5)') solver_name,
'Current time:', &
1585 pregion%iRegionGlobal,global%currentIter, &
1588 IF ( global%myProcid == masterproc .AND. &
1589 global%verbLevel > verbose_none )
THEN
1590 WRITE(stdout,
'(A,3X,A,1X,I5.5)') solver_name,
'Global region:', &
1591 pregion%iRegionGlobal
1592 WRITE(stdout,
'(A,3X,A,1X,I6.6)') solver_name,
'Current iteration '// &
1593 'number:',global%currentIter
1598 OPEN(ifile,file=ifilename,
form=
"UNFORMATTED",
status=
"UNKNOWN", &
1600 global%error = errorflag
1601 IF ( global%error /= err_none )
THEN
1602 CALL
errorstop(global,err_file_open,__line__,ifilename)
1609 IF ( global%myProcid == masterproc .AND. &
1610 global%verbLevel > verbose_low )
THEN
1611 WRITE(stdout,
'(A,3X,A)') solver_name,
'Header information...'
1614 sectionstring =
'# ROCFLU flow file'
1615 WRITE(ifile) sectionstring
1617 sectionstring =
'# Precision and range'
1618 WRITE(ifile) sectionstring
1619 WRITE(ifile)
precision(1.0_rfreal),range(1.0_rfreal)
1621 sectionstring =
'# Initial residual'
1622 WRITE(ifile) sectionstring
1623 WRITE(ifile) global%resInit
1625 sectionstring =
'# Physical time'
1626 WRITE(ifile) sectionstring
1627 WRITE(ifile) global%currentTime
1633 pgrid => pregion%grid
1635 sectionstring =
'# Dimensions'
1636 WRITE(ifile) sectionstring
1637 WRITE(ifile) pgrid%nCellsTot,pregion%mixtInput%nCv
1643 pcv => pregion%mixt%cv
1645 SELECT CASE ( pregion%mixtInput%fluidModel )
1651 CASE ( fluid_model_comp )
1655 IF ( global%myProcid == masterproc .AND. &
1656 global%verbLevel > verbose_low )
THEN
1657 WRITE(stdout,
'(A,3X,A)') solver_name,
'Mixture density...'
1660 cvmixtdens =
rflu_getcvloc(global,fluid_model_comp,cv_mixt_dens)
1662 sectionstring =
'# Mixture density'
1663 WRITE(ifile) sectionstring
1664 WRITE(ifile) (pcv(cvmixtdens,
j),
j=1,pgrid%nCellsTot)
1668 IF ( global%myProcid == masterproc .AND. &
1669 global%verbLevel > verbose_low )
THEN
1670 WRITE(stdout,
'(A,3X,A)') solver_name,
'Mixture x-momentum...'
1673 cvmixtxmom =
rflu_getcvloc(global,fluid_model_comp,cv_mixt_xmom)
1675 sectionstring =
'# Mixture x-momentum'
1676 WRITE(ifile) sectionstring
1677 WRITE(ifile) (pcv(cvmixtxmom,
j),
j=1,pgrid%nCellsTot)
1681 IF ( global%myProcid == masterproc .AND. &
1682 global%verbLevel > verbose_low )
THEN
1683 WRITE(stdout,
'(A,3X,A)') solver_name,
'Mixture y-momentum...'
1686 cvmixtymom =
rflu_getcvloc(global,fluid_model_comp,cv_mixt_ymom)
1688 sectionstring =
'# Mixture y-momentum'
1689 WRITE(ifile) sectionstring
1690 WRITE(ifile) (pcv(cvmixtymom,
j),
j=1,pgrid%nCellsTot)
1694 IF ( global%myProcid == masterproc .AND. &
1695 global%verbLevel > verbose_low )
THEN
1696 WRITE(stdout,
'(A,3X,A)') solver_name,
'Mixture z-momentum...'
1699 cvmixtzmom =
rflu_getcvloc(global,fluid_model_comp,cv_mixt_zmom)
1701 sectionstring =
'# Mixture z-momentum'
1702 WRITE(ifile) sectionstring
1703 WRITE(ifile) (pcv(cvmixtzmom,
j),
j=1,pgrid%nCellsTot)
1707 IF ( global%myProcid == masterproc .AND. &
1708 global%verbLevel > verbose_low )
THEN
1709 WRITE(stdout,
'(A,3X,A)') solver_name, &
1710 'Mixture total internal energy...'
1713 cvmixtener =
rflu_getcvloc(global,fluid_model_comp,cv_mixt_ener)
1715 sectionstring =
'# Mixture total internal energy'
1716 WRITE(ifile) sectionstring
1717 WRITE(ifile) (pcv(cvmixtener,
j),
j=1,pgrid%nCellsTot)
1723 CASE ( fluid_model_incomp )
1727 IF ( global%myProcid == masterproc .AND. &
1728 global%verbLevel > verbose_low )
THEN
1729 WRITE(stdout,
'(A,3X,A)') solver_name,
'Mixture x-velocity...'
1732 cvmixtxvel =
rflu_getcvloc(global,fluid_model_incomp,cv_mixt_xvel)
1734 sectionstring =
'# Mixture x-velocity'
1735 WRITE(ifile) sectionstring
1736 WRITE(ifile) (pcv(cvmixtxvel,
j),
j=1,pgrid%nCellsTot)
1740 IF ( global%myProcid == masterproc .AND. &
1741 global%verbLevel > verbose_low )
THEN
1742 WRITE(stdout,
'(A,3X,A)') solver_name,
'Mixture y-velocity...'
1745 cvmixtyvel =
rflu_getcvloc(global,fluid_model_incomp,cv_mixt_yvel)
1747 sectionstring =
'# Mixture y-velocity'
1748 WRITE(ifile) sectionstring
1749 WRITE(ifile) (pcv(cvmixtyvel,
j),
j=1,pgrid%nCellsTot)
1753 IF ( global%myProcid == masterproc .AND. &
1754 global%verbLevel > verbose_low )
THEN
1755 WRITE(stdout,
'(A,3X,A)') solver_name,
'Mixture z-velocity...'
1758 cvmixtzvel =
rflu_getcvloc(global,fluid_model_incomp,cv_mixt_zvel)
1760 sectionstring =
'# Mixture z-velocity'
1761 WRITE(ifile) sectionstring
1762 WRITE(ifile) (pcv(cvmixtzvel,
j),
j=1,pgrid%nCellsTot)
1766 IF ( global%myProcid == masterproc .AND. &
1767 global%verbLevel > verbose_low )
THEN
1768 WRITE(stdout,
'(A,3X,A)') solver_name, &
1769 'Mixture pressure...'
1772 cvmixtpres =
rflu_getcvloc(global,fluid_model_incomp,cv_mixt_pres)
1774 sectionstring =
'# Mixture pressure'
1775 WRITE(ifile) sectionstring
1776 WRITE(ifile) (pcv(cvmixtpres,
j),
j=1,pgrid%nCellsTot)
1783 CALL
errorstop(global,err_reached_default,__line__)
1790 IF ( global%myProcid == masterproc .AND. &
1791 global%verbLevel > verbose_low )
THEN
1792 WRITE(stdout,
'(A,3X,A)') solver_name,
'End marker...'
1795 sectionstring =
'# End'
1796 WRITE(ifile) sectionstring
1802 CLOSE(ifile,iostat=errorflag)
1803 global%error = errorflag
1804 IF ( global%error /= err_none )
THEN
1805 CALL
errorstop(global,err_file_close,__line__,ifilename)
1812 IF ( global%myProcid == masterproc .AND. &
1813 global%verbLevel > verbose_none )
THEN
1814 WRITE(stdout,
'(A,1X,A)') solver_name,
'Writing binary flow file done.'
1877 TYPE(t_region
),
POINTER :: pregion
1890 global => pregion%global
1893 'RFLU_ModReadWriteFlow.F90')
1902 IF ( global%solutFormat == format_ascii )
THEN
1904 ELSE IF ( global%solutFormat == format_binary )
THEN
1907 CALL
errorstop(global,err_reached_default,__line__)
1911 CALL com_get_size(trim(global%volWinName)//
'.rhof', 101, sz, ng)
1925 IF ( global%plagUsed .EQV. .true. )
THEN
1926 IF ( global%solutFormat == format_ascii )
THEN
1928 ELSE IF ( global%solutFormat == format_binary )
THEN
1931 CALL
errorstop(global,err_reached_default,__line__)
1941 IF ( global%specUsed .EQV. .true. )
THEN
1942 IF ( global%solutFormat == format_ascii )
THEN
1945 IF ( pregion%specInput%nSpeciesEE > 0 )
THEN
1948 ELSE IF ( global%solutFormat == format_binary )
THEN
1951 IF ( pregion%specInput%nSpeciesEE > 0 )
THEN
1955 CALL
errorstop(global,err_reached_default,__line__)
1965 IF ( pregion%mixtInput%flowModel == flow_navst .AND. &
1966 pregion%mixtInput%turbModel /= turb_model_none )
THEN
1967 IF ( global%solutFormat == format_ascii )
THEN
1969 ELSE IF ( global%solutFormat == format_binary )
THEN
1972 CALL
errorstop(global,err_reached_default,__line__)
INTEGER function rflu_getcvloc(global, fluidModel, var)
subroutine, public spec_rflu_readcvbinary(pRegion)
subroutine, public rflu_genx_getdataflow(pRegion)
subroutine, public rflu_writeflowwrapper(pRegion)
subroutine rflu_writeflowbinary(pRegion)
subroutine registerfunction(global, funName, fileName)
int status() const
Obtain the status of the attribute.
subroutine turb_rflu_writesolutionbinary(region)
subroutine turb_rflu_writesolutionascii(region)
subroutine rflu_readflowascii(pRegion)
subroutine plag_rflu_writesolutionascii(pRegion)
subroutine rflu_readflowbinary(pRegion)
subroutine, public spec_rflu_writeeevbinary(pRegion)
subroutine, public spec_rflu_readeevbinary(pRegion)
subroutine, public spec_rflu_writecvbinary(pRegion)
subroutine plag_rflu_readsolutionbinary(pRegion)
**********************************************************************Rocstar Simulation Suite Illinois Rocstar LLC All rights reserved ****Illinois Rocstar LLC IL **www illinoisrocstar com **sales illinoisrocstar com WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **Arising OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE **********************************************************************INTERFACE SUBROUTINE form
subroutine, public rflu_genx_putdataflow(pRegion)
subroutine, public rflu_readflowwrapper(pRegion)
subroutine rflu_writeflowascii(pRegion)
subroutine, public spec_rflu_readcvascii(pRegion)
LOGICAL function, public rflu_genx_decidereadfile(global)
subroutine turb_rflu_readsolutionascii(region)
subroutine, public spec_rflu_writeeevascii(pRegion)
subroutine plag_rflu_readsolutionascii(pRegion)
subroutine, public turb_rflu_genxgetdata(pRegion)
subroutine turb_initsolution(region)
subroutine errorstop(global, errorCode, errorLine, addMessage)
subroutine, public spec_rflu_writecvascii(pRegion)
subroutine, public spec_rflu_readeevascii(pRegion)
subroutine turb_rflu_readsolutionbinary(region)
subroutine deregisterfunction(global)
subroutine plag_rflu_writesolutionbinary(pRegion)
LOGICAL function, public rflu_genx_decidewritefile(global)
subroutine buildfilenamesteady(global, dest, ext, id, it, fileName)
subroutine buildfilenameunsteady(global, dest, ext, id, tm, fileName)