Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TURB_InitInputValues.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: Initialize input parameters for turbulence to default values.
26 !
27 ! Description: none.
28 !
29 ! Input: none.
30 !
31 ! Output: regions = initial input values.
32 !
33 ! Notes: none.
34 !
35 !******************************************************************************
36 !
37 ! $Id: TURB_InitInputValues.F90,v 1.15 2008/12/06 08:44:41 mtcampbe Exp $
38 !
39 ! Copyright: (c) 2001 by the University of Illinois
40 !
41 !******************************************************************************
42 
43 SUBROUTINE turb_initinputvalues( regions )
44 
45  USE moddatatypes
46  USE modbndpatch, ONLY : t_patch
47  USE moddatastruct, ONLY : t_region
48  USE modturbulence, ONLY : t_turb_input
49  USE modglobal, ONLY : t_global
50  USE moderror
51  USE modmpi
52  USE modparameters
54 #ifdef RFLU
55  USE modinterfaces, ONLY : rflu_creategrid
58 #endif
59  IMPLICIT NONE
60 
61 ! ... parameters
62  TYPE(t_region), POINTER :: regions(:)
63 
64 ! ... loop variables
65  INTEGER :: ipatch
66  INTEGER :: ireg
67 
68 ! ... local variables
69  CHARACTER(CHRLEN) :: rcsidentstring
70  TYPE(t_patch), POINTER :: patch1
71  TYPE(t_global), POINTER :: global
72  TYPE(t_turb_input), POINTER :: input
73 #ifdef RFLU
74  TYPE(t_region), POINTER :: pregion
75 #endif
76  INTEGER :: errorflag
77 
78 !******************************************************************************
79 
80  rcsidentstring = '$RCSfile: TURB_InitInputValues.F90,v $'
81 
82  global => regions(1)%global
83  CALL registerfunction( global,'TURB_InitInputValues',&
84  'TURB_InitInputValues.F90' )
85 
86  IF ( global%myProcid == masterproc .AND. &
87  global%verbLevel > verbose_none ) THEN
88  WRITE(stdout,'(A,1X,A)') solver_name,'Entering TURB_InitInputValues...'
89  END IF ! global%verbLevel
90 
91 ! global values ---------------------------------------------------------------
92 
93  global%turbActive = .false.
94  global%turbCalcWDist = .false.
95  global%turbWorkUnused = .true.
96  global%turbWallDim = 0
97  global%turbCalcWDistFreq = calcwdist_ini
98 
99 ! region related values -------------------------------------------------------
100 
101 #ifdef RFLO
102  DO ireg=1,global%nRegions
103 #endif
104 #ifdef RFLU
105 !$ Start Temporary Procedure
106  IF (global%moduleType == module_type_solver) THEN
107  DO ireg = lbound(regions,1),ubound(regions,1)
108  pregion => regions(ireg)
109  CALL rflu_readdimensions( pregion ) ! needed to get grid%nPatches
110  CALL rflu_creategrid( pregion ) ! needed to allocate patches
111  CALL rflu_readbcinputfilewrapper( pregion ) ! needed to get patch%bcType
112  ENDDO
113  ELSE
114  DO ireg = lbound(regions,1),ubound(regions,1)
115  regions(ireg)%grid%nPatches = 0
116  ENDDO
117  ENDIF ! moduleType
118 !$ End Temporary
119 
120  DO ireg = lbound(regions,1),ubound(regions,1)
121 #endif
122 
123  input => regions(ireg)%turbInput
124 
125 ! - general input parameters
126 
127  input%nOutField = 1
128  input%modelClass = model_none
129  input%nZof = 0
130 
131 ! - RaNS/DES input parameters
132 
133  input%wDistMethod = wdist_direct
134  input%cDes = 0.65_rfreal
135  input%smoocf = -1._rfreal
136  input%spaceDiscr = rans_discr_upw
137  input%vis2 = 0.50_rfreal
138  input%vis4 = 0._rfreal
139  input%spaceOrder = rans_discr_ord1
140  input%functV1 = sa_fv1_pow3
141 
142 ! - LES input parameters
143 
144  input%cSmag = 0.1_rfreal
145  input%xyzSmag(:) = -huge( 1.0_rfreal )
146  input%filterType = filtype_uniform
147  input%deltaType = deltype_cbrt
148  input%filterWidth(:) = filwidth_one
149  input%homDir(:) = off
150  input%engModel = active
151  input%calcVort = calcvort_no
152 
153 ! - wlm input parameters
154 
155  input%wallModel = wlm_model_nomodel ! These r initial single vals per
156  input%wlmRefPoint = 1 ! region, and copied to all patches
157  ! below. Later they are assigned
158  ! (TURB_CoWlmReadBcSectionFlo/Flu)
159  ! max. values over all patches and
160  ! presented in TURB_PrinUserInput
161 #ifdef RFLO
162  DO ipatch=1,regions(ireg)%nPatches
163 
164 ! --- only finest level defined yet
165 
166  patch1 => regions(ireg)%levels(1)%patches(ipatch)
167 
168  patch1%turb%nData = 0 ! used by TBC
169  patch1%turb%nSwitches = 0
170  patch1%turb%distrib = bcdat_constant
171 
172  patch1%valBola%bcSet = .false.
173 
174  IF ((patch1%bcType>=bc_noslipwall .AND. &
175  patch1%bcType<=bc_noslipwall+bc_range) .AND. & ! my boundary type,
176  regions(ireg)%procid==global%myProcid .AND. & ! region active and
177  regions(ireg)%active==active) THEN ! on my processor
178 #endif
179 #ifdef RFLU
180  DO ipatch=1,regions(ireg)%grid%nPatches ! to getrid of above RFLU calls
181  ! this should move to TURB_Read
182 ! --- defined in current level ! BcInputFile to be called from
183  ! RFLU_ReadBcInputFileWrapper.
184  patch1 => regions(ireg)%patches(ipatch) ! CheckParamInput for FLU patch
185  ! moves after TURB_ReadBcInputF
186 
187  patch1%turb%nData = 0 ! used by TBC
188  patch1%turb%nSwitches = 0 ! RFLU turb TBC is
189  patch1%turb%distrib = bcdat_constant ! cycled for now (RFLU_
190  ! AllocateMemoryTbc)
191  IF (patch1%bcType>=bc_noslipwall .AND. &
192  patch1%bcType<=bc_noslipwall+bc_range) THEN ! my boundary type
193 #endif
194 
195 ! ----- initiate parameters in all no-slip patches
196 
197  patch1%valBola%nData = 0
198  patch1%valBola%nSwitches = 0
199  patch1%valBola%distrib = bcdat_constant
200  patch1%valBola%nSwitches = patch1%valBola%nSwitches + wlm_nswitch
201 
202  ALLOCATE( patch1%valBola%switches(patch1%valBola%nSwitches), &
203  stat=errorflag )
204  global%error = errorflag
205  IF (global%error /= 0) CALL errorstop( global,err_allocate,__line__ )
206 
207 ! ----- initiate wlm switches in all no-slip patches
208 
209  patch1%valBola%switches(wlm_input_model) = input%wallModel
210  patch1%valBola%switches(wlm_input_refpoint) = input%wlmRefPoint
211 
212 ! ----- allocation and valuation of patch1%valBola%vals, which roughness data
213 ! is part of, starts in TURB_CoWlmReadBcSectionFlo/Flu
214 
215  ENDIF ! bcType
216  ENDDO ! iPatch
217  ENDDO ! iReg
218 
219 ! finalize --------------------------------------------------------------------
220 
221  IF ( global%myProcid == masterproc .AND. &
222  global%verbLevel > verbose_none ) THEN
223  WRITE(stdout,'(A,1X,A)') solver_name,'Leaving TURB_InitInputValues.'
224  END IF ! global%verbLevel
225 
226  CALL deregisterfunction( global )
227 
228 END SUBROUTINE turb_initinputvalues
229 
230 !******************************************************************************
231 !
232 ! RCS Revision history:
233 !
234 ! $Log: TURB_InitInputValues.F90,v $
235 ! Revision 1.15 2008/12/06 08:44:41 mtcampbe
236 ! Updated license.
237 !
238 ! Revision 1.14 2008/11/19 22:17:53 mtcampbe
239 ! Added Illinois Open Source License/Copyright
240 !
241 ! Revision 1.13 2006/08/19 15:40:35 mparmar
242 ! Renamed patch variables
243 !
244 ! Revision 1.12 2006/03/03 23:03:19 wasistho
245 ! added moduleType condition for Rocflu
246 !
247 ! Revision 1.11 2006/02/11 02:46:06 wasistho
248 ! early obtaining nPatches, patches and bcType from rocflu
249 !
250 ! Revision 1.10 2006/02/05 04:43:05 wasistho
251 ! skip loop over patches in Rocflu
252 !
253 ! Revision 1.9 2006/02/04 04:59:04 wasistho
254 ! added enter and leave statements
255 !
256 ! Revision 1.8 2006/01/12 09:48:01 wasistho
257 ! enabled tripping fixed Smagorinsky
258 !
259 ! Revision 1.7 2006/01/06 07:02:44 wasistho
260 ! set valturb%nData to 0
261 !
262 ! Revision 1.6 2005/01/12 01:13:23 wasistho
263 ! removed single quote signs since SUN has trouble with it
264 !
265 ! Revision 1.5 2004/04/20 20:45:57 wasistho
266 ! added user option for frequency of computing wall distance
267 !
268 ! Revision 1.4 2004/03/20 03:28:29 wasistho
269 ! prepared for RFLU
270 !
271 ! Revision 1.3 2004/03/19 02:47:08 wasistho
272 ! prepared for RFLU
273 !
274 ! Revision 1.2 2004/03/08 23:30:56 wasistho
275 ! changed turb nomenclature
276 !
277 ! Revision 1.1 2004/03/05 04:37:00 wasistho
278 ! changed nomenclature
279 !
280 ! Revision 1.12 2004/02/19 04:02:58 wasistho
281 ! added new rans/SA parameter VISCFUNCTION
282 !
283 ! Revision 1.11 2004/02/14 03:42:48 wasistho
284 ! added new WLM parameter: reference point
285 !
286 ! Revision 1.10 2004/02/11 03:24:20 wasistho
287 ! added feature: variable number of turbulence output fields
288 !
289 ! Revision 1.9 2003/10/26 00:10:44 wasistho
290 ! added multiple discr.types and order
291 !
292 ! Revision 1.8 2003/10/15 03:40:49 wasistho
293 ! added 2nd order dissipation coeff. k2
294 !
295 ! Revision 1.7 2003/10/09 20:48:53 wasistho
296 ! added DES lengthscale coefficient CDES
297 !
298 ! Revision 1.6 2003/10/07 02:05:49 wasistho
299 ! initial installation of RaNS-SA and DES
300 !
301 ! Revision 1.5 2003/08/02 00:19:13 wasistho
302 ! set initial calcVort to zero
303 !
304 ! Revision 1.4 2003/08/01 22:17:37 wasistho
305 ! prepared rocturb for Genx
306 !
307 ! Revision 1.3 2003/07/22 02:58:58 wasistho
308 ! prepare more accurate rocturb restart
309 !
310 ! Revision 1.2 2003/05/31 01:46:43 wasistho
311 ! installed turb. wall layer model
312 !
313 ! Revision 1.1 2002/10/14 23:55:29 wasistho
314 ! Install Rocturb
315 !
316 !
317 !******************************************************************************
318 
319 
320 
321 
322 
323 
324 
subroutine rflu_creategrid(pRegion)
subroutine registerfunction(global, funName, fileName)
Definition: ModError.F90:449
subroutine, public rflu_readbcinputfilewrapper(pRegion)
subroutine turb_initinputvalues(regions)
subroutine input(X, NNODE, NDC, NCELL, NFCE, NBPTS, NBFACE, ITYP, NPROP, XBNDY, XFAR, YFAR, ZFAR)
subroutine, public rflu_readdimensions(pRegion)
subroutine errorstop(global, errorCode, errorLine, addMessage)
Definition: ModError.F90:483
subroutine deregisterfunction(global)
Definition: ModError.F90:469