Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ReadNumericsSection.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 numerical procedure.
26 !
27 ! Description: none.
28 !
29 ! Input: user input file.
30 !
31 ! Output: regions = numerical switches and parameters.
32 !
33 ! Notes: none.
34 !
35 !******************************************************************************
36 !
37 ! $Id: ReadNumericsSection.F90,v 1.13 2008/12/06 08:44:09 mtcampbe Exp $
38 !
39 ! Copyright: (c) 2001 by the University of Illinois
40 !
41 !******************************************************************************
42 
43 SUBROUTINE readnumericssection( regions )
44 
45  USE moddatatypes
46  USE moddatastruct, ONLY : t_region
47  USE modglobal, ONLY : t_global
48 #ifdef RFLO
50 #endif
51 #ifdef RFLU
52  USE modinterfaces, ONLY : readsection
53 #endif
54  USE moderror
55  USE modparameters
56  IMPLICIT NONE
57 
58 ! ... parameters
59  TYPE(t_region), POINTER :: regions(:)
60 
61 ! ... local variables
62  INTEGER :: nvals
63 
64 #ifdef RFLO
65  INTEGER :: brbeg, brend
66  INTEGER, PARAMETER :: nvals_max = 11
67 #endif
68 #ifdef RFLU
69  INTEGER :: ireg
70  INTEGER, PARAMETER :: nvals_max = 16
71 #endif
72 
73  CHARACTER(10) :: keys(nvals_max)
74 
75  LOGICAL :: defined(nvals_max)
76 
77  REAL(RFREAL) :: vals(nvals_max)
78 
79  TYPE(t_global), POINTER :: global
80 
81 !******************************************************************************
82 
83  global => regions(1)%global
84 
85  CALL registerfunction( global,'ReadNumericsSection',&
86  'ReadNumericsSection.F90' )
87 
88 ! specify keywords and search for them
89 
90  nvals = nvals_max
91 
92 #ifdef RFLO
93  keys( 1) = 'CFL'
94  keys( 2) = 'SMOOCF'
95  keys( 3) = 'DISCR'
96  keys( 4) = 'ORDER'
97  keys( 5) = 'LIMFAC'
98  keys( 6) = 'ENTROPY'
99  keys( 7) = 'K2'
100  keys( 8) = '1/K4'
101  keys( 9) = 'PSWTYPE'
102  keys(10) = 'PSWOMEGA'
103  keys(11) = 'FEAVERAG'
104 
105  CALL readregionsection( global,if_input,nvals,keys(1:nvals),vals(1:nvals), &
106  brbeg,brend,defined(1:nvals) )
107 
108  IF (defined(3).eqv..true.) THEN
109  SELECT CASE(int(vals(3)+0.5_rfreal))
110  CASE (0)
111  regions(brbeg:brend)%mixtInput%spaceDiscr = discr_cen_scal
112  CASE (1)
113  regions(brbeg:brend)%mixtInput%spaceDiscr = discr_upw_roe
114  CASE (2)
115  regions(brbeg:brend)%mixtInput%spaceDiscr = discr_upw_maps
116  END SELECT
117  ENDIF
118  IF (defined(4).eqv..true.) THEN
119  SELECT CASE(int(vals(4)+0.5_rfreal))
120  CASE (1)
121  regions(brbeg:brend)%mixtInput%spaceOrder = discr_order_1
122  CASE (2)
123  regions(brbeg:brend)%mixtInput%spaceOrder = discr_order_2
124  CASE (4)
125  regions(brbeg:brend)%mixtInput%spaceOrder = discr_order_4
126  END SELECT
127  ENDIF
128  IF (defined(8).eqv..true.) THEN
129  IF (vals(8) > 1.e-10_rfreal) THEN
130  regions(brbeg:brend)%mixtInput%vis4 = 1._rfreal/vals(8)
131  ELSEIF (vals(8) > 0._rfreal .AND. vals(8) <= 1.e-10_rfreal) THEN
132  regions(brbeg:brend)%mixtInput%vis4 = 1.e+10_rfreal
133  ELSEIF (vals(8) <= 0._rfreal ) THEN
134  regions(brbeg:brend)%mixtInput%vis4 = 0.0_rfreal
135  ENDIF
136  ENDIF
137  IF (defined(9).eqv..true.) THEN
138  IF (vals(9) < 0.5_rfreal) THEN
139  regions(brbeg:brend)%mixtInput%pSwitchType = pswitch_std
140  ELSE
141  regions(brbeg:brend)%mixtInput%pSwitchType = pswitch_tvd
142  ENDIF
143  ENDIF
144  IF (defined( 1).eqv..true.) regions(brbeg:brend)%mixtInput%cfl = abs(vals(1))
145  IF (defined( 2).eqv..true.) regions(brbeg:brend)%mixtInput%smoocf = vals(2)
146  IF (defined( 5).eqv..true.) regions(brbeg:brend)%mixtInput%limfac = abs(vals(5))
147  IF (defined( 6).eqv..true.) regions(brbeg:brend)%mixtInput%epsentr = abs(vals(6))
148  IF (defined( 7).eqv..true.) regions(brbeg:brend)%mixtInput%vis2 = abs(vals(7))
149  IF (defined(10).eqv..true.) regions(brbeg:brend)%mixtInput%pSwitchOmega = abs(vals(10))
150  IF (defined(11).eqv..true.) THEN
151  IF (vals(11) < 0.5_rfreal) THEN
152  regions(brbeg:brend)%mixtInput%faceEdgeAvg = fe_avg_uniform
153  ELSE
154  regions(brbeg:brend)%mixtInput%faceEdgeAvg = fe_avg_linear
155  ENDIF
156  ENDIF
157 #endif
158 
159 #ifdef RFLU
160  keys( 1) = 'CFL'
161  keys( 2) = 'DISCR'
162  keys( 3) = 'ORDER'
163  keys( 4) = 'ENTROPY'
164  keys( 5) = 'DISSFACT'
165  keys( 6) = 'RECONST'
166  keys( 7) = 'DIMENS'
167  keys( 8) = 'CRECONSTC'
168  keys( 9) = 'CRECONSTF'
169  keys(10) = 'CRECONSTCW'
170  keys(11) = 'CRECONSTFW'
171  keys(12) = 'TOLERICT'
172  keys(13) = 'SDIMENSC'
173  keys(14) = 'SDIMENSF'
174  keys(15) = 'SDIMENSBF'
175  keys(16) = 'ORDERBF'
176 
177  CALL readsection( global,if_input,nvals,keys(1:nvals),vals(1:nvals), &
178  defined(1:nvals) )
179 
180  IF ( defined(1) .EQV. .true. ) THEN
181  DO ireg = lbound(regions,1),ubound(regions,1)
182  regions(ireg)%mixtInput%cfl = abs(vals(1))
183  END DO ! iReg
184  END IF ! defined
185 
186  IF ( defined(2) .EQV. .true. ) THEN
187  DO ireg = lbound(regions,1),ubound(regions,1)
188  regions(ireg)%mixtInput%spaceDiscr = nint(vals(2))
189  END DO ! iReg
190  END IF ! defined
191 
192  IF ( defined(3) .EQV. .true. ) THEN
193  DO ireg = lbound(regions,1),ubound(regions,1)
194  regions(ireg)%mixtInput%spaceOrder = nint(vals(3))
195  END DO ! iReg
196  END IF ! defined
197 
198  IF ( defined(4) .EQV. .true. ) THEN
199  DO ireg = lbound(regions,1),ubound(regions,1)
200  regions(ireg)%mixtInput%epsentr = abs(vals(4))
201  END DO ! iReg
202  END IF ! defined
203 
204  IF ( defined(5) .EQV. .true. ) THEN
205  DO ireg = lbound(regions,1),ubound(regions,1)
206  regions(ireg)%mixtInput%dissFact = abs(vals(5))
207  END DO ! iReg
208  END IF ! defined
209 
210  IF ( defined(6) .EQV. .true. ) THEN
211  DO ireg = lbound(regions,1),ubound(regions,1)
212  regions(ireg)%mixtInput%reconst = nint(vals(6))
213  END DO ! iReg
214  END IF ! defined
215 
216  IF ( defined(7) .EQV. .true. ) THEN
217  DO ireg = lbound(regions,1),ubound(regions,1)
218  regions(ireg)%mixtInput%dimens = nint(vals(7))
219  END DO ! iReg
220  END IF ! defined
221 
222  IF ( defined(8) .EQV. .true. ) THEN
223  DO ireg = lbound(regions,1),ubound(regions,1)
224  regions(ireg)%mixtInput%cReconstCells = nint(vals(8))
225  END DO ! iReg
226  END IF ! defined
227 
228  IF ( defined(9) .EQV. .true. ) THEN
229  DO ireg = lbound(regions,1),ubound(regions,1)
230  regions(ireg)%mixtInput%cReconstFaces = nint(vals(9))
231  END DO ! iReg
232  END IF ! defined
233 
234  IF ( defined(10) .EQV. .true. ) THEN
235  DO ireg = lbound(regions,1),ubound(regions,1)
236  regions(ireg)%mixtInput%cReconstCellsWeight = abs(vals(10))
237  END DO ! iReg
238  END IF ! defined
239 
240  IF ( defined(11) .EQV. .true. ) THEN
241  DO ireg = lbound(regions,1),ubound(regions,1)
242  regions(ireg)%mixtInput%cReconstFacesWeight = abs(vals(11))
243  END DO ! iReg
244  END IF ! defined
245 
246  IF ( defined(12) .EQV. .true. ) THEN
247  DO ireg = lbound(regions,1),ubound(regions,1)
248  regions(ireg)%mixtInput%tolerICT = abs(vals(12))
249  END DO ! iReg
250  END IF ! defined
251 
252  IF ( defined(13) .EQV. .true. ) THEN
253  DO ireg = lbound(regions,1),ubound(regions,1)
254  regions(ireg)%mixtInput%stencilDimensCells = abs(vals(13))
255  END DO ! iReg
256  END IF ! defined
257 
258  IF ( defined(14) .EQV. .true. ) THEN
259  DO ireg = lbound(regions,1),ubound(regions,1)
260  regions(ireg)%mixtInput%stencilDimensFaces = abs(vals(14))
261  END DO ! iReg
262  END IF ! defined
263 
264  IF ( defined(15) .EQV. .true. ) THEN
265  DO ireg = lbound(regions,1),ubound(regions,1)
266  regions(ireg)%mixtInput%stencilDimensBFaces = abs(vals(15))
267  END DO ! iReg
268  END IF ! defined
269 
270  IF ( defined(16) .EQV. .true. ) THEN
271  DO ireg = lbound(regions,1),ubound(regions,1)
272  regions(ireg)%mixtInput%spaceOrderBFaces = abs(vals(16))
273  END DO ! iReg
274  END IF ! defined
275 #endif
276 
277 ! finalize
278 
279  CALL deregisterfunction( global )
280 
281 END SUBROUTINE readnumericssection
282 
283 !******************************************************************************
284 !
285 ! RCS Revision history:
286 !
287 ! $Log: ReadNumericsSection.F90,v $
288 ! Revision 1.13 2008/12/06 08:44:09 mtcampbe
289 ! Updated license.
290 !
291 ! Revision 1.12 2008/11/19 22:17:23 mtcampbe
292 ! Added Illinois Open Source License/Copyright
293 !
294 ! Revision 1.11 2008/10/23 18:20:55 mtcampbe
295 ! Crazy number of changes to track and fix initialization and
296 ! restart bugs. Many improperly formed logical expressions
297 ! were fixed, and bug in allocation for data associated with
298 ! the BC_INFLOWVELTEMP boundary condition squashed in
299 ! RFLO_ReadBcInflowVelSection.F90.
300 !
301 ! Revision 1.10 2006/10/20 21:20:48 mparmar
302 ! Renamed keyword SORDERBF to ORDERBF
303 !
304 ! Revision 1.9 2006/08/19 15:38:29 mparmar
305 ! Added reading of mixtInput%spaceOrderBFaces
306 !
307 ! Revision 1.8 2006/04/07 14:37:44 haselbac
308 ! Added new stencilDimens parameters
309 !
310 ! Revision 1.7 2006/01/06 22:04:19 haselbac
311 ! Added SDIMENS
312 !
313 ! Revision 1.6 2005/12/25 15:20:21 haselbac
314 ! Added constrained reconstuction input variables, minor bug fixes (NINT instead of ABS)
315 !
316 ! Revision 1.5 2005/12/24 21:23:35 haselbac
317 ! Added reading of ICT tolerance
318 !
319 ! Revision 1.4 2005/10/27 18:53:24 haselbac
320 ! Added input parameter for constrained reconstruction
321 !
322 ! Revision 1.3 2005/07/11 19:22:20 mparmar
323 ! Added reading of RECONST keyword
324 !
325 ! Revision 1.2 2005/03/09 14:51:41 haselbac
326 ! Added DIMENS variable
327 !
328 ! Revision 1.1 2004/12/01 16:50:37 haselbac
329 ! Initial revision after changing case
330 !
331 ! Revision 1.19 2004/09/02 02:34:11 wasistho
332 ! added face-edge averaging input-option parameter in Rocflo
333 !
334 ! Revision 1.18 2004/07/08 02:18:37 haselbac
335 ! Added dissFact, cosmetics
336 !
337 ! Revision 1.17 2003/12/05 16:54:34 haselbac
338 ! Fixed bug in DO loop ranges
339 !
340 ! Revision 1.16 2003/11/20 16:40:35 mdbrandy
341 ! Backing out RocfluidMP changes from 11-17-03
342 !
343 ! Revision 1.13 2003/05/15 02:57:02 jblazek
344 ! Inlined index function.
345 !
346 ! Revision 1.12 2003/04/09 20:42:54 wasistho
347 ! enable k4 = 0.0
348 !
349 ! Revision 1.11 2002/09/09 14:03:46 haselbac
350 ! mixtInput now under regions
351 !
352 ! Revision 1.10 2002/09/05 17:40:20 jblazek
353 ! Variable global moved into regions().
354 !
355 ! Revision 1.9 2002/07/25 00:38:00 jblazek
356 ! Option for TVD type pressure switch.
357 !
358 ! Revision 1.8 2002/05/04 16:21:58 haselbac
359 ! Bug fix: spaceOrder was set twice
360 !
361 ! Revision 1.7 2002/03/26 19:06:47 haselbac
362 ! Added ROCFLU functionality
363 !
364 ! Revision 1.6 2002/02/27 18:38:19 jblazek
365 ! Changed extrapol. to dummy cells at injection boundaries and slip walls.
366 !
367 ! Revision 1.5 2002/02/21 23:25:05 jblazek
368 ! Blocks renamed as regions.
369 !
370 ! Revision 1.4 2002/01/28 23:55:22 jblazek
371 ! Added flux computation (central scheme).
372 !
373 ! Revision 1.3 2002/01/11 17:18:31 jblazek
374 ! Updated description of I/O variables.
375 !
376 ! Revision 1.2 2001/12/22 00:09:38 jblazek
377 ! Added routines to store grid and solution.
378 !
379 ! Revision 1.1 2001/12/07 16:54:31 jblazek
380 ! Added files to read user input.
381 !
382 !******************************************************************************
383 
384 
385 
386 
387 
388 
389 
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
subroutine readnumericssection(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 deregisterfunction(global)
Definition: ModError.F90:469