Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RFLO_DerivedInputValues.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: set values derived from user input.
26 !
27 ! Description: none.
28 !
29 ! Input: regions = input parameters for all regions.
30 !
31 ! Output: regions = numerical parameters and no. of equations for each region.
32 !
33 ! Notes: dimensions of work arrays are also set here (for the mixture).
34 !
35 !******************************************************************************
36 !
37 ! $Id: RFLO_DerivedInputValues.F90,v 1.8 2008/12/06 08:44:06 mtcampbe Exp $
38 !
39 ! Copyright: (c) 2001 by the University of Illinois
40 !
41 !******************************************************************************
42 
43 SUBROUTINE rflo_derivedinputvalues( regions )
44 
45  USE moddatatypes
46  USE modbndpatch, ONLY : t_patch
47  USE moddatastruct, ONLY : t_region
48  USE modglobal, ONLY : t_global
49  USE modmixture, ONLY : t_mixt_input
51  USE moderror
52  USE modparameters
53  IMPLICIT NONE
54 
55 ! ... parameters
56  TYPE(t_region), POINTER :: regions(:)
57 
58 ! ... loop variables
59  INTEGER :: ireg, ilev
60 
61 ! ... local variables
62  INTEGER :: dim1d
63  LOGICAL :: somemoved
64 
65  TYPE(t_mixt_input), POINTER :: input
66  TYPE(t_global), POINTER :: global
67 
68 !******************************************************************************
69 
70  global => regions(1)%global
71 
72  CALL registerfunction( global,'RFLO_DerivedInputValues',&
73  'RFLO_DerivedInputValues.F90' )
74 
75 ! global values ---------------------------------------------------------------
76 
77  IF (global%refREnum > 0._rfreal) THEN
78  global%refVisc = global%refDensity*global%RefVelocity*global%refLength/ &
79  global%refREnum
80  ELSE
81  global%refVisc = 0._rfreal
82  ENDIF
83 
84 ! compute cell and face centers?
85 
86  somemoved = .false.
87  DO ireg=1,global%nRegions
88  IF (regions(ireg)%mixtInput%moveGrid .eqv. .true.) THEN
89  somemoved = .true.
90  EXIT
91  ENDIF
92  ENDDO
93 
94  IF ( (somemoved.eqv..true.) .AND. &
95  (global%moveGridScheme==movegrid_vms .OR. &
96  global%moveGridScheme==movegrid_foms)) THEN
97  global%calcCellCtr = .true.
98  global%calcFaceCtr = .true.
99  ENDIF
100 
101  IF (global%aeroCoeffs==active) THEN
102  global%calcFaceCtr = .true.
103  ENDIF
104 
105 ! region related data ---------------------------------------------------------
106 
107  DO ireg=1,global%nRegions
108 
109  input => regions(ireg)%mixtInput
110 
111 ! - number of dummy cells
112 
113  IF (input%spaceOrder > discr_order_2) THEN ! > 2nd-order
114  regions(ireg)%nDumCells = 3 ! (LES may add more)
115  ENDIF
116 
117 ! - determine if we need to compute transport variables
118 
119  input%computeTv = (input%flowModel == flow_navst)
120 
121 ! - mixture constants, no. of variables, indexing of Cp and Mol vectors
122 
123  DO ilev=1,regions(ireg)%nGridLevels
124  regions(ireg)%levels(ilev)%mixt%nDv = 6 ! dependent variables
125  IF (input%computeTv.eqv..true.) THEN
126  regions(ireg)%levels(ilev)%mixt%nTv = 2 ! transport variables
127  ELSE
128  regions(ireg)%levels(ilev)%mixt%nTv = 0 ! transport variables
129  ENDIF
130  regions(ireg)%levels(ilev)%mixt%nGv = 2 ! gas variables
131  IF (input%flowModel == flow_navst) THEN
132  regions(ireg)%levels(ilev)%mixt%nGrad = 12 ! gradients
133  ELSE
134  regions(ireg)%levels(ilev)%mixt%nGrad = 0 ! gradients
135  ENDIF
136  regions(ireg)%levels(ilev)%mixt%indCp = 0 ! pointer to Cp
137  regions(ireg)%levels(ilev)%mixt%indMol = 0 ! pointer to Mol
138 
139  regions(ireg)%levels(ilev)%mixt%prLam = global%prLam
140  regions(ireg)%levels(ilev)%mixt%prTurb = global%prTurb
141  regions(ireg)%levels(ilev)%mixt%scnLam = global%scnLam
142  regions(ireg)%levels(ilev)%mixt%scnTurb = global%scnTurb
143  ENDDO
144 
145  IF (input%refVisc < 0._rfreal) input%refVisc = global%refVisc
146 
147 ! - grid motion
148 
149  IF (.NOT. (input%moveGrid.eqv..true.)) THEN
150  global%moveGridScheme = movegrid_blocks
151  ENDIF
152 
153 ! - grid variables (grid speeds)
154 
155  DO ilev=1,regions(ireg)%nGridLevels
156  IF (input%moveGrid.eqv..true.) THEN
157  regions(ireg)%levels(ilev)%grid%indSvel = 1
158  ELSE
159  regions(ireg)%levels(ilev)%grid%indSvel = 0
160  ENDIF
161  ENDDO
162 
163 ! - time-stepping scheme
164 
165  IF (global%flowType == flow_steady) THEN ! steady flow
166  input%timeScheme = tst_hyb5rk
167  global%tstepOrder = 0
168  ELSE ! unsteady flow
169  IF (global%solverType == solv_explicit) THEN
170  input%timeScheme = tst_std4rk
171  global%tstepOrder = 4
172  ELSE
173  input%timeScheme = tst_hyb5rk
174  global%startLevel = 1 ! no FMG here
175  ENDIF
176  ENDIF
177 
178  CALL rflo_setmstagecoeffs( global,regions(ireg)%mixtInput,global%nrkSteps )
179 
180 ! - dimensions of work arrays
181 
182  dim1d = max(regions(ireg)%levels(1)%grid%ipc, &
183  regions(ireg)%levels(1)%grid%jpc, &
184  regions(ireg)%levels(1)%grid%kpc) + 6 ! 2*3 dummy cells
185  regions(ireg)%dimWork1D = dim1d*dim1d
186  regions(ireg)%dimWork2D(:) = 1
187 
188  ENDDO ! iReg
189 
190 ! finalize --------------------------------------------------------------------
191 
192  CALL deregisterfunction( global )
193 
194 END SUBROUTINE rflo_derivedinputvalues
195 
196 !******************************************************************************
197 !
198 ! RCS Revision history:
199 !
200 ! $Log: RFLO_DerivedInputValues.F90,v $
201 ! Revision 1.8 2008/12/06 08:44:06 mtcampbe
202 ! Updated license.
203 !
204 ! Revision 1.7 2008/11/19 22:17:20 mtcampbe
205 ! Added Illinois Open Source License/Copyright
206 !
207 ! Revision 1.6 2008/10/23 18:20:53 mtcampbe
208 ! Crazy number of changes to track and fix initialization and
209 ! restart bugs. Many improperly formed logical expressions
210 ! were fixed, and bug in allocation for data associated with
211 ! the BC_INFLOWVELTEMP boundary condition squashed in
212 ! RFLO_ReadBcInflowVelSection.F90.
213 !
214 ! Revision 1.5 2006/03/24 05:01:27 wasistho
215 ! calc faceCtr for active global%aeroCoeffs
216 !
217 ! Revision 1.4 2005/10/20 06:52:16 wasistho
218 ! assign value to calcFaceCtr
219 !
220 ! Revision 1.3 2005/10/17 22:33:40 wasistho
221 ! moved calcCellCtr test to from InitFlowSolver to DerivedInputValues
222 !
223 ! Revision 1.2 2005/06/26 08:42:50 wasistho
224 ! set moveGridScheme to type 0 if no grid motion
225 !
226 ! Revision 1.1 2004/11/29 21:25:16 wasistho
227 ! lower to upper case
228 !
229 ! Revision 1.30 2004/11/17 16:12:34 haselbac
230 ! Added global pointer to RFLO_SetMStageCoeffs interface
231 !
232 ! Revision 1.29 2004/04/08 03:15:57 wasistho
233 ! nDummyCells in Rocflo read from INITFLOW section
234 !
235 ! Revision 1.28 2004/03/05 22:08:59 jferry
236 ! created global variables for peul, plag, and inrt use
237 !
238 ! Revision 1.27 2004/03/03 23:55:38 jferry
239 ! Allowed particles to be run with Euler case
240 !
241 ! Revision 1.26 2003/11/20 16:40:34 mdbrandy
242 ! Backing out RocfluidMP changes from 11-17-03
243 !
244 ! Revision 1.23 2003/07/03 21:48:44 jblazek
245 ! Implemented dual-time stepping.
246 !
247 ! Revision 1.22 2003/05/20 22:16:16 jblazek
248 ! Corrected bug in viscosity model input.
249 !
250 ! Revision 1.21 2003/05/20 21:13:20 jblazek
251 ! Reworked RK coefficients.
252 !
253 ! Revision 1.20 2003/05/15 02:57:01 jblazek
254 ! Inlined index function.
255 !
256 ! Revision 1.19 2002/09/27 00:57:09 jblazek
257 ! Changed makefiles - no makelinks needed.
258 !
259 ! Revision 1.18 2002/09/20 22:22:35 jblazek
260 ! Finalized integration into GenX.
261 !
262 ! Revision 1.17 2002/09/05 17:40:19 jblazek
263 ! Variable global moved into regions().
264 !
265 ! Revision 1.16 2002/08/30 19:08:58 jblazek
266 ! Dimensions of work arrays now set in derivedInputValues.
267 !
268 ! Revision 1.15 2002/08/29 23:37:52 jblazek
269 ! Changed name of index pointer for grid speeds. Set nTv=2 for N.-S. equs.
270 !
271 ! Revision 1.14 2002/08/21 22:47:49 wasistho
272 ! Set nTv = 4 if turbulence is active
273 !
274 ! Revision 1.13 2002/06/30 00:02:50 jblazek
275 ! Set nTv=2 for viscous flows.
276 !
277 ! Revision 1.12 2002/05/21 01:50:16 wasistho
278 ! add viscous terms
279 !
280 ! Revision 1.11 2002/03/30 00:50:48 jblazek
281 ! Cleaned up with flint.
282 !
283 ! Revision 1.10 2002/03/18 21:56:39 jblazek
284 ! Finished multiblock and MPI.
285 !
286 ! Revision 1.9 2002/02/27 18:38:19 jblazek
287 ! Changed extrapol. to dummy cells at injection boundaries and slip walls.
288 !
289 ! Revision 1.8 2002/02/25 22:36:52 jblazek
290 ! Simplified solver initialization routine.
291 !
292 ! Revision 1.7 2002/02/21 23:25:04 jblazek
293 ! Blocks renamed as regions.
294 !
295 ! Revision 1.6 2002/02/06 00:15:39 jblazek
296 ! Improved injection BC. Added pointers to gradients.
297 !
298 ! Revision 1.5 2002/02/04 15:30:25 jblazek
299 ! Added injection boundary condition.
300 !
301 ! Revision 1.4 2002/02/01 00:00:24 jblazek
302 ! Edge and corner cells defined for each level.
303 !
304 ! Revision 1.3 2002/01/31 20:56:30 jblazek
305 ! Added basic boundary conditions.
306 !
307 ! Revision 1.2 2002/01/28 23:55:22 jblazek
308 ! Added flux computation (central scheme).
309 !
310 ! Revision 1.1 2002/01/12 00:02:48 jblazek
311 ! Added postprocessor.
312 !
313 !******************************************************************************
314 
315 
316 
317 
318 
319 
320 
Vector_n max(const Array_n_const &v1, const Array_n_const &v2)
Definition: Vector_n.h:354
subroutine registerfunction(global, funName, fileName)
Definition: ModError.F90:449
subroutine rflo_setmstagecoeffs(global, input, nrkSteps)
subroutine input(X, NNODE, NDC, NCELL, NFCE, NBPTS, NBFACE, ITYP, NPROP, XBNDY, XFAR, YFAR, ZFAR)
subroutine rflo_derivedinputvalues(regions)
subroutine deregisterfunction(global)
Definition: ModError.F90:469