Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ReadInitFlowSection.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: Read in user input related to flow initialization.
26 !
27 ! Description: None.
28 !
29 ! Input:
30 ! regions Data for regions
31 !
32 ! Output: None.
33 !
34 ! Notes: None.
35 !
36 ! ******************************************************************************
37 !
38 ! $Id: ReadInitFlowSection.F90,v 1.12 2008/12/06 08:44:09 mtcampbe Exp $
39 !
40 ! Copyright: (c) 2002-2006 by the University of Illinois
41 !
42 ! ******************************************************************************
43 
44 SUBROUTINE readinitflowsection(regions)
45 
46  USE moddatatypes
47  USE modglobal, ONLY: t_global
48  USE moddatastruct, ONLY: t_region
49  USE moderror
50  USE modparameters
51  USE modmixture, ONLY: t_mixt_input
52 
53  USE modinterfaces, ONLY: readsection, &
55 
56  IMPLICIT NONE
57 
58 ! ******************************************************************************
59 ! Declarations and definitions
60 ! ******************************************************************************
61 
62 ! ==============================================================================
63 ! Arguments
64 ! ==============================================================================
65 
66  TYPE(t_region), DIMENSION(:), POINTER :: regions
67 
68 ! ==============================================================================
69 ! Local variables
70 ! ==============================================================================
71 
72  INTEGER :: i,ireg,nvals
73 #ifdef RFLO
74  INTEGER :: brbeg, brend
75  INTEGER, PARAMETER :: nvals_max = 1
76 #endif
77 #ifdef RFLU
78  INTEGER, PARAMETER :: nvals_max = 29
79 #endif
80 
81  CHARACTER(10) :: keys(nvals_max)
82  LOGICAL :: defined(nvals_max)
83  REAL(RFREAL) :: vals(nvals_max)
84  TYPE(t_global), POINTER :: global
85 
86 ! ******************************************************************************
87 ! Start
88 ! ******************************************************************************
89 
90  global => regions(1)%global
91 
92  CALL registerfunction(global,'ReadInitFlowSection',&
93  'ReadInitFlowSection.F90')
94 
95 ! specify keywords and search for them
96 
97  nvals = nvals_max
98 
99 #ifdef RFLO
100  keys(1) = 'NDUMMY'
101 #endif
102 #ifdef RFLU
103  keys( 1) = 'FLAG'
104  keys( 2) = 'VELX'
105  keys( 3) = 'VELY'
106  keys( 4) = 'VELZ'
107  keys( 5) = 'PRESS'
108  keys( 6) = 'DENS'
109  keys( 7) = 'TEMP'
110  keys( 8) = 'IVAL1'
111  keys( 9) = 'IVAL2'
112  keys(10) = 'IVAL3'
113  keys(11) = 'IVAL4'
114  keys(12) = 'IVAL5'
115  keys(13) = 'IVAL6'
116  keys(14) = 'RVAL1'
117  keys(15) = 'RVAL2'
118  keys(16) = 'RVAL3'
119  keys(17) = 'RVAL4'
120  keys(18) = 'RVAL5'
121  keys(19) = 'RVAL6'
122  keys(20) = 'RVAL7'
123  keys(21) = 'RVAL8'
124  keys(22) = 'RVAL9'
125  keys(23) = 'RVAL10'
126  keys(24) = 'RVAL11'
127  keys(25) = 'RVAL12'
128  keys(26) = 'RVAL13'
129  keys(27) = 'RVAL14'
130  keys(28) = 'RVAL15'
131  keys(29) = 'RVAL16'
132 #endif
133 
134 
135 #ifdef RFLO
136  CALL readregionsection( global,if_input,nvals,keys,vals, &
137  brbeg,brend,defined )
138 
139  IF (defined(1).eqv..true.) regions(brbeg:brend)%nDumCells = abs(vals(1)+0.5_rfreal)
140 #endif
141 
142 #ifdef RFLU
143  CALL readsection(global,if_input,nvals,keys,vals,defined )
144 
145  IF ( defined(1) .EQV. .false. ) THEN
146  CALL errorstop(global,err_val_undefined,__line__,'INITFLOW-FLAG')
147  ELSE
148  IF ( nint(vals(1)) == initflow_fromscratch ) THEN
149  global%initFlowFlag = initflow_fromscratch
150 
151  DO ireg = lbound(regions,1),ubound(regions,1)
152  SELECT CASE ( regions(ireg)%mixtInput%fluidModel )
153  CASE ( fluid_model_incomp )
154  DO i = 2,5
155  IF ( defined(i) .EQV. .false. ) THEN
156  CALL errorstop(global,err_val_undefined,__line__,keys(i))
157  END IF ! defined
158  END DO ! i
159 
160  regions(ireg)%mixtInput%iniVelX = vals(2)
161  regions(ireg)%mixtInput%iniVelY = vals(3)
162  regions(ireg)%mixtInput%iniVelZ = vals(4)
163  regions(ireg)%mixtInput%iniPress = vals(5)
164  CASE ( fluid_model_comp )
165  SELECT CASE ( regions(ireg)%mixtInput%gasModel )
166  CASE ( gas_model_tcperf, &
167  gas_model_mixt_tcperf, &
168  gas_model_mixt_tperf, &
169  gas_model_mixt_pseudo )
170  DO i = 2,6
171  IF ( defined(i) .EQV. .false. ) THEN
172  CALL errorstop(global,err_val_undefined,__line__,keys(i))
173  END IF ! defined
174  END DO ! i
175 
176  regions(ireg)%mixtInput%iniVelX = vals(2)
177  regions(ireg)%mixtInput%iniVelY = vals(3)
178  regions(ireg)%mixtInput%iniVelZ = vals(4)
179  regions(ireg)%mixtInput%iniPress = vals(5)
180  regions(ireg)%mixtInput%iniDens = vals(6)
181  CASE ( gas_model_mixt_gasliq )
182  DO i = 2,4
183  IF ( defined(i) .EQV. .false. ) THEN
184  CALL errorstop(global,err_val_undefined,__line__,keys(i))
185  END IF ! defined
186  END DO ! i
187 
188  DO i = 6,7
189  IF ( defined(i) .EQV. .false. ) THEN
190  CALL errorstop(global,err_val_undefined,__line__,keys(i))
191  END IF ! defined
192  END DO ! i
193 
194  regions(ireg)%mixtInput%iniVelX = vals(2)
195  regions(ireg)%mixtInput%iniVelY = vals(3)
196  regions(ireg)%mixtInput%iniVelZ = vals(4)
197  regions(ireg)%mixtInput%iniPress = vals(5)
198  regions(ireg)%mixtInput%iniTemp = vals(7)
199  CASE default
200  CALL errorstop(global,err_reached_default,__line__)
201  END SELECT ! regions(iReg)%mixtInput%gasModel
202  CASE default
203  CALL errorstop(global,err_reached_default,__line__)
204  END SELECT ! regions(iReg)%mixtInput%fluidModel
205  END DO ! iReg
206  ELSE IF ( nint(vals(1)) == initflow_fromfile ) THEN
207  global%initFlowFlag = initflow_fromfile
208  ELSE IF ( nint(vals(1)) == initflow_fromhardcode ) THEN
209  global%initFlowFlag = initflow_fromhardcode
210  ELSE IF ( nint(vals(1)) == initflow_fromcombo_serial ) THEN
211  global%initFlowFlag = initflow_fromcombo_serial
212  ELSE IF ( nint(vals(1)) == initflow_fromcombo_parallel ) THEN
213  global%initFlowFlag = initflow_fromcombo_parallel
214  ELSE
215  CALL errorstop(global,err_reached_default,__line__)
216  END IF ! NINT(vals(1))
217  END IF ! defined
218 
219  DO ireg = lbound(regions,1),ubound(regions,1)
220  IF ( defined(8) .EQV. .false. ) THEN
221  regions(ireg)%mixtInput%prepIntVal1 = crazy_value_int
222  ELSE
223  regions(ireg)%mixtInput%prepIntVal1 = vals(8)
224  END IF ! defined
225 
226  IF ( defined(9) .EQV. .false. ) THEN
227  regions(ireg)%mixtInput%prepIntVal2 = crazy_value_int
228  ELSE
229  regions(ireg)%mixtInput%prepIntVal2 = vals(9)
230  END IF ! defined
231 
232  IF ( defined(10) .EQV. .false. ) THEN
233  regions(ireg)%mixtInput%prepIntVal3 = crazy_value_int
234  ELSE
235  regions(ireg)%mixtInput%prepIntVal3 = vals(10)
236  END IF ! defined
237 
238  IF ( defined(11) .EQV. .false. ) THEN
239  regions(ireg)%mixtInput%prepIntVal4 = crazy_value_int
240  ELSE
241  regions(ireg)%mixtInput%prepIntVal4 = vals(11)
242  END IF ! defined
243 
244  IF ( defined(12) .EQV. .false. ) THEN
245  regions(ireg)%mixtInput%prepIntVal5 = crazy_value_int
246  ELSE
247  regions(ireg)%mixtInput%prepIntVal5 = vals(12)
248  END IF ! defined
249 
250  IF ( defined(13) .EQV. .false. ) THEN
251  regions(ireg)%mixtInput%prepIntVal6 = crazy_value_int
252  ELSE
253  regions(ireg)%mixtInput%prepIntVal6 = vals(13)
254  END IF ! defined
255 
256  IF ( defined(14) .EQV. .false. ) THEN
257  regions(ireg)%mixtInput%prepRealVal1 = REAL(crazy_value_int,kind=rfreal)
258  ELSE
259  regions(ireg)%mixtInput%prepRealVal1 = vals(14)
260  END IF ! defined
261 
262  IF ( defined(15) .EQV. .false. ) THEN
263  regions(ireg)%mixtInput%prepRealVal2 = REAL(crazy_value_int,kind=rfreal)
264  ELSE
265  regions(ireg)%mixtInput%prepRealVal2 = vals(15)
266  END IF ! defined
267 
268  IF ( defined(16) .EQV. .false. ) THEN
269  regions(ireg)%mixtInput%prepRealVal3 = REAL(crazy_value_int,kind=rfreal)
270  ELSE
271  regions(ireg)%mixtInput%prepRealVal3 = vals(16)
272  END IF ! defined
273 
274  IF ( defined(17) .EQV. .false. ) THEN
275  regions(ireg)%mixtInput%prepRealVal4 = REAL(crazy_value_int,kind=rfreal)
276  ELSE
277  regions(ireg)%mixtInput%prepRealVal4 = vals(17)
278  END IF ! defined
279 
280  IF ( defined(18) .EQV. .false. ) THEN
281  regions(ireg)%mixtInput%prepRealVal5 = REAL(crazy_value_int,kind=rfreal)
282  ELSE
283  regions(ireg)%mixtInput%prepRealVal5 = vals(18)
284  END IF ! defined
285 
286  IF ( defined(19) .EQV. .false. ) THEN
287  regions(ireg)%mixtInput%prepRealVal6 = REAL(crazy_value_int,kind=rfreal)
288  ELSE
289  regions(ireg)%mixtInput%prepRealVal6 = vals(19)
290  END IF ! defined
291 
292  IF ( defined(20) .EQV. .false. ) THEN
293  regions(ireg)%mixtInput%prepRealVal7 = REAL(crazy_value_int,kind=rfreal)
294  ELSE
295  regions(ireg)%mixtInput%prepRealVal7 = vals(20)
296  END IF ! defined
297 
298  IF ( defined(21) .EQV. .false. ) THEN
299  regions(ireg)%mixtInput%prepRealVal8 = REAL(crazy_value_int,kind=rfreal)
300  ELSE
301  regions(ireg)%mixtInput%prepRealVal8 = vals(21)
302  END IF ! defined
303 
304  IF ( defined(22) .EQV. .false. ) THEN
305  regions(ireg)%mixtInput%prepRealVal9 = REAL(crazy_value_int,kind=rfreal)
306  ELSE
307  regions(ireg)%mixtInput%prepRealVal9 = vals(22)
308  END IF ! defined
309 
310  IF ( defined(23) .EQV. .false. ) THEN
311  regions(ireg)%mixtInput%prepRealVal10 = REAL(crazy_value_int,kind=rfreal)
312  ELSE
313  regions(ireg)%mixtInput%prepRealVal10 = vals(23)
314  END IF ! defined
315 
316  IF ( defined(24) .EQV. .false. ) THEN
317  regions(ireg)%mixtInput%prepRealVal11 = REAL(crazy_value_int,kind=rfreal)
318  ELSE
319  regions(ireg)%mixtInput%prepRealVal11 = vals(24)
320  END IF ! defined
321 
322  IF ( defined(25) .EQV. .false. ) THEN
323  regions(ireg)%mixtInput%prepRealVal12 = REAL(crazy_value_int,kind=rfreal)
324  ELSE
325  regions(ireg)%mixtInput%prepRealVal12 = vals(25)
326  END IF ! defined
327 
328  IF ( defined(26) .EQV. .false. ) THEN
329  regions(ireg)%mixtInput%prepRealVal13 = REAL(crazy_value_int,kind=rfreal)
330  ELSE
331  regions(ireg)%mixtInput%prepRealVal13 = vals(26)
332  END IF ! defined
333 
334  IF ( defined(27) .EQV. .false. ) THEN
335  regions(ireg)%mixtInput%prepRealVal14 = REAL(crazy_value_int,kind=rfreal)
336  ELSE
337  regions(ireg)%mixtInput%prepRealVal14 = vals(27)
338  END IF ! defined
339 
340  IF ( defined(28) .EQV. .false. ) THEN
341  regions(ireg)%mixtInput%prepRealVal15 = REAL(crazy_value_int,kind=rfreal)
342  ELSE
343  regions(ireg)%mixtInput%prepRealVal15 = vals(28)
344  END IF ! defined
345 
346  IF ( defined(29) .EQV. .false. ) THEN
347  regions(ireg)%mixtInput%prepRealVal16 = REAL(crazy_value_int,kind=rfreal)
348  ELSE
349  regions(ireg)%mixtInput%prepRealVal16 = vals(29)
350  END IF ! defined
351  END DO ! iReg
352 #endif
353 
354 ! ******************************************************************************
355 ! End
356 ! ******************************************************************************
357 
358  CALL deregisterfunction(global)
359 
360 END SUBROUTINE readinitflowsection
361 
362 ! ******************************************************************************
363 !
364 ! RCS Revision history:
365 !
366 ! $Log: ReadInitFlowSection.F90,v $
367 ! Revision 1.12 2008/12/06 08:44:09 mtcampbe
368 ! Updated license.
369 !
370 ! Revision 1.11 2008/11/19 22:17:23 mtcampbe
371 ! Added Illinois Open Source License/Copyright
372 !
373 ! Revision 1.10 2008/10/23 18:20:55 mtcampbe
374 ! Crazy number of changes to track and fix initialization and
375 ! restart bugs. Many improperly formed logical expressions
376 ! were fixed, and bug in allocation for data associated with
377 ! the BC_INFLOWVELTEMP boundary condition squashed in
378 ! RFLO_ReadBcInflowVelSection.F90.
379 !
380 ! Revision 1.9 2007/04/05 00:56:57 haselbac
381 ! Added additional RVALxy params for 2p shocktube problems
382 !
383 ! Revision 1.8 2006/04/07 15:19:15 haselbac
384 ! Removed tabs
385 !
386 ! Revision 1.7 2006/03/26 20:21:20 haselbac
387 ! Added TEMP input argument
388 !
389 ! Revision 1.6 2005/11/17 14:37:24 haselbac
390 ! Added more RVAL variables
391 !
392 ! Revision 1.5 2005/09/13 21:36:45 haselbac
393 ! Adapted to new init option
394 !
395 ! Revision 1.4 2005/04/20 14:38:36 haselbac
396 ! Added more int and real vals
397 !
398 ! Revision 1.3 2005/03/29 22:28:31 haselbac
399 ! Added setting of initFlowFlag for combo option
400 !
401 ! Revision 1.2 2005/03/22 03:32:39 haselbac
402 ! Added initialization of integer and real helper variables
403 !
404 ! Revision 1.1 2004/12/01 16:50:26 haselbac
405 ! Initial revision after changing case
406 !
407 ! Revision 1.13 2004/11/14 19:35:42 haselbac
408 ! Added initialization for incompressible fluid model
409 !
410 ! Revision 1.12 2004/07/28 16:41:32 haselbac
411 ! Bug fix: Initial values not assigned to all regions
412 !
413 ! Revision 1.11 2004/04/08 03:15:24 wasistho
414 ! nDummyCells in Rocflo read from INITFLOW section
415 !
416 ! Revision 1.10 2003/11/20 16:40:35 mdbrandy
417 ! Backing out RocfluidMP changes from 11-17-03
418 !
419 ! Revision 1.7 2003/09/15 00:36:19 haselbac
420 ! Added hard-code option as input
421 !
422 ! Revision 1.6 2003/05/16 02:27:43 haselbac
423 ! Removed KIND=RFREAL from NINT statements
424 !
425 ! Revision 1.5 2003/05/15 02:57:02 jblazek
426 ! Inlined index function.
427 !
428 ! Revision 1.4 2003/03/25 19:15:17 haselbac
429 ! Fixed bug in RCSIdentString
430 !
431 ! Revision 1.3 2003/03/15 16:27:39 haselbac
432 ! Added KIND qualifyer
433 !
434 ! Revision 1.2 2003/02/13 22:30:54 jferry
435 ! removed RFLU_ prefix in RegisterFunction
436 !
437 ! Revision 1.1 2003/01/28 16:12:56 haselbac
438 ! Moved here from rfluprep
439 !
440 ! Revision 1.4 2002/10/27 19:23:46 haselbac
441 ! Removed tabs
442 !
443 ! Revision 1.3 2002/10/07 14:11:29 haselbac
444 ! Removed tabs
445 !
446 ! Revision 1.2 2002/09/09 16:40:13 haselbac
447 ! global and mixtInput now under regions
448 !
449 ! Revision 1.1 2002/04/11 19:13:22 haselbac
450 ! Initial revision
451 !
452 ! ******************************************************************************
453 
454 
455 
456 
457 
458 
459 
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 brbeg
blockLoc i
Definition: read.cpp:79
subroutine readinitflowsection(regions)
subroutine readsection(global, fileID, nvals, keys, vals, defined)
subroutine readregionsection(global, fileID, nvals, keys, vals, brbeg, brend, defined)
**********************************************************************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 USE ModDataTypes USE nvals
subroutine errorstop(global, errorCode, errorLine, addMessage)
Definition: ModError.F90:483
subroutine deregisterfunction(global)
Definition: ModError.F90:469