Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RFLU_CheckUserInput.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: Check parameters specified by the user.
26 !
27 ! Description: None.
28 !
29 ! Input:
30 ! regions Region data
31 !
32 ! Output: None.
33 !
34 ! Notes:
35 ! 1. Only check input for one region because input is the same for all
36 ! regions.
37 !
38 ! ******************************************************************************
39 !
40 ! $Id: RFLU_CheckUserInput.F90,v 1.32 2008/12/06 08:44:11 mtcampbe Exp $
41 !
42 ! Copyright: (c) 2001-2005 by the University of Illinois
43 !
44 ! ******************************************************************************
45 
46 SUBROUTINE rflu_checkuserinput(regions)
47 
48  USE moddatatypes
49  USE modglobal, ONLY: t_global
50  USE modmixture, ONLY: t_mixt_input
51  USE moddatastruct, ONLY: t_region
52  USE moderror
53  USE modparameters
54  USE modmpi
55 
56  IMPLICIT NONE
57 
58 ! ******************************************************************************
59 ! Arguments
60 ! ******************************************************************************
61 
62  TYPE(t_region), DIMENSION(:), POINTER :: regions
63 
64 ! ******************************************************************************
65 ! Locals
66 ! ******************************************************************************
67 
68  INTEGER :: ireg
69  CHARACTER(CHRLEN) :: rcsidentstring
70  TYPE(t_mixt_input), POINTER :: pmixtinput
71  TYPE(t_global), POINTER :: global
72 
73 ! ******************************************************************************
74 ! Start
75 ! ******************************************************************************
76 
77  rcsidentstring = '$RCSfile: RFLU_CheckUserInput.F90,v $ $Revision: 1.32 $'
78 
79  global => regions(1)%global
80 
81  CALL registerfunction(global,'RFLU_CheckUserInput',&
82  'RFLU_CheckUserInput.F90')
83 
84 ! ******************************************************************************
85 ! Check global data
86 ! ******************************************************************************
87 
88 ! ==============================================================================
89 ! Solver type
90 ! ==============================================================================
91 
92  IF ( global%solverType /= solv_explicit .AND. &
93  global%solverType /= solv_implicit_nk ) THEN
94  CALL errorstop(global,err_solver_type_invalid,__line__)
95  END IF ! global%solverType
96 
97 ! ==============================================================================
98 ! Output format
99 ! ==============================================================================
100 
101  IF ( global%postOutputFormat /= post_output_format_tecplot .AND. &
102  global%postOutputFormat /= post_output_format_ensight ) THEN
103  CALL errorstop(global,err_post_output_format_invalid,__line__)
104  END IF ! global%postOutputFormat
105 
106 ! ==============================================================================
107 ! For ENSIGHT, check number of servers
108 ! ==============================================================================
109 
110  IF ( global%postOutputFormat == post_output_format_ensight ) THEN
111  IF ( (global%postMergeFlag .EQV. .false.) .AND. &
112  (global%postNServers > global%nRegions) ) THEN
113  CALL errorstop(global,err_post_nservers_invalid,__line__)
114  END IF ! global%postNServers
115 
116  IF ( (global%postMergeFlag .EQV. .true.) .AND. &
117  (global%postNServers /= 1) ) THEN
118  WRITE(stdout,'(A,3X,A)') solver_name, &
119  '*** WARNING *** Invalid input for number of servers.'
120  WRITE(stdout,'(A,20X,A)') solver_name,'Setting number of servers to one.'
121 
122  global%postNServers = 1
123  END IF ! global%postNServers
124  END IF ! global%postOutputFormat
125 
126 ! ******************************************************************************
127 ! Check region related data
128 ! ******************************************************************************
129 
130  DO ireg = lbound(regions,1),ubound(regions,1)
131  pmixtinput => regions(ireg)%mixtInput
132 
133 ! ==============================================================================
134 ! Check dimensionality
135 ! ==============================================================================
136 
137  IF ( pmixtinput%dimens < 1 .OR. pmixtinput%dimens > 3 ) THEN
138  CALL errorstop(global,err_dimens_invalid,__line__)
139  END IF ! pMixtInput%dimens
140 
141 ! ==============================================================================
142 ! Check stencil dimensionality
143 ! ==============================================================================
144 
145  IF ( pmixtinput%stencilDimensCells < 1 .OR. &
146  pmixtinput%stencilDimensCells > 3 ) THEN
147  CALL errorstop(global,err_stencildimens_invalid,__line__)
148  END IF ! pMixtInput%stencilDimensCells
149 
150  IF ( pmixtinput%stencilDimensFaces < 1 .OR. &
151  pmixtinput%stencilDimensFaces > 3 ) THEN
152  CALL errorstop(global,err_stencildimens_invalid,__line__)
153  END IF ! pMixtInput%stencilDimensFaces
154 
155  IF ( pmixtinput%stencilDimensBFaces < 1 .OR. &
156  pmixtinput%stencilDimensBFaces > 3 ) THEN
157  CALL errorstop(global,err_stencildimens_invalid,__line__)
158  END IF ! pMixtInput%stencilDimensBFaces
159 
160  IF ( pmixtinput%stencilDimensCells > pmixtinput%dimens ) THEN
161  CALL errorstop(global,err_stencildimens_invalid,__line__)
162  END IF ! pMixtInput%stencilDimensCells
163 
164  IF ( pmixtinput%stencilDimensFaces > pmixtinput%dimens ) THEN
165  CALL errorstop(global,err_stencildimens_invalid,__line__)
166  END IF ! pMixtInput%stencilDimensFaces
167 
168  IF ( pmixtinput%stencilDimensBFaces > pmixtinput%dimens ) THEN
169  CALL errorstop(global,err_stencildimens_invalid,__line__)
170  END IF ! pMixtInput%stencilDimensBFaces
171 
172 ! ==============================================================================
173 ! Check order
174 ! ==============================================================================
175 
176  IF ( pmixtinput%stencilDimensCells > 1 ) THEN
177  IF ( pmixtinput%spaceOrder < 1 .OR. &
178  pmixtinput%spaceOrder > 2 ) THEN
179  CALL errorstop(global,err_order_invalid,__line__)
180  END IF ! pMixtInput%spaceOrder
181  END IF ! pMixtInput%stencilDimensCells
182 
183  IF ( pmixtinput%spaceOrderBFaces < 1 .OR. &
184  pmixtinput%spaceOrderBFaces > 2 ) THEN
185  CALL errorstop(global,err_order_invalid,__line__)
186  END IF ! pMixtInput%spaceOrderBFaces
187 
188 ! ==============================================================================
189 ! Check reconstruction
190 ! ==============================================================================
191 
192  IF ( pmixtinput%reconst /= reconst_none .AND. &
193  pmixtinput%reconst /= reconst_weno_simple .AND. &
194  pmixtinput%reconst /= reconst_weno_xyz .AND. &
195  pmixtinput%reconst /= reconst_lim_barthjesp .AND. &
196  pmixtinput%reconst /= reconst_lim_venkat ) THEN
197  CALL errorstop(global,err_reconst_invalid,__line__)
198  END IF ! pMixtInput%reconst
199 
200 ! ==============================================================================
201 ! Check constraints
202 ! ==============================================================================
203 
204  IF ( pmixtinput%cReconstCells /= constr_none .AND. &
205  pmixtinput%cReconstCells /= constr_weighted ) THEN
206  CALL errorstop(global,err_constr_invalid,__line__)
207  END IF ! pMixtInput%cReconstCells
208 
209  IF ( pmixtinput%cReconstFaces /= constr_none .AND. &
210  pmixtinput%cReconstFaces /= constr_weighted ) THEN
211  CALL errorstop(global,err_constr_invalid,__line__)
212  END IF ! pMixtInput%cReconstFaces
213 
214 ! ==============================================================================
215 ! Check discretization
216 ! ==============================================================================
217 
218  IF ( pmixtinput%spaceDiscr /= discr_upw_roe .AND. &
219  pmixtinput%spaceDiscr /= discr_upw_hllc .AND. &
220  pmixtinput%spaceDiscr /= discr_upw_ausmplus ) THEN
221  CALL errorstop(global,err_discr_invalid,__line__)
222  END IF ! pMixtInput%spaceDiscr
223 
224 ! ==============================================================================
225 ! Check gas model and compatibility with flux function
226 ! ==============================================================================
227 
228  IF ( pmixtinput%gasModel /= gas_model_tcperf .AND. &
229  pmixtinput%gasModel /= gas_model_mixt_tcperf .AND. &
230  pmixtinput%gasModel /= gas_model_mixt_pseudo .AND. &
231  pmixtinput%gasModel /= gas_model_mixt_gasliq ) THEN
232  CALL errorstop(global,err_gasmodel_invalid,__line__)
233  END IF ! pMixtInput%gasModel
234 
235  IF ( pmixtinput%gasModel == gas_model_mixt_tcperf .OR. &
236  pmixtinput%gasModel == gas_model_mixt_pseudo ) THEN
237  IF ( pmixtinput%spaceDiscr /= discr_upw_hllc .AND. &
238  pmixtinput%spaceDiscr /= discr_upw_ausmplus ) THEN
239  CALL errorstop(global,err_gasmodel_discr_mismatch,__line__)
240  END IF ! pMixtInput%spaceDiscr
241  END IF ! pMixtInput%gasModel
242 
243  IF ( pmixtinput%gasModel == gas_model_mixt_gasliq ) THEN
244  IF ( pmixtinput%spaceDiscr /= discr_upw_roe .AND. &
245  pmixtinput%spaceDiscr /= discr_upw_hllc ) THEN
246  CALL errorstop(global,err_gasmodel_discr_mismatch,__line__)
247  END IF ! pMixtInput%spaceDiscr
248  END IF ! pMixtInput%gasModel
249 
250 ! ==============================================================================
251 ! Check in-cell test tolerance
252 ! ==============================================================================
253 
254  IF ( pmixtinput%tolerICT < 0.0_rfreal ) THEN
255  CALL errorstop(global,err_tolerict_invalid,__line__)
256  END IF ! pMixtInput%tolerICT
257 
258 ! ==============================================================================
259 ! Check for valid input for grid motion type
260 ! ==============================================================================
261 
262  IF ( pmixtinput%moveGrid .EQV. .true. ) THEN
263  IF ( pmixtinput%moveGridType /= movegrid_type_disp .AND. &
264  pmixtinput%moveGridType /= movegrid_type_xyz .AND. &
265  pmixtinput%moveGridType /= movegrid_type_genx ) THEN
266  global%warnCounter = global%warnCounter + 1
267 
268  IF ( ireg == lbound(regions,1) .AND. &
269  global%myProcid == masterproc .AND. &
270  global%verbLevel > verbose_none ) THEN
271  WRITE(stdout,'(A,3X,A,A)') solver_name, &
272  '*** WARNING *** Invalid input for ', &
273  'grid motion type. Overriding user input.'
274  END IF ! iReg
275 
276 #ifndef GENX
277  pmixtinput%moveGridType = movegrid_type_disp
278 #else
279  pmixtinput%moveGridType = movegrid_type_genx
280 #endif
281  END IF ! pMixtInput%moveGridType
282 
283 #ifdef GENX
284  IF ( pmixtinput%moveGridType /= movegrid_type_genx ) THEN
285  global%warnCounter = global%warnCounter + 1
286 
287  IF ( ireg == lbound(regions,1) .AND. &
288  global%myProcid == masterproc .AND. &
289  global%verbLevel > verbose_none ) THEN
290  WRITE(stdout,'(A,3X,A,A)') solver_name, &
291  '*** WARNING *** Invalid input for ', &
292  'grid motion type. Overriding user input.'
293  END IF ! iReg
294 
295  pmixtinput%moveGridType = movegrid_type_genx
296  END IF ! pMixtInput%moveGridType
297 #endif
298  END IF ! pMixtInput%moveGrid
299 
300 #ifdef GENX
301 ! ==============================================================================
302 ! Check for valid input for grid motion within coupled calculations
303 ! ==============================================================================
304 
305  IF ( pmixtinput%moveGrid .EQV. .false. ) THEN
306  global%warnCounter = global%warnCounter + 1
307 
308  IF ( ireg == lbound(regions,1) .AND. &
309  global%myProcid == masterproc .AND. &
310  global%verbLevel > verbose_none ) THEN
311  WRITE(stdout,'(A,3X,A,A)') solver_name, &
312  '*** WARNING *** Invalid input for ', &
313  'grid motion. Overriding user input.'
314  END IF ! global%myProcid
315 
316  pmixtinput%moveGrid = .true.
317  END IF ! pMixtInput
318 #endif
319 
320 ! ==============================================================================
321 ! Check for valid input for OLES computations
322 ! ==============================================================================
323 
324  IF ( pmixtinput%spaceDiscr == discr_opt_les .AND. &
325  pmixtinput%flowModel /= flow_navst ) THEN
326  CALL errorstop(global,err_oles_flowmodel,__line__)
327  END IF ! pMixtInput
328  END DO ! iReg
329 
330 ! ==============================================================================
331 ! Check for valid input for random number generator
332 ! ==============================================================================
333 
334  IF ( global%randSeedType < rand_seed_type_fixed .OR. &
335  global%randSeedType > rand_seed_type_clock ) THEN
336  CALL errorstop(global,err_rand_seed_type_invalid,__line__)
337  END IF ! global%randSeedType
338 
339 ! ******************************************************************************
340 ! End
341 ! ******************************************************************************
342 
343  CALL deregisterfunction(global)
344 
345 END SUBROUTINE rflu_checkuserinput
346 
347 ! ******************************************************************************
348 !
349 ! RCS Revision history:
350 !
351 ! $Log: RFLU_CheckUserInput.F90,v $
352 ! Revision 1.32 2008/12/06 08:44:11 mtcampbe
353 ! Updated license.
354 !
355 ! Revision 1.31 2008/11/19 22:17:25 mtcampbe
356 ! Added Illinois Open Source License/Copyright
357 !
358 ! Revision 1.30 2007/02/27 13:01:33 haselbac
359 ! Enabled 1d computations
360 !
361 ! Revision 1.29 2006/10/20 21:23:07 mparmar
362 ! Added upper limit check of spaceOrderBFaces
363 !
364 ! Revision 1.28 2006/08/19 15:38:43 mparmar
365 ! Added checking of mixtInput%spaceOrderBFaces
366 !
367 ! Revision 1.27 2006/05/01 20:59:30 haselbac
368 ! Changed check for spaceDiscr with MTCP gas model
369 !
370 ! Revision 1.26 2006/04/15 16:54:19 haselbac
371 ! Expanded check for reconst
372 !
373 ! Revision 1.25 2006/04/13 18:06:15 haselbac
374 ! Fixed check for gas model, added check for GASLIQ gas model and discr
375 !
376 ! Revision 1.24 2006/04/07 14:41:21 haselbac
377 ! Added checks for stencilDimens params, shuffled checks around
378 !
379 ! Revision 1.23 2006/03/26 20:21:28 haselbac
380 ! Extended check of gas model
381 !
382 ! Revision 1.22 2006/01/06 22:05:46 haselbac
383 ! Added check for stencil dimensionality and order
384 !
385 ! Revision 1.21 2005/12/25 15:22:16 haselbac
386 ! Added checks for constrained reconstruction
387 !
388 ! Revision 1.20 2005/12/24 21:25:11 haselbac
389 ! Added check for ICT tolerance
390 !
391 ! Revision 1.19 2005/12/01 17:09:53 fnajjar
392 ! Added appropriate initialization, checking and printing of random seed type
393 !
394 ! Revision 1.18 2005/11/14 16:54:04 haselbac
395 ! Added error checking for pseudo-gas model
396 !
397 ! Revision 1.17 2005/11/10 01:59:24 haselbac
398 ! Added checks for gas-model/discr consistency
399 !
400 ! Revision 1.16 2005/10/31 19:25:35 haselbac
401 ! Added checking of gasModel
402 !
403 ! Revision 1.15 2005/10/27 18:55:11 haselbac
404 ! Added check for constraints, clean-up
405 !
406 ! Revision 1.14 2005/10/05 20:01:46 haselbac
407 ! Added checks for pot output format and nservers
408 !
409 ! Revision 1.13 2005/08/03 18:53:48 hdewey2
410 ! Added check for solverType
411 !
412 ! Revision 1.12 2005/07/14 21:58:30 haselbac
413 ! Added checking for flux function and order of discretization
414 !
415 ! Revision 1.11 2005/07/11 19:23:02 mparmar
416 ! Added check of reconst option
417 !
418 ! Revision 1.10 2005/06/29 18:07:28 haselbac
419 ! Added check for gm type within GENX
420 !
421 ! Revision 1.9 2005/03/09 14:52:46 haselbac
422 ! Added check for dimensionality
423 !
424 ! Revision 1.8 2004/10/19 19:36:58 haselbac
425 ! Updated for GEN3
426 !
427 ! Revision 1.7 2004/07/30 22:47:35 jferry
428 ! Implemented Equilibrium Eulerian method for Rocflu
429 !
430 ! Revision 1.6 2004/03/05 22:09:01 jferry
431 ! created global variables for peul, plag, and inrt use
432 !
433 ! Revision 1.5 2004/01/09 21:02:41 haselbac
434 ! Cosmetics only
435 !
436 ! Revision 1.4 2003/07/22 01:55:21 haselbac
437 ! Added global%warnCounter
438 !
439 ! Revision 1.3 2003/04/10 23:29:20 fnajjar
440 ! Checking consistency of viscosity models
441 !
442 ! Revision 1.2 2003/03/31 16:10:55 haselbac
443 ! Cosmetics, added grid-motion type check
444 !
445 ! Revision 1.1 2003/01/28 15:53:31 haselbac
446 ! Initial revision, moved from rocflu
447 !
448 ! Revision 1.7 2003/01/08 21:08:31 haselbac
449 ! Fixed problems with double slashes in ifdefs (Absoft 8.0)
450 !
451 ! Revision 1.6 2002/12/20 23:19:22 haselbac
452 ! Fixed output bug: increased indentation
453 !
454 ! Revision 1.5 2002/10/27 19:11:27 haselbac
455 ! Added check for GENX calculations
456 !
457 ! Revision 1.4 2002/09/09 15:37:29 haselbac
458 ! Cleaned up routine and moved global under regions
459 !
460 ! Revision 1.3 2002/09/02 23:44:42 wasistho
461 ! Removed TURB compilation check
462 !
463 ! Revision 1.2 2002/08/24 03:18:35 wasistho
464 ! modify TURB error msg
465 !
466 ! Revision 1.1 2002/08/18 02:34:09 wasistho
467 ! Added to check TURB module activation and other input data
468 !
469 ! ******************************************************************************
470 
471 
472 
473 
474 
475 
476 
subroutine registerfunction(global, funName, fileName)
Definition: ModError.F90:449
subroutine rflu_checkuserinput(regions)
subroutine errorstop(global, errorCode, errorLine, addMessage)
Definition: ModError.F90:483
subroutine deregisterfunction(global)
Definition: ModError.F90:469