66 TYPE(t_region
),
POINTER :: regions(:)
69 INTEGER :: ireg,
i,
j,
k,
n
72 CHARACTER(2*CHRLEN+17) :: fname
73 CHARACTER(CHRLEN) ::
msg, timestring
77 INTEGER ::
status(mpi_status_size)
79 INTEGER :: ilev, iregfile, ipc, jpc, kpc, ndumcells, nfield, ioff, ijoff, ijk
81 INTEGER :: ndimc, nrvar, noutsol, globalclass, errorflag
82 INTEGER,
ALLOCATABLE :: ivar(:,:)
84 REAL(RFREAL),
POINTER :: tv(:,:), tcv(:,:)
85 REAL(RFREAL),
ALLOCATABLE :: rvar(:,:), solfile(:,:)
91 global => regions(1)%global
94 'TURB_rFLO_ReadSolution.F90' )
100 ALLOCATE( ivar(6,1),stat=errorflag )
101 ALLOCATE( rvar(nrvar,1),stat=errorflag )
102 global%error = errorflag
103 IF (global%error /= 0) CALL
errorstop( global,err_allocate,__line__ )
107 IF (global%flowType == flow_unsteady)
THEN
108 WRITE(timestring,
'(1PE11.5)') global%timeStamp
110 WRITE(timestring,
'(1PE11.5)') 0._rfreal
115 IF (global%myProcid == masterproc)
THEN
119 IF (global%flowType == flow_unsteady)
THEN
120 IF (global%solutFormat == format_ascii)
THEN
121 WRITE(fname,
'(A,1PE11.5)') trim(global%inDir)//trim(global%casename)//
'.turba_', &
123 INQUIRE(file=fname,exist=fileexists)
124 IF (fileexists .EQV. .true.) &
125 OPEN(if_solut,file=fname,
form=
'formatted',
status=
'old',iostat=errorflag)
126 ELSE IF (global%solutFormat == format_binary)
THEN
127 WRITE(fname,
'(A,1PE11.5)') trim(global%inDir)//trim(global%casename)//
'.turbb_', &
129 INQUIRE(file=fname,exist=fileexists)
130 IF (fileexists .EQV. .true.) &
131 OPEN(if_solut,file=fname,
form=
'unformatted',
status=
'old',iostat=errorflag)
133 CALL
errorstop( global,err_unknown_format,__line__ )
139 IF (global%solutFormat == format_ascii)
THEN
140 WRITE(fname,
'(A,I6.6)') trim(global%inDir)//trim(global%casename)//
'.turba_', &
142 INQUIRE(file=fname,exist=fileexists)
143 IF (fileexists .EQV. .true.) &
144 OPEN(if_solut,file=fname,
form=
'formatted',
status=
'old',iostat=errorflag)
145 ELSE IF (global%solutFormat == format_binary)
THEN
146 WRITE(fname,
'(A,I6.6)') trim(global%inDir)//trim(global%casename)//
'.turbb_', &
148 INQUIRE(file=fname,exist=fileexists)
149 IF (fileexists .EQV. .true.) &
150 OPEN(if_solut,file=fname,
form=
'unformatted',
status=
'old',iostat=errorflag)
152 CALL
errorstop( global,err_unknown_format,__line__ )
156 IF (fileexists .EQV. .true.)
THEN
157 global%error = errorflag
158 IF (global%error /= 0) &
159 CALL
errorstop( global,err_file_open,__line__,
'File: '//trim(fname) )
161 IF (global%myProcid==masterproc .AND. global%verbLevel/=verbose_none) &
162 WRITE(stdout,
'(A)') solver_name//
' - turbulence'
164 IF (global%myProcid==masterproc .AND. global%verbLevel/=verbose_none) &
165 WRITE(stdout,
'(A)') solver_name//
' Start new turbulence ...'
171 CALL mpi_bcast( fileexists,1,mpi_logical,masterproc,global%mpiComm,global%mpierr )
172 IF (global%mpierr /=0 ) CALL
errorstop( global,err_mpi_trouble,__line__ )
175 IF (.NOT. (fileexists .eqv. .true.))
THEN
181 IF (global%myProcid == masterproc)
THEN
186 CALL mpi_bcast( rvar,nrvar,mpi_rfreal,masterproc,global%mpiComm,global%mpierr )
187 IF (global%mpierr /=0 ) CALL
errorstop( global,err_mpi_trouble,__line__ )
190 IF (global%flowType==flow_unsteady .AND. global%currentTime>0._rfreal)
THEN
191 IF (global%currentTime /= rvar(1,1))
THEN
192 WRITE(
msg,1000) rvar(1,1),global%currentTime
193 CALL
errorstop( global,err_time_solution,__line__,
msg//
' File: '//trim(fname) )
196 global%currentTime = rvar(1,1)
198 global%resInit = rvar(2,1)
199 global%esg1Sum = rvar(3,1)
200 global%esg4Sum = rvar(4,1)
206 DO ireg=1,global%nRegions
207 IF (regions(ireg)%procid == global%myProcid)
THEN
208 IF (regions(ireg)%turbInput%modelClass == model_les)
THEN
209 globalclass = model_les
214 DO ireg=1,global%nRegions
215 IF (regions(ireg)%procid == global%myProcid)
THEN
216 IF ((regions(ireg)%mixtInput%turbModel == turb_model_sa) .OR. &
217 (regions(ireg)%mixtInput%turbModel == turb_model_dessa) .OR. &
218 (regions(ireg)%mixtInput%turbModel == turb_model_hdessa))
THEN
219 globalclass = model_rans
224 DO ireg=1,global%nRegions
228 ilev = regions(ireg)%currLevel
234 ndimc = ijkend - ijkbeg + 1
238 IF (global%myProcid == masterproc)
THEN
244 ndumcells = ivar(5,1)
247 IF (iregfile /= ireg) &
248 CALL
errorstop( global,err_region_number,__line__,
'File: '//trim(fname) )
249 IF ((ipc /= regions(ireg)%levels(ilev)%grid%ipc) .OR. &
250 (jpc /= regions(ireg)%levels(ilev)%grid%jpc) .OR. &
251 (kpc /= regions(ireg)%levels(ilev)%grid%kpc))
THEN
252 WRITE(
msg,1005) ireg,ipc,jpc,kpc
253 CALL
errorstop( global,err_grid_dimensions,__line__,
msg )
255 IF (ndumcells /= regions(ireg)%nDumCells)
THEN
256 WRITE(
msg,1010) ireg,ndumcells,regions(ireg)%nDumCells
263 IF (global%myProcid == masterproc)
THEN
266 ALLOCATE( solfile(noutsol,ndimc),stat=errorflag )
267 global%error = errorflag
268 IF (global%error /= 0) CALL
errorstop( global,err_allocate,__line__ )
271 noutsol,ndimc,solfile )
274 IF (regions(ireg)%procid /= masterproc)
THEN
275 CALL mpi_send( noutsol,1,mpi_integer, &
276 regions(ireg)%procid,ireg, &
277 global%mpiComm,global%mpierr )
278 IF (global%mpierr /=0 ) CALL
errorstop( global,err_mpi_trouble,__line__ )
279 CALL mpi_send( solfile,noutsol*ndimc,mpi_rfreal, &
280 regions(ireg)%procid,ireg, &
281 global%mpiComm,global%mpierr )
282 IF (global%mpierr /=0 ) CALL
errorstop( global,err_mpi_trouble,__line__ )
288 IF (regions(ireg)%procid == global%myProcid)
THEN
290 CALL mpi_recv( noutsol,1,mpi_integer,masterproc,ireg, &
291 global%mpiComm,
status,global%mpierr )
292 IF (global%mpierr /=0 ) CALL
errorstop( global,err_mpi_trouble,__line__ )
294 ALLOCATE( solfile(noutsol,ndimc),stat=errorflag )
295 global%error = errorflag
296 IF (global%error /= 0) CALL
errorstop( global,err_allocate,__line__ )
299 CALL mpi_recv( solfile,noutsol*ndimc,mpi_rfreal,masterproc,ireg, &
300 global%mpiComm,
status,global%mpierr )
301 IF (global%mpierr /=0 ) CALL
errorstop( global,err_mpi_trouble,__line__ )
309 IF (regions(ireg)%procid == global%myProcid)
THEN
310 IF (regions(ireg)%turbInput%modelClass == model_les)
THEN
311 tv => regions(ireg)%levels(ilev)%mixt%tv
317 ijk = indijk(
i,
j,
k,ioff,ijoff)
318 tv(tv_mixt_muet,ijk) = solfile(1,
n)
323 IF ((regions(ireg)%mixtInput%turbModel == turb_model_sa) .OR. &
324 (regions(ireg)%mixtInput%turbModel == turb_model_dessa) .OR. &
325 (regions(ireg)%mixtInput%turbModel == turb_model_hdessa))
THEN
326 tcv => regions(ireg)%levels(ilev)%turb%cv
332 ijk = indijk(
i,
j,
k,ioff,ijoff)
333 tcv(cv_sa_nutil,ijk) = solfile(1,
n)
340 IF (
ALLOCATED(solfile).eqv..true.)
THEN
341 DEALLOCATE( solfile,stat=errorflag )
342 global%error = errorflag
343 IF (global%error /= 0) CALL
errorstop( global,err_deallocate,__line__ )
350 IF (global%myProcid == masterproc)
THEN
351 CLOSE(if_solut,iostat=errorflag)
352 global%error = errorflag
353 IF (global%error /= 0) &
354 CALL
errorstop( global,err_file_close,__line__,
'File: '//trim(fname) )
361 1000
FORMAT(
'Time in file is= ',1pe12.5,
' but it should be= ',e12.5,
'.')
362 1005
FORMAT(
'Region ',i5,
', ipc= ',i6,
', jpc= ',i6,
', kpc= ',i6,
'.')
363 1010
FORMAT(
'Region ',i5,
', # dummy cells=',i2,
' but should be= ',i1)
**********************************************************************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 idcend
subroutine registerfunction(global, funName, fileName)
int status() const
Obtain the status of the attribute.
subroutine rflo_readdatafileint(global, fileId, form, nDim1, nDim2, ivar)
subroutine rflo_getdimensdummy(region, iLev, idcbeg, idcend, jdcbeg, jdcend, kdcbeg, kdcend)
**********************************************************************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 kdcbeg
subroutine turb_rflo_readsolution(regions)
subroutine rflo_getcelloffset(region, iLev, iCellOffset, ijCellOffset)
**********************************************************************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 idcbeg
**********************************************************************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
**********************************************************************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 jdcend
**********************************************************************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 jdcbeg
subroutine errorstop(global, errorCode, errorLine, addMessage)
subroutine deregisterfunction(global)
subroutine rflo_readdatafilereal(global, fileId, form, nDim1, nDim2, var)