Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TURB_floRansSetCornEdgeCells.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: set values in edge and corner cells of a region.
26 !
27 ! Description: this is for the case if the cells are not located
28 ! within another region.
29 !
30 ! Input: region = region data.
31 !
32 ! Output: new values of RaNS variables.
33 !
34 ! Notes: values in ALL edge and corner cells are averaged from neighboring
35 ! cells. Hence, this routine should be called first, before values
36 ! from adjacent regions are copied.
37 !
38 !******************************************************************************
39 !
40 ! $Id: TURB_floRansSetCornEdgeCells.F90,v 1.6 2008/12/06 08:44:44 mtcampbe Exp $
41 !
42 ! Copyright: (c) 2001 by the University of Illinois
43 !
44 !******************************************************************************
45 
46 SUBROUTINE turb_floranssetcornedgecells( region )
47 
48  USE moddatatypes
49  USE moddatastruct, ONLY : t_region
52  USE moderror
53  IMPLICIT NONE
54 
55 #include "Indexing.h"
56 
57 ! ... parameters
58  TYPE(t_region) :: region
59 
60 ! ... loop variables
61  INTEGER :: i, j, k
62 
63 ! ... local variables
64  INTEGER :: idcbeg, idcend, jdcbeg, jdcend, kdcbeg, kdcend
65  INTEGER :: ipcbeg, ipcend, jpcbeg, jpcend, kpcbeg, kpcend
66  INTEGER :: ilev, ncv, gasmodel, icoff, ijcoff, ijkd, ijkc1, ijkc2
67 
68  REAL(RFREAL), POINTER :: tcv(:,:)
69 
70 !******************************************************************************
71 
72  CALL registerfunction( region%global,'TURB_FloRansSetCornEdgeCells', &
73  'TURB_floRansSetCornEdgeCells.F90' )
74 
75 ! get dimensions and pointers -------------------------------------------------
76 
77  ilev = region%currLevel
78 
79  CALL rflo_getdimensdummy( region,ilev,idcbeg,idcend, &
80  jdcbeg,jdcend,kdcbeg,kdcend )
81  CALL rflo_getdimensphys( region,ilev,ipcbeg,ipcend, &
82  jpcbeg,jpcend,kpcbeg,kpcend )
83  CALL rflo_getcelloffset( region,ilev,icoff,ijcoff )
84 
85  ncv = region%turbInput%nCv
86 
87  tcv => region%levels(ilev)%turb%cv
88 
89 ! edges 9, 10, 11, 12 ---------------------------------------------------------
90 
91  DO i=ipcbeg,ipcend
92  DO j=jpcbeg-1,jdcbeg,-1 ! edges 9, 10
93  DO k=kpcbeg-1,kdcbeg,-1
94  ijkd = indijk(i,j ,k ,icoff,ijcoff)
95  ijkc1 = indijk(i,j+1,k ,icoff,ijcoff)
96  ijkc2 = indijk(i,j ,k+1,icoff,ijcoff)
97  CALL averageedgecells( ijkd,ijkc1,ijkc2,ncv,tcv )
98  ENDDO
99  DO k=kpcend+1,kdcend
100  ijkd = indijk(i,j,k,icoff,ijcoff)
101  ijkc1 = indijk(i,j+1,k ,icoff,ijcoff)
102  ijkc2 = indijk(i,j ,k-1,icoff,ijcoff)
103  CALL averageedgecells( ijkd,ijkc1,ijkc2,ncv,tcv )
104  ENDDO
105  ENDDO
106 
107  DO j=jpcend+1,jdcend ! edges 11, 12
108  DO k=kpcbeg-1,kdcbeg,-1
109  ijkd = indijk(i,j,k,icoff,ijcoff)
110  ijkc1 = indijk(i,j-1,k ,icoff,ijcoff)
111  ijkc2 = indijk(i,j ,k+1,icoff,ijcoff)
112  CALL averageedgecells( ijkd,ijkc1,ijkc2,ncv,tcv )
113  ENDDO
114  DO k=kpcend+1,kdcend
115  ijkd = indijk(i,j,k,icoff,ijcoff)
116  ijkc1 = indijk(i,j-1,k ,icoff,ijcoff)
117  ijkc2 = indijk(i,j ,k-1,icoff,ijcoff)
118  CALL averageedgecells( ijkd,ijkc1,ijkc2,ncv,tcv )
119  ENDDO
120  ENDDO
121  ENDDO
122 
123 ! edges 2, 4, 6, 8 ------------------------------------------------------------
124 
125  DO j=jpcbeg,jpcend
126  DO i=ipcbeg-1,idcbeg,-1 ! edges 2, 4
127  DO k=kpcend+1,kdcend
128  ijkd = indijk(i ,j,k ,icoff,ijcoff)
129  ijkc1 = indijk(i+1,j,k ,icoff,ijcoff)
130  ijkc2 = indijk(i ,j,k-1,icoff,ijcoff)
131  CALL averageedgecells( ijkd,ijkc1,ijkc2,ncv,tcv )
132  ENDDO
133  DO k=kpcbeg-1,kdcbeg,-1
134  ijkd = indijk(i ,j,k ,icoff,ijcoff)
135  ijkc1 = indijk(i+1,j,k ,icoff,ijcoff)
136  ijkc2 = indijk(i ,j,k+1,icoff,ijcoff)
137  CALL averageedgecells( ijkd,ijkc1,ijkc2,ncv,tcv )
138  ENDDO
139  ENDDO
140 
141  DO i=ipcend+1,idcend ! edges 6, 8
142  DO k=kpcend+1,kdcend
143  ijkd = indijk(i ,j,k ,icoff,ijcoff)
144  ijkc1 = indijk(i-1,j,k ,icoff,ijcoff)
145  ijkc2 = indijk(i ,j,k-1,icoff,ijcoff)
146  CALL averageedgecells( ijkd,ijkc1,ijkc2,ncv,tcv )
147  ENDDO
148  DO k=kpcbeg-1,kdcbeg,-1
149  ijkd = indijk(i ,j,k ,icoff,ijcoff)
150  ijkc1 = indijk(i-1,j,k ,icoff,ijcoff)
151  ijkc2 = indijk(i ,j,k+1,icoff,ijcoff)
152  CALL averageedgecells( ijkd,ijkc1,ijkc2,ncv,tcv )
153  ENDDO
154  ENDDO
155  ENDDO
156 
157 ! edges 1, 3, 5, 7 ------------------------------------------------------------
158 
159  DO k=kdcbeg,kdcend
160  DO i=ipcbeg-1,idcbeg,-1 ! edges 1, 3
161  DO j=jpcbeg-1,jdcbeg,-1
162  ijkd = indijk(i ,j ,k,icoff,ijcoff)
163  ijkc1 = indijk(i+1,j ,k,icoff,ijcoff)
164  ijkc2 = indijk(i ,j+1,k,icoff,ijcoff)
165  CALL averageedgecells( ijkd,ijkc1,ijkc2,ncv,tcv )
166  ENDDO
167  DO j=jpcend+1,jdcend
168  ijkd = indijk(i ,j ,k,icoff,ijcoff)
169  ijkc1 = indijk(i+1,j ,k,icoff,ijcoff)
170  ijkc2 = indijk(i ,j-1,k,icoff,ijcoff)
171  CALL averageedgecells( ijkd,ijkc1,ijkc2,ncv,tcv )
172  ENDDO
173  ENDDO
174 
175  DO i=ipcend+1,idcend ! edges 5, 7
176  DO j=jpcbeg-1,jdcbeg,-1
177  ijkd = indijk(i ,j ,k,icoff,ijcoff)
178  ijkc1 = indijk(i-1,j ,k,icoff,ijcoff)
179  ijkc2 = indijk(i ,j+1,k,icoff,ijcoff)
180  CALL averageedgecells( ijkd,ijkc1,ijkc2,ncv,tcv )
181  ENDDO
182  DO j=jpcend+1,jdcend
183  ijkd = indijk(i ,j ,k,icoff,ijcoff)
184  ijkc1 = indijk(i-1,j ,k,icoff,ijcoff)
185  ijkc2 = indijk(i ,j-1,k,icoff,ijcoff)
186  CALL averageedgecells( ijkd,ijkc1,ijkc2,ncv,tcv )
187  ENDDO
188  ENDDO
189  ENDDO
190 
191 ! finalize --------------------------------------------------------------------
192 
193  CALL deregisterfunction( region%global )
194 
195 ! =============================================================================
196 ! Averaging subroutine
197 ! =============================================================================
198 
199  CONTAINS
200 
201  SUBROUTINE averageedgecells( ijkD,ijkC1,ijkC2,nCv,tcv )
202  USE moddatatypes
203  IMPLICIT NONE
204 
205  INTEGER :: l
206  INTEGER :: ijkd, ijkc1, ijkc2, ncv
207  REAL(RFREAL), POINTER :: tcv(:,:)
208 
209  DO l=1,ncv
210  tcv(l,ijkd) = 0.5_rfreal*(tcv(l,ijkc1)+ tcv(l,ijkc2))
211  ENDDO
212 
213  END SUBROUTINE averageedgecells
214 
215 END SUBROUTINE turb_floranssetcornedgecells
216 
217 !******************************************************************************
218 !
219 ! RCS Revision history:
220 !
221 ! $Log: TURB_floRansSetCornEdgeCells.F90,v $
222 ! Revision 1.6 2008/12/06 08:44:44 mtcampbe
223 ! Updated license.
224 !
225 ! Revision 1.5 2008/11/19 22:17:56 mtcampbe
226 ! Added Illinois Open Source License/Copyright
227 !
228 ! Revision 1.4 2005/10/31 21:09:37 haselbac
229 ! Changed specModel and SPEC_MODEL_NONE
230 !
231 ! Revision 1.3 2004/09/27 23:29:04 wasistho
232 ! changed TURB_AverageEdgeCells to AverageEdgeCells
233 !
234 ! Revision 1.2 2004/03/12 02:55:36 wasistho
235 ! changed rocturb routine names
236 !
237 ! Revision 1.1 2004/03/08 23:35:46 wasistho
238 ! changed turb nomenclature
239 !
240 ! Revision 1.1 2004/01/23 00:39:06 wasistho
241 ! added communication routines for RaNS edge/corners
242 !
243 !
244 !******************************************************************************
245 
246 
247 
248 
249 
250 
251 
**********************************************************************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 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_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 averageedgecells(ijkD, ijkC1, ijkC2, nCv, tcv)
**********************************************************************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 deregisterfunction(global)
Definition: ModError.F90:469
subroutine turb_floranssetcornedgecells(region)
subroutine rflo_getdimensphys(region, iLev, ipcbeg, ipcend, jpcbeg, jpcend, kpcbeg, kpcend)