Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
POST_WriteTecplotBinary.F90
Go to the documentation of this file.
1 ! *********************************************************************
2 ! * Rocstar Simulation Suite *
3 ! * Copyright@2015, Illinois Rocstar LLC. All rights reserved. *
4 ! * *
5 ! * Illinois Rocstar LLC *
6 ! * Champaign, IL *
7 ! * www.illinoisrocstar.com *
8 ! * sales@illinoisrocstar.com *
9 ! * *
10 ! * License: See LICENSE file in top level of distribution package or *
11 ! * http://opensource.org/licenses/NCSA *
12 ! *********************************************************************
13 ! *********************************************************************
14 ! * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, *
15 ! * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES *
16 ! * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND *
17 ! * NONINFRINGEMENT. IN NO EVENT SHALL THE CONTRIBUTORS OR *
18 ! * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER *
19 ! * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, *
20 ! * Arising FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE *
21 ! * USE OR OTHER DEALINGS WITH THE SOFTWARE. *
22 ! *********************************************************************
23 !******************************************************************************
24 !
25 ! Purpose: write grid (and solution) data to plot file in binary format.
26 !
27 ! Description: none.
28 !
29 ! Input: iReg = region number
30 ! region = region data (dimensions, flow variables)
31 !
32 ! Output: to plot file.
33 !
34 ! Notes: none.
35 !
36 !******************************************************************************
37 !
38 ! $Id: POST_WriteTecplotBinary.F90,v 1.5 2008/12/06 08:44:49 mtcampbe Exp $
39 !
40 ! Copyright: (c) 2001 by the University of Illinois
41 !
42 !******************************************************************************
43 
44 SUBROUTINE writetecplotbinary( iReg,region )
45 
46  USE moddatatypes
47  USE moderror
48  USE moddatastruct, ONLY : t_region
49  USE modglobal, ONLY : t_global
50  USE modmixture, ONLY : t_mixt
54  USE modmpi
55  USE modparameters
56 #ifdef TURB
57  USE modturbulence, ONLY : t_turb
59 #endif
60  IMPLICIT NONE
61 
62 #include "Indexing.h"
63 
64 ! ... parameters
65  INTEGER :: ireg
66  TYPE(t_region) :: region
67 
68 ! ... loop variables
69  INTEGER :: i, j, k, ii, jj, kk
70 
71 ! ... local variables
72  CHARACTER(CHRLEN) :: zonename
73  CHARACTER(2*CHRLEN) :: title
74  CHARACTER(1) :: nullchr
75 
76  INTEGER :: ilev, debug, visdouble, iret, imax, jmax, kmax, ijkmax
77  INTEGER :: ipnbeg, ipnend, jpnbeg, jpnend, kpnbeg, kpnend
78  INTEGER :: icoff, ijcoff, inoff, ijnoff, ijkn, cell(8), errorflag
79 
80  REAL(RFREAL) :: c, qq
81  REAL(RFREAL), POINTER :: xyz(:,:), cv(:,:), dv(:,:), tv(:,:), gv(:,:)
82  DOUBLE PRECISION, ALLOCATABLE :: x(:,:,:), y(:,:,:), z(:,:,:), &
83  rho(:,:,:), u(:,:,:), v(:,:,:), w(:,:,:), &
84  press(:,:,:), temp(:,:,:), mach(:,:,:)
85 #ifdef TURB
86  REAL(RFREAL), POINTER :: vort(:,:), lens(:)
87  DOUBLE PRECISION, ALLOCATABLE :: mut(:,:,:), tvort(:,:,:), len(:,:,:)
88 #endif
89 #ifdef STATS
90  DOUBLE PRECISION, ALLOCATABLE :: srho(:,:,:),su(:,:,:), sv(:,:,:), sw(:,:,:), &
91  spress(:,:,:), stemp(:,:,:), &
92  suu(:,:,:), svv(:,:,:), sww(:,:,:), suv(:,:,:), &
93  srr(:,:,:), spp(:,:,:), stt(:,:,:)
94  DOUBLE PRECISION, ALLOCATABLE :: smut(:,:,:), scdyn(:,:,:)
95  REAL(RFREAL) :: rtime
96  LOGICAL :: statsactive
97 #endif
98 
99  TYPE(t_global), POINTER :: global
100  TYPE(t_mixt) , POINTER :: mixt
101 #ifdef TURB
102  TYPE(t_turb) , POINTER :: turb
103 #endif
104 
105 ! ... functions
106  INTEGER :: tecini, tecdat, teczne, tecend
107 
108 !******************************************************************************
109 
110  global => region%global
111 
112  CALL registerfunction( global,'WriteTecplotBinary',&
113  'POST_WriteTecplotBinary.F90' )
114 
115 #ifdef NO_TECPLOT
116  CALL errorstop( global,err_file_write,__line__ )
117 #else
118 
119 ! set parameters --------------------------------------------------------------
120 
121  nullchr = char(0)
122  debug = 0
123  visdouble = 1
124  ilev = global%startLevel
125 
126  CALL rflo_getdimensphysnodes( region,ilev,ipnbeg,ipnend, &
127  jpnbeg,jpnend,kpnbeg,kpnend )
128  CALL rflo_getcelloffset( region,ilev,icoff,ijcoff )
129  CALL rflo_getnodeoffset( region,ilev,inoff,ijnoff )
130 
131  imax = ipnend - ipnbeg + 1
132  jmax = jpnend - jpnbeg + 1
133  kmax = kpnend - kpnbeg + 1
134  ijkmax = imax*jmax*kmax
135 
136 ! statistics active?
137 
138 #ifdef STATS
139  statsactive = (global%postStatsFlag .AND. &
140  (global%flowType == flow_unsteady) .AND. &
141  (global%doStat == active))
142 
143 ! set 1/integrTime
144  rtime = 1._rfreal/global%integrTime
145 #endif
146 
147 ! open file and write the header ----------------------------------------------
148 
149  IF (ireg == 1) THEN
150  IF (global%flowType == flow_steady) THEN
151  WRITE(title,1000) trim(global%casename),global%postIter
152  ELSE
153  WRITE(title,1005) trim(global%casename),global%postTime
154  ENDIF
155  IF (global%postPlotType == plot_grid_only) THEN
156  iret = tecini( trim(title)//nullchr, &
157  'x y z'//nullchr, &
158  trim(global%casename)//'.plt'//nullchr,'.'//nullchr, &
159  debug,visdouble )
160  ELSE
161 #ifndef TURB
162 #ifdef STATS
163  IF (statsactive) THEN
164  IF (global%mixtNStat > 0) THEN
165  iret = tecini( trim(title)//nullchr, &
166 ! 'x y z rho u v w p T M <u> <v> <w> <p> <uu> <vv> <ww> <uv> <pp>'//nullchr, &
167  'x y z rho u v w p T M <u> <v> <T> <uu> <vv> <ww> <uv> <TT>'//nullchr, &
168  trim(global%casename)//'.plt'//nullchr,'.'//nullchr, &
169  debug,visdouble )
170  ELSE
171  iret = tecini( trim(title)//nullchr, &
172  'x y z rho u v w p T M'//nullchr, &
173  trim(global%casename)//'.plt'//nullchr,'.'//nullchr, &
174  debug,visdouble )
175  ENDIF
176  ELSE
177  iret = tecini( trim(title)//nullchr, &
178  'x y z rho u v w p T M'//nullchr, &
179  trim(global%casename)//'.plt'//nullchr,'.'//nullchr, &
180  debug,visdouble )
181  ENDIF
182 #else
183  iret = tecini( trim(title)//nullchr, &
184  'x y z rho u v w p T M'//nullchr, &
185  trim(global%casename)//'.plt'//nullchr,'.'//nullchr, &
186  debug,visdouble )
187 #endif ! Stats
188 #endif ! noTurb
189 
190 #ifdef TURB
191  IF ((global%postTurbFlag .EQV. .false.) .OR. &
192  region%mixtInput%turbModel == turb_model_none) THEN
193 #ifdef STATS
194  IF (statsactive) THEN
195  IF (global%mixtNStat > 0) THEN
196  iret = tecini( trim(title)//nullchr, &
197 ! 'x y z rho u v w p T M <u> <v> <w> <p> <uu> <vv> <ww> <uv> <pp>'//nullchr, &
198  'x y z rho u v w p T M <u> <v> <T> <uu> <vv> <ww> <uv> <TT>'//nullchr, &
199  trim(global%casename)//'.plt'//nullchr,'.'//nullchr, &
200  debug,visdouble )
201  ELSE
202  iret = tecini( trim(title)//nullchr, &
203  'x y z rho u v w p T M'//nullchr, &
204  trim(global%casename)//'.plt'//nullchr,'.'//nullchr, &
205  debug,visdouble )
206  ENDIF
207  ELSE
208  iret = tecini( trim(title)//nullchr, &
209  'x y z rho u v w p T M'//nullchr, &
210  trim(global%casename)//'.plt'//nullchr,'.'//nullchr, &
211  debug,visdouble )
212  ENDIF
213 #else
214  iret = tecini( trim(title)//nullchr, &
215  'x y z rho u v w p T M'//nullchr, &
216  trim(global%casename)//'.plt'//nullchr,'.'//nullchr, &
217  debug,visdouble )
218 #endif
219  ELSE
220  IF (region%turbInput%nOutField == 1) THEN
221 #ifdef STATS
222  IF (statsactive) THEN
223  IF (global%turbNStat > 0) THEN
224  iret = tecini( trim(title)//nullchr, &
225 ! 'x y z rho u v w p T M mut <u> <v> <w> <p> <uu> <vv> <ww> <uv> <pp> <mut> <cdyn>'//nullchr, &
226  'x y z rho u v w p T M mut <u> <v> <T> <uu> <vv> <ww> <uv> <TT> <mut> <cdyn>'//nullchr, &
227  trim(global%casename)//'.plt'//nullchr,'.'//nullchr, &
228  debug,visdouble )
229  ELSE
230  iret = tecini( trim(title)//nullchr, &
231 ! 'x y z rho u v w p T M mut <u> <v> <w> <p> <uu> <vv> <ww> <uv> <pp>'//nullchr, &
232  'x y z rho u v w p T M mut <u> <v> <T> <uu> <vv> <ww> <uv> <TT>'//nullchr, &
233  trim(global%casename)//'.plt'//nullchr,'.'//nullchr, &
234  debug,visdouble )
235  ENDIF
236  ELSE
237  iret = tecini( trim(title)//nullchr, &
238  'x y z rho u v w p T M mut'//nullchr, &
239  trim(global%casename)//'.plt'//nullchr,'.'//nullchr, &
240  debug,visdouble )
241  ENDIF
242 #else
243  iret = tecini( trim(title)//nullchr, &
244  'x y z rho u v w p T M mut'//nullchr, &
245  trim(global%casename)//'.plt'//nullchr,'.'//nullchr, &
246  debug,visdouble )
247 #endif
248  ELSEIF (region%turbInput%nOutField == 2) THEN
249 #ifdef STATS
250  IF (statsactive) THEN
251  IF (global%turbNStat > 0) THEN
252  iret = tecini( trim(title)//nullchr, &
253 ! 'x y z rho u v w p T M mut tvort <u> <v> <w> <p> <uu> <vv> <ww> <uv> <pp> <mut> <cdyn>'//nullchr, &
254  'x y z rho u v w p T M mut tvort <u> <v> <T> <uu> <vv> <ww> <uv> <TT> <mut> <cdyn>'//nullchr, &
255  trim(global%casename)//'.plt'//nullchr,'.'//nullchr, &
256  debug,visdouble )
257  ELSE
258  iret = tecini( trim(title)//nullchr, &
259 ! 'x y z rho u v w p T M mut tvort <u> <v> <w> <p> <uu> <vv> <ww> <uv> <pp>'//nullchr, &
260  'x y z rho u v w p T M mut tvort <u> <v> <T> <uu> <vv> <ww> <uv> <TT>'//nullchr, &
261  trim(global%casename)//'.plt'//nullchr,'.'//nullchr, &
262  debug,visdouble )
263  ENDIF
264  ELSE
265  iret = tecini( trim(title)//nullchr, &
266  'x y z rho u v w p T M mut tvort'//nullchr, &
267  trim(global%casename)//'.plt'//nullchr,'.'//nullchr, &
268  debug,visdouble )
269  ENDIF
270 #else
271  iret = tecini( trim(title)//nullchr, &
272  'x y z rho u v w p T M mut tvort'//nullchr, &
273  trim(global%casename)//'.plt'//nullchr,'.'//nullchr, &
274  debug,visdouble )
275 #endif
276  ENDIF
277  IF ((region%turbInput%modelClass == model_rans ) .AND. &
278  (region%turbInput%nOutField == 3)) THEN
279 #ifdef STATS
280  IF (statsactive) THEN
281  IF (global%turbNStat > 0) THEN
282  iret = tecini( trim(title)//nullchr, &
283 ! 'x y z rho u v w p T M mut tvort lens <u> <v> <w> <p> <uu> <vv> <ww> <uv> <pp> <mut> <cdyn>'//nullchr, &
284  'x y z rho u v w p T M mut tvort lens <u> <v> <T> <uu> <vv> <ww> <uv> <TT> <mut> <cdyn>'//nullchr, &
285  trim(global%casename)//'.plt'//nullchr,'.'//nullchr, &
286  debug,visdouble )
287  ELSE
288  iret = tecini( trim(title)//nullchr, &
289 ! 'x y z rho u v w p T M mut tvort lens <u> <v> <w> <p> <uu> <vv> <ww> <uv> <pp>'//nullchr, &
290  'x y z rho u v w p T M mut tvort lens <u> <v> <T> <uu> <vv> <ww> <uv> <TT>'//nullchr, &
291  trim(global%casename)//'.plt'//nullchr,'.'//nullchr, &
292  debug,visdouble )
293  ENDIF
294  ELSE
295  iret = tecini( trim(title)//nullchr, &
296  'x y z rho u v w p T M mut tvort lens'//nullchr, &
297  trim(global%casename)//'.plt'//nullchr,'.'//nullchr, &
298  debug,visdouble )
299  ENDIF
300 #else
301  iret = tecini( trim(title)//nullchr, &
302  'x y z rho u v w p T M mut tvort lens'//nullchr, &
303  trim(global%casename)//'.plt'//nullchr,'.'//nullchr, &
304  debug,visdouble )
305 #endif ! Stats
306  ENDIF ! nOutField
307  ENDIF ! postTurbFlag and turbModel
308 #endif ! Turb
309  ENDIF ! plotType
310  ENDIF ! iReg=1
311 
312 ! write zone header -----------------------------------------------------------
313 
314  WRITE(zonename,1010) ireg
315 
316  iret = teczne( trim(zonename)//nullchr, &
317  imax,jmax,kmax, &
318  'BLOCK'//nullchr,nullchr )
319 
320 ! write data ------------------------------------------------------------------
321 ! pointer to variables
322 
323  xyz => region%levels(ilev)%grid%xyz
324  mixt => region%levels(ilev)%mixt
325  cv => mixt%cv
326  dv => mixt%dv
327  tv => mixt%tv
328  gv => mixt%gv
329 #ifdef TURB
330  turb => region%levels(ilev)%turb
331 
332  IF (global%postTurbFlag .AND. &
333  region%mixtInput%turbModel /= turb_model_none) THEN
334  IF (region%turbInput%nOutField > 1) vort => region%levels(ilev)%turb%vort
335 
336  IF (region%turbInput%modelClass == model_rans) &
337  lens => region%levels(ilev)%turb%lens
338  ENDIF
339 #endif
340 
341 ! allocate memory for temporary values
342 
343  ALLOCATE( x(imax,jmax,kmax),stat=errorflag )
344  ALLOCATE( y(imax,jmax,kmax),stat=errorflag )
345  ALLOCATE( z(imax,jmax,kmax),stat=errorflag )
346  global%error = errorflag
347  IF (global%error /= 0) CALL errorstop( global,err_allocate,__line__ )
348 
349  IF (global%postPlotType == plot_grid_flow) THEN
350  ALLOCATE( rho(imax,jmax,kmax),stat=errorflag )
351  ALLOCATE( u(imax,jmax,kmax),stat=errorflag )
352  ALLOCATE( v(imax,jmax,kmax),stat=errorflag )
353  ALLOCATE( w(imax,jmax,kmax),stat=errorflag )
354  ALLOCATE( press(imax,jmax,kmax),stat=errorflag )
355  ALLOCATE( temp(imax,jmax,kmax),stat=errorflag )
356  ALLOCATE( mach(imax,jmax,kmax),stat=errorflag )
357 
358 #ifdef TURB
359  IF (global%postTurbFlag .AND. &
360  region%mixtInput%turbModel /= turb_model_none) THEN
361  ALLOCATE( mut(imax,jmax,kmax),stat=errorflag )
362  IF (region%turbInput%nOutField >= 2) THEN
363  ALLOCATE( tvort(imax,jmax,kmax),stat=errorflag )
364  ENDIF
365  IF ((region%turbInput%modelClass == model_rans ) .AND. &
366  (region%turbInput%nOutField == 3)) THEN
367  ALLOCATE( len(imax,jmax,kmax),stat=errorflag )
368  ENDIF
369  ENDIF
370 #endif
371 
372 #ifdef STATS
373  IF (statsactive) THEN
374  IF (global%mixtNStat > 0) THEN
375  ALLOCATE( srho(imax,jmax,kmax),stat=errorflag )
376  ALLOCATE( su(imax,jmax,kmax),stat=errorflag )
377  ALLOCATE( sv(imax,jmax,kmax),stat=errorflag )
378  ALLOCATE( sw(imax,jmax,kmax),stat=errorflag )
379  ALLOCATE( spress(imax,jmax,kmax),stat=errorflag )
380  ALLOCATE( stemp(imax,jmax,kmax),stat=errorflag )
381  ALLOCATE( suu(imax,jmax,kmax),stat=errorflag )
382  ALLOCATE( svv(imax,jmax,kmax),stat=errorflag )
383  ALLOCATE( sww(imax,jmax,kmax),stat=errorflag )
384  ALLOCATE( suv(imax,jmax,kmax),stat=errorflag )
385  ALLOCATE( srr(imax,jmax,kmax),stat=errorflag )
386  ALLOCATE( spp(imax,jmax,kmax),stat=errorflag )
387  ALLOCATE( stt(imax,jmax,kmax),stat=errorflag )
388  sw = 0._rfreal
389  ENDIF
390 #ifdef TURB
391  IF (global%turbNStat > 0) THEN
392  ALLOCATE( smut(imax,jmax,kmax),stat=errorflag )
393  ALLOCATE( scdyn(imax,jmax,kmax),stat=errorflag )
394  ENDIF
395 #endif
396  ENDIF
397 #endif
398 
399  ENDIF
400  global%error = errorflag
401  IF (global%error /= 0) CALL errorstop( global,err_allocate,__line__ )
402 
403 ! write grid coordinates
404 
405  kk = 0
406  DO k=kpnbeg,kpnend
407  kk = kk + 1
408  jj = 0
409  DO j=jpnbeg,jpnend
410  jj = jj + 1
411  ii = 0
412  DO i=ipnbeg,ipnend
413  ii = ii + 1
414  ijkn = indijk(i,j,k,inoff,ijnoff)
415 
416  x(ii,jj,kk) = xyz(xcoord,ijkn)
417  y(ii,jj,kk) = xyz(ycoord,ijkn)
418  z(ii,jj,kk) = xyz(zcoord,ijkn)
419  ENDDO
420  ENDDO
421  ENDDO
422 
423  iret = tecdat( ijkmax,x,visdouble )
424  iret = tecdat( ijkmax,y,visdouble )
425  iret = tecdat( ijkmax,z,visdouble )
426 
427 ! write solution
428 
429  IF (global%postPlotType == plot_grid_flow) THEN
430  kk = 0
431  DO k=kpnbeg,kpnend
432  kk = kk + 1
433  jj = 0
434  DO j=jpnbeg,jpnend
435  jj = jj + 1
436  ii = 0
437  DO i=ipnbeg,ipnend
438  ii = ii + 1
439  cell(1) = indijk(i ,j ,k ,icoff,ijcoff)
440  cell(2) = indijk(i-1,j ,k ,icoff,ijcoff)
441  cell(3) = indijk(i ,j-1,k ,icoff,ijcoff)
442  cell(4) = indijk(i-1,j-1,k ,icoff,ijcoff)
443  cell(5) = indijk(i ,j ,k-1,icoff,ijcoff)
444  cell(6) = indijk(i-1,j ,k-1,icoff,ijcoff)
445  cell(7) = indijk(i ,j-1,k-1,icoff,ijcoff)
446  cell(8) = indijk(i-1,j-1,k-1,icoff,ijcoff)
447 
448  rho(ii,jj,kk) = aver(cell,cv_mixt_dens,cv)
449  u(ii,jj,kk) = averdiv(cell,cv_mixt_xmom,cv,cv_mixt_dens,cv)
450  v(ii,jj,kk) = averdiv(cell,cv_mixt_ymom,cv,cv_mixt_dens,cv)
451  w(ii,jj,kk) = averdiv(cell,cv_mixt_zmom,cv,cv_mixt_dens,cv)
452  press(ii,jj,kk) = aver(cell,dv_mixt_pres,dv)
453  temp(ii,jj,kk) = aver(cell,dv_mixt_temp,dv)
454  c = aver(cell,dv_mixt_soun,dv)
455  qq = u(ii,jj,kk)*u(ii,jj,kk) + &
456  v(ii,jj,kk)*v(ii,jj,kk) + &
457  w(ii,jj,kk)*w(ii,jj,kk)
458  mach(ii,jj,kk) = sqrt(qq)/c
459 #ifdef TURB
460  IF (global%postTurbFlag .AND. &
461  region%mixtInput%turbModel /= turb_model_none) THEN
462  mut(ii,jj,kk) = aver(cell,tv_mixt_muet,tv)
463  IF (region%turbInput%nOutField >= 2) THEN
464  tvort(ii,jj,kk) = aver(cell,xcoord,vort)
465  ENDIF
466  IF ((region%turbInput%modelClass == model_rans ) .AND. &
467  (region%turbInput%nOutField == 3)) THEN
468  len(ii,jj,kk) = aver1d(cell,lens)
469  ENDIF
470  ENDIF
471 #endif
472 
473 #ifdef STATS
474  IF (statsactive) THEN
475  IF (global%mixtNStat > 0) THEN
476 ! su (ii,jj,kk) = Aver(cell,2,mixt%tav)*rtime ! 02 mixtStatId
477 ! sv (ii,jj,kk) = Aver(cell,3,mixt%tav)*rtime ! 03
478 ! sw (ii,jj,kk) = Aver(cell,4,mixt%tav)*rtime ! 04
479 ! spress(ii,jj,kk) = Aver(cell,5,mixt%tav)*rtime ! 06
480 ! suu (ii,jj,kk) = Aver(cell,7,mixt%tav)*rtime ! 22
481 ! svv (ii,jj,kk) = Aver(cell,8,mixt%tav)*rtime ! 33
482 ! sww (ii,jj,kk) = Aver(cell,9,mixt%tav)*rtime ! 44
483 ! suv (ii,jj,kk) = Aver(cell,10,mixt%tav)*rtime ! 23
484 ! spp (ii,jj,kk) = Aver(cell,11,mixt%tav)*rtime ! 66
485 ! suu(ii,jj,kk) = suu(ii,jj,kk) - su(ii,jj,kk)*su(ii,jj,kk)
486 ! svv(ii,jj,kk) = svv(ii,jj,kk) - sv(ii,jj,kk)*sv(ii,jj,kk)
487 ! sww(ii,jj,kk) = sww(ii,jj,kk) - sw(ii,jj,kk)*sw(ii,jj,kk)
488 ! suv(ii,jj,kk) = suv(ii,jj,kk) - su(ii,jj,kk)*sv(ii,jj,kk)
489 ! spp(ii,jj,kk) = spp(ii,jj,kk) - spress(ii,jj,kk)*spress(ii,jj,kk)
490 
491  su(ii,jj,kk) = aver(cell,2,mixt%tav)*rtime ! 02 mixtStatId
492  sv(ii,jj,kk) = aver(cell,3,mixt%tav)*rtime ! 03
493  stemp(ii,jj,kk) = aver(cell,4,mixt%tav)*rtime ! 05
494  suu(ii,jj,kk) = aver(cell,6,mixt%tav)*rtime ! 22
495  svv(ii,jj,kk) = aver(cell,7,mixt%tav)*rtime ! 33
496  sww(ii,jj,kk) = aver(cell,8,mixt%tav)*rtime ! 44
497  suv(ii,jj,kk) = aver(cell,9,mixt%tav)*rtime ! 23
498  stt(ii,jj,kk) = aver(cell,10,mixt%tav)*rtime ! 55
499  suu(ii,jj,kk) = suu(ii,jj,kk) - su(ii,jj,kk)*su(ii,jj,kk)
500  svv(ii,jj,kk) = svv(ii,jj,kk) - sv(ii,jj,kk)*sv(ii,jj,kk)
501  sww(ii,jj,kk) = sww(ii,jj,kk) - sw(ii,jj,kk)*sw(ii,jj,kk)
502  suv(ii,jj,kk) = suv(ii,jj,kk) - su(ii,jj,kk)*sv(ii,jj,kk)
503  stt(ii,jj,kk) = stt(ii,jj,kk) - stemp(ii,jj,kk)*stemp(ii,jj,kk)
504  ENDIF
505 #ifdef TURB
506  IF (global%turbNStat > 0) THEN
507  smut(ii,jj,kk) = aver(cell,1,turb%tav)*rtime ! 02 turbStatId
508  scdyn(ii,jj,kk) = aver(cell,2,turb%tav)*rtime ! 03
509  ENDIF
510 #endif
511  ENDIF ! statsActive
512 #endif
513  ENDDO
514  ENDDO
515  ENDDO
516 
517  iret = tecdat( ijkmax,rho ,visdouble )
518  iret = tecdat( ijkmax,u ,visdouble )
519  iret = tecdat( ijkmax,v ,visdouble )
520  iret = tecdat( ijkmax,w ,visdouble )
521  iret = tecdat( ijkmax,press,visdouble )
522  iret = tecdat( ijkmax,temp ,visdouble )
523  iret = tecdat( ijkmax,mach ,visdouble )
524 
525 #ifdef TURB
526  IF (global%postTurbFlag .AND. &
527  region%mixtInput%turbModel /= turb_model_none) THEN
528  iret = tecdat( ijkmax,mut ,visdouble )
529  IF (region%turbInput%nOutField >= 2) THEN
530  iret = tecdat( ijkmax,tvort ,visdouble )
531  ENDIF
532  IF ((region%turbInput%modelClass == model_rans ) .AND. &
533  (region%turbInput%nOutField == 3)) THEN
534  iret = tecdat( ijkmax,len ,visdouble )
535  ENDIF
536  ENDIF
537 #endif
538 
539 #ifdef STATS
540  IF (statsactive) THEN
541  IF (global%mixtNStat > 0) THEN
542 ! iret = TecDat( ijkMax,su ,vIsDouble )
543 ! iret = TecDat( ijkMax,sv ,vIsDouble )
544 ! iret = TecDat( ijkMax,sw ,vIsDouble )
545 ! iret = TecDat( ijkMax,spress,vIsDouble )
546 ! iret = TecDat( ijkMax,suu ,vIsDouble )
547 ! iret = TecDat( ijkMax,svv ,vIsDouble )
548 ! iret = TecDat( ijkMax,sww ,vIsDouble )
549 ! iret = TecDat( ijkMax,suv ,vIsDouble )
550 ! iret = TecDat( ijkMax,spp ,vIsDouble )
551 
552  iret = tecdat( ijkmax,su ,visdouble )
553  iret = tecdat( ijkmax,sv ,visdouble )
554  iret = tecdat( ijkmax,stemp ,visdouble )
555  iret = tecdat( ijkmax,suu ,visdouble )
556  iret = tecdat( ijkmax,svv ,visdouble )
557  iret = tecdat( ijkmax,sww ,visdouble )
558  iret = tecdat( ijkmax,suv ,visdouble )
559  iret = tecdat( ijkmax,stt ,visdouble )
560  ENDIF
561 #ifdef TURB
562  IF (global%turbNStat > 0) THEN ! if (mixtNStat />0) it ll abort
563  iret = tecdat( ijkmax,smut ,visdouble )
564  iret = tecdat( ijkmax,scdyn ,visdouble )
565  ENDIF
566 #endif
567  ENDIF ! statsActive
568 #endif
569  ENDIF ! plotType == PLOT_GRID_FLOW
570 
571 ! close file ------------------------------------------------------------------
572 
573  IF (ireg == global%nRegions) THEN
574  iret = tecend()
575  ENDIF
576 
577 ! finalize --------------------------------------------------------------------
578 
579  DEALLOCATE( x,stat=errorflag )
580  DEALLOCATE( y,stat=errorflag )
581  DEALLOCATE( z,stat=errorflag )
582  global%error = errorflag
583  IF (global%error /= 0) CALL errorstop( global,err_deallocate,__line__ )
584 
585  IF (global%postPlotType == plot_grid_flow) THEN
586  DEALLOCATE( rho ,stat=errorflag )
587  DEALLOCATE( u ,stat=errorflag )
588  DEALLOCATE( v ,stat=errorflag )
589  DEALLOCATE( w ,stat=errorflag )
590  DEALLOCATE( press,stat=errorflag )
591  DEALLOCATE( temp ,stat=errorflag )
592  DEALLOCATE( mach ,stat=errorflag )
593 #ifdef TURB
594  IF (global%postTurbFlag .AND. &
595  region%mixtInput%turbModel /= turb_model_none) THEN
596  DEALLOCATE( mut ,stat=errorflag )
597  IF (region%turbInput%nOutField >= 2) THEN
598  DEALLOCATE( tvort ,stat=errorflag )
599  ENDIF
600  IF ((region%turbInput%modelClass == model_rans ) .AND. &
601  (region%turbInput%nOutField == 3)) THEN
602  DEALLOCATE( len ,stat=errorflag )
603  ENDIF
604  ENDIF
605 #endif
606 #ifdef STATS
607  IF (statsactive) THEN
608  IF (global%mixtNStat > 0) THEN
609  DEALLOCATE( srho, stat=errorflag )
610  DEALLOCATE( su, stat=errorflag )
611  DEALLOCATE( sv, stat=errorflag )
612  DEALLOCATE( sw, stat=errorflag )
613  DEALLOCATE( spress, stat=errorflag )
614  DEALLOCATE( stemp, stat=errorflag )
615  DEALLOCATE( suu, stat=errorflag )
616  DEALLOCATE( svv, stat=errorflag )
617  DEALLOCATE( sww, stat=errorflag )
618  DEALLOCATE( suv, stat=errorflag )
619  DEALLOCATE( srr, stat=errorflag )
620  DEALLOCATE( spp, stat=errorflag )
621  DEALLOCATE( stt, stat=errorflag )
622  ENDIF
623 #ifdef TURB
624  IF (global%turbNStat > 0) THEN
625  DEALLOCATE( smut, stat=errorflag )
626  DEALLOCATE( scdyn, stat=errorflag )
627  ENDIF
628 #endif
629  ENDIF
630 #endif
631  ENDIF ! plotType == PLOT_GRID_FLOW
632  global%error = errorflag
633  IF (global%error /= 0) CALL errorstop( global,err_deallocate,__line__ )
634 
635 #endif
636 
637  CALL deregisterfunction( global )
638 
639 ! formats
640 
641 1000 FORMAT(a,'. Iteration: ',i8,'.')
642 1005 FORMAT(a,'. Time: ',1pe11.5,'.')
643 1010 FORMAT(i5.5)
644 
645 END SUBROUTINE writetecplotbinary
646 
647 !******************************************************************************
648 !
649 ! RCS Revision history:
650 !
651 ! $Log: POST_WriteTecplotBinary.F90,v $
652 ! Revision 1.5 2008/12/06 08:44:49 mtcampbe
653 ! Updated license.
654 !
655 ! Revision 1.4 2008/11/19 22:17:59 mtcampbe
656 ! Added Illinois Open Source License/Copyright
657 !
658 ! Revision 1.3 2005/04/27 04:48:13 wasistho
659 ! additinal statistics input set
660 !
661 ! Revision 1.2 2004/12/03 03:20:36 wasistho
662 ! rflo_modinterfacespost to post_modinterfaces
663 !
664 ! Revision 1.1 2004/12/03 02:03:16 wasistho
665 ! added prefix
666 !
667 ! Revision 1.1 2004/12/03 00:32:01 wasistho
668 ! lower to upper case
669 !
670 ! Revision 1.16 2004/11/10 18:29:59 wasistho
671 ! put rtime within ifdef STATS
672 !
673 ! Revision 1.15 2004/11/10 02:19:41 wasistho
674 ! devided accumulated tav by integrTime
675 !
676 ! Revision 1.14 2004/11/09 12:34:11 wasistho
677 ! bug fixed, forgoten indeks ii,j,kk in getting rms of small scales
678 !
679 ! Revision 1.13 2004/11/09 12:17:12 wasistho
680 ! compute <u> = <uu>-<u><u> inside routine
681 !
682 ! Revision 1.12 2004/11/09 10:50:23 wasistho
683 ! added statistics to rflopost
684 !
685 ! Revision 1.11 2004/08/26 00:44:38 wasistho
686 ! bug fixed interconnection turbFlag and turbModel
687 !
688 ! Revision 1.10 2004/07/24 03:48:28 wasistho
689 ! use postSection instead of command line input
690 !
691 ! Revision 1.9 2004/02/11 03:26:23 wasistho
692 ! added feature: variable number of turbulence output fields
693 !
694 ! Revision 1.8 2004/02/07 01:19:06 wasistho
695 ! added turbulence related results in rocflo post processing
696 !
697 ! Revision 1.7 2003/05/15 02:57:07 jblazek
698 ! Inlined index function.
699 !
700 ! Revision 1.6 2003/03/20 22:23:47 haselbac
701 ! Renamed ModInterfaces
702 !
703 ! Revision 1.5 2003/03/20 19:41:26 haselbac
704 ! Corrected mistake in phased check-in
705 !
706 ! Revision 1.4 2003/03/20 19:34:37 haselbac
707 ! Modified RegFun call to avoid probs with long 'POST_WriteTecplotBinary.F90' names
708 !
709 ! Revision 1.3 2002/10/12 03:20:51 jblazek
710 ! Replaced [io]stat=global%error with local errorFlag for Rocflo.
711 !
712 ! Revision 1.2 2002/09/05 17:40:22 jblazek
713 ! Variable global moved into regions().
714 !
715 ! Revision 1.1 2002/07/20 00:42:05 jblazek
716 ! Added ASCII Tecplot format.
717 !
718 ! Revision 1.5 2002/04/11 21:10:27 jblazek
719 ! Set correct time when writing grid only for Tecplot.
720 !
721 ! Revision 1.4 2002/02/22 20:30:39 jblazek
722 ! Changed generic format. Enhanced Tecplot title.
723 !
724 ! Revision 1.3 2002/02/21 23:25:06 jblazek
725 ! Blocks renamed as regions.
726 !
727 ! Revision 1.2 2002/02/16 07:16:00 jblazek
728 ! Added implicit residual smoothing.
729 !
730 ! Revision 1.1 2002/01/12 00:02:49 jblazek
731 ! Added postprocessor.
732 !
733 !******************************************************************************
734 
735 
736 
737 
738 
739 
740 
741 
subroutine writetecplotbinary(iReg, region)
**********************************************************************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 jpnbeg
j indices k indices k
Definition: Indexing.h:6
void int int REAL REAL * y
Definition: read.cpp:74
**********************************************************************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 kpnbeg
subroutine registerfunction(global, funName, fileName)
Definition: ModError.F90:449
double sqrt(double d)
Definition: double.h:73
RT c() const
Definition: Line_2.h:150
*********************************************************************Illinois Open Source License ****University of Illinois NCSA **Open Source License University of Illinois All rights reserved ****Developed free of to any person **obtaining a copy of this software and associated documentation to deal with the Software without including without limitation the rights to and or **sell copies of the and to permit persons to whom the **Software is furnished to do subject to the following this list of conditions and the following disclaimers ****Redistributions in binary form must reproduce the above **copyright this list of conditions and the following **disclaimers in the documentation and or other materials **provided with the distribution ****Neither the names of the Center for Simulation of Advanced the University of nor the names of its **contributors may be used to endorse or promote products derived **from this Software without specific prior written permission ****THE SOFTWARE IS PROVIDED AS 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 v
Definition: roccomf90.h:20
**********************************************************************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 jpnend
subroutine rflo_getnodeoffset(region, iLev, iNodeOffset, ijNodeOffset)
void int int int REAL REAL REAL * z
Definition: write.cpp:76
blockLoc i
Definition: read.cpp:79
**********************************************************************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 ipnbeg
subroutine rflo_getcelloffset(region, iLev, iCellOffset, ijCellOffset)
void int int REAL * x
Definition: read.cpp:74
DOUBLE PRECISION function aver1d(cell, var)
subroutine rflo_getdimensphysnodes(region, iLev, ipnbeg, ipnend, jpnbeg, jpnend, kpnbeg, kpnend)
j indices j
Definition: Indexing.h:6
DOUBLE PRECISION function aver(cell, iEq, var)
DOUBLE PRECISION function averdiv(cell, iEq1, var1, iEq2, var2)
bool debug(bool s=true)
Definition: GEM.H:193
subroutine errorstop(global, errorCode, errorLine, addMessage)
Definition: ModError.F90:483
subroutine deregisterfunction(global)
Definition: ModError.F90:469
**********************************************************************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 ipnend
RT a() const
Definition: Line_2.h:140