Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PREP_InitGenxInterface.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: register grid and flow variables with GenX for pre-processing
26 !
27 ! Description: none.
28 !
29 ! Input: iReg = current region number
30 ! region = data of current region
31 ! wins, winv = name of fluid surface and volume windows
32 !
33 ! Output: to Roccom.
34 !
35 ! Notes: none.
36 !
37 !******************************************************************************
38 !
39 ! $Id: PREP_InitGenxInterface.F90,v 1.15 2009/08/27 14:04:53 mtcampbe Exp $
40 !
41 ! Copyright: (c) 2002 by the University of Illinois
42 !
43 !******************************************************************************
44 
45 SUBROUTINE rflo_initgenxinterfaceprep( iReg,region,wins,winv )
46 
47  USE moddatatypes
48  USE modglobal, ONLY : t_global
49  USE modbndpatch, ONLY : t_patch
50  USE moddatastruct, ONLY : t_region
52 #ifdef PEUL
53 ! USE PREP_ModInterfaces, ONLY : PREP_PEUL_InitGenxInterface
54 #endif
55 #ifdef PLAG
56 ! USE PREP_ModInterfaces, ONLY : PREP_PLAG_InitGenxInterface
57 #endif
58  USE moderror
59  USE modparameters
60  IMPLICIT NONE
61  include 'roccomf90.h'
62 
63 ! ... parameters
64  INTEGER :: ireg
65  TYPE(t_region) :: region
66  CHARACTER(CHRLEN) :: wins, winv
67 
68 ! ... loop variables
69  INTEGER :: ipatch
70 
71 ! ... local variables
72  INTEGER :: ilev, bctype, pid, icount, errorflag, ilb
73  INTEGER :: idnbeg, idnend, jdnbeg, jdnend, kdnbeg, kdnend
74  INTEGER, POINTER :: dims(:), iconstrtype
75  TYPE(t_global), POINTER :: global
76  TYPE(t_patch) , POINTER :: patch
77 
78 !******************************************************************************
79 
80  global => region%global
81 
82  CALL registerfunction( global,'RFLO_InitGenxInterfacePrep', &
83  'PREP_InitGenxInterface.F90' )
84 
85 ! open data windows and register variables ------------------------------------
86 
87 ! input surface data
88 
89  CALL com_new_attribute( trim(wins)//'.bcflag' ,'p',com_integer,1,'' )
90  CALL com_new_attribute( trim(wins)//'.cnstr_type','p',com_integer,1,'' )
91 
92 ! input volume data
93 
94  CALL com_new_attribute( trim(winv)//'.rhof' ,'e',com_double,1,&
95  'kg/(m^3)')
96  CALL com_new_attribute( trim(winv)//'.rhovf','e',com_double,3,&
97  'kg/(m^2 s)')
98  CALL com_new_attribute( trim(winv)//'.rhoEf','e',com_double,1,&
99  '(J/kg)')
100 
101 ! store pointers to variables -------------------------------------------------
102 
103  ALLOCATE( dims(3),stat=errorflag )
104  global%error = errorflag
105  IF (global%error /= 0) CALL errorstop( global,err_allocate,__line__ )
106 
107  ilev = region%currLevel
108  icount = 0
109 
110 ! surface data
111 
112  DO ipatch=1,region%nPatches
113  patch => region%levels(ilev)%patches(ipatch)
114  bctype = patch%bcType
115 ! IF(bcType .NE. BC_SYMMETRY) THEN
116 
117  IF (patch%bcCoupled == bc_external) THEN ! data from outside
118  icount = icount + 1
119  pid = ireg*regoff + icount
120 
121 ! --- burning pane?
122 
123  CALL com_set_size(trim(wins)//'.bcflag',pid,1)
124  CALL com_set_array( trim(wins)//'.bcflag',pid,patch%bcFlag )
125 
126  IF (bctype>=bc_injection .AND. bctype<=bc_injection+bc_range) THEN
127  patch%bcFlag(1) = 1 ! ignitable patch
128  ELSE
129  patch%bcFlag(1) = 0 ! non-ignitable patch
130  ENDIF
131 
132 ! --- surface grid
133 
134  dims(1) = abs(patch%l1end-patch%l1beg) + 2 ! nodal values
135  dims(2) = abs(patch%l2end-patch%l2beg) + 2
136 
137  CALL com_set_array_const( trim(wins)//'.:st2:',pid,dims )
138  CALL com_set_array( trim(wins)//'.nc',pid,patch%surfCoord )
139 
140 ! --- constraint type
141 
142  CALL com_set_size(trim(wins)//'.cnstr_type',pid,1)
143  CALL com_allocate_array( trim(wins)//'.cnstr_type',pid,iconstrtype )
144 
145  iconstrtype = 0
146  IF (bctype==bc_symmetry_free) THEN
147  iconstrtype = 0
148  ELSEIF (bctype==bc_symmetry_fixed) THEN
149  iconstrtype = 2
150  ELSEIF (bctype==bc_symmetry_xslide) THEN
151  iconstrtype = 120
152  ELSEIF (bctype==bc_symmetry_yslide) THEN
153  iconstrtype = 121
154  ELSEIF (bctype==bc_symmetry_zslide) THEN
155  iconstrtype = 122
156  ELSEIF (bctype==bc_symmetry_xyslide) THEN
157  iconstrtype = -122
158  ELSEIF (bctype==bc_symmetry_xzslide) THEN
159  iconstrtype = -121
160  ELSEIF (bctype==bc_symmetry_yzslide) THEN
161  iconstrtype = -120
162  ENDIF
163  IF (bctype==bc_slipwall_free) THEN
164  iconstrtype = 0
165  ELSEIF (bctype==bc_slipwall_fixed) THEN
166  iconstrtype = 2
167  ELSEIF (bctype==bc_slipwall_xslide) THEN
168  iconstrtype = 120
169  ELSEIF (bctype==bc_slipwall_yslide) THEN
170  iconstrtype = 121
171  ELSEIF (bctype==bc_slipwall_zslide) THEN
172  iconstrtype = 122
173  ELSEIF (bctype==bc_slipwall_xyslide) THEN
174  iconstrtype = -122
175  ELSEIF (bctype==bc_slipwall_xzslide) THEN
176  iconstrtype = -121
177  ELSEIF (bctype==bc_slipwall_yzslide) THEN
178  iconstrtype = -120
179  ENDIF
180  IF (bctype==bc_noslipwall_free) THEN
181  iconstrtype = 0
182  ELSEIF (bctype==bc_noslipwall_fixed) THEN
183  iconstrtype = 2
184  ELSEIF (bctype==bc_noslipwall_xslide) THEN
185  iconstrtype = 120
186  ELSEIF (bctype==bc_noslipwall_yslide) THEN
187  iconstrtype = 121
188  ELSEIF (bctype==bc_noslipwall_zslide) THEN
189  iconstrtype = 122
190  ELSEIF (bctype==bc_noslipwall_xyslide) THEN
191  iconstrtype = -122
192  ELSEIF (bctype==bc_noslipwall_xzslide) THEN
193  iconstrtype = -121
194  ELSEIF (bctype==bc_noslipwall_yzslide) THEN
195  iconstrtype = -120
196  ENDIF
197  IF (bctype==bc_outflow_free) THEN
198  iconstrtype = 0
199  ELSEIF (bctype==bc_outflow_fixed) THEN
200  iconstrtype = 2
201  ELSEIF (bctype==bc_outflow_xslide) THEN
202  iconstrtype = 120
203  ELSEIF (bctype==bc_outflow_yslide) THEN
204  iconstrtype = 121
205  ELSEIF (bctype==bc_outflow_zslide) THEN
206  iconstrtype = 122
207  ELSEIF (bctype==bc_outflow_xyslide) THEN
208  iconstrtype = -122
209  ELSEIF (bctype==bc_outflow_xzslide) THEN
210  iconstrtype = -121
211  ELSEIF (bctype==bc_outflow_yzslide) THEN
212  iconstrtype = -120
213  ENDIF
214 
215  ELSE ! internal BC
216  IF ((bctype>=bc_regionconf .AND. bctype<=bc_regionconf+bc_range) .OR. &
217  (bctype>=bc_regionint .AND. bctype<=bc_regionint+bc_range) .OR. &
218  (bctype>=bc_regnonconf .AND. bctype<=bc_regnonconf+bc_range) .OR. &
219  (bctype>=bc_tra_peri .AND. bctype<=bc_tra_peri+bc_range) .OR. &
220  (bctype>=bc_rot_peri .AND. bctype<=bc_rot_peri+bc_range)) THEN
221 
222  ELSE
223  icount = icount + 1
224  pid = ireg*regoff + icount
225 
226  CALL com_set_size(trim(wins)//'.bcflag',pid,1)
227  CALL com_set_array( trim(wins)//'.bcflag',pid,patch%bcFlag )
228 
229  patch%bcFlag(1) = 2 ! non-interacting patch
230 
231 ! ----- surface grid
232 
233  dims(1) = abs(patch%l1end-patch%l1beg) + 2 ! nodal values
234  dims(2) = abs(patch%l2end-patch%l2beg) + 2
235 
236  CALL com_set_array_const( trim(wins)//'.:st2:',pid,dims )
237  CALL com_set_array( trim(wins)//'.nc',pid,patch%surfCoord )
238 
239 ! ----- constrain type
240 
241  CALL com_set_size(trim(wins)//'.cnstr_type',pid,1)
242  CALL com_allocate_array( trim(wins)//'.cnstr_type',pid,iconstrtype )
243 
244  iconstrtype = 2
245  IF (bctype==bc_symmetry_free) THEN
246  iconstrtype = 0
247  ELSEIF (bctype==bc_symmetry_fixed) THEN
248  iconstrtype = 2
249  ELSEIF (bctype==bc_symmetry_xslide) THEN
250  iconstrtype = 120
251  ELSEIF (bctype==bc_symmetry_yslide) THEN
252  iconstrtype = 121
253  ELSEIF (bctype==bc_symmetry_zslide) THEN
254  iconstrtype = 122
255  ELSEIF (bctype==bc_symmetry_xyslide) THEN
256  iconstrtype = -122
257  ELSEIF (bctype==bc_symmetry_xzslide) THEN
258  iconstrtype = -121
259  ELSEIF (bctype==bc_symmetry_yzslide) THEN
260  iconstrtype = -120
261  ENDIF
262  IF (bctype==bc_slipwall_free) THEN
263  iconstrtype = 0
264  ELSEIF (bctype==bc_slipwall_fixed) THEN
265  iconstrtype = 2
266  ELSEIF (bctype==bc_slipwall_xslide) THEN
267  iconstrtype = 120
268  ELSEIF (bctype==bc_slipwall_yslide) THEN
269  iconstrtype = 121
270  ELSEIF (bctype==bc_slipwall_zslide) THEN
271  iconstrtype = 122
272  ELSEIF (bctype==bc_slipwall_xyslide) THEN
273  iconstrtype = -122
274  ELSEIF (bctype==bc_slipwall_xzslide) THEN
275  iconstrtype = -121
276  ELSEIF (bctype==bc_slipwall_yzslide) THEN
277  iconstrtype = -120
278  ENDIF
279  IF (bctype==bc_noslipwall_free) THEN
280  iconstrtype = 0
281  ELSEIF (bctype==bc_noslipwall_fixed) THEN
282  iconstrtype = 2
283  ELSEIF (bctype==bc_noslipwall_xslide) THEN
284  iconstrtype = 120
285  ELSEIF (bctype==bc_noslipwall_yslide) THEN
286  iconstrtype = 121
287  ELSEIF (bctype==bc_noslipwall_zslide) THEN
288  iconstrtype = 122
289  ELSEIF (bctype==bc_noslipwall_xyslide) THEN
290  iconstrtype = -122
291  ELSEIF (bctype==bc_noslipwall_xzslide) THEN
292  iconstrtype = -121
293  ELSEIF (bctype==bc_noslipwall_yzslide) THEN
294  iconstrtype = -120
295  ENDIF
296  IF (bctype==bc_outflow_free) THEN
297  iconstrtype = 0
298  ELSEIF (bctype==bc_outflow_fixed) THEN
299  iconstrtype = 2
300  ELSEIF (bctype==bc_outflow_xslide) THEN
301  iconstrtype = 120
302  ELSEIF (bctype==bc_outflow_yslide) THEN
303  iconstrtype = 121
304  ELSEIF (bctype==bc_outflow_zslide) THEN
305  iconstrtype = 122
306  ELSEIF (bctype==bc_outflow_xyslide) THEN
307  iconstrtype = -122
308  ELSEIF (bctype==bc_outflow_xzslide) THEN
309  iconstrtype = -121
310  ELSEIF (bctype==bc_outflow_yzslide) THEN
311  iconstrtype = -120
312  ENDIF
313 
314  ENDIF ! block-interfaces
315 
316  ENDIF ! external/internal BC
317 ! ENDIF
318  ENDDO ! iPatch
319 
320 ! volume data
321 
322  pid = ireg*regoff
323 
324  CALL rflo_getdimensdummynodes( region,ilev,idnbeg,idnend, &
325  jdnbeg,jdnend,kdnbeg,kdnend )
326  dims(1) = idnend - idnbeg + 1
327  dims(2) = jdnend - jdnbeg + 1
328  dims(3) = kdnend - kdnbeg + 1
329 
330  CALL com_set_size( trim(winv)//".:st3:",pid,3, region%nDumCells)
331  CALL com_set_array_const( trim(winv)//".:st3:",pid,dims )
332  CALL com_set_array( trim(winv)//'.nc',pid, &
333  region%levels(ilev)%grid%xyz )
334 
335 ! set cv
336 
337  ilb = lbound(region%levels(ilev)%mixt%cv,2)
338 
339  CALL com_set_array( trim(winv)//'.rhof',pid, &
340  region%levels(ilev)%mixt%cv(1,ilb),5)
341  CALL com_set_array( trim(winv)//'.1-rhovf',pid, &
342  region%levels(ilev)%mixt%cv(2,ilb),5)
343  CALL com_set_array( trim(winv)//'.2-rhovf',pid, &
344  region%levels(ilev)%mixt%cv(3,ilb),5)
345  CALL com_set_array( trim(winv)//'.3-rhovf',pid, &
346  region%levels(ilev)%mixt%cv(4,ilb),5)
347  CALL com_set_array( trim(winv)//'.rhoEf',pid, &
348  region%levels(ilev)%mixt%cv(5,ilb),5)
349 
350 ! deallocate local arrays
351 
352  DEALLOCATE( dims )
353  global%error = errorflag
354  IF (global%error /= 0) CALL errorstop( global,err_allocate,__line__ )
355 
356 ! Genx initialization of physical modules -------------------------------------
357 
358 #ifdef PEUL
359 ! IF (global%peulUsed) CALL PEUL_initGenxInterfacePrep( iReg,region,wins,winv )
360 #endif
361 #ifdef PLAG
362 ! IF (global%plagUsed) CALL PLAG_initGenxInterfacePrep( iReg,region,wins,winv )
363 #endif
364 
365 ! finalize --------------------------------------------------------------------
366 
367  CALL com_window_init_done( trim(wins))
368  CALL com_window_init_done( trim(winv))
369 
370  CALL deregisterfunction( global )
371 
372 END SUBROUTINE rflo_initgenxinterfaceprep
373 
374 !******************************************************************************
375 !
376 ! RCS Revision history:
377 !
378 ! $Log: PREP_InitGenxInterface.F90,v $
379 ! Revision 1.15 2009/08/27 14:04:53 mtcampbe
380 ! Updated to enable burning motion with symmetry boundaries and enhanced
381 ! burnout code.
382 !
383 ! Revision 1.14 2008/12/06 08:44:50 mtcampbe
384 ! Updated license.
385 !
386 ! Revision 1.13 2008/11/19 22:18:00 mtcampbe
387 ! Added Illinois Open Source License/Copyright
388 !
389 ! Revision 1.12 2006/08/28 11:42:13 rfiedler
390 ! Add grid motion constraint types for outflow BC.
391 !
392 ! Revision 1.11 2006/08/24 15:05:29 rfiedler
393 ! Support XYSLIDE, XZSLIDE, and YZSLIDE instead of TANGEN. Use numbers not ICHAR.
394 !
395 ! Revision 1.10 2005/06/19 05:33:07 wasistho
396 ! shift index rocprop slipwalls and change default iConstrType
397 !
398 ! Revision 1.9 2005/06/17 03:09:45 wasistho
399 ! relocated cnstr_type kernel inside both external internal loops
400 !
401 ! Revision 1.8 2005/06/17 02:23:47 jiao
402 ! Fixed bug in registering cnstr_type.
403 !
404 ! Revision 1.7 2005/06/16 22:34:05 wasistho
405 ! constr_type to cnstr_type
406 !
407 ! Revision 1.6 2005/06/13 04:37:25 wasistho
408 ! registered constr_type for both internal external
409 !
410 ! Revision 1.5 2005/06/13 02:17:15 wasistho
411 ! registered constr_type
412 !
413 ! Revision 1.4 2005/05/10 15:04:28 wasistho
414 ! exclude block interfaces in registration of internal surfaces
415 !
416 ! Revision 1.3 2005/04/18 18:12:08 wasistho
417 ! registered non-interacting patches
418 !
419 ! Revision 1.2 2004/12/03 03:29:02 wasistho
420 ! rflo_modinterfacesprep to prep_modinterfaces
421 !
422 ! Revision 1.1 2004/12/03 02:20:08 wasistho
423 ! added prefix
424 !
425 ! Revision 1.1 2004/12/03 00:40:49 wasistho
426 ! lower to upper case
427 !
428 ! Revision 1.2 2004/06/30 04:07:06 wasistho
429 ! moved Genx related parameter REGOFF to ModParameters
430 !
431 ! Revision 1.1 2004/06/30 00:06:05 wasistho
432 ! initial import for GEN3
433 !
434 !
435 !******************************************************************************
436 
437 
438 
439 
440 
441 
442 
subroutine registerfunction(global, funName, fileName)
Definition: ModError.F90:449
**********************************************************************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 jdnbeg
**********************************************************************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 idnend
**********************************************************************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 jdnend
subroutine rflo_initgenxinterfaceprep(iReg, region, wins, winv)
**********************************************************************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 idnbeg
Definition: patch.h:74
subroutine rflo_getdimensdummynodes(region, iLev, idnbeg, idnend, jdnbeg, jdnend, kdnbeg, kdnend)
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 kdnbeg