Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RFLO_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: regions = input parameters for all grid regions.
30 !
31 ! Output: none.
32 !
33 ! Notes: none.
34 !
35 !******************************************************************************
36 !
37 ! $Id: RFLO_CheckUserInput.F90,v 1.16 2008/12/06 08:44:26 mtcampbe Exp $
38 !
39 ! Copyright: (c) 2001 by the University of Illinois
40 !
41 !******************************************************************************
42 
43 SUBROUTINE rflo_checkuserinput( regions )
44 
45  USE moddatatypes
46  USE moddatastruct, ONLY : t_region
47  USE modglobal, ONLY : t_global
48  USE modmpi
49  USE moderror
50  USE modparameters
51  IMPLICIT NONE
52 
53 ! ... parameters
54  TYPE(t_region), POINTER :: regions(:)
55 
56 ! ... loop variables
57  INTEGER :: ireg
58 
59 ! ... local variables
60  INTEGER :: istop
61  INTEGER :: viscmodel
62  LOGICAL :: computetv
63 
64  TYPE(t_global), POINTER :: global
65 
66 !******************************************************************************
67 
68  global => regions(1)%global
69 
70  CALL registerfunction( global,'RFLO_CheckUserInput',&
71  'RFLO_CheckUserInput.F90' )
72 
73 ! fixed parameters check ------------------------------------------------------
74 
75 ! check consistency of mixture gradient and dv indices
76 
77  istop = 0
78 
79  IF (((dv_mixt_vvel - dv_mixt_uvel)/=1).OR. &
80  ((dv_mixt_wvel - dv_mixt_vvel)/=1).OR. &
81  ((dv_mixt_temp - dv_mixt_wvel)/=1)) istop = 1
82  IF (((gr_mixt_vx - gr_mixt_ux)/=1).OR.((gr_mixt_wx - gr_mixt_vx)/=1).OR. &
83  ((gr_mixt_tx - gr_mixt_wx)/=1).OR.((gr_mixt_uy - gr_mixt_tx)/=1).OR. &
84  ((gr_mixt_vy - gr_mixt_uy)/=1).OR.((gr_mixt_wy - gr_mixt_vy)/=1).OR. &
85  ((gr_mixt_ty - gr_mixt_wy)/=1).OR.((gr_mixt_uz - gr_mixt_ty)/=1).OR. &
86  ((gr_mixt_vz - gr_mixt_uz)/=1).OR.((gr_mixt_wz - gr_mixt_vz)/=1).OR. &
87  ((gr_mixt_tz - gr_mixt_wz)/=1) ) istop = 1
88 
89  IF (istop == 1) CALL errorstop( global,err_grad_index,__line__ )
90 
91 ! user input check ------------------------------------------------------------
92 
93 ! check mapping to processors
94 
95  IF (global%nRegionsProc < 0) THEN ! manual region to processor mapping
96  CALL errorstop( global,err_no_procmap,__line__ )
97  ELSE IF (global%nRegionsProc > 0) THEN ! number regions per processor given
98  IF (global%nProcAlloc*global%nRegionsProc /= global%nRegions) &
99  CALL errorstop( global,err_no_procmatch,__line__ )
100  ENDIF
101 
102 ! dual time-stepping
103 
104 #ifdef GENX
105  IF (global%flowType == flow_unsteady .AND. &
106  global%solverType == solv_implicit) THEN
107  IF (global%predictSol.eqv..true.) THEN
108  CALL errorstop( global,err_illegal_value,__line__, &
109  'for Rocstar, safer to use PREDICTSOL=0' )
110  ENDIF
111  ENDIF
112 #endif
113 
114 ! grid motion
115 
116  IF (global%moveGridScheme == movegrid_frame .OR. &
117  global%moveGridScheme == movegrid_foms) THEN
118  IF (global%nRegions < 8) THEN
119  CALL errorstop( global,err_illegal_value,__line__, &
120  'Selected grid motion type only applicable for cases with >= 8 regions' )
121  ENDIF
122  IF (global%moveGridNbour > (26 + (global%nRegions-8)*2)) THEN
123  CALL errorstop( global,err_illegal_value,__line__, &
124  'Maximum number of NEIGHBOR in type 2 grid motion is 26+2*(nReg-8)' )
125  ENDIF
126  IF (global%moveGridNbour < 2) THEN
127  CALL errorstop( global,err_illegal_value,__line__, &
128  'Minimum number of NEIGHBOR in type 2 grid motion is 2' )
129  ENDIF
130  IF (global%moveGridNsmatch < 2) THEN
131  CALL errorstop( global,err_illegal_value,__line__, &
132  'Minimum number NSURFMATCH in type 2 grid motion is 2' )
133  ENDIF
134  ENDIF
135 
136 ! random number generator
137 
138  IF ( global%randSeedType < rand_seed_type_fixed .OR. &
139  global%randSeedType > rand_seed_type_clock ) THEN
140  CALL errorstop(global,err_rand_seed_type_invalid,__line__)
141  END IF ! global%randSeedType
142 
143 ! aerodynamic coefficients
144 
145  IF ( global%aeroCoeffs==active .AND. global%nProbes==0) THEN
146  CALL errorstop(global,err_dependent_input,__line__, &
147  'activate Probe section (NUMBER>0) when AEROCOEFFS/=0 in Force section')
148  ENDIF
149 
150 ! region dependent ------------------------------------------------------------
151 
152  DO ireg=1,global%nRegions
153 
154 ! - check numeric
155 
156  IF (regions(ireg)%mixtInput%spaceDiscr/=discr_cen_scal .AND. &
157  regions(ireg)%mixtInput%spaceDiscr/= discr_upw_roe) THEN
158  CALL errorstop(global,err_unknown_option,__line__, &
159  'only central and Roe-upwind implemented')
160  ENDIF
161 
162  IF (regions(ireg)%mixtInput%spaceOrder < discr_order_1 .OR. &
163  regions(ireg)%mixtInput%spaceOrder > discr_order_2) THEN
164  CALL errorstop(global,err_unknown_option,__line__, &
165  'only 1st and 2nd order space discr. implemented')
166  ENDIF
167 
168 ! - check dummy cells
169 
170  IF (regions(ireg)%mixtInput%spaceOrder <= discr_order_2 .AND. &
171  regions(ireg)%nDumCells < 2) THEN ! <= 2nd-order
172  CALL errorstop( global,err_grid_dumcells,__line__, &
173  'number of dummy layers should be at least 2' )
174  ENDIF
175 
176 ! - check consistency of viscosity models
177 
178  computetv = regions(ireg)%mixtInput%computeTv
179  viscmodel = regions(ireg)%mixtInput%viscModel
180  IF ((computetv.eqv..true.) .AND. &
181  (viscmodel < visc_suthr .OR. viscmodel > visc_antib )) &
182  CALL errorstop( global,err_unknown_viscmodel,__line__ )
183 
184 ! - check consistency of gridmotion
185 
186  IF (regions(ireg)%mixtInput%moveGrid.eqv..true.) THEN
187  IF (mod( global%nRegions,global%nProcAlloc )/=0) THEN
188  CALL errorstop( global,err_no_procmatch,__line__, &
189  'Sorry, currently gridmotion only allows nRegs multiple of nProcs' )
190  ENDIF
191  ENDIF
192 
193 ! - check if mpi-tag-shifts are sufficiently large
194 
195  IF (regions(ireg)%localNumber > base_tag_shift) THEN
196  CALL errorstop( global,err_mpi_trouble,__line__, &
197  'increase TAG_SHIFTs parameters or reduce maximum nRegions/proc.' )
198  ENDIF
199  ENDDO
200 
201 ! tag shift of physical modules
202 
203  IF (base_tag_shift < 0 .OR. &
204  mod( peul_tag_shift,base_tag_shift ) /= 1 .OR. &
205  mod( turb_tag_shift,base_tag_shift ) /= 1 .OR. &
206  mod( radi_tag_shift,base_tag_shift ) /= 1 .OR. &
207  mod( plag_tag_shift,base_tag_shift ) /= 1) THEN
208  CALL errorstop( global,err_mpi_trouble,__line__, &
209  'TAG_SHIFTs should be n*BASE_TAG_SHIFT+1, n>0, BASE_TAG_SHIFT>0' )
210  ENDIF
211 
212 ! finalize
213 
214  CALL deregisterfunction( global )
215 
216 END SUBROUTINE rflo_checkuserinput
217 
218 !******************************************************************************
219 !
220 ! RCS Revision history:
221 !
222 ! $Log: RFLO_CheckUserInput.F90,v $
223 ! Revision 1.16 2008/12/06 08:44:26 mtcampbe
224 ! Updated license.
225 !
226 ! Revision 1.15 2008/11/19 22:17:37 mtcampbe
227 ! Added Illinois Open Source License/Copyright
228 !
229 ! Revision 1.14 2008/10/23 18:20:57 mtcampbe
230 ! Crazy number of changes to track and fix initialization and
231 ! restart bugs. Many improperly formed logical expressions
232 ! were fixed, and bug in allocation for data associated with
233 ! the BC_INFLOWVELTEMP boundary condition squashed in
234 ! RFLO_ReadBcInflowVelSection.F90.
235 !
236 ! Revision 1.13 2006/03/25 01:06:05 wasistho
237 ! changed errcode to ERR_DEPENDENT_INPUT
238 !
239 ! Revision 1.12 2006/03/25 01:02:04 wasistho
240 ! modified test to aeroCoeffs==ACTIVE
241 !
242 ! Revision 1.11 2006/03/24 23:31:48 wasistho
243 ! added consistency check between aeroCoeffs and probes
244 !
245 ! Revision 1.10 2005/12/01 17:12:49 fnajjar
246 ! Added check for randSeedType
247 !
248 ! Revision 1.9 2005/11/08 21:34:24 wasistho
249 ! forgot line continuation sign &
250 !
251 ! Revision 1.8 2005/11/08 21:32:13 wasistho
252 ! added check for movegrid_foms
253 !
254 ! Revision 1.7 2005/08/19 00:02:03 wasistho
255 ! made gridmotion max neighbour dependent on nReg
256 !
257 ! Revision 1.6 2005/08/18 19:48:52 wasistho
258 ! added check moveGridNsmatch
259 !
260 ! Revision 1.5 2005/06/25 03:57:10 wasistho
261 ! check nRegions multiple of nProcs for moving grid
262 !
263 ! Revision 1.4 2005/06/23 01:45:02 wasistho
264 ! added checks specific for type 2 grid motion
265 !
266 ! Revision 1.3 2005/06/20 16:55:42 wasistho
267 ! added check nprocs vs nregions for type 2 grid motion
268 !
269 ! Revision 1.2 2004/12/15 09:03:44 wasistho
270 ! added trap for predictsol (dual tst) within genx
271 !
272 ! Revision 1.1 2004/11/29 20:51:38 wasistho
273 ! lower to upper case
274 !
275 ! Revision 1.21 2004/10/01 18:08:18 wasistho
276 ! trapped unimplemented space discretization options
277 !
278 ! Revision 1.20 2004/04/08 03:16:42 wasistho
279 ! nDummyCells in Rocflo read from INITFLOW section
280 !
281 ! Revision 1.19 2004/03/06 02:34:06 wasistho
282 ! added PLAG tag shift
283 !
284 ! Revision 1.18 2004/03/05 22:09:02 jferry
285 ! created global variables for peul, plag, and inrt use
286 !
287 ! Revision 1.17 2004/03/05 21:09:03 wasistho
288 ! added check consistency of mpi-tag-shifts
289 !
290 ! Revision 1.16 2003/05/15 02:57:03 jblazek
291 ! Inlined index function.
292 !
293 ! Revision 1.15 2003/04/10 23:30:51 fnajjar
294 ! Checking consistency of viscosity models
295 !
296 ! Revision 1.14 2003/02/11 22:49:53 jferry
297 ! Re-worked BC and TBC input routines to add multi-physics capability
298 !
299 ! Revision 1.1 2003/02/11 22:30:21 jferry
300 ! Re-worked BC and TBC input routines to add multi-physics capability
301 !
302 ! Revision 1.13 2002/09/26 19:29:40 jferry
303 ! removed TBC check
304 !
305 ! Revision 1.11 2002/09/05 17:40:21 jblazek
306 ! Variable global moved into regions().
307 !
308 ! Revision 1.10 2002/09/02 23:35:22 wasistho
309 ! Add grad index check and removed TURB compilation check
310 !
311 ! Revision 1.9 2002/08/30 01:47:58 jblazek
312 ! Added support for moving grids.
313 !
314 ! Revision 1.8 2002/08/24 03:15:30 wasistho
315 ! modify TURB error msg
316 !
317 ! Revision 1.7 2002/08/18 02:30:47 wasistho
318 ! Added check TURB module activation
319 !
320 ! Revision 1.6 2002/03/18 23:11:33 jblazek
321 ! Finished multiblock and MPI.
322 !
323 ! Revision 1.5 2002/02/21 23:25:06 jblazek
324 ! Blocks renamed as regions.
325 !
326 ! Revision 1.4 2002/02/09 01:47:01 jblazek
327 ! Added multi-probe option, residual smoothing, physical time step.
328 !
329 ! Revision 1.3 2002/01/31 20:56:30 jblazek
330 ! Added basic boundary conditions.
331 !
332 ! Revision 1.2 2002/01/11 17:20:19 jblazek
333 ! Added time stamp or iteration number to file names.
334 !
335 ! Revision 1.1 2001/12/08 00:18:41 jblazek
336 ! Added routines to read BC input file.
337 !
338 !******************************************************************************
339 
340 
341 
342 
343 
344 
345 
subroutine registerfunction(global, funName, fileName)
Definition: ModError.F90:449
subroutine errorstop(global, errorCode, errorLine, addMessage)
Definition: ModError.F90:483
subroutine deregisterfunction(global)
Definition: ModError.F90:469
subroutine rflo_checkuserinput(regions)