Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TURB_GetModelStressCell.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 subgrid or Reynolds stresses at cell centers.
26 !
27 ! Description: The cell values are obtained by averaging the face values.
28 ! The result are stored in turb%sv at cells, including dummmies.
29 !
30 ! Input: region = data of current region
31 !
32 ! Output: turb%sv(E11:E33,:) at cell centers incl. dummies.
33 !
34 ! Notes: Dummy stress obtained by extrapolation as dummy mut not computed.
35 !
36 !******************************************************************************
37 !
38 ! $Id: TURB_GetModelStressCell.F90,v 1.8 2008/12/06 08:44:41 mtcampbe Exp $
39 !
40 ! Copyright: (c) 2001 by the University of Illinois
41 !
42 !******************************************************************************
43 
44 SUBROUTINE turb_getmodelstresscell( region )
45 
46  USE moddatatypes
47  USE moddatastruct, ONLY : t_region
48  USE modglobal, ONLY : t_global
49 #ifdef RFLO
52 
53 #include "Indexing.h"
54 #endif
55  USE moderror
56  USE modparameters
58  IMPLICIT NONE
59 
60 ! ... parameters
61  TYPE(t_region) :: region
62 
63 ! ... loop variables
64  INTEGER :: i, j, k, l, ic, in, ipatch
65 
66 ! ... local variables
67  CHARACTER(CHRLEN) :: rcsidentstring
68  TYPE(t_global), POINTER :: global
69 
70  REAL(RFREAL), POINTER :: muet(:,:),siij(:,:), sjij(:,:), skij(:,:), sv(:,:)
71 #ifdef RFLO
72  INTEGER :: ipcbeg, ipcend, jpcbeg, jpcend, kpcbeg, kpcend
73  INTEGER :: idcbeg, idcend, jdcbeg, jdcend, kdcbeg, kdcend
74  INTEGER :: ilev,icoff,ijcoff,inoff,ijnoff,ijkc,ijkci,ijkn,ijkni,ijknj,ijknk
75  REAL(RFREAL) :: one6th
76 #endif
77 #ifdef RFLU
78  INTEGER :: ic0, ic1, ict, icl, ifg, ifgbeg, nfacespercell
79  INTEGER, POINTER :: c2f(:,:,:)
80  REAL(RFREAL), POINTER :: bmuet(:,:), bsiij(:,:)
81 #endif
82 
83 !******************************************************************************
84 
85  rcsidentstring = '$RCSfile: TURB_GetModelStressCell.F90,v $'
86 
87  global => region%global
88  CALL registerfunction( global,'Turb_GetModelStressCell',&
89  'TURB_GetModelStressCell.F90' )
90 
91 ! get parameters -------------------------------------------------------------
92 
93 #ifdef RFLO
94  one6th = 1._rfreal/6._rfreal
95  ilev = region%currLevel
96 
97 ! get dimensions and pointers
98 
99  CALL rflo_getdimensphys( region,ilev,ipcbeg,ipcend, &
100  jpcbeg,jpcend,kpcbeg,kpcend )
101  CALL rflo_getdimensdummy( region,ilev,idcbeg,idcend, &
102  jdcbeg,jdcend,kdcbeg,kdcend )
103  CALL rflo_getcelloffset( region,ilev,icoff,ijcoff )
104  CALL rflo_getnodeoffset( region,ilev,inoff,ijnoff )
105 
106  muet => region%levels(ilev)%turb%mueT
107  siij => region%levels(ilev)%turb%mISij
108  sjij => region%levels(ilev)%turb%mJSij
109  skij => region%levels(ilev)%turb%mKSij
110  sv => region%levels(ilev)%turb%sv
111 
112 ! perform averaging of stress tensor
113 
114  DO k=kpcbeg,kpcend
115  DO j=jpcbeg,jpcend
116  DO i=ipcbeg,ipcend
117 
118  ijkc = indijk(i ,j ,k ,icoff,ijcoff)
119  ijkn = indijk(i ,j ,k ,inoff,ijnoff)
120  ijkni = ijkn + 1
121  ijknj = ijkn + inoff
122  ijknk = ijkn + ijnoff
123 
124  DO l = e11, e33
125  sv(l,ijkc) = &
126  muet(diri,ijkn)*siij(l,ijkn)+muet(diri,ijkni)*siij(l,ijkni)+ &
127  muet(dirj,ijkn)*sjij(l,ijkn)+muet(dirj,ijknj)*siij(l,ijknj)+ &
128  muet(dirk,ijkn)*skij(l,ijkn)+muet(dirk,ijknk)*siij(l,ijknk)
129  sv(l,ijkc) = one6th*sv(l,ijkc)
130  ENDDO ! l
131  ENDDO ! i
132  ENDDO ! j
133  ENDDO ! k
134 #endif
135 
136 #ifdef RFLU
137  muet => region%turb%mueT
138  bmuet => region%turb%bMueT
139  siij => region%turb%mISij
140  bsiij => region%turb%bmISij
141  sv => region%turb%sv
142  sv(:,:) = 0._rfreal
143 
144 ! compute stress tensor at faces then average it from faces to cells
145 ! waiting for Andreas` routine for proper averaging
146 
147  DO in = 1,region%grid%nFaces
148  ic0 = region%grid%f2c(1,in)
149  ic1 = region%grid%f2c(2,in)
150  DO l = e11, e33
151  sv(l,ic0) = sv(l,ic0) + muet(diri,in)*siij(l,in)
152  sv(l,ic1) = sv(l,ic1) + muet(diri,in)*siij(l,in)
153  ENDDO ! l
154  ENDDO ! iN
155 
156  DO ipatch = 1,region%grid%nPatches
157 ! TEMPORARY : removing usage of bf2bg from everywhere
158 ! ifgBeg = region%patches(iPatch)%bf2bg(BF2BG_BEG)
159  DO in = 1,region%patches(ipatch)%nBFaces
160  ic0 = region%patches(ipatch)%bf2c(in)
161  ifg = in + ifgbeg-1
162  DO l = e11, e33
163  sv(l,ic0) = sv(l,ic0) + bmuet(diri,ifg)*bsiij(l,ifg)
164  ENDDO ! l
165  ENDDO ! iN
166  ENDDO ! iPatch
167 
168  DO ic = 1,region%grid%nCells
169  ict = region%grid%cellGlob2Loc(1,ic) ! cell type
170  icl = region%grid%cellGlob2Loc(2,ic) ! local (type) cell index
171  SELECT CASE ( ict )
172  CASE ( cell_type_tet )
173  nfacespercell = 4
174  c2f => region%grid%tet2f
175  CASE ( cell_type_hex )
176  nfacespercell = 6
177  c2f => region%grid%hex2f
178  CASE ( cell_type_pri )
179  nfacespercell = 5
180  c2f => region%grid%pri2f
181  CASE ( cell_type_pyr )
182  nfacespercell = 5
183  c2f => region%grid%pyr2f
184  CASE default
185  CALL errorstop(global,err_reached_default,__line__)
186  END SELECT ! ict
187 
188  DO l = e11, e33
189  sv(l,ic) = sv(l,ic)/nfacespercell
190  ENDDO ! l
191  ENDDO ! iC
192 
193 #endif
194 
195 ! linear extrapolate to the six sides of region
196 
197 #ifdef RFLO
198  DO k=kdcbeg,kdcend
199  DO j=jdcbeg,jdcend
200 
201  ijkn = indijk(ipcbeg ,j ,k ,inoff,ijnoff)
202  DO i=idcbeg,ipcbeg-1
203  ijkc = indijk(i ,j ,k ,icoff,ijcoff)
204  ijkci = indijk(2*ipcbeg-i-1 ,j ,k ,icoff,ijcoff)
205 
206  DO l = e11, e33
207  sv(l,ijkc) = 2._rfreal*muet(diri,ijkn)*siij(l,ijkn) - &
208  sv(l,ijkci)
209  ENDDO
210  ENDDO
211  ijkn = indijk(ipcend+1 ,j ,k ,inoff,ijnoff)
212  DO i=ipcend+1,idcend
213  ijkc = indijk(i ,j ,k ,icoff,ijcoff)
214  ijkci = indijk(2*ipcend-i+1 ,j ,k ,icoff,ijcoff)
215 
216  DO l = e11, e33
217  sv(l,ijkc) = 2._rfreal*muet(diri,ijkn)*siij(l,ijkn) - &
218  sv(l,ijkci)
219  ENDDO
220  ENDDO ! i
221  ENDDO ! j
222  ENDDO ! k
223  DO k=kdcbeg,kdcend
224  DO i=idcbeg,idcend
225 
226  ijkn = indijk(i ,jpcbeg ,k ,inoff,ijnoff)
227  DO j=jdcbeg,jpcbeg-1
228  ijkc = indijk(i ,j ,k ,icoff,ijcoff)
229  ijkci = indijk(i ,2*jpcbeg-j-1 ,k ,icoff,ijcoff)
230 
231  DO l = e11, e33
232  sv(l,ijkc) = 2._rfreal*muet(dirj,ijkn)*sjij(l,ijkn) - &
233  sv(l,ijkci)
234  ENDDO
235  ENDDO
236  ijkn = indijk(i ,jpcend+1 ,k ,inoff,ijnoff)
237  DO j=jpcend+1,jdcend
238  ijkc = indijk(i ,j ,k ,icoff,ijcoff)
239  ijkci = indijk(i ,2*jpcend-j+1 ,k ,icoff,ijcoff)
240 
241  DO l = e11, e33
242  sv(l,ijkc) = 2._rfreal*muet(dirj,ijkn)*sjij(l,ijkn) - &
243  sv(l,ijkci)
244  ENDDO
245  ENDDO ! j
246  ENDDO ! i
247  ENDDO ! k
248  DO j=jdcbeg,jdcend
249  DO i=idcbeg,idcend
250 
251  ijkn = indijk(i ,j ,kpcbeg ,inoff,ijnoff)
252  DO k=kdcbeg,kpcbeg-1
253  ijkc = indijk(i ,j ,k ,icoff,ijcoff)
254  ijkci = indijk(i ,j ,2*kpcbeg-k-1 ,icoff,ijcoff)
255 
256  DO l = e11, e33
257  sv(l,ijkc) = 2._rfreal*muet(dirk,ijkn)*skij(l,ijkn) - &
258  sv(l,ijkci)
259  ENDDO
260  ENDDO
261  ijkn = indijk(i ,j ,kpcend+1 ,inoff,ijnoff)
262  DO k=kpcend+1,kdcend
263  ijkc = indijk(i ,j ,k ,icoff,ijcoff)
264  ijkci = indijk(i ,j ,2*kpcend-k+1 ,icoff,ijcoff)
265 
266  DO l = e11, e33
267  sv(l,ijkc) = 2._rfreal*muet(dirk,ijkn)*skij(l,ijkn) - &
268  sv(l,ijkci)
269  ENDDO
270  ENDDO ! k
271  ENDDO ! i
272  ENDDO ! j
273 #endif
274 
275 ! finalize --------------------------------------------------------------------
276 
277  CALL deregisterfunction( global )
278 
279 END SUBROUTINE turb_getmodelstresscell
280 
281 !******************************************************************************
282 !
283 ! RCS Revision history:
284 !
285 ! $Log: TURB_GetModelStressCell.F90,v $
286 ! Revision 1.8 2008/12/06 08:44:41 mtcampbe
287 ! Updated license.
288 !
289 ! Revision 1.7 2008/11/19 22:17:53 mtcampbe
290 ! Added Illinois Open Source License/Copyright
291 !
292 ! Revision 1.6 2006/08/19 15:40:55 mparmar
293 ! Removed bf2bg
294 !
295 ! Revision 1.5 2005/12/29 19:53:05 wasistho
296 ! modified face indexing in f2c averaging
297 !
298 ! Revision 1.4 2005/01/12 01:12:53 wasistho
299 ! removed single quote signs since SUN has trouble with it
300 !
301 ! Revision 1.3 2004/03/27 02:16:42 wasistho
302 ! compiled with Rocflu
303 !
304 ! Revision 1.2 2004/03/19 02:46:48 wasistho
305 ! prepared for RFLU
306 !
307 ! Revision 1.1 2004/03/05 04:37:00 wasistho
308 ! changed nomenclature
309 !
310 ! Revision 1.1 2003/05/24 02:30:28 wasistho
311 ! turbulence statistics expanded
312 !
313 !
314 !******************************************************************************
315 
316 
317 
318 
319 
320 
321 
**********************************************************************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
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
subroutine turb_getmodelstresscell(region)
**********************************************************************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
**********************************************************************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 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)