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