Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TURB_floFaceVolume.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 face volume.
26 !
27 ! Description: The face volume is obtained by averaging the two adjacent cell
28 ! volumes then extrapolated to outerst faces.
29 !
30 ! Input: region = data of current region
31 ! ijk = ijk-face is being treated
32 !
33 ! Output: Face volume defined at all nodes.
34 !
35 ! Notes: Face volume is used in several routines, a.o LesMij & LesCalcEddyVis.
36 !
37 !******************************************************************************
38 !
39 ! $Id: TURB_floFaceVolume.F90,v 1.4 2008/12/06 08:44:43 mtcampbe Exp $
40 !
41 ! Copyright: (c) 2001 by the University of Illinois
42 !
43 !******************************************************************************
44 
45 SUBROUTINE turb_flofacevolume( region,ijk )
46 
47  USE moddatatypes
48  USE moddatastruct, ONLY : t_region
49  USE modglobal, ONLY : t_global
52  USE moderror
54  IMPLICIT NONE
55 
56 #include "Indexing.h"
57 
58 ! ... parameters
59  TYPE(t_region) :: region
60  INTEGER :: ijk
61 
62 ! ... loop variables
63  INTEGER :: i, j, k, ijkc0, ijkc1, ijkn, ijkn1
64 
65 ! ... local variables
66  CHARACTER(CHRLEN) :: rcsidentstring
67  TYPE(t_global), POINTER :: global
68 
69  INTEGER :: ibeg,iend,jbeg,jend,kbeg,kend, iadd,jadd,kadd
70  INTEGER :: idnbeg,idnend,jdnbeg,jdnend,kdnbeg,kdnend
71  INTEGER :: ilev,inoff,ijnoff,icoff,ijcoff
72 
73  REAL(RFREAL), POINTER :: vol(:), fvol(:)
74 
75 !******************************************************************************
76 
77  rcsidentstring = '$RCSfile: TURB_floFaceVolume.F90,v $'
78 
79  global => region%global
80  CALL registerfunction( global,'TURB_FloFaceVolume',&
81  'TURB_floFaceVolume.F90' )
82 
83 ! get indices and pointers --------------------------------------------------
84 
85  ilev = region%currLevel
86  CALL rflo_getdimensdummynodes( region,ilev,idnbeg,idnend, &
87  jdnbeg,jdnend,kdnbeg,kdnend )
88  CALL rflo_getcelloffset( region,ilev,icoff,ijcoff )
89  CALL rflo_getnodeoffset( region,ilev,inoff,ijnoff )
90  vol => region%levels(ilev)%grid%vol
91 
92  IF (ijk==diri) THEN
93  fvol => region%levels(ilev)%turb%fvolI
94  ibeg = idnbeg
95  iend = idnend
96  jbeg = jdnbeg
97  jend = jdnend-1
98  kbeg = kdnbeg
99  kend = kdnend-1
100  iadd = -1
101  jadd = 0
102  kadd = 0
103  ELSEIF (ijk==dirj) THEN
104  fvol => region%levels(ilev)%turb%fvolJ
105  ibeg = idnbeg
106  iend = idnend-1
107  jbeg = jdnbeg
108  jend = jdnend
109  kbeg = kdnbeg
110  kend = kdnend-1
111  iadd = 0
112  jadd = -1
113  kadd = 0
114  ELSEIF (ijk==dirk) THEN
115  fvol => region%levels(ilev)%turb%fvolK
116  ibeg = idnbeg
117  iend = idnend-1
118  jbeg = jdnbeg
119  jend = jdnend-1
120  kbeg = kdnbeg
121  kend = kdnend
122  iadd = 0
123  jadd = 0
124  kadd = -1
125  ENDIF
126 
127 ! Define face volumes and store in fvol(:)
128 
129  DO k=kbeg-kadd,kend+kadd
130  DO j=jbeg-jadd,jend+jadd
131  DO i=ibeg-iadd,iend+iadd
132  ijkc0 = indijk(i ,j ,k ,icoff,ijcoff)
133  ijkc1 = ijkc0 + iadd + jadd*icoff + kadd*ijcoff
134  ijkn = indijk(i ,j ,k ,inoff,ijnoff)
135  fvol(ijkn) = 0.5_rfreal*(vol(ijkc1)+vol(ijkc0))
136  ENDDO
137  ENDDO
138  ENDDO
139 
140  IF (ijk==diri) THEN
141 
142 ! - extrapolation to outerst layers
143 
144  DO k=kbeg,kend
145  DO j=jbeg,jend
146  i = ibeg
147  ijkc0 = indijk(i ,j ,k ,icoff,ijcoff)
148  ijkn = indijk(i ,j ,k ,inoff,ijnoff)
149  fvol(ijkn) = vol(ijkc0)
150  i = iend
151  ijkc1 = indijk(i+iadd,j+jadd,k+kadd,icoff,ijcoff)
152  ijkn = indijk(i ,j ,k ,inoff,ijnoff)
153  fvol(ijkn) = vol(ijkc1)
154  ENDDO
155  ENDDO
156 
157  DO k=kdnbeg,kdnend
158  DO i=idnbeg,idnend
159  ijkn = indijk(i ,jdnend ,k ,inoff,ijnoff)
160  ijkn1 = ijkn - inoff
161  fvol(ijkn) = fvol(ijkn1)
162  fvol(ijkn) = fvol(ijkn1)
163  fvol(ijkn) = fvol(ijkn1)
164  fvol(ijkn) = fvol(ijkn1)
165  ENDDO ! i
166  ENDDO ! k
167  DO j=jdnbeg,jdnend
168  DO i=idnbeg,idnend
169  ijkn = indijk(i ,j ,kdnend ,inoff,ijnoff)
170  ijkn1 = ijkn - ijnoff
171  fvol(ijkn) = fvol(ijkn1)
172  fvol(ijkn) = fvol(ijkn1)
173  fvol(ijkn) = fvol(ijkn1)
174  fvol(ijkn) = fvol(ijkn1)
175  ENDDO ! i
176  ENDDO ! j
177 
178  ELSEIF (ijk==dirj) THEN
179 
180 ! - extrapolation to outerst layers
181 
182  DO k=kbeg,kend
183  DO i=ibeg,iend
184  j = jbeg
185  ijkc0 = indijk(i ,j ,k ,icoff,ijcoff)
186  ijkn = indijk(i ,j ,k ,inoff,ijnoff)
187  fvol(ijkn) = vol(ijkc0)
188  j = jend
189  ijkc1 = indijk(i+iadd,j+jadd,k+kadd,icoff,ijcoff)
190  ijkn = indijk(i ,j ,k ,inoff,ijnoff)
191  fvol(ijkn) = vol(ijkc1)
192  ENDDO
193  ENDDO
194 
195  DO k=kdnbeg,kdnend
196  DO j=jdnbeg,jdnend
197  ijkn = indijk(idnend ,j ,k ,inoff,ijnoff)
198  ijkn1 = ijkn - 1
199  fvol(ijkn) = fvol(ijkn1)
200  fvol(ijkn) = fvol(ijkn1)
201  fvol(ijkn) = fvol(ijkn1)
202  fvol(ijkn) = fvol(ijkn1)
203  ENDDO ! j
204  ENDDO ! k
205  DO j=jdnbeg,jdnend
206  DO i=idnbeg,idnend
207  ijkn = indijk(i ,j ,kdnend ,inoff,ijnoff)
208  ijkn1 = ijkn - ijnoff
209  fvol(ijkn) = fvol(ijkn1)
210  fvol(ijkn) = fvol(ijkn1)
211  fvol(ijkn) = fvol(ijkn1)
212  fvol(ijkn) = fvol(ijkn1)
213  ENDDO ! i
214  ENDDO ! j
215 
216  ELSEIF (ijk==dirk) THEN
217 
218 ! - extrapolation to outerst layers
219 
220  DO j=jbeg,jend
221  DO i=ibeg,iend
222  k = kbeg
223  ijkc0 = indijk(i ,j ,k ,icoff,ijcoff)
224  ijkn = indijk(i ,j ,k ,inoff,ijnoff)
225  fvol(ijkn) = vol(ijkc0)
226  k = kend
227  ijkc1 = indijk(i+iadd,j+jadd,k+kadd,icoff,ijcoff)
228  ijkn = indijk(i ,j ,k ,inoff,ijnoff)
229  fvol(ijkn) = vol(ijkc1)
230  ENDDO
231  ENDDO
232 
233  DO k=kdnbeg,kdnend
234  DO j=jdnbeg,jdnend
235  ijkn = indijk(idnend ,j ,k ,inoff,ijnoff)
236  ijkn1 = ijkn - 1
237  fvol(ijkn) = fvol(ijkn1)
238  fvol(ijkn) = fvol(ijkn1)
239  fvol(ijkn) = fvol(ijkn1)
240  fvol(ijkn) = fvol(ijkn1)
241  ENDDO ! j
242  ENDDO ! k
243  DO k=kdnbeg,kdnend
244  DO i=idnbeg,idnend
245  ijkn = indijk(i ,jdnend ,k ,inoff,ijnoff)
246  ijkn1 = ijkn - inoff
247  fvol(ijkn) = fvol(ijkn1)
248  fvol(ijkn) = fvol(ijkn1)
249  fvol(ijkn) = fvol(ijkn1)
250  fvol(ijkn) = fvol(ijkn1)
251  ENDDO ! i
252  ENDDO ! k
253 
254  ENDIF
255 
256 ! finalize --------------------------------------------------------------------
257 
258  CALL deregisterfunction( global )
259 
260 END SUBROUTINE turb_flofacevolume
261 
262 !******************************************************************************
263 !
264 ! RCS Revision history:
265 !
266 ! $Log: TURB_floFaceVolume.F90,v $
267 ! Revision 1.4 2008/12/06 08:44:43 mtcampbe
268 ! Updated license.
269 !
270 ! Revision 1.3 2008/11/19 22:17:55 mtcampbe
271 ! Added Illinois Open Source License/Copyright
272 !
273 ! Revision 1.2 2004/03/12 02:55:35 wasistho
274 ! changed rocturb routine names
275 !
276 ! Revision 1.1 2004/03/08 23:35:45 wasistho
277 ! changed turb nomenclature
278 !
279 ! Revision 1.3 2003/10/09 23:07:08 wasistho
280 ! renamed CalcEddyVis to LesCalcEddyVis
281 !
282 ! Revision 1.2 2003/05/15 02:57:06 jblazek
283 ! Inlined index function.
284 !
285 ! Revision 1.1 2002/10/14 23:55:29 wasistho
286 ! Install Rocturb
287 !
288 !
289 !******************************************************************************
290 
291 
292 
293 
294 
295 
296 
**********************************************************************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 ibeg
j indices k indices k
Definition: Indexing.h:6
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 jdnbeg
**********************************************************************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 idnend
subroutine rflo_getnodeoffset(region, iLev, iNodeOffset, ijNodeOffset)
**********************************************************************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 jdnend
**********************************************************************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 idnbeg
**********************************************************************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 knode iend
blockLoc i
Definition: read.cpp:79
subroutine rflo_getcelloffset(region, iLev, iCellOffset, ijCellOffset)
subroutine turb_flofacevolume(region, ijk)
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 knode jend
subroutine rflo_getdimensdummynodes(region, iLev, idnbeg, idnend, jdnbeg, jdnend, kdnbeg, kdnend)
**********************************************************************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 knode jbeg
**********************************************************************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 knode kbeg
subroutine deregisterfunction(global)
Definition: ModError.F90:469
**********************************************************************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 kdnbeg