Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RFLU_InitGlobal.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: Initialize global information.
26 !
27 ! Description: None.
28 !
29 ! Input:
30 ! casename Case name
31 ! verbLevel Verbosity level
32 ! communicator Communicator
33 ! global Pointer to type global
34 !
35 ! Output: None.
36 !
37 ! Notes: None.
38 !
39 ! ******************************************************************************
40 !
41 ! $Id: RFLU_InitGlobal.F90,v 1.52 2008/12/06 08:44:12 mtcampbe Exp $
42 !
43 ! Copyright: (c) 2002-2006 by the University of Illinois
44 !
45 ! ******************************************************************************
46 
47 SUBROUTINE rflu_initglobal(casename,verbLevel,communicator,global)
48 
49  USE moddatatypes
50  USE moderror
51  USE modglobal, ONLY: t_global
52  USE modmpi
53  USE modparameters
54 
55  IMPLICIT NONE
56 
57 ! ******************************************************************************
58 ! Declarations and definitions
59 ! ******************************************************************************
60 
61 ! ==============================================================================
62 ! Arguments
63 ! ==============================================================================
64 
65  CHARACTER(*), INTENT(IN) :: casename
66  INTEGER, INTENT(IN) :: communicator,verblevel
67  TYPE(t_global), POINTER :: global
68 
69 ! ==============================================================================
70 ! Locals
71 ! ==============================================================================
72 
73  CHARACTER(CHRLEN) :: rcsidentstring
74 
75 ! ******************************************************************************
76 ! Start
77 ! ******************************************************************************
78 
79  rcsidentstring = '$RCSfile: RFLU_InitGlobal.F90,v $ $Revision: 1.52 $'
80 
81 ! ******************************************************************************
82 ! Initialize global variables
83 ! ******************************************************************************
84 
85 ! ==============================================================================
86 ! Main variables
87 ! ==============================================================================
88 
89  global%nFunTree = 0
90 
91  global%casename = casename
92 
93  global%verbLevel = verblevel
94 #ifdef GENX
95  global%verbLevelCOM = 0
96 #endif
97 
98  global%checkLevel = check_high ! Default
99 
100  global%nLevels = 1
101  global%nRegions = 1
102 
103  global%nRegionsLocal = 1
104  global%nRegionsProc = 1
105 
106 ! ==============================================================================
107 ! Grid and solution file formats
108 ! ==============================================================================
109 
110  global%gridFormat = format_ascii
111  global%solutFormat = format_ascii
112 
113 ! ==============================================================================
114 ! Parallel stuff
115 ! ==============================================================================
116 
117  global%nProcAlloc = 1
118  global%myProcid = masterproc ! Default process number (if not MPI)
119  global%mpiComm = communicator
120  global%mpierr = err_none
121 
122 ! ==============================================================================
123 ! Time stepping
124 ! ==============================================================================
125 
126  global%flowType = flow_steady
127  global%solverType = solv_explicit
128 
129  global%currentIter = 0
130  global%iterSinceRestart = 0
131  global%maxIter = 10000
132  global%printIter = 1
133  global%restartIter = 0
134  global%resTol = 1.0e-5_rfreal
135  global%writeIter = 1000
136 
137  global%currentTime = 0.0_rfreal ! No physical time set
138  global%currentTimeRK = 0.0_rfreal
139  global%dtImposed = 1.0e-5_rfreal
140  global%dtMinLimit = 1.0e-10_rfreal
141  global%maxTime = 1.0e-4_rfreal
142  global%printTime = 1.0e-12_rfreal
143  global%restartTime = 0.0_rfreal
144  global%timeSinceRestart = 0.0_rfreal
145  global%timeSincePrint = 0.0_rfreal
146  global%timeSinceProbe = 0.0_rfreal
147  global%timeSinceWrite = 0.0_rfreal
148  global%writeTime = 5.0e-5_rfreal
149 
150  global%rkScheme = rk_scheme_4_classical
151 
152 #ifndef GENX
153  global%timeStamp = 0.0e+0_rfreal
154 #endif
155 
156  global%restartFromScratch = .false.
157 
158  global%dualTstSource = .false.
159 
160 ! ==============================================================================
161 ! Optimal LES stuff
162 ! ==============================================================================
163 
164  global%dissOLES = 0.0_rfreal
165  global%enerOLES = 0.0_rfreal
166 
167  global%progressCounter = 1
168 
169 #ifdef STATS
170 ! ==============================================================================
171 ! Time averaged statistics
172 ! ==============================================================================
173 
174  global%doStat = 0
175  global%reStat = 0
176  global%mixtNStat = 0
177  global%turbNStat = 0
178  global%integrTime = 0.0_rfreal
179 #endif
180 
181 ! ==============================================================================
182 ! Error variable
183 ! ==============================================================================
184 
185  global%error = err_none
186 
187 ! ==============================================================================
188 ! Mathematical constants (these should really be parameters...)
189 ! ==============================================================================
190 
191  global%pi = 4.0_rfreal*atan(1.0_rfreal)
192  global%rad2deg = 180.0_rfreal/global%pi
193  global%deg2rad = 1.0_rfreal/global%rad2deg
194  global%rad = global%deg2rad ! Should not be used in Rocflu
195 
196 ! ==============================================================================
197 ! Multigrid
198 ! ==============================================================================
199 
200  global%startLevel = 1
201  global%cycleType = mgcycle_no
202  global%refineIter = 9999999
203 
204 ! ==============================================================================
205 ! Reference values
206 ! ==============================================================================
207 
208  global%refVelocity = 100.0_rfreal
209  global%refPressure = 1.0e+5_rfreal
210  global%refDensity = 1.2_rfreal
211  global%refCp = 1004.5_rfreal
212  global%refGamma = 1.4_rfreal
213  global%refLength = 1.0_rfreal
214  global%refREnum = 100.0_rfreal
215  global%prLam = 0.72_rfreal
216  global%prTurb = 0.9_rfreal
217  global%scnLam = 0.22_rfreal
218  global%scnTurb = 0.9_rfreal
219 
220 ! ------------------------------------------------------------------------------
221 ! Reference values specific to gas-liquid mixture computations
222 ! ------------------------------------------------------------------------------
223 
224  global%refBetaPLiq = 4.5e-7_rfreal
225  global%refBetaTLiq = -4.5e-7_rfreal
226  global%refCvLiq = 4179.0_rfreal
227  global%refDensityLiq = 1000.0_rfreal
228  global%refPressLiq = 1.0e+5_rfreal
229  global%refTempLiq = 273.0_rfreal
230 
231 ! ==============================================================================
232 ! Geometric transformations
233 ! ==============================================================================
234 
235  global%transformFlag = .false. ! No transformation
236  global%distortFlag = .false. ! No distortion
237  global%enforceFlag = .false.
238 
239  global%angleX = 0.0_rfreal
240  global%angleY = 0.0_rfreal
241  global%angleZ = 0.0_rfreal
242  global%scaleX = 1.0_rfreal
243  global%scaleY = 1.0_rfreal
244  global%scaleZ = 1.0_rfreal
245  global%distortX = 1.0_rfreal
246  global%distortY = 1.0_rfreal
247  global%distortZ = 1.0_rfreal
248 
249 ! ==============================================================================
250 ! Probe
251 ! ==============================================================================
252 
253  global%nProbes = 0
254 
255  global%probeSaveIter = 1
256  global%probeSaveTime = 0.0_rfreal
257 
258 ! ==============================================================================
259 ! Forces and acceleration
260 ! ==============================================================================
261 
262  global%accelOn = .false.
263  global%forceFlag = .false.
264  global%patchCoeffFlag = .true.
265 
266  global%forceWriteCntr = 0
267  global%thrustWriteCntr = 0
268 
269  global%accelX = 0.0_rfreal
270  global%accelY = 0.0_rfreal
271  global%accelZ = 0.0_rfreal
272 
273  global%gravity = 9.81_rfreal
274 
275  global%forceRefArea = 1.0_rfreal
276  global%forceRefLength = 1.0_rfreal
277  global%forceRefXCoord = 0.0_rfreal
278  global%forceRefYCoord = 0.0_rfreal
279  global%forceRefZCoord = 0.0_rfreal
280 
281 ! ==============================================================================
282 ! Random number generator
283 ! ==============================================================================
284 
285  global%randSeedOffset = 0
286  global%randSeedType = rand_seed_type_fixed
287 
288 ! ==============================================================================
289 ! Multiphysics modules
290 ! ==============================================================================
291 
292  global%inrtUsed = .false.
293  global%peulUsed = .false.
294  global%plagUsed = .false.
295  global%specUsed = .false.
296 
297  global%plagUsedSave = global%plagUsed
298 
299 #ifdef SPEC
300  global%nSpecies = 0
301 #endif
302 
303 ! ==============================================================================
304 ! Miscellaneous
305 ! ==============================================================================
306 
307  global%resInit = 0.0_rfreal
308 
309  global%warnCounter = 0
310 
311  global%moduleType = module_type_none
312 
313  global%cnstrCaseRad = -1.0
314 
315 ! ==============================================================================
316 ! Flow initialization
317 ! ==============================================================================
318 
319  global%initFlowFlag = crazy_value_int ! To force setting of value
320 #ifdef PLAG
321  global%initPlagFlag = crazy_value_int ! To force setting of value
322 #endif
323 
324 ! ==============================================================================
325 ! Preprocessor
326 ! ==============================================================================
327 
328  global%prepPartMode = partition_mode_proper
329  global%syPePatchesFlag = .false.
330 
331 ! ==============================================================================
332 ! Postprocessor
333 ! ==============================================================================
334 
335  global%postOutputFormat = post_output_format_tecplot
336 
337  global%postInterpOrder = 1
338  global%postInterpType = interp_type_proper
339  global%postPlotType = plot_grid_flow
340 
341  global%postCompErrFlag = .false.
342  global%postMergeFlag = .true.
343  global%postPlotPatchFlag = .true.
344  global%postPlotVolFlag = .true.
345  global%postWriteMergeFlag = .false.
346 
347  global%postDiscFlag = .false.
348  global%postExtractFlag = .false.
349  global%postLag2EulFlag = .false.
350  global%postSpecFlag = .false.
351  global%postVortFlag = .false.
352  global%postVortCoreFlag = .false.
353 
354  global%postSchType = 0
355  global%postSchExp = 10.0_rfreal
356  global%postNFringes = 32
357 
358  global%postNServers = 1
359 
360 ! ==============================================================================
361 ! Picking
362 ! ==============================================================================
363 
364  global%pickCoordFlag = .false.
365 
366  global%pickXCoordLow = -huge(1.0_rfreal)
367  global%pickXCoordUpp = huge(1.0_rfreal)
368  global%pickYCoordLow = -huge(1.0_rfreal)
369  global%pickYCoordUpp = huge(1.0_rfreal)
370  global%pickZCoordLow = -huge(1.0_rfreal)
371  global%pickZCoordUpp = huge(1.0_rfreal)
372 
373 ! ==============================================================================
374 ! GENX; if GENX is defined, winName is set in rocflu_load_module.F90
375 ! ==============================================================================
376 
377 #ifndef GENX
378  global%surfWinName = ''
379  global%surfWinNameInput = ''
380  global%volWinName = ''
381  global%volWinNameInput = ''
382 #endif
383 
384 ! The following will be overwritten by RFLU_ReadGENXControlFile
385 
386  global%inDir = './'
387  global%outDir = './'
388 
389 ! ******************************************************************************
390 ! End
391 ! ******************************************************************************
392 
393 END SUBROUTINE rflu_initglobal
394 
395 ! ******************************************************************************
396 !
397 ! RCS Revision history:
398 !
399 ! $Log: RFLU_InitGlobal.F90,v $
400 ! Revision 1.52 2008/12/06 08:44:12 mtcampbe
401 ! Updated license.
402 !
403 ! Revision 1.51 2008/11/19 22:17:25 mtcampbe
404 ! Added Illinois Open Source License/Copyright
405 !
406 ! Revision 1.50 2006/10/20 21:23:29 mparmar
407 ! Added initialization of gravity,thrustWriteCntr
408 !
409 ! Revision 1.49 2006/08/04 03:03:23 haselbac
410 ! Added init of grid distortion parameters, fixed typo
411 !
412 ! Revision 1.48 2006/05/06 15:20:09 haselbac
413 ! Bug fix: Missing ifdef PLAG
414 !
415 ! Revision 1.47 2006/04/07 15:19:16 haselbac
416 ! Removed tabs
417 !
418 ! Revision 1.46 2006/03/26 20:21:35 haselbac
419 ! Added ref values for GL model
420 !
421 ! Revision 1.45 2006/03/25 21:42:47 haselbac
422 ! Added init of syPePatchesFlag
423 !
424 ! Revision 1.44 2006/02/06 23:56:37 haselbac
425 ! Added communicator to arg list to fix bug in GENX init with Panda
426 !
427 ! Revision 1.43 2005/12/10 23:28:05 haselbac
428 ! Renamed geom post variables to pick variables
429 !
430 ! Revision 1.42 2005/12/10 16:54:30 haselbac
431 ! Added init for postLag2EulFlag
432 !
433 ! Revision 1.41 2005/12/01 17:09:53 fnajjar
434 ! Added appropriate initialization, checking and printing of random seed type
435 !
436 ! Revision 1.40 2005/11/10 02:01:55 haselbac
437 ! Added init of acceleration components
438 !
439 ! Revision 1.39 2005/10/28 19:17:07 haselbac
440 ! Added setting of postPlotPatchFlag
441 !
442 ! Revision 1.38 2005/10/05 20:02:28 haselbac
443 ! Added init for post output format and nservers
444 !
445 ! Revision 1.37 2005/08/10 00:30:55 haselbac
446 ! Added init of postVortCoreFlag
447 !
448 ! Revision 1.36 2005/08/09 00:54:26 haselbac
449 ! Added init of patchCoeffFlag, postCompErrFlag, postWriteMergeFlag
450 !
451 ! Revision 1.35 2005/07/25 12:20:22 haselbac
452 ! Added init of postVortFlag, changed postSchExp to float
453 !
454 ! Revision 1.34 2005/07/05 19:26:38 haselbac
455 ! Added init for postSchType and postSchExp
456 !
457 ! Revision 1.33 2005/07/01 15:13:12 haselbac
458 ! Added init of verbLevelCOM
459 !
460 ! Revision 1.32 2005/05/01 14:18:28 haselbac
461 ! Added init of postDiscFlag and postNFringes
462 !
463 ! Revision 1.31 2005/04/15 15:06:17 haselbac
464 ! Removed Charm/FEM routines, added init of mpiComm and plagUsedSave
465 !
466 ! Revision 1.30 2005/03/31 16:49:55 haselbac
467 ! Added initialization of currentTimeRK
468 !
469 ! Revision 1.29 2004/11/17 16:27:54 haselbac
470 ! Added setting of rkScheme
471 !
472 ! Revision 1.28 2004/10/26 15:16:16 haselbac
473 ! Added initialization of postExtractFlag
474 !
475 ! Revision 1.27 2004/10/19 19:24:22 haselbac
476 ! Added and removed several variables
477 !
478 ! Revision 1.26 2004/10/09 16:36:15 fnajjar
479 ! Initialized initPlagFlag
480 !
481 ! Revision 1.25 2004/07/21 14:54:31 haselbac
482 ! Added initialization of postInterpType
483 !
484 ! Revision 1.24 2004/06/16 20:00:19 haselbac
485 ! Added force variables, clean-up, cosmetics
486 !
487 ! Revision 1.23 2004/03/15 21:02:57 haselbac
488 ! Changed init value of checkLevel to use parameter
489 !
490 ! Revision 1.22 2004/03/05 22:09:01 jferry
491 ! created global variables for peul, plag, and inrt use
492 !
493 ! Revision 1.21 2004/01/29 22:56:33 haselbac
494 ! Added initialization of rad2deg and deg2rad
495 !
496 ! Revision 1.20 2003/12/04 03:23:54 haselbac
497 ! Collect initialization of ALL global variables, clean-up
498 !
499 ! Revision 1.19 2003/11/25 21:02:47 haselbac
500 ! Added initialization of initFlowFlag
501 !
502 ! Revision 1.18 2003/10/29 21:38:14 haselbac
503 ! Added init for new global variables
504 !
505 ! Revision 1.17 2003/10/15 02:40:07 haselbac
506 ! Added init for dtMinLimit
507 !
508 ! Revision 1.16 2003/08/07 15:30:32 haselbac
509 ! Added and changed var names
510 !
511 ! Revision 1.15 2003/07/22 01:55:54 haselbac
512 ! Added init of postInterpOrder and warnCounter
513 !
514 ! Revision 1.14 2003/05/05 18:39:03 haselbac
515 ! Added init of plotType
516 !
517 ! Revision 1.13 2003/04/29 21:48:05 haselbac
518 ! Added initialization of surfDiverFlag
519 !
520 ! Revision 1.12 2003/04/28 22:40:01 haselbac
521 ! Added init of post and prep vars, cosmetics
522 !
523 ! Revision 1.11 2003/04/12 21:36:22 haselbac
524 ! Added init of FEMRocfluGrid
525 !
526 ! Revision 1.10 2003/04/07 14:21:07 haselbac
527 ! Initialize new probe parameters, cosmetic changes
528 !
529 ! Revision 1.9 2003/03/15 17:00:03 haselbac
530 ! Removed splitFlag
531 !
532 ! Revision 1.8 2003/02/01 00:27:17 haselbac
533 ! Added initialization of transform variables and enforceFlag
534 !
535 ! Revision 1.7 2002/10/27 18:52:16 haselbac
536 ! Removed tabs
537 !
538 ! Revision 1.6 2002/10/16 21:11:40 haselbac
539 ! Added initialization of resInit
540 !
541 ! Revision 1.5 2002/10/13 21:41:40 jiao
542 ! Compiled Rocflu on IBM SP.
543 !
544 ! Revision 1.4 2002/10/05 18:46:28 haselbac
545 ! Integration into GENX, some clean-up
546 !
547 ! Revision 1.3 2002/09/09 14:15:01 haselbac
548 ! global now under regions
549 !
550 ! Revision 1.2 2002/07/25 14:42:07 haselbac
551 ! Added arguments, status of routine has changed, now called from main
552 !
553 ! Revision 1.1 2002/06/14 20:05:48 haselbac
554 ! Former RFLU_InitLocalGlobal.F90, renamed as ModLocal.F90 no longer used
555 !
556 ! Revision 1.3 2002/05/28 13:49:10 haselbac
557 ! Changed initial value for currentTime
558 !
559 ! Revision 1.2 2002/05/07 18:51:01 haselbac
560 ! Added initialization of transform flag
561 !
562 ! Revision 1.1 2002/05/04 16:09:00 haselbac
563 ! Initial revision
564 !
565 ! ******************************************************************************
566 
567 
568 
569 
570 
571 
MPI_Comm communicator() const
Definition: Function.h:119
subroutine rflu_initglobal(casename, verbLevel, communicator, global)