Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TURB_RFLU_ModGenxAdmin.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: Collection of routines related to GENX interaction.
26 !
27 ! Description: None
28 !
29 ! Notes: None.
30 !
31 ! ******************************************************************************
32 !
33 ! $Id: TURB_RFLU_ModRocstarAdmin.F90,v 1.7 2008/12/06 08:44:01 mtcampbe Exp $
34 !
35 ! Copyright: (c) 2004-2005 by the University of Illinois
36 !
37 ! ******************************************************************************
38 
40 
41  USE moddatatypes
42  USE modparameters
43  USE moderror
44  USE modglobal, ONLY: t_global
45  USE modbndpatch, ONLY: t_patch
46  USE moddatastruct, ONLY: t_region
47  USE modgrid, ONLY: t_grid
48  USE modmpi
49 
51 
52  IMPLICIT NONE
53 
54  include 'roccomf90.h'
55 
56  PRIVATE
57 
58  PUBLIC :: turb_rflu_genxcreateattr, &
61 
62 ! ******************************************************************************
63 ! Declarations and definitions
64 ! ******************************************************************************
65 
66 ! ==============================================================================
67 ! Private
68 ! ==============================================================================
69 
70  CHARACTER(CHRLEN) :: &
71  RCSIdentString = '$RCSfile: TURB_RFLU_ModRocstarAdmin.F90,v $ $Revision: 1.7 $'
72 
73 ! ==============================================================================
74 ! Public
75 ! ==============================================================================
76 
77 
78 ! ******************************************************************************
79 ! Contained routines
80 ! ******************************************************************************
81 
82  CONTAINS
83 
84 
85 
86 ! ******************************************************************************
87 !
88 ! Purpose: Create new attributes for turbulence solution.
89 !
90 ! Description: None.
91 !
92 ! Input:
93 ! pRegion Pointer to region
94 !
95 ! Output: None.
96 !
97 ! Notes: None.
98 !
99 ! ******************************************************************************
100 
101  SUBROUTINE turb_rflu_genxcreateattr(pRegion)
102 
103  IMPLICIT NONE
104 
105 ! ******************************************************************************
106 ! Declarations and definitions
107 ! ******************************************************************************
108 
109 ! ==============================================================================
110 ! Arguments
111 ! ==============================================================================
112 
113  TYPE(t_region), POINTER :: pregion
114 
115 ! ==============================================================================
116 ! Locals
117 ! ==============================================================================
118 
119  CHARACTER(CHRLEN) :: winv
120  TYPE(t_global), POINTER :: global
121 
122 ! ******************************************************************************
123 ! Start, set pointers
124 ! ******************************************************************************
125 
126  global => pregion%global
127 
128 ! ******************************************************************************
129 ! End
130 ! ******************************************************************************
131 
132  END SUBROUTINE turb_rflu_genxcreateattr
133 
134 
135 
136 
137 
138 
139 
140 ! ******************************************************************************
141 !
142 ! Purpose: Register turbulence data.
143 !
144 ! Description: None.
145 !
146 ! Input:
147 ! pRegion Pointer to region
148 !
149 ! Output: None.
150 !
151 ! Notes: None.
152 !
153 ! ******************************************************************************
154 
155  SUBROUTINE turb_rflu_genxregisterdata(pRegion)
156 
158 
159  IMPLICIT NONE
160 
161 ! ******************************************************************************
162 ! Declarations and definitions
163 ! ******************************************************************************
164 
165 ! ==============================================================================
166 ! Arguments
167 ! ==============================================================================
168 
169  TYPE(t_region), POINTER :: pregion
170 
171 ! ==============================================================================
172 ! Locals
173 ! ==============================================================================
174 
175  CHARACTER(CHRLEN) :: winv
176  INTEGER :: paneid, ilb, ndim, ntv, errorflag
177  REAL(RFREAL), POINTER :: preal
178  TYPE(t_grid), POINTER :: pgrid
179  TYPE(t_global), POINTER :: global
180 
181 ! ******************************************************************************
182 ! Start, set pointers
183 ! ******************************************************************************
184 
185  global => pregion%global
186 
187  pgrid => pregion%grid
188 
189  IF ( global%myProcid == masterproc .AND. &
190  global%verbLevel >= verbose_high ) THEN
191  WRITE(stdout,'(A,1X,A)') solver_name,'Registering turbulence data...'
192  END IF ! global%verbLevel
193 
194 ! ******************************************************************************
195 ! Create new attributes
196 ! ******************************************************************************
197 
198 ! ==============================================================================
199 ! Volume
200 ! ==============================================================================
201 
202  winv = global%volWinName
203 
204 ! ------------------------------------------------------------------------------
205 ! Global
206 ! ------------------------------------------------------------------------------
207  CALL com_new_attribute(trim(winv)//'.esg1Sum','w',com_double,1,'J/(m^3s)')
208  CALL com_new_attribute(trim(winv)//'.esg4Sum','w',com_double,1,'J/(m^3s)')
209  CALL com_set_array( trim(winv)//'.esg1Sum' ,0, global%esg1Sum )
210  CALL com_set_array( trim(winv)//'.esg4Sum' ,0, global%esg4Sum )
211 
212 ! ------------------------------------------------------------------------------
213 ! Model and instantaneous variables
214 ! ------------------------------------------------------------------------------
215 
216  CALL com_new_attribute( trim(winv)//'.lens','e',com_double,1,'m' )
217  CALL com_new_attribute( trim(winv)//'.mut' ,'e',com_double,1,'kg/(ms)' )
218  CALL com_new_attribute( trim(winv)//'.vort','e',com_double,3,'1/s' )
219 
220 
221 ! ******************************************************************************
222 ! Register data
223 ! ******************************************************************************
224 
225 ! ==============================================================================
226 ! Volume
227 ! ==============================================================================
228 
229  winv = global%volWinName
230 
231  CALL rflu_genx_buildpaneid(pregion%iRegionGlobal,0,paneid)
232 
233  IF ( global%myProcid == masterproc .AND. &
234  global%verbLevel >= verbose_high) THEN
235  WRITE(stdout,'(A,3X,A,1X,A)') solver_name,'Window name:',trim(winv)
236  WRITE(stdout,'(A,3X,A,1X,I5.5)') solver_name,'Pane id:', paneid
237  END IF ! global%verbLevel
238 
239 ! ------------------------------------------------------------------------------
240 ! Initialisation
241 ! ------------------------------------------------------------------------------
242  IF (pregion%turbInput%modelClass /= model_rans) THEN
243  ALLOCATE( pregion%turb%lens(pgrid%nCellsTot),stat=errorflag )
244  global%error = errorflag
245  IF (global%error /= 0) CALL errorstop( global,err_allocate,__line__ )
246  ENDIF
247  IF (pregion%mixtInput%turbModel == turb_model_none) THEN
248  ALLOCATE( pregion%turb%vort(3,pgrid%nCellsTot),stat=errorflag )
249  global%error = errorflag
250  IF (global%error /= 0) CALL errorstop( global,err_allocate,__line__ )
251  ENDIF
252 
253  pregion%mixt%tv = 0._rfreal
254  pregion%turb%lens = 0._rfreal
255  pregion%turb%vort = 0._rfreal
256 
257 ! ------------------------------------------------------------------------------
258 ! Model and instantaneous variables
259 ! ------------------------------------------------------------------------------
260  ilb = 1
261  ndim = pgrid%nCellsTot
262  ntv = pregion%mixtInput%nTv
263 
264  preal => pregion%turb%lens(1)
265  CALL com_set_array( trim(winv)//'.lens' ,paneid, preal )
266 
267  preal => pregion%mixt%tv(tv_mixt_muet,ilb)
268  CALL com_set_array( trim(winv)//'.mut',paneid, preal,ntv )
269 
270  preal => pregion%turb%vort(1,ilb)
271  CALL com_set_array( trim(winv)//'.vort',paneid,preal )
272 
273 ! ******************************************************************************
274 ! End
275 ! ******************************************************************************
276 
277  IF ( global%myProcid == masterproc .AND. &
278  global%verbLevel >= verbose_high ) THEN
279  WRITE(stdout,'(A,1X,A)') solver_name,'Registering turbulence data done.'
280  END IF ! global%verbLevel
281 
282  END SUBROUTINE turb_rflu_genxregisterdata
283 
284 
285 
286 
287 
288 
289 
290 
291 ! ******************************************************************************
292 !
293 ! Purpose: Get turbulence data through Roccom.
294 !
295 ! Description: None.
296 !
297 ! Input:
298 ! pRegion Pointer to region
299 !
300 ! Output: None.
301 !
302 ! Notes: None.
303 !
304 ! ******************************************************************************
305 
306  SUBROUTINE turb_rflu_genxgetdata(pRegion)
307 
308  IMPLICIT NONE
309 
310 ! ******************************************************************************
311 ! Declarations and definitions
312 ! ******************************************************************************
313 
314 ! ==============================================================================
315 ! Arguments
316 ! ==============================================================================
317 
318  TYPE(t_region), POINTER :: pregion
319 
320 ! ==============================================================================
321 ! Loop
322 ! ==============================================================================
323  INTEGER :: istat
324 
325 ! ==============================================================================
326 ! Locals
327 ! ==============================================================================
328 
329  CHARACTER(CHRLEN) :: winname,winnamein
330  CHARACTER(CHRLEN), POINTER :: statnm(:,:,:)
331  INTEGER :: handlein,handleobtain,handleout
332  TYPE(t_global), POINTER :: global
333  TYPE(t_grid), POINTER :: pgrid
334 
335 ! ******************************************************************************
336 ! Start, set pointers and variables
337 ! ******************************************************************************
338 
339  global => pregion%global
340 
341  winnamein = global%volWinNameInput
342  winname = global%volWinName
343 
344 ! ******************************************************************************
345 ! First check if it is new or restart turbulence. If new, skip this routine.
346 ! ******************************************************************************
347 
348  handlein = com_get_attribute_handle_const(trim(winnamein)//'.mut')
349  IF (handlein <= 0) THEN
350  IF ( global%myProcid == masterproc .AND. &
351  global%verbLevel >= verbose_high ) THEN
352  WRITE(stdout,'(A,1X,A)') solver_name,'Starting new turbulence...'
353  END IF ! global%verbLevel
354  goto 999
355  ENDIF
356 
357 ! ******************************************************************************
358 ! Get data
359 ! ******************************************************************************
360 
361  handleobtain = global%handleObtain
362 
363  IF ( global%myProcid == masterproc .AND. &
364  global%verbLevel >= verbose_high ) THEN
365  WRITE(stdout,'(A,1X,A)') solver_name,'Getting turbulence data...'
366  END IF ! global%verbLevel
367 
368  IF ( global%myProcid == masterproc .AND. &
369  global%verbLevel >= verbose_high) THEN
370  WRITE(stdout,'(A,3X,A,1X,I5.5)') solver_name,'Global region:', &
371  pregion%iRegionGlobal
372  END IF ! global%myProcid
373 
374 ! ==============================================================================
375 ! Global
376 ! ==============================================================================
377 
378  handlein = com_get_attribute_handle_const(trim(winnamein)//'.esg1Sum')
379  handleout = com_get_attribute_handle(trim(winname)//'.esg1Sum')
380  CALL com_call_function(handleobtain,2,handlein,handleout)
381 
382  handlein = com_get_attribute_handle_const(trim(winnamein)//'.esg4Sum')
383  handleout = com_get_attribute_handle(trim(winname)//'.esg4Sum')
384  CALL com_call_function(handleobtain,2,handlein,handleout)
385 
386 ! ==============================================================================
387 ! Turbulence variables
388 ! ==============================================================================
389 
390  handlein = com_get_attribute_handle_const(trim(winnamein)//'.lens')
391  handleout = com_get_attribute_handle(trim(winname)//'.lens')
392  CALL com_call_function(handleobtain,2,handlein,handleout)
393 
394  handlein = com_get_attribute_handle_const(trim(winnamein)//'.mut')
395  handleout = com_get_attribute_handle(trim(winname)//'.mut')
396  CALL com_call_function(handleobtain,2,handlein,handleout)
397 
398  handlein = com_get_attribute_handle_const(trim(winnamein)//'.vort')
399  handleout = com_get_attribute_handle(trim(winname)//'.vort')
400  CALL com_call_function(handleobtain,2,handlein,handleout)
401 
402 
403 ! ******************************************************************************
404 ! End
405 ! ******************************************************************************
406 
407  IF ( global%myProcid == masterproc .AND. &
408  global%verbLevel >= verbose_high ) THEN
409  WRITE(stdout,'(A,1X,A)') solver_name,'Getting turbulence data done.'
410  END IF ! global%verbLevel
411 
412 999 CONTINUE
413 
414  END SUBROUTINE turb_rflu_genxgetdata
415 
416 
417 
418 
419 
420 
421 
422 ! ******************************************************************************
423 ! End Module
424 ! ******************************************************************************
425 
426 
427 
428 
429 END MODULE turb_rflu_modrocstaradmin
430 
431 ! ******************************************************************************
432 !
433 ! RCS Revision history:
434 !
435 ! $Log: TURB_RFLU_ModRocstarAdmin.F90,v $
436 ! Revision 1.7 2008/12/06 08:44:01 mtcampbe
437 ! Updated license.
438 !
439 ! Revision 1.6 2008/11/19 22:17:15 mtcampbe
440 ! Added Illinois Open Source License/Copyright
441 !
442 ! Revision 1.5 2006/02/11 06:45:06 wasistho
443 ! identify new or restart turbulence in genxGetData
444 !
445 ! Revision 1.4 2006/01/10 05:00:05 wasistho
446 ! added GenxGetData
447 !
448 ! Revision 1.3 2006/01/04 20:06:02 wasistho
449 ! modified data registration
450 !
451 ! Revision 1.2 2006/01/03 09:51:35 wasistho
452 ! get rid of ifdef rflu
453 !
454 ! Revision 1.1 2006/01/03 06:34:41 wasistho
455 ! initial import
456 !
457 !
458 ! ******************************************************************************
459 
460 
461 
462 
463 
464 
subroutine, public turb_rflu_genxregisterdata(pRegion)
subroutine, public turb_rflu_genxcreateattr(pRegion)
subroutine, public turb_rflu_genxgetdata(pRegion)
subroutine errorstop(global, errorCode, errorLine, addMessage)
Definition: ModError.F90:483
subroutine, public rflu_genx_buildpaneid(iRegion, iPatch, paneId)