Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ModTurbulence.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: define data types related to turbulence model.
26 !
27 ! Description: -distinction is made between LES, RaNS/DES specific, or
28 ! common LES and RaNS/DES input and data
29 ! -in RaNS/DES equations are solved for turbulence quantities
30 ! -in LES subgrid viscous terms are computed according to
31 ! selected SGS model
32 !
33 ! Notes: leswv: LES work variables
34 ! altwv: altered wv: allocated/used differently in LES, RaNS regions
35 ! comwv: common wv for LES and RaNS
36 ! altv : altered permanent variables: allocated/used differently
37 ! comv : common permanent variables for LES and RaNS
38 !
39 !******************************************************************************
40 !
41 ! $Id: ModTurbulence.F90,v 1.29 2008/12/06 08:44:19 mtcampbe Exp $
42 !
43 ! Copyright: (c) 2001 by the University of Illinois
44 !
45 !******************************************************************************
46 
48 
49  USE moddatatypes
50  IMPLICIT NONE
51 
52 ! input -----------------------------------------------------------------------
53 
55 
56 ! - general input
57 
58  INTEGER :: modelClass ! class of model, LES or RANS
59  INTEGER :: nOutField ! number of solution fields output
60  INTEGER :: nZof ! number zero-one switch fields
61 
62 ! - RaNS/DES input
63 
64  INTEGER :: nTurbEqs ! number of turb.equations
65  INTEGER :: wDistMethod ! wall dist.: 0 direct, 1 hierarchical
66  INTEGER :: functV1 ! visc.function, SA: 0 pow3(std), 1 pow2
67  INTEGER :: spaceDiscr ! spatial discretization type
68  INTEGER :: spaceOrder ! spatial discretization order
69  REAL(RFREAL) :: vis2 ! 2nd order dissipation coefficient
70  REAL(RFREAL) :: vis4 ! 4th order dissipation coefficient
71  REAL(RFREAL) :: smoocf ! residual smoothing coefficient
72  REAL(RFREAL) :: cDes ! DES lengthscale coefficient
73  REAL(RFREAL), POINTER :: const(:) ! RaNS model constants
74 
75 ! - LES input
76 
77  REAL(RFREAL) :: cSmag ! Smagorinsky constant, typically 0.1-0.2
78  REAL(RFREAL) :: xyzSmag(3) ! tripping location of fixed Smagorinsky
79  REAL(RFREAL) :: wallRough ! max. wall roughness size in curr. region
80 
81  REAL(RFREAL) :: delFac2 ! filter width scaling factor
82  INTEGER :: filterType ! filter type, uniform or non-uniform
83  INTEGER :: deltaType ! model length scale formula, sqrt or cbrt
84  INTEGER :: filterWidth(3) ! base filter width, 0,1, or 2 grd-spacing
85  INTEGER :: homDir(3) ! identifier if i,j, or k dir. homogeneous
86 
87  INTEGER :: engModel ! switch for subgrid energy models
88  INTEGER :: calcVort ! compute vortic.0=no 1=per-fdt 2=per-sdt
89  INTEGER :: nCv,nDv,nSv,nGrad ! number of cv, dv, sv and gradients
90  INTEGER :: nSt,nFixSt ! number of st and permanent turb.nstats
91  INTEGER :: wallModel ! most general WLM in current region
92  INTEGER :: wlmRefPoint ! WLM reference point above the wall
93 
94 ! - POST input
95 
96  INTEGER :: nPostv ! number of postprocessed variables
97  END TYPE t_turb_input
98 
99 ! data ------------------------------------------------------------------------
100 
101  TYPE t_turb
102 
103 ! - RaNS/DES data
104 
105  REAL(RFREAL), POINTER :: cv(:,:), cvOld(:,:)
106  REAL(RFREAL), POINTER :: rhs(:,:), rhsSum(:,:), diss(:,:), dsterm(:,:)
107  REAL(RFREAL), POINTER :: lens(:)
108 #ifdef RFLO
109  REAL(RFREAL), POINTER :: srad(:,:), epsIrs(:,:)
110 #endif
111  REAL(RFREAL), POINTER :: tv(:,:) ! ranswv
112 
113 ! - additional Rans/DES data with dual-timestepping
114  REAL(RFREAL), POINTER :: cvn(:,:), cvn1(:,:), cvn2(:,:), sDual(:,:)
115 
116 ! - LES data
117 
118 #ifdef RFLO
119  REAL(RFREAL), POINTER :: ccCofi1(:,:) ,ccCofi2(:,:) ,ccCofi4(:,:)
120  REAL(RFREAL), POINTER :: ccCofj1(:,:) ,ccCofj2(:,:) ,ccCofj4(:,:)
121  REAL(RFREAL), POINTER :: ccCofk1(:,:) ,ccCofk2(:,:) ,ccCofk4(:,:)
122  REAL(RFREAL), POINTER :: ffCofi1I(:,:),ffCofi2I(:,:),ffCofi4I(:,:)
123  REAL(RFREAL), POINTER :: ffCofi1J(:,:),ffCofi2J(:,:),ffCofi4J(:,:)
124  REAL(RFREAL), POINTER :: ffCofi1K(:,:),ffCofi2K(:,:),ffCofi4K(:,:)
125  REAL(RFREAL), POINTER :: ffCofj1I(:,:),ffCofj2I(:,:),ffCofj4I(:,:)
126  REAL(RFREAL), POINTER :: ffCofj1J(:,:),ffCofj2J(:,:),ffCofj4J(:,:)
127  REAL(RFREAL), POINTER :: ffCofj1K(:,:),ffCofj2K(:,:),ffCofj4K(:,:)
128  REAL(RFREAL), POINTER :: ffCofk1I(:,:),ffCofk2I(:,:),ffCofk4I(:,:)
129  REAL(RFREAL), POINTER :: ffCofk1J(:,:),ffCofk2J(:,:),ffCofk4J(:,:)
130  REAL(RFREAL), POINTER :: ffCofk1K(:,:),ffCofk2K(:,:),ffCofk4K(:,:)
131  REAL(RFREAL), POINTER :: fvolI(:) ,fvolJ(:) ,fvolK(:)
132  REAL(RFREAL), POINTER :: fISij(:,:),fJSij(:,:),fKSij(:,:) !leswv
133 #endif
134 #ifdef RFLU
135  REAL(RFREAL), POINTER :: avgCoI(:,:), bAvgCoI(:,:)
136  REAL(RFREAL), POINTER :: ccCofi1(:,:) ,ccCofi2(:,:) ,ccCofi4(:,:)
137  REAL(RFREAL), POINTER :: ffCofi1I(:,:),ffCofi2I(:,:),ffCofi4I(:,:)
138  REAL(RFREAL), POINTER :: bffCofi1I(:,:),bffCofi2I(:,:),bffCofi4I(:,:)
139  REAL(RFREAL), POINTER :: fvolI(:) ,bfVolI(:)
140  REAL(RFREAL), POINTER :: fISij(:,:),bfISij(:,:) !leswv
141 #endif
142  REAL(RFREAL), POINTER :: lij(:,:),mij(:,:) !leswv
143  REAL(RFREAL), POINTER :: fVar(:,:),ffVar(:,:),ccVar(:,:) !leswv
144  REAL(RFREAL), POINTER :: trace(:),coef(:,:),mueT(:,:) !leswv
145 #ifdef RFLU
146  REAL(RFREAL), POINTER :: bLij(:,:),bMij(:,:) !leswv
147  REAL(RFREAL), POINTER :: bfVar(:,:),bffVar(:,:) !leswv
148  REAL(RFREAL), POINTER :: bCoef(:,:),bMueT(:,:) !leswv
149 #endif
150 
151 ! - common LES and RaNS/DES data
152 
153 #ifdef RFLO
154  REAL(RFREAL), POINTER :: gradi(:,:),gradj(:,:),gradk(:,:) !altwv
155  REAL(RFREAL), POINTER :: mISij(:,:),mJSij(:,:),mKSij(:,:) !comwv
156  REAL(RFREAL), POINTER :: workI(:,:),workJ(:,:),workK(:,:) !comwv
157 #endif
158 #ifdef RFLU
159  REAL(RFREAL), POINTER :: gradi(:,:,:),bGradi(:,:,:) !altwv
160  REAL(RFREAL), POINTER :: mISij(:,:),bmISij(:,:) !comwv
161 #endif
162  REAL(RFREAL), POINTER :: dv(:,:) !altv
163  REAL(RFREAL), POINTER :: sv(:,:),vort(:,:) !comv
164 #ifdef RFLO
165  REAL(RFREAL), POINTER :: zofi(:,:,:),zofj(:,:,:),zofk(:,:,:) !comwv
166 #endif
167 #ifdef RFLU
168  REAL(RFREAL), POINTER :: zofi(:,:,:),bZofi(:,:,:) !comwv
169 #endif
170 
171 ! - statistics data
172 
173 #ifdef STATS
174  REAL(RFREAL), POINTER :: tav(:,:),st(:,:) !comv
175  REAL(RFREAL), POINTER :: stwork(:,:) !wv
176 #endif
177 
178 ! - postprocessing data
179 
180  REAL(RFREAL), POINTER :: postv(:,:), postvVert(:,:) !comv
181 #ifdef STATS
182  REAL(RFREAL), POINTER :: tavVert(:,:) !comv
183 #endif
184 
185 ! - in summary, RFLU boundary data:
186 ! bAvgCoI, bfVolI, bGradi (allocMemory)
187 ! bMuet, bfISij, bmISij (coViscFluxesFlu)
188 ! bLij, bMij, bfVar, bffVar, bCoef (lesCalcEddyVis)
189 
190  END TYPE t_turb
191 
192 END MODULE modturbulence
193 
194 !******************************************************************************
195 !
196 ! RCS Revision history:
197 !
198 ! $Log: ModTurbulence.F90,v $
199 ! Revision 1.29 2008/12/06 08:44:19 mtcampbe
200 ! Updated license.
201 !
202 ! Revision 1.28 2008/11/19 22:17:30 mtcampbe
203 ! Added Illinois Open Source License/Copyright
204 !
205 ! Revision 1.27 2006/01/12 09:42:19 wasistho
206 ! added post proc variables
207 !
208 ! Revision 1.26 2004/12/09 22:16:06 wasistho
209 ! added data structures
210 !
211 ! Revision 1.25 2004/10/22 23:14:25 wasistho
212 ! added work variable for statistics
213 !
214 ! Revision 1.24 2004/08/04 02:48:51 wasistho
215 ! removed turb%avgCoI,J,K as it is defined as grid%c2fCoI,J,K
216 !
217 ! Revision 1.23 2004/05/28 02:02:23 wasistho
218 ! update unstructured grid LES
219 !
220 ! Revision 1.22 2004/03/25 04:40:03 wasistho
221 ! added boundary data needed for RFLU
222 !
223 ! Revision 1.21 2004/03/19 02:41:12 wasistho
224 ! prepared for RFLU
225 !
226 ! Revision 1.20 2004/03/13 03:06:18 wasistho
227 ! prepared for RFLU
228 !
229 ! Revision 1.19 2004/02/26 21:15:24 wasistho
230 ! delete esg1Sum
231 !
232 ! Revision 1.18 2004/02/19 04:02:42 wasistho
233 ! added new rans/SA parameter VISCFUNCTION
234 !
235 ! Revision 1.17 2004/02/14 03:42:06 wasistho
236 ! added new WLM parameter: reference point
237 !
238 ! Revision 1.16 2004/02/11 03:23:31 wasistho
239 ! added feature: variable number of turbulence output fields
240 !
241 ! Revision 1.15 2003/10/26 00:07:44 wasistho
242 ! added multiple discr.types and order
243 !
244 ! Revision 1.14 2003/10/21 20:32:55 wasistho
245 ! added dt relaxation in steady flow due to RANS source term
246 !
247 ! Revision 1.13 2003/10/15 03:40:33 wasistho
248 ! added 2nd order dissipation coeff. k2
249 !
250 ! Revision 1.12 2003/10/09 20:49:20 wasistho
251 ! added DES lengthscale coefficient CDES
252 !
253 ! Revision 1.11 2003/10/03 20:14:29 wasistho
254 ! initial installation of turbModel SA and DES
255 !
256 ! Revision 1.10 2003/08/09 02:21:13 wasistho
257 ! restore version 1.8
258 !
259 ! Revision 1.9 2003/08/08 02:57:31 wasistho
260 ! added Genx buffers
261 !
262 ! Revision 1.8 2003/08/06 15:51:15 wasistho
263 ! added vorticities computation
264 !
265 ! Revision 1.7 2003/08/01 22:12:56 wasistho
266 ! changed soluFile to calcVort
267 !
268 ! Revision 1.6 2003/07/22 02:55:07 wasistho
269 ! prepare accurate rocturb restart
270 !
271 ! Revision 1.5 2003/05/31 01:40:21 wasistho
272 ! installed wall layer model
273 !
274 ! Revision 1.4 2003/05/24 02:06:34 wasistho
275 ! turbulence statistics expanded
276 !
277 ! Revision 1.3 2002/11/02 01:54:45 wasistho
278 ! Added TURB statistics
279 !
280 ! Revision 1.2 2002/10/14 23:51:12 wasistho
281 ! Install Rocturb
282 !
283 ! Revision 1.1.1.1 2001/12/03 21:44:05 jblazek
284 ! Import of RocfluidMP
285 !
286 !******************************************************************************
287 
288 
289 
290 
291 
292