Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TURB_ModPostFlu.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: Suite for turbulence postprocessing routines.
26 !
27 ! Description: None.
28 !
29 ! Notes: None.
30 !
31 ! ******************************************************************************
32 !
33 ! $Id: TURB_ModPostFlu.F90,v 1.3 2008/12/06 08:44:42 mtcampbe Exp $
34 !
35 ! Copyright: (c) 2004 by the University of Illinois
36 !
37 ! ******************************************************************************
38 
40 
41  USE modglobal, ONLY: t_global
42  USE modparameters
43  USE moddatatypes
44  USE moderror
45  USE moddatastruct, ONLY: t_region
46  USE modgrid, ONLY: t_grid
47  USE modmpi
48 
49  IMPLICIT NONE
50 
51  PRIVATE
52 
53  PUBLIC :: turb_rflu_allocmempost, &
57 
58 ! ******************************************************************************
59 ! Declarations and definitions
60 ! ******************************************************************************
61 
62  CHARACTER(CHRLEN) :: RCSIdentString = &
63  '$RCSfile: TURB_ModPostFlu.F90,v $ $Revision: 1.3 $'
64 
65 ! ******************************************************************************
66 ! Routines
67 ! ******************************************************************************
68 
69  CONTAINS
70 
71 
72 ! ******************************************************************************
73 !
74 ! Purpose: Allocate memory of turbulence post quantities.
75 !
76 ! Description: None.
77 !
78 ! Input:
79 ! pRegion Region pointer
80 !
81 ! Output: None.
82 !
83 ! Notes: None.
84 !
85 ! ******************************************************************************
86 
87 SUBROUTINE turb_rflu_allocmempost(pRegion)
88 
89  IMPLICIT NONE
90 
91 ! ******************************************************************************
92 ! Definitions and declarations
93 ! ******************************************************************************
94 
95 ! ==============================================================================
96 ! Arguments
97 ! ==============================================================================
98 
99  TYPE(t_region), POINTER :: pregion
100 
101 ! ==============================================================================
102 ! Locals
103 ! ==============================================================================
104 
105  CHARACTER(CHRLEN) :: rcsidentstring
106  INTEGER :: npostv, ntv, nvars, errorflag
107  TYPE(t_grid), POINTER :: pgrid
108  TYPE(t_global), POINTER :: global
109 
110 ! ******************************************************************************
111 ! Start
112 ! ******************************************************************************
113 
114  global => pregion%global
115 
116  CALL registerfunction(global,'TURB_RFLU_AllocMemPost',&
117  'TURB_ModPostFlu.F90')
118 
119 ! ******************************************************************************
120 ! Set pointers and variables
121 ! ******************************************************************************
122 
123  npostv = 1 ! for tv(TV_MIXT_MUET,:)
124  ntv = pregion%mixtInput%nTv
125  nvars = pregion%turbInput%nOutField
126  pgrid => pregion%grid
127 
128 ! ******************************************************************************
129 ! Allocate memory
130 ! ******************************************************************************
131 
132 ! ==============================================================================
133 ! Turbulence variables
134 ! ==============================================================================
135 
136  IF (nvars > 1) THEN
137  ALLOCATE(pregion%turb%vort(1,pgrid%nCellsTot),stat=errorflag)
138  global%error = errorflag
139  IF (global%error /= err_none) THEN
140  CALL errorstop(global,err_allocate,__line__,'pRegion%turb%vort')
141  END IF ! global%error
142  ENDIF
143 
144  IF (nvars > 2) THEN
145  ALLOCATE(pregion%turb%lens(pgrid%nCellsTot),stat=errorflag)
146  global%error = errorflag
147  IF (global%error /= err_none) THEN
148  CALL errorstop(global,err_allocate,__line__,'pRegion%turb%lens')
149  END IF ! global%error
150 
151  npostv = npostv + 1
152  ENDIF
153 
154 ! ==============================================================================
155 ! Post quantities
156 ! ==============================================================================
157 
158  pregion%turbInput%nPostv = npostv
159 
160  ALLOCATE(pregion%turb%postv(npostv,pgrid%nCellsTot),stat=errorflag)
161  global%error = errorflag
162  IF (global%error /= err_none) THEN
163  CALL errorstop(global,err_allocate,__line__,'pRegion%turb%postv')
164  END IF ! global%error
165 
166 ! ******************************************************************************
167 ! End
168 ! ******************************************************************************
169 
170  CALL deregisterfunction(global)
171 
172 END SUBROUTINE turb_rflu_allocmempost
173 
174 
175 
176 ! ******************************************************************************
177 !
178 ! Purpose: Deallocate memory of turbulence post quantities.
179 !
180 ! Description: None.
181 !
182 ! Input:
183 ! pRegion Region pointer
184 !
185 ! Output: None.
186 !
187 ! Notes: None.
188 !
189 ! ******************************************************************************
190 
191 SUBROUTINE turb_rflu_deallocmempost(pRegion)
192 
193  IMPLICIT NONE
194 
195 ! ******************************************************************************
196 ! Definitions and declarations
197 ! ******************************************************************************
198 
199 ! ==============================================================================
200 ! Arguments
201 ! ==============================================================================
202 
203  TYPE(t_region), POINTER :: pregion
204 
205 ! ==============================================================================
206 ! Locals
207 ! ==============================================================================
208 
209  CHARACTER(CHRLEN) :: rcsidentstring
210  INTEGER :: nvars, errorflag
211  TYPE(t_global), POINTER :: global
212 
213 ! ******************************************************************************
214 ! Start
215 ! ******************************************************************************
216 
217  global => pregion%global
218 
219  CALL registerfunction(global,'TURB_RFLU_DeallocMemPost',&
220  'TURB_ModPostFlu.F90')
221 
222 ! ******************************************************************************
223 ! Set pointers and variables
224 ! ******************************************************************************
225 
226  nvars = pregion%turbInput%nOutField
227 
228 ! ******************************************************************************
229 ! Deallocate memory
230 ! ******************************************************************************
231 
232 ! ==============================================================================
233 ! Turbulence variables
234 ! ==============================================================================
235 
236  IF (nvars > 1) THEN
237  DEALLOCATE(pregion%turb%vort,stat=errorflag)
238  global%error = errorflag
239  IF (global%error /= err_none) THEN
240  CALL errorstop(global,err_deallocate,__line__,'pRegion%turb%vort')
241  END IF ! global%error
242  ENDIF
243 
244  IF (nvars > 2) THEN
245  DEALLOCATE(pregion%turb%lens,stat=errorflag)
246  global%error = errorflag
247  IF (global%error /= err_none) THEN
248  CALL errorstop(global,err_deallocate,__line__,'pRegion%turb%lens')
249  END IF ! global%error
250  ENDIF
251 
252 ! ==============================================================================
253 ! Post quantities
254 ! ==============================================================================
255 
256  DEALLOCATE(pregion%turb%postv,stat=errorflag)
257  global%error = errorflag
258  IF (global%error /= err_none) THEN
259  CALL errorstop(global,err_deallocate,__line__,'pRegion%turb%postv')
260  END IF ! global%error
261 
262 ! ******************************************************************************
263 ! End
264 ! ******************************************************************************
265 
266  CALL deregisterfunction(global)
267 
268 END SUBROUTINE turb_rflu_deallocmempost
269 
270 
271 
272 ! ******************************************************************************
273 !
274 ! Purpose: Allocate memory to store interpolated post quantities at vertices.
275 !
276 ! Description: None.
277 !
278 ! Input:
279 ! pRegion Region pointer
280 !
281 ! Output: None.
282 !
283 ! Notes: None.
284 !
285 ! ******************************************************************************
286 
287 SUBROUTINE turb_rflu_allocmempostvert(pRegion)
288 
289  IMPLICIT NONE
290 
291 ! ******************************************************************************
292 ! Definitions and declarations
293 ! ******************************************************************************
294 
295 ! ==============================================================================
296 ! Arguments
297 ! ==============================================================================
298 
299  TYPE(t_region), POINTER :: pregion
300 
301 ! ==============================================================================
302 ! Locals
303 ! ==============================================================================
304 
305  CHARACTER(CHRLEN) :: rcsidentstring
306  INTEGER :: npostv, errorflag
307  TYPE(t_grid), POINTER :: pgrid
308  TYPE(t_global), POINTER :: global
309 
310 ! ******************************************************************************
311 ! Start
312 ! ******************************************************************************
313 
314  global => pregion%global
315 
316  CALL registerfunction(global,'TURB_RFLU_AllocMemPostVert',&
317  'TURB_ModPostFlu.F90')
318 
319 ! ******************************************************************************
320 ! Set pointers and variables
321 ! ******************************************************************************
322 
323  npostv = pregion%turbInput%nPostv
324  pgrid => pregion%grid
325 
326 ! ******************************************************************************
327 ! Allocate memory
328 ! ******************************************************************************
329 
330 ! ==============================================================================
331 ! Post quantities
332 ! ==============================================================================
333 
334  ALLOCATE(pregion%turb%postvVert(npostv,pgrid%nVertTot),stat=errorflag)
335  global%error = errorflag
336  IF (global%error /= err_none) THEN
337  CALL errorstop(global,err_allocate,__line__,'pRegion%turb%postvVert')
338  END IF ! global%error
339 
340 ! ******************************************************************************
341 ! End
342 ! ******************************************************************************
343 
344  CALL deregisterfunction(global)
345 
346 END SUBROUTINE turb_rflu_allocmempostvert
347 
348 
349 
350 ! ******************************************************************************
351 !
352 ! Purpose: Deallocate memory of post quantities at vertices.
353 !
354 ! Description: None.
355 !
356 ! Input:
357 ! pRegion Region pointer
358 !
359 ! Output: None.
360 !
361 ! Notes: None.
362 !
363 ! ******************************************************************************
364 
365 SUBROUTINE turb_rflu_deallocmempostvert(pRegion)
366 
367  IMPLICIT NONE
368 
369 ! ******************************************************************************
370 ! Definitions and declarations
371 ! ******************************************************************************
372 
373 ! ==============================================================================
374 ! Arguments
375 ! ==============================================================================
376 
377  TYPE(t_region), POINTER :: pregion
378 
379 ! ==============================================================================
380 ! Locals
381 ! ==============================================================================
382 
383  CHARACTER(CHRLEN) :: rcsidentstring
384  INTEGER :: errorflag
385  TYPE(t_global), POINTER :: global
386 
387 ! ******************************************************************************
388 ! Start
389 ! ******************************************************************************
390 
391  global => pregion%global
392 
393  CALL registerfunction(global,'TURB_RFLU_DeallocMemPostVert',&
394  'TURB_ModPostFlu.F90')
395 
396 ! ******************************************************************************
397 ! Set pointers and variables
398 ! ******************************************************************************
399 
400 ! ******************************************************************************
401 ! Deallocate memory
402 ! ******************************************************************************
403 
404 ! ==============================================================================
405 ! Post quantities
406 ! ==============================================================================
407 
408  DEALLOCATE(pregion%turb%postvVert,stat=errorflag)
409  global%error = errorflag
410  IF (global%error /= err_none) THEN
411  CALL errorstop(global,err_deallocate,__line__,'pRegion%turb%postvVert')
412  END IF ! global%error
413 
414 ! ******************************************************************************
415 ! End
416 ! ******************************************************************************
417 
418  CALL deregisterfunction(global)
419 
420 END SUBROUTINE turb_rflu_deallocmempostvert
421 
422 
423 ! ******************************************************************************
424 ! End
425 ! ******************************************************************************
426 
427 END MODULE turb_modpostflu
428 
429 ! ******************************************************************************
430 !
431 ! RCS Revision history:
432 !
433 ! $Log: TURB_ModPostFlu.F90,v $
434 ! Revision 1.3 2008/12/06 08:44:42 mtcampbe
435 ! Updated license.
436 !
437 ! Revision 1.2 2008/11/19 22:17:54 mtcampbe
438 ! Added Illinois Open Source License/Copyright
439 !
440 ! Revision 1.1 2006/01/12 09:51:15 wasistho
441 ! initial import
442 !
443 !
444 !
445 ! ******************************************************************************
446 
447 
448 
449 
450 
451 
452 
453 
454 
455 
subroutine, public turb_rflu_allocmempostvert(pRegion)
subroutine registerfunction(global, funName, fileName)
Definition: ModError.F90:449
subroutine, public turb_rflu_deallocmempostvert(pRegion)
subroutine, public turb_rflu_allocmempost(pRegion)
subroutine errorstop(global, errorCode, errorLine, addMessage)
Definition: ModError.F90:483
subroutine deregisterfunction(global)
Definition: ModError.F90:469
subroutine, public turb_rflu_deallocmempost(pRegion)