Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TURB_LesCoefDynMixd.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: Obtain model coefficient for dynamic mixed model.
26 !
27 ! Description: none.
28 !
29 ! Input: region = data of current region
30 ! ibn,ien = begin and end node index
31 ! ijk = ijk-face is being treated
32 !
33 ! Output: cModel = turb%coef = model coefficient
34 !
35 ! Notes: none.
36 !
37 !******************************************************************************
38 !
39 ! $Id: TURB_LesCoefDynMixd.F90,v 1.7 2008/12/06 08:44:41 mtcampbe Exp $
40 !
41 ! Copyright: (c) 2001 by the University of Illinois
42 !
43 !******************************************************************************
44 
45 SUBROUTINE turb_lescoefdynmixd( region,ibn,ien,ijk )
46 
47  USE moddatatypes
48  USE moddatastruct, ONLY : t_region
49  USE modturbulence, ONLY : t_turb
50  USE modglobal, ONLY : t_global
51 #ifdef RFLU
52  USE modbndpatch, ONLY : t_patch
55 #endif
56 #ifdef RFLO
58 #endif
61  USE moderror
62  USE modparameters
64  IMPLICIT NONE
65 
66 ! ... parameters
67 #ifdef RFLO
68  TYPE(t_region), TARGET :: region
69 #endif
70 #ifdef RFLU
71  TYPE(t_region), POINTER :: region
72 #endif
73  INTEGER :: ibn,ien,ijk
74 
75 ! ... loop variables
76  INTEGER :: ipatch
77 
78 ! ... local variables
79  CHARACTER(CHRLEN) :: rcsidentstring
80  TYPE(t_global), POINTER :: global
81  TYPE(t_turb), POINTER :: turb
82 #ifdef RFLU
83  TYPE(t_patch), POINTER :: patch
84 #endif
85 
86  REAL(RFREAL), POINTER :: lij(:,:)
87  INTEGER :: tndel(diri:dirk), errorflag
88 #ifdef RFLO
89  INTEGER :: ilev, filtertype
90 #endif
91 #ifdef RFLU
92  INTEGER :: npatches, nbfaces
93  REAL(RFREAL), POINTER :: blij(:,:)
94 #endif
95 
96 !******************************************************************************
97 
98  rcsidentstring = '$RCSfile: TURB_LesCoefDynMixd.F90,v $'
99 
100  global => region%global
101  CALL registerfunction( global,'Turb_LesCoefDynMixd',&
102  'TURB_LesCoefDynMixd.F90' )
103 
104 ! get some parameters --------------------------------------------------------
105 
106 #ifdef RFLO
107  ilev = region%currLevel
108  filtertype = region%turbInput%filterType
109  turb => region%levels(ilev)%turb
110 #endif
111 #ifdef RFLU
112  npatches = region%grid%nPatches
113  nbfaces = 0
114 
115  DO ipatch = 1,npatches
116  patch => region%patches(ipatch)
117  nbfaces = nbfaces + patch%nBTris + patch%nBQuads
118  END DO ! iPatch
119  turb => region%turb
120 #endif
121 
122 ! settle the filter-width for the test-filter
123 
124  tndel(diri) = 2*region%turbInput%filterWidth(diri)
125 #ifdef RFLO
126  tndel(dirj) = 2*region%turbInput%filterWidth(dirj)
127  tndel(dirk) = 2*region%turbInput%filterWidth(dirk)
128 #endif
129 #ifdef RFLU
130  tndel(dirj) = 0._rfreal
131  tndel(dirk) = 0._rfreal
132 #endif
133 
134 ! first transfer rho and rho*ui from the centers to the faces since we
135 ! require the turbulent stress tensor in these points; store the results
136 ! in rhof, rhou1f, rhou2f and rhou3f; face-cv, fVar, is already allocated
137 
138 #ifdef RFLO
139  CALL turb_flolesgenc2f( region,ijk )
140 #endif
141 #ifdef RFLU
142  CALL turb_flulesc2f( region )
143 #endif
144 
145 ! allocate and point arrays required by LesLij (ffVar, lij), LesMij (ffVar),
146 ! lesHij (ffVar,lij) and by lesContract (lij)
147 
148  ALLOCATE( turb%ffVar(cv_turb_nelm,ibn:ien),stat=errorflag )
149  ALLOCATE( turb%lij(tensor_symm_nelm,ibn:ien),stat=errorflag )
150  ALLOCATE( turb%mij(tensor_symm_nelm,ibn:ien),stat=errorflag )
151  global%error = errorflag
152  IF (global%error /= 0) CALL errorstop( global,err_allocate,__line__ )
153 
154  lij => turb%lij
155 
156 #ifdef RFLU
157  ALLOCATE( turb%bffVar(cv_turb_nelm,nbfaces),stat=errorflag )
158  ALLOCATE( turb%bLij(tensor_symm_nelm,nbfaces),stat=errorflag )
159  ALLOCATE( turb%bMij(tensor_symm_nelm,nbfaces),stat=errorflag )
160  global%error = errorflag
161  IF (global%error /= 0) CALL errorstop( global,err_allocate,__line__ )
162 
163  blij => turb%bLij
164 #endif
165 
166 ! determine components of lij for which we use the routine TURB_LesLij
167 ! with test-filter instead of bar-filter
168 
169  CALL turb_leslij( region,ijk,tndel,lij )
170 #ifdef RFLU
171  CALL turb_flulesblij( region,tndel,blij )
172 #endif
173 
174 ! determine components of mij which we store in mij using rhof and rhoftb
175 ! already available from TURB_LesLij
176 
177  CALL turb_lesmij( region,ijk )
178 #ifdef RFLU
179  CALL turb_flulesbmij( region )
180 #endif
181 
182 ! adjust L_{ij} and subtract H_{ij} from it and store this in lij again
183 
184 #ifdef RFLO
185  CALL turb_leshij( region,ijk )
186  DEALLOCATE( turb%ffVar )
187 #endif
188 #ifdef RFLU
189  DEALLOCATE( turb%bffVar )
190 #endif
191 
192 ! contract lij and mij to obtain model-coefficient at cell faces
193 
194  CALL turb_lescontract( region,ijk )
195  DEALLOCATE( turb%lij,turb%mij )
196 #ifdef RFLU
197  DEALLOCATE( turb%bLij,turb%bMij )
198 #endif
199 
200 ! finalize --------------------------------------------------------------------
201 
202  CALL deregisterfunction( global )
203 
204 END SUBROUTINE turb_lescoefdynmixd
205 
206 !******************************************************************************
207 !
208 ! RCS Revision history:
209 !
210 ! $Log: TURB_LesCoefDynMixd.F90,v $
211 ! Revision 1.7 2008/12/06 08:44:41 mtcampbe
212 ! Updated license.
213 !
214 ! Revision 1.6 2008/11/19 22:17:54 mtcampbe
215 ! Added Illinois Open Source License/Copyright
216 !
217 ! Revision 1.5 2004/07/30 22:34:22 wasistho
218 ! replaced floLesUniC2F by floLesGenC2F
219 !
220 ! Revision 1.4 2004/05/28 02:00:50 wasistho
221 ! update unstructured grid LES
222 !
223 ! Revision 1.3 2004/03/19 02:49:12 wasistho
224 ! prepared for RFLU
225 !
226 ! Revision 1.2 2004/03/12 02:55:35 wasistho
227 ! changed rocturb routine names
228 !
229 ! Revision 1.1 2004/03/05 04:37:00 wasistho
230 ! changed nomenclature
231 !
232 ! Revision 1.3 2003/08/29 01:40:50 wasistho
233 ! Added TARGET attribute to region variable, since pointers are cached into it
234 !
235 ! Revision 1.2 2002/10/16 01:59:21 wasistho
236 ! Changed global%error flag
237 !
238 ! Revision 1.1 2002/10/14 23:55:29 wasistho
239 ! Install Rocturb
240 !
241 !
242 !******************************************************************************
243 
244 
245 
246 
247 
248 
249 
subroutine turb_flulesblij(region, nDel, lij)
subroutine turb_leshij(region, ijk)
Definition: TURB_LesHij.F90:48
subroutine registerfunction(global, funName, fileName)
Definition: ModError.F90:449
subroutine turb_flulesc2f(region)
subroutine turb_flulesbmij(region, ijk)
Definition: patch.h:74
subroutine turb_lescontract(region, ijk)
subroutine turb_lesmij(region, ijk)
Definition: TURB_LesMij.F90:52
subroutine errorstop(global, errorCode, errorLine, addMessage)
Definition: ModError.F90:483
subroutine turb_lescoefdynmixd(region, ibn, ien, ijk)
subroutine turb_leslij(region, ijk, nDel, lij)
Definition: TURB_LesLij.F90:57
subroutine deregisterfunction(global)
Definition: ModError.F90:469
subroutine turb_flolesgenc2f(region, ijk)