Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TURB_rFLO_RansResSmoothing.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: conduct implicit residual smoothing (central form) for RaNS class
26 ! of turbulence
27 !
28 ! Description: none.
29 !
30 ! Input: region = region data (residual, smoothing coeff., temporary array)
31 !
32 ! Output: region%levels%turb%rhs = smoothed residual.
33 !
34 ! Notes: none.
35 !
36 !******************************************************************************
37 !
38 ! $Id: TURB_rFLO_RansResSmoothing.F90,v 1.3 2008/12/06 08:44:45 mtcampbe Exp $
39 !
40 ! Copyright: (c) 2003 by the University of Illinois
41 !
42 !******************************************************************************
43 
44 SUBROUTINE turb_rflo_ransressmoothing( region ) ! PUBLIC
45 
46  USE moddatatypes
47  USE moddatastruct, ONLY : t_region
48  USE modglobal, ONLY : t_global
49  USE moderror
50  USE modparameters
52  IMPLICIT NONE
53 
54 #include "Indexing.h"
55 
56 ! ... parameters
57  TYPE(t_region), INTENT(INOUT) :: region
58 
59 ! ... loop variables
60  INTEGER :: i, j, k, icv
61 
62 ! ... local variables
63 
64  INTEGER :: ipcbeg, ipcend, jpcbeg, jpcend, kpcbeg, kpcend
65  INTEGER :: ilev, icoff, ijcoff, off1d, ijkc, ijkc1, ijdum, ijdum1
66  INTEGER :: im1, jm1, km1, ip1, jp1, kp1, ncv
67 
68  REAL(RFREAL) :: t
69  REAL(RFREAL), POINTER :: rhs(:,:), epsirs(:,:), d(:)
70 
71  TYPE(t_global), POINTER :: global
72 
73 !******************************************************************************
74 
75  global => region%global
76 
77  CALL registerfunction( global,'TURB_RFLO_RansResSmoothing',&
78  'TURB_rFLO_RansResSmoothing.F90' )
79 
80  IF (region%turbInput%modelClass /= model_rans) goto 999
81 
82 ! begin -----------------------------------------------------------------------
83 
84 ! get dimensions and pointers
85 
86  ilev = region%currLevel
87 
88  CALL rflo_getdimensphys( region,ilev,ipcbeg,ipcend,jpcbeg,jpcend, &
89  kpcbeg,kpcend )
90  CALL rflo_getcelloffset( region,ilev,icoff,ijcoff )
91 
92  epsirs => region%levels(ilev)%turb%epsIrs
93  rhs => region%levels(ilev)%turb%rhs
94  d => region%work1D
95 
96  ncv = region%turbInput%nCv
97 
98 ! solution of tridiagonal system in I-direction
99 
100  DO k=kpcbeg,kpcend
101 
102  i = ipcbeg - 1
103  off1d = ipcend + 1
104  DO j=jpcbeg,jpcend
105  ijdum = indij(i,j,off1d) + 1
106  d(ijdum) = 0._rfreal
107  ENDDO
108 
109  DO i=ipcbeg,ipcend
110  im1 = i - 1
111  DO j=jpcbeg,jpcend
112  ijkc = indijk(i ,j,k,icoff,ijcoff)
113  ijkc1 = indijk(im1,j,k,icoff,ijcoff)
114  ijdum = indij(i ,j,off1d) + 1
115  ijdum1 = indij(im1,j,off1d) + 1
116  t = 1._rfreal/(1._rfreal+2._rfreal*epsirs(icoord,ijkc)- &
117  epsirs(icoord,ijkc)*d(ijdum1))
118  d(ijdum) = t*epsirs(icoord,ijkc)
119 
120  DO icv=1,ncv
121  rhs(icv,ijkc) = t*(rhs(icv,ijkc) + epsirs(icoord,ijkc)*rhs(icv,ijkc1))
122  ENDDO
123 
124  ENDDO
125  ENDDO
126 
127  DO i=ipcend-1,ipcbeg,-1
128  ip1 = i + 1
129  DO j=jpcbeg,jpcend
130  ijkc = indijk(i ,j,k,icoff,ijcoff)
131  ijkc1 = indijk(ip1,j,k,icoff,ijcoff)
132  ijdum = indij(i,j,off1d) + 1
133 
134  DO icv=1,ncv
135  rhs(icv,ijkc) = rhs(icv,ijkc) + d(ijdum)*rhs(icv,ijkc1)
136  ENDDO
137 
138  ENDDO
139  ENDDO
140 
141  ENDDO ! k
142 
143 ! solution of tridiagonal system in J-direction
144 
145  DO k=kpcbeg,kpcend
146 
147  j = jpcbeg - 1
148  off1d = jpcend + 1
149  DO i=ipcbeg,ipcend
150  ijdum = indij(j,i,off1d) + 1
151  d(ijdum) = 0._rfreal
152  ENDDO
153 
154  DO j=jpcbeg,jpcend
155  jm1 = j - 1
156  DO i=ipcbeg,ipcend
157  ijkc = indijk(i,j ,k,icoff,ijcoff)
158  ijkc1 = indijk(i,jm1,k,icoff,ijcoff)
159  ijdum = indij(j ,i,off1d) + 1
160  ijdum1 = indij(jm1,i,off1d) + 1
161  t = 1._rfreal/(1._rfreal+2._rfreal*epsirs(jcoord,ijkc)- &
162  epsirs(jcoord,ijkc)*d(ijdum1))
163  d(ijdum) = t*epsirs(jcoord,ijkc)
164 
165  DO icv=1,ncv
166  rhs(icv,ijkc) = t*(rhs(icv,ijkc) + epsirs(icoord,ijkc)*rhs(icv,ijkc1))
167  ENDDO
168 
169  ENDDO
170  ENDDO
171 
172  DO j=jpcend-1,jpcbeg,-1
173  jp1 = j + 1
174  DO i=ipcbeg,ipcend
175  ijkc = indijk(i,j ,k,icoff,ijcoff)
176  ijkc1 = indijk(i,jp1,k,icoff,ijcoff)
177  ijdum = indij(j,i,off1d) + 1
178 
179  DO icv=1,ncv
180  rhs(icv,ijkc) = rhs(icv,ijkc) + d(ijdum)*rhs(icv,ijkc1)
181  ENDDO
182 
183  ENDDO
184  ENDDO
185 
186  ENDDO ! k
187 
188 ! solution of tridiagonal system in K-direction
189 
190  DO j=jpcbeg,jpcend
191 
192  k = kpcbeg - 1
193  off1d = kpcend + 1
194  DO i=ipcbeg,ipcend
195  ijdum = indij(k,i,off1d) + 1
196  d(ijdum) = 0._rfreal
197  ENDDO
198 
199  DO k=kpcbeg,kpcend
200  km1 = k - 1
201  DO i=ipcbeg,ipcend
202  ijkc = indijk(i,j,k ,icoff,ijcoff)
203  ijkc1 = indijk(i,j,km1,icoff,ijcoff)
204  ijdum = indij(k ,i,off1d) + 1
205  ijdum1 = indij(km1,i,off1d) + 1
206  t = 1._rfreal/(1._rfreal+2._rfreal*epsirs(kcoord,ijkc)- &
207  epsirs(kcoord,ijkc)*d(ijdum1))
208  d(ijdum) = t*epsirs(kcoord,ijkc)
209 
210  DO icv=1,ncv
211  rhs(icv,ijkc) = t*(rhs(icv,ijkc) + epsirs(icoord,ijkc)*rhs(icv,ijkc1))
212  ENDDO
213 
214  ENDDO
215  ENDDO
216 
217  DO k=kpcend-1,kpcbeg,-1
218  kp1 = k + 1
219  DO i=ipcbeg,ipcend
220  ijkc = indijk(i,j,k ,icoff,ijcoff)
221  ijkc1 = indijk(i,j,kp1,icoff,ijcoff)
222  ijdum = indij(k,i,off1d) + 1
223 
224  DO icv=1,ncv
225  rhs(icv,ijkc) = rhs(icv,ijkc) + d(ijdum)*rhs(icv,ijkc1)
226  ENDDO
227 
228  ENDDO
229  ENDDO
230 
231  ENDDO ! j
232 
233 ! finalize --------------------------------------------------------------------
234 
235 999 CONTINUE
236 
237  CALL deregisterfunction( global )
238 
239 END SUBROUTINE turb_rflo_ransressmoothing
240 
241 !******************************************************************************
242 !
243 ! RCS Revision history:
244 !
245 ! $Log: TURB_rFLO_RansResSmoothing.F90,v $
246 ! Revision 1.3 2008/12/06 08:44:45 mtcampbe
247 ! Updated license.
248 !
249 ! Revision 1.2 2008/11/19 22:17:56 mtcampbe
250 ! Added Illinois Open Source License/Copyright
251 !
252 ! Revision 1.1 2004/03/11 03:26:33 wasistho
253 ! changed rocturb nomenclature
254 !
255 ! Revision 1.1 2004/03/08 23:35:46 wasistho
256 ! changed turb nomenclature
257 !
258 ! Revision 1.1 2003/10/07 02:17:03 wasistho
259 ! initial installation of RaNS-SA and DES
260 !
261 !
262 !******************************************************************************
263 
264 
265 
266 
267 
268 
269 
const NT & d
j indices k indices k
Definition: Indexing.h:6
NT rhs
**********************************************************************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 turb_rflo_ransressmoothing(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 ipcbeg
blockLoc i
Definition: read.cpp:79
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 jpcend
subroutine deregisterfunction(global)
Definition: ModError.F90:469
subroutine rflo_getdimensphys(region, iLev, ipcbeg, ipcend, jpcbeg, jpcend, kpcbeg, kpcend)