Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PLAG_WriteTecplotAscii.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 solution data to plot file in ASCII format.
26 !
27 ! Description: none.
28 !
29 ! Input: iReg = region number
30 ! iLev = current level
31 ! region = region data (dimensions, plag variables)
32 !
33 ! Output: to plot file.
34 !
35 ! Notes: none.
36 !
37 !******************************************************************************
38 !
39 ! $Id: PLAG_WriteTecplotAscii.F90,v 1.3 2008/12/06 08:45:07 mtcampbe Exp $
40 !
41 ! Copyright: (c) 2003 by the University of Illinois
42 !
43 !******************************************************************************
44 
45 SUBROUTINE plag_writetecplotascii( iReg, iLev, region )
46 
47  USE moddatatypes
48  USE moderror
49  USE modpartlag, ONLY : t_plag, t_plag_input
50  USE moddatastruct, ONLY : t_region
51  USE modglobal, ONLY : t_global
52 
53  USE modmpi
54  USE modparameters
56  IMPLICIT NONE
57 
58 ! ... parameters
59  INTEGER :: ireg, ilev
60 
61  TYPE(t_region) :: region
62 
63 ! ... loop variables
64  INTEGER :: i
65 
66 ! ... local variables
67  CHARACTER(CHRLEN) :: rcsidentstring
68  CHARACTER(CHRLEN+4) :: fname
69 
70  INTEGER :: errorflag, ndimplag
71  INTEGER :: pidini,regini,icell,indexi,indexj,indexk
72  INTEGER, POINTER :: cvplagmass(:)
73  INTEGER, POINTER :: aiv(:,:)
74 
75  REAL(RFREAL) :: x,y,z,diam,evapor,temp,up,vp,wp
76  REAL(RFREAL), POINTER :: cv(:,:), dv(:,:)
77  REAL(RFREAL) :: massp,muem,taup
78 
79  TYPE(t_global), POINTER :: global
80 
81 !******************************************************************************
82 
83  rcsidentstring = '$RCSfile: PLAG_WriteTecplotAscii.F90,v $ $Revision: 1.3 $'
84 
85  global => region%global
86 
87  CALL registerfunction( global,'PLAG_WriteTecplotAscii', 'PLAG_WriteTecplotAscii.F90' )
88 
89 ! set parameters --------------------------------------------------------------
90 
91  ndimplag = region%levels(ilev)%plag%nPcls
92 
93 ! PRINT*,'PLAG_writeTecplotAscii: iReg, nDimPlag = ',iReg,nDimPlag
94 
95 ! open file and write the header ----------------------------------------------
96 
97  IF (ireg == 1) THEN
98  WRITE(fname,'(A,1PE11.5,A)') &
99  trim(global%casename)//'.plag_',global%currentTime,'.dat'
100  OPEN(if_plot,file=fname,status='unknown',form='formatted',iostat=errorflag)
101  global%error = errorflag
102  IF (global%error /= 0) CALL errorstop( global,err_file_open,__line__,fname )
103 
104  IF (global%currentTime <= 0._rfreal) THEN
105  WRITE(if_plot,1005,err=10) trim(global%casename),global%timeStamp
106  ELSE
107  WRITE(if_plot,1005,err=10) trim(global%casename),global%currentTime
108  ENDIF
109 
110  WRITE(if_plot,1010,err=10) 'x y z diam Evapor temp up vp wp tau pidini regini icellp ip jp kp'
111 
112  ENDIF ! iReg=1
113 
114 ! for zero nDimPlag exit ------------------------------------------------------
115 
116  IF ( ndimplag <= 0 ) goto 1999
117 
118 ! write zone header -----------------------------------------------------------
119 
120  WRITE(if_plot,1015) ireg, ndimplag
121 
122 ! write data ------------------------------------------------------------------
123 ! pointer to variables
124 
125  aiv => region%levels(ilev)%plag%aiv
126  cv => region%levels(ilev)%plag%cv
127  dv => region%levels(ilev)%plag%dv
128  cvplagmass => region%levels(ilev)%plag%cvPlagMass
129 
130  DO i = 1, ndimplag
131  x = cv(cv_plag_xpos, i)
132  y = cv(cv_plag_ypos, i)
133  z = cv(cv_plag_zpos, i)
134  diam = dv(dv_plag_diam, i)
135  evapor = cv(cv_plag_enervapor,i)
136  temp = dv(dv_plag_temp, i)
137  up = dv(dv_plag_uvel, i)
138  vp = dv(dv_plag_vvel, i)
139  wp = dv(dv_plag_wvel, i)
140 
141  pidini = aiv(aiv_plag_pidini, i)
142  regini = aiv(aiv_plag_regini, i)
143  icell = aiv(aiv_plag_icells, i)
144  indexi = aiv(aiv_plag_indexi, i)
145  indexj = aiv(aiv_plag_indexj, i)
146  indexk = aiv(aiv_plag_indexk, i)
147 
148  massp = sum( cv(cvplagmass(:),i) )
149  muem = 3.6e-04_rfreal
150  taup = massp/(3.0_rfreal*global%pi*muem*diam)
151 
152  WRITE(if_plot,1020,err=10) x,y,z,diam,evapor,temp,up,vp,wp,taup, &
153  pidini,regini,icell,indexi,indexj,indexk
154 
155  ENDDO ! i
156 
157 ! close file, handle errors ---------------------------------------------------
158 
159  IF (ireg == global%nRegions) THEN
160  CLOSE(if_plot,iostat=errorflag)
161  global%error = errorflag
162  IF (global%error /= 0) CALL errorstop( global,err_file_close,__line__,fname )
163  ENDIF
164 
165 1999 CONTINUE
166  CALL deregisterfunction( global )
167  goto 999
168 
169 10 CONTINUE
170  CALL errorstop( global,err_file_write,__line__,fname )
171 
172 ! formats ---------------------------------------------------------------------
173 
174 1005 FORMAT('TITLE="',a,'. Time: ',1pe11.5,'."')
175 1010 FORMAT('VARIABLES= ',a)
176 1015 FORMAT('ZONE T="',i5.5,'", I=',i10,', F=POINT')
177 1020 FORMAT(1p,10(1x,e13.6),1x,i10,5(1x,i8))
178 
179 999 CONTINUE
180 END SUBROUTINE plag_writetecplotascii
181 
182 !******************************************************************************
183 !
184 ! RCS Revision history:
185 !
186 ! $Log: PLAG_WriteTecplotAscii.F90,v $
187 ! Revision 1.3 2008/12/06 08:45:07 mtcampbe
188 ! Updated license.
189 !
190 ! Revision 1.2 2008/11/19 22:18:18 mtcampbe
191 ! Added Illinois Open Source License/Copyright
192 !
193 ! Revision 1.1 2004/12/01 22:00:47 fnajjar
194 ! Initial revision after changing case
195 !
196 ! Revision 1.7 2004/11/18 22:06:30 fnajjar
197 ! Modified formatting to properly write high particle count index
198 !
199 ! Revision 1.6 2004/11/13 22:03:55 fnajjar
200 ! Included particle timescale in Tecplot output file
201 !
202 ! Revision 1.5 2004/06/29 14:07:03 fnajjar
203 ! Removed mixture properties from Tecplot file since mixture data not allocated and read
204 !
205 ! Revision 1.4 2004/05/24 14:23:24 fnajjar
206 ! Added variables to Tecplot file
207 !
208 ! Revision 1.3 2004/03/05 22:52:00 fnajjar
209 ! Added particle temperature to Tecplot output file and changed extension to .dat
210 !
211 ! Revision 1.2 2004/03/02 21:51:15 jferry
212 ! Added output of vapor energy to rplagpost output file
213 !
214 ! Revision 1.1.1.1 2003/05/06 16:14:38 fnajjar
215 ! Import of postprocessing tool for Rocpart
216 !
217 !******************************************************************************
218 
219 
220 
221 
222 
223 
224 
Tfloat sum() const
Return the sum of all the pixel values in an image.
Definition: CImg.h:13022
void int int REAL REAL * y
Definition: read.cpp:74
subroutine registerfunction(global, funName, fileName)
Definition: ModError.F90:449
int status() const
Obtain the status of the attribute.
Definition: Attribute.h:240
subroutine plag_writetecplotascii(iReg, iLev, region)
void int int int REAL REAL REAL * z
Definition: write.cpp:76
blockLoc i
Definition: read.cpp:79
void int int REAL * x
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 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 icell
subroutine errorstop(global, errorCode, errorLine, addMessage)
Definition: ModError.F90:483
subroutine deregisterfunction(global)
Definition: ModError.F90:469
RT a() const
Definition: Line_2.h:140