Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TURB_GetTvCell.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: Get turbulent variables mu_t, kapp_t and cdyn at cell centers.
26 !
27 ! Description: The cell values are obtained by averaging the face values.
28 ! Mu_t and kappa_t are defined at all cells, including dummmies.
29 ! Cdyn, stored in turb%dv, is available only at interior cells.
30 !
31 ! Input: region = data of current region
32 !
33 ! Output: mixt%tv(TV_MIXT_MUET:TV_MIXT_TCOT,:) at cell centers and
34 ! turb%dv(DV_TURB_CDYN,:) at interior cells.
35 !
36 ! Notes: Mu_t and kapp_t at dummy cells are obtained by extrapolation.
37 ! If needed they can be computed directly in routine LesCalcEddyVis.
38 !
39 !******************************************************************************
40 !
41 ! $Id: TURB_GetTvCell.F90,v 1.14 2008/12/06 08:44:41 mtcampbe Exp $
42 !
43 ! Copyright: (c) 2001 by the University of Illinois
44 !
45 !******************************************************************************
46 
47 SUBROUTINE turb_gettvcell( region )
48 
49  USE moddatatypes
50  USE moddatastruct, ONLY : t_region
51  USE modglobal, ONLY : t_global
52  USE moderror
53  USE modparameters
55 #ifdef RFLO
59 
60 #include "Indexing.h"
61 #endif
62  IMPLICIT NONE
63 
64 ! ... parameters
65  TYPE(t_region) :: region
66 
67 ! ... loop variables
68  INTEGER :: i, j, k, ic, ijkc, in, ijkn, ipatch, ift, ifl
69 
70 ! ... local variables
71  CHARACTER(CHRLEN) :: rcsidentstring
72  TYPE(t_global), POINTER :: global
73 
74  INTEGER :: indcp
75  REAL(RFREAL), POINTER :: muet(:,:),tv(:,:), gv(:,:), tdv(:,:)
76  REAL(RFREAL) :: rprt,cpprt
77 
78 #ifdef RFLO
79  INTEGER :: ipcbeg, ipcend, jpcbeg, jpcend, kpcbeg, kpcend
80  INTEGER :: idcbeg, idcend, jdcbeg, jdcend, kdcbeg, kdcend
81  INTEGER :: ilev,icoff,ijcoff,inoff,ijnoff,ijkni,ijknj,ijknk
82  REAL(RFREAL) :: one6th
83 #endif
84 #ifdef RFLU
85  INTEGER :: ifg, ifgbeg, ic0, ic1, ict, icl, nfacespercell
86  INTEGER, POINTER :: c2f(:,:,:)
87  REAL(RFREAL), POINTER :: bmuet(:,:)
88 #endif
89 
90 !******************************************************************************
91 
92  rcsidentstring = '$RCSfile: TURB_GetTvCell.F90,v $'
93 
94  global => region%global
95  CALL registerfunction( global,'Turb_GetTvCell',&
96  'TURB_GetTvCell.F90' )
97 
98 ! get parameters ----------------------------------------------------
99 
100 #ifdef RFLO
101  ilev = region%currLevel
102  one6th = 1._rfreal/6._rfreal
103  rprt = 1._rfreal/region%levels(ilev)%mixt%prTurb
104  indcp = region%levels(ilev)%mixt%indCp
105 
106 ! get dimensions and pointers
107 
108  CALL rflo_getdimensphys( region,ilev,ipcbeg,ipcend, &
109  jpcbeg,jpcend,kpcbeg,kpcend )
110  CALL rflo_getdimensdummy( region,ilev,idcbeg,idcend, &
111  jdcbeg,jdcend,kdcbeg,kdcend )
112  CALL rflo_getcelloffset( region,ilev,icoff,ijcoff )
113  CALL rflo_getnodeoffset( region,ilev,inoff,ijnoff )
114 
115  muet => region%levels(ilev)%turb%mueT
116  tv => region%levels(ilev)%mixt%tv
117  gv => region%levels(ilev)%mixt%gv
118  tdv => region%levels(ilev)%turb%dv
119 
120  DO k=kpcbeg-1,kpcend+1
121  DO j=jpcbeg-1,jpcend+1
122  DO i=ipcbeg-1,ipcend+1
123 
124  ijkc = indijk(i ,j ,k ,icoff,ijcoff)
125  ijkn = indijk(i ,j ,k ,inoff,ijnoff)
126  ijkni = ijkn + 1
127  ijknj = ijkn + inoff
128  ijknk = ijkn + ijnoff
129 
130 ! ----- summing muet from the six faces has to be done here
131 ! since not all LES models calls TURB_LesCalcEddyVis
132 
133  tv(tv_mixt_muet,ijkc) = muet(diri,ijkn)+muet(diri,ijkni) + &
134  muet(dirj,ijkn)+muet(dirj,ijknj) + &
135  muet(dirk,ijkn)+muet(dirk,ijknk)
136  tv(tv_mixt_muet,ijkc) = one6th*tv(tv_mixt_muet,ijkc)
137  tdv(dv_turb_cdyn,ijkc)= one6th*tdv(dv_turb_cdyn,ijkc)
138 
139  ENDDO ! i
140  ENDDO ! j
141  ENDDO ! k
142 #endif
143 #ifdef RFLU
144  rprt = 1._rfreal/region%mixtInput%prTurb
145  indcp = region%mixtInput%indCp
146  muet => region%turb%mueT
147  bmuet => region%turb%bMueT
148  tv => region%mixt%tv
149  gv => region%mixt%gv
150  tdv => region%turb%dv
151 
152 ! average muet at faces into cells
153 ! waiting for Andreas` routine for proper averaging
154 
155  tv(tv_mixt_muet,:) = 0._rfreal
156 
157  DO ift = 1,region%grid%nFaces
158  ic0 = region%grid%f2c(1,ift)
159  ic1 = region%grid%f2c(2,ift)
160  tv(tv_mixt_muet,ic0) = tv(tv_mixt_muet,ic0) + muet(diri,ift)
161  tv(tv_mixt_muet,ic1) = tv(tv_mixt_muet,ic1) + muet(diri,ift)
162  ENDDO ! ift
163 
164  DO ipatch = 1,region%grid%nPatches
165 ! TEMPORARY : removing usage of bf2bg from everywhere
166 ! ifgBeg = region%patches(iPatch)%bf2bg(BF2BG_BEG)
167  ifg = ifgbeg
168  DO ifl = 1,region%patches(ipatch)%nBFaces
169  ic0 = region%patches(ipatch)%bf2c(ifl)
170  tv(tv_mixt_muet,ic0) = tv(tv_mixt_muet,ic0) + bmuet(diri,ifg)
171  ifg = ifg + 1
172  ENDDO ! ifl
173  ENDDO ! iPatch
174 
175  DO ic = 1,region%grid%nCells
176  ict = region%grid%cellGlob2Loc(1,ic) ! cell type
177  icl = region%grid%cellGlob2Loc(2,ic) ! local (type) cell index
178  SELECT CASE ( ict )
179  CASE ( cell_type_tet )
180  nfacespercell = 4
181  c2f => region%grid%tet2f
182  CASE ( cell_type_hex )
183  nfacespercell = 6
184  c2f => region%grid%hex2f
185  CASE ( cell_type_pri )
186  nfacespercell = 5
187  c2f => region%grid%pri2f
188  CASE ( cell_type_pyr )
189  nfacespercell = 5
190  c2f => region%grid%pyr2f
191  CASE default
192  CALL errorstop(global,err_reached_default,__line__)
193  END SELECT ! ict
194 
195  tv( tv_mixt_muet,ic) = tv( tv_mixt_muet,ic)/nfacespercell
196  tdv(dv_turb_cdyn,ic) = tdv(dv_turb_cdyn,ic)/nfacespercell
197  ENDDO ! iC
198 #endif
199 
200 ! extrapolate to dummy faces at the six sides of region; simple extrapolation
201 ! provides the original face TV values (through two point averaging) needed in
202 ! the computation of viscous fluxes
203 
204 #ifdef RFLO
205 ! extrapolate solution to dummy cells
206 
207  CALL turb_floextrapolcellvec( region,tv_mixt_muet,tv_mixt_muet,tv )
208 #endif
209 
210 ! get turbulent thermal conductivity
211 
212 #ifdef RFLO
213  DO k=kdcbeg,kdcend
214  DO j=jdcbeg,jdcend
215  DO i=idcbeg,idcend
216 
217  ijkc = indijk(i ,j ,k ,icoff,ijcoff)
218 #endif
219 #ifdef RFLU
220  DO ic = 1,region%grid%nCells
221  ijkc = ic
222 #endif
223  tv(tv_mixt_muet,ijkc) = max( tv(tv_mixt_muet,ijkc), 0._rfreal )
224  cpprt = gv(gv_mixt_cp,ijkc*indcp)*rprt
225  tv(tv_mixt_tcot,ijkc) = cpprt*tv(tv_mixt_muet,ijkc)
226 #ifdef RFLO
227  ENDDO ! i
228  ENDDO ! j
229  ENDDO ! k
230 #endif
231 #ifdef RFLU
232  ENDDO ! iC
233 #endif
234 
235 ! finalize --------------------------------------------------------------------
236 
237  CALL deregisterfunction( global )
238 
239 END SUBROUTINE turb_gettvcell
240 
241 !******************************************************************************
242 !
243 ! RCS Revision history:
244 !
245 ! $Log: TURB_GetTvCell.F90,v $
246 ! Revision 1.14 2008/12/06 08:44:41 mtcampbe
247 ! Updated license.
248 !
249 ! Revision 1.13 2008/11/19 22:17:53 mtcampbe
250 ! Added Illinois Open Source License/Copyright
251 !
252 ! Revision 1.12 2006/08/19 15:40:57 mparmar
253 ! Removed bf2bg
254 !
255 ! Revision 1.11 2006/01/13 03:47:11 wasistho
256 ! initialize tv(muet,:) in Rocflu
257 !
258 ! Revision 1.10 2005/12/30 23:21:29 wasistho
259 ! bug fixed face indexing in patch
260 !
261 ! Revision 1.9 2005/01/12 01:12:59 wasistho
262 ! removed single quote signs since SUN has trouble with it
263 !
264 ! Revision 1.8 2004/05/28 02:00:31 wasistho
265 ! update unstructured grid LES
266 !
267 ! Revision 1.7 2004/05/18 03:15:29 wasistho
268 ! changed FloExtrapIntCellVec to FloExtrapolCellVec
269 !
270 ! Revision 1.6 2004/05/17 20:47:48 wasistho
271 ! compute first layer dummy mu_t instead of extrapolated
272 !
273 ! Revision 1.5 2004/03/27 02:16:42 wasistho
274 ! compiled with Rocflu
275 !
276 ! Revision 1.4 2004/03/24 03:37:02 wasistho
277 ! prepared for RFLU
278 !
279 ! Revision 1.3 2004/03/19 02:46:57 wasistho
280 ! prepared for RFLU
281 !
282 ! Revision 1.2 2004/03/12 02:55:35 wasistho
283 ! changed rocturb routine names
284 !
285 ! Revision 1.1 2004/03/05 04:37:00 wasistho
286 ! changed nomenclature
287 !
288 ! Revision 1.4 2004/02/18 02:23:11 wasistho
289 ! used extrapolation routine to fill in dummy mut and klipped it
290 !
291 ! Revision 1.3 2003/10/09 23:07:17 wasistho
292 ! renamed CalcEddyVis to LesCalcEddyVis
293 !
294 ! Revision 1.2 2003/05/15 02:57:06 jblazek
295 ! Inlined index function.
296 !
297 ! Revision 1.1 2002/10/14 23:55:29 wasistho
298 ! Install Rocturb
299 !
300 !******************************************************************************
301 
302 
303 
304 
305 
306 
307 
**********************************************************************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 idcend
j indices k indices k
Definition: Indexing.h:6
**********************************************************************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 kpcbeg
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
**********************************************************************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 ic
**********************************************************************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 jpcbeg
**********************************************************************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 ipcend
subroutine rflo_getnodeoffset(region, iLev, iNodeOffset, ijNodeOffset)
subroutine rflo_getdimensdummy(region, iLev, idcbeg, idcend, jdcbeg, jdcend, kdcbeg, kdcend)
**********************************************************************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 kdcbeg
**********************************************************************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 ipcbeg
blockLoc i
Definition: read.cpp:79
subroutine rflo_getcelloffset(region, iLev, iCellOffset, ijCellOffset)
**********************************************************************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 idcbeg
**********************************************************************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 jdcend
j indices j
Definition: Indexing.h:6
**********************************************************************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 jpcend
subroutine turb_floextrapolcellvec(region, idBeg, idEnd, fVec)
**********************************************************************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 jdcbeg
subroutine turb_gettvcell(region)
subroutine errorstop(global, errorCode, errorLine, addMessage)
Definition: ModError.F90:483
subroutine deregisterfunction(global)
Definition: ModError.F90:469
subroutine rflo_getdimensphys(region, iLev, ipcbeg, ipcend, jpcbeg, jpcend, kpcbeg, kpcend)