Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TURB_RansWallDistOVPatch.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: compute distance of each cell centers to the nearest no-slip wall
26 !
27 ! Description: in this routine we search for no-slip wall, for each no-slip
28 ! wall patch, we loop over regions and compute the minimum
29 ! wall distance. In this way, global wall distance is obtained,
30 ! assuming open view (OV) from cell centers to the nearest wall.
31 !
32 ! Input: region = data of current region
33 !
34 ! Output: region%levels%turb%lens = turbulence length scale.
35 !
36 ! Notes: none.
37 !
38 !******************************************************************************
39 !
40 ! $Id: TURB_RansWallDistOVPatch.F90,v 1.6 2008/12/06 08:44:42 mtcampbe Exp $
41 !
42 ! Copyright: (c) 2003 by the University of Illinois
43 !
44 !******************************************************************************
45 
46 SUBROUTINE turb_ranswalldistovpatch( region,patch )
47 
48  USE moddatatypes
49  USE modbndpatch, ONLY : t_patch
50  USE moddatastruct, ONLY : t_region
51 #ifdef RFLO
52  USE modinterfaces, ONLY : centroidhexa, &
55 
56 #include "Indexing.h"
57 #endif
58  USE moderror
59  USE modparameters
61  IMPLICIT NONE
62 
63 ! ... parameters
64  TYPE(t_region) :: region
65  TYPE(t_patch) :: patch
66 
67 ! ... loop variables
68  INTEGER :: i, j, k, l, m
69 
70 ! ... local variables
71  INTEGER :: bctype, ibeg, iend, jbeg, jend, kbeg, kend, corner(8)
72  REAL(RFREAL) :: csfx, csfy, csfz
73  REAL(RFREAL), POINTER :: xyz(:,:)
74 
75 #ifdef RFLO
76  INTEGER :: ilev, lbound, inode, jnode, knode, ia, ja, ka
77  INTEGER :: idir, jdir, kdir, icoff, ijcoff, inoff, ijnoff
78  REAL(RFREAL) :: sgn, xyzhexa(ndir,8)
79 #endif
80 #ifdef RFLU
81  REAL(RFREAL), POINTER :: fc(:,:)
82 #endif
83 
84 !******************************************************************************
85 
86  CALL registerfunction( region%global,'TURB_RansWallDistOVPatch',&
87  'TURB_RansWallDistOVPatch.F90' )
88 
89 ! get dimensions and pointers -------------------------------------------------
90 
91  bctype = patch%bcType
92 
93 #ifdef RFLO
94  ilev = region%currLevel
95 
96  CALL rflo_getpatchindices( region,patch,ilev, &
97  ibeg,iend,jbeg,jend,kbeg,kend )
99  CALL rflo_getcelloffset( region,ilev,icoff,ijcoff )
100  CALL rflo_getnodeoffset( region,ilev,inoff,ijnoff )
101 
102  lbound = patch%lbound
103  xyz => region%levels(ilev)%grid%xyz
104 
105 ! to take the right face vector and make it point outwards
106 
107  sgn = +1._rfreal
108  inode = 0
109  jnode = 0
110  knode = 0
111  IF (lbound==2 .OR. lbound==4 .OR. lbound==6) THEN
112  sgn = -1._rfreal
113  inode = -idir
114  jnode = -jdir
115  knode = -kdir
116  ENDIF
117 
118 ! get the appropriate face vector and grid speed
119 
120  IF (lbound==1 .OR. lbound==2) THEN
121  ia=0
122  ja=1
123  ka=1
124  ELSE IF (lbound==3 .OR. lbound==4) THEN
125  ia=1
126  ja=0
127  ka=1
128  ELSE IF (lbound==5 .OR. lbound==6) THEN
129  ia=1
130  ja=1
131  ka=0
132  ENDIF
133 #endif
134 #ifdef RFLU
135  xyz => region%grid%xyz
136  fc => region%grid%fc
137  ibeg = 1
138  iend = patch%nBFaces
139 #endif
140 
141  IF ((bctype>=bc_noslipwall .AND. bctype<=bc_noslipwall+bc_range) .OR. &
142  (bctype>=bc_injection .AND. bctype<=bc_injection+bc_range)) THEN
143 
144 #ifdef RFLO
145  DO k=kbeg,kend
146  DO j=jbeg,jend
147  DO i=ibeg,iend
148 
149  corner(1) = indijk(i+inode ,j+jnode ,k+knode ,inoff,ijnoff)
150  corner(2) = indijk(i+inode ,j+jnode ,k+knode+ka,inoff,ijnoff)
151  corner(3) = indijk(i+inode ,j+jnode+ja,k+knode+ka,inoff,ijnoff)
152  corner(4) = indijk(i+inode ,j+jnode+ja,k+knode ,inoff,ijnoff)
153  corner(5) = indijk(i+inode+ia,j+jnode ,k+knode ,inoff,ijnoff)
154  corner(6) = indijk(i+inode+ia,j+jnode ,k+knode+ka,inoff,ijnoff)
155  corner(7) = indijk(i+inode+ia,j+jnode+ja,k+knode+ka,inoff,ijnoff)
156  corner(8) = indijk(i+inode+ia,j+jnode+ja,k+knode ,inoff,ijnoff)
157 
158  DO m = 1,8
159  DO l = 1,3
160  xyzhexa(l,m) = xyz(l,corner(m))
161  ENDDO
162  ENDDO
163 
164  CALL centroidhexa( xyzhexa,csfx,csfy,csfz )
165 #endif
166 #ifdef RFLU
167  DO i=ibeg,iend
168 
169  csfx = fc(xcoord,i)
170  csfy = fc(ycoord,i)
171  csfz = fc(zcoord,i)
172 #endif
173  region%global%turbWorkDim = region%global%turbWorkDim + 1
174  region%global%turbWork1D(region%global%turbWorkDim) = csfx
175  region%global%turbWorkDim = region%global%turbWorkDim + 1
176  region%global%turbWork1D(region%global%turbWorkDim) = csfy
177  region%global%turbWorkDim = region%global%turbWorkDim + 1
178  region%global%turbWork1D(region%global%turbWorkDim) = csfz
179 #ifdef RFLO
180  ENDDO ! i
181  ENDDO ! j
182  ENDDO ! k of patch coordinate
183 #endif
184 #ifdef RFLU
185  ENDDO ! i
186 #endif
187  ENDIF ! bcType
188 
189 ! finalize --------------------------------------------------------------------
190 
191  CALL deregisterfunction( region%global )
192 
193 END SUBROUTINE turb_ranswalldistovpatch
194 
195 !******************************************************************************
196 !
197 ! RCS Revision history:
198 !
199 ! $Log: TURB_RansWallDistOVPatch.F90,v $
200 ! Revision 1.6 2008/12/06 08:44:42 mtcampbe
201 ! Updated license.
202 !
203 ! Revision 1.5 2008/11/19 22:17:54 mtcampbe
204 ! Added Illinois Open Source License/Copyright
205 !
206 ! Revision 1.4 2004/03/27 02:16:42 wasistho
207 ! compiled with Rocflu
208 !
209 ! Revision 1.3 2004/03/23 03:35:00 wasistho
210 ! prepared for RFLU
211 !
212 ! Revision 1.2 2004/03/20 03:28:29 wasistho
213 ! prepared for RFLU
214 !
215 ! Revision 1.1 2004/03/05 04:37:00 wasistho
216 ! changed nomenclature
217 !
218 ! Revision 1.4 2004/01/22 04:02:23 wasistho
219 ! add wall-injection bctype for wall distance
220 !
221 ! Revision 1.3 2003/10/17 20:21:59 wasistho
222 ! do-loop i.o. dimension range
223 !
224 ! Revision 1.2 2003/10/07 20:32:24 wasistho
225 ! turbWork2D to turbWork1D
226 !
227 !
228 !******************************************************************************
229 
230 
231 
232 
233 
234 
235 
**********************************************************************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
FT m(int i, int j) const
subroutine rflo_getpatchdirection(patch, idir, jdir, kdir)
**********************************************************************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 inode
j indices k indices k
Definition: Indexing.h:6
subroutine registerfunction(global, funName, fileName)
Definition: ModError.F90:449
subroutine rflo_getpatchindices(region, patch, iLev, ibeg, iend, jbeg, jend, kbeg, kend)
subroutine centroidhexa(xyzNodes, cofgX, cofgY, cofgZ)
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 jdir
Definition: patch.h:74
**********************************************************************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
**********************************************************************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 idir
subroutine rflo_getcelloffset(region, iLev, iCellOffset, ijCellOffset)
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
**********************************************************************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 kdir
**********************************************************************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
subroutine turb_ranswalldistovpatch(region, patch)
**********************************************************************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 jnode