Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RFLO_C2fAvgCoeffsDummyPhys.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: Extrapolate coefficient from the interior domain or at the patch
26 ! to the dummy points at physical and symmetry boundaries.
27 !
28 ! Description: The averaging coefficients at dummy faces are obtained by
29 ! mirroring from the interior faces.
30 !
31 ! Input: region = current region data
32 ! lbound = patch boundary ID
33 ! i,j,kdir = direction identifier
34 ! i,j,kndBeg = i,j,k begin index
35 ! i,j,kndEnd = i,j,k end index
36 !
37 ! Output: Averaging coefficients c2fCoI, c2fCoJ, c2fCoK at dummy faces.
38 !
39 ! Notes: Mother routine = RFLO_C2fAvgCoeffsDummy.
40 !
41 !******************************************************************************
42 !
43 ! $Id: RFLO_C2fAvgCoeffsDummyPhys.F90,v 1.3 2008/12/06 08:44:26 mtcampbe Exp $
44 !
45 ! Copyright: (c) 2001 by the University of Illinois
46 !
47 !******************************************************************************
48 
49 SUBROUTINE rflo_c2favgcoeffsdummyphys( region,lbound,idir,jdir,kdir, &
50  indbeg,indend,jndbeg,jndend,kndbeg,kndend )
51 
52  USE moddatatypes
53  USE moddatastruct, ONLY : t_region
54  USE modglobal, ONLY : t_global
56  USE moderror
57  USE modparameters
58  IMPLICIT NONE
59 
60 #include "Indexing.h"
61 
62 ! ... parameters
63  TYPE(t_region) :: region
64  INTEGER :: lbound, idir, jdir, kdir
65  INTEGER :: indbeg, indend, jndbeg, jndend, kndbeg, kndend
66 
67 ! ... loop variables
68  INTEGER :: i, j, k, idum, jdum, kdum
69 
70 ! ... local variables
71  TYPE(t_global), POINTER :: global
72 
73  INTEGER :: ilev, inoff, ijnoff
74  INTEGER :: ijknb, ijkni, ijknj, ijknk, ijknd
75  INTEGER :: coindxi(2), coindxj(2), coindxk(2)
76  INTEGER :: ig(3), jg(3), kg(3), ir(3), jr(3), kr(3)
77  INTEGER :: idumb(3), jdumb(3), kdumb(3), idume(3), jdume(3), kdume(3)
78 
79 !******************************************************************************
80 
81  global => region%global
82  CALL registerfunction( global,'RFLO_C2fAvgCoeffsDummyPhys',&
83  'RFLO_C2fAvgCoeffsDummyPhys.F90' )
84 
85 ! get dimensions and pointers -------------------------------------------------
86 
87  ilev = region%currLevel
88  CALL rflo_getnodeoffset( region,ilev,inoff,ijnoff )
89 
90  IF (lbound==1 .OR. lbound==3 .OR. lbound==5) THEN
91  idumb(:) = -idir*region%nDumCells
92  jdumb(:) = -jdir*region%nDumCells
93  kdumb(:) = -kdir*region%nDumCells
94  idume(:) = -idir
95  jdume(:) = -jdir
96  kdume(:) = -kdir
97  ELSE
98  idumb(:) = 0
99  jdumb(:) = 0
100  kdumb(:) = 0
101  idume(:) = -idir*region%nDumCells
102  jdume(:) = -jdir*region%nDumCells
103  kdume(:) = -kdir*region%nDumCells
104  ENDIF
105 
106  ig(:)=-abs(idir); jg(:)=-abs(jdir); kg(:)=-abs(kdir)
107  IF (lbound == 1) THEN
108  ig(1)=0
109  ELSE IF (lbound == 3) THEN
110  jg(2)=0
111  ELSE IF (lbound == 5) THEN
112  kg(3)=0
113  ELSE IF (lbound == 2) THEN
114  ig(1)=0
115  idumb(1) = idumb(1)-idir
116  ELSE IF (lbound == 4) THEN
117  jg(2)=0
118  jdumb(2) = jdumb(2)-jdir
119  ELSE IF (lbound == 6) THEN
120  kg(3)=0
121  kdumb(3) = kdumb(3)-kdir
122  ENDIF
123 
124  IF (lbound==1 .OR. lbound==2) THEN
125  coindxi(1) = 2
126  coindxi(2) = 1
127  coindxj(1) = 1
128  coindxj(2) = 2
129  coindxk(1) = 1
130  coindxk(2) = 2
131  ELSEIF (lbound==3 .OR. lbound==4) THEN
132  coindxi(1) = 1
133  coindxi(2) = 2
134  coindxj(1) = 2
135  coindxj(2) = 1
136  coindxk(1) = 1
137  coindxk(2) = 2
138  ELSEIF (lbound==5 .OR. lbound==6) THEN
139  coindxi(1) = 1
140  coindxi(2) = 2
141  coindxj(1) = 1
142  coindxj(2) = 2
143  coindxk(1) = 2
144  coindxk(2) = 1
145  ENDIF
146 
147 ! specify averaging coefficients at dummy points by mirroring
148 ! 2D loop over patch nodes
149 
150  DO k=kndbeg,kndend
151  DO j=jndbeg,jndend
152  DO i=indbeg,indend
153 
154 ! ----- 1D loop in direction normal to patch to define dummy face values
155 
156  DO idum=idumb(1),idume(1)
157  DO jdum=jdumb(1),jdume(1)
158  DO kdum=kdumb(1),kdume(1)
159  ijknd = indijk(i+idum,j+jdum,k+kdum,inoff,ijnoff) ! dummy points
160  ijkni = indijk(i+ig(1)-idum,j+jg(1)-jdum,k+kg(1)-kdum,inoff,ijnoff)
161  region%levels(ilev)%grid%c2fCoI(coindxi(2),ijknd) = &
162  region%levels(ilev)%grid%c2fCoI(2,ijkni)
163  region%levels(ilev)%grid%c2fCoI(coindxi(1),ijknd) = &
164  1._rfreal-region%levels(ilev)%grid%c2fCoI(coindxi(2),ijknd)
165  ENDDO
166  ENDDO
167  ENDDO
168 
169  DO idum=idumb(2),idume(2)
170  DO jdum=jdumb(2),jdume(2)
171  DO kdum=kdumb(2),kdume(2)
172  ijknd = indijk(i+idum,j+jdum,k+kdum,inoff,ijnoff) ! dummy points
173  ijknj = indijk(i+ig(2)-idum,j+jg(2)-jdum,k+kg(2)-kdum,inoff,ijnoff) ! interior
174  region%levels(ilev)%grid%c2fCoJ(coindxj(2),ijknd) = &
175  region%levels(ilev)%grid%c2fCoJ(2,ijknj)
176  region%levels(ilev)%grid%c2fCoJ(coindxj(1),ijknd) = &
177  1._rfreal-region%levels(ilev)%grid%c2fCoJ(coindxj(2),ijknd)
178  ENDDO
179  ENDDO
180  ENDDO
181 
182  DO idum=idumb(3),idume(3)
183  DO jdum=jdumb(3),jdume(3)
184  DO kdum=kdumb(3),kdume(3)
185  ijknd = indijk(i+idum,j+jdum,k+kdum,inoff,ijnoff) ! dummy points
186  ijknk = indijk(i+ig(3)-idum,j+jg(3)-jdum,k+kg(3)-kdum,inoff,ijnoff) ! interior
187  region%levels(ilev)%grid%c2fCoK(coindxk(2),ijknd) = &
188  region%levels(ilev)%grid%c2fCoK(2,ijknk)
189  region%levels(ilev)%grid%c2fCoK(coindxk(1),ijknd) = &
190  1._rfreal-region%levels(ilev)%grid%c2fCoK(coindxk(2),ijknd)
191  ENDDO
192  ENDDO
193  ENDDO
194 
195  ENDDO ! i
196  ENDDO ! j
197  ENDDO ! k
198 
199 ! finalize --------------------------------------------------------------------
200 
201  CALL deregisterfunction( global )
202 
203 END SUBROUTINE rflo_c2favgcoeffsdummyphys
204 
205 !******************************************************************************
206 !
207 ! RCS Revision history:
208 !
209 ! $Log: RFLO_C2fAvgCoeffsDummyPhys.F90,v $
210 ! Revision 1.3 2008/12/06 08:44:26 mtcampbe
211 ! Updated license.
212 !
213 ! Revision 1.2 2008/11/19 22:17:37 mtcampbe
214 ! Added Illinois Open Source License/Copyright
215 !
216 ! Revision 1.1 2004/11/29 20:51:38 wasistho
217 ! lower to upper case
218 !
219 ! Revision 1.3 2004/08/03 00:52:13 wasistho
220 ! changed avgCo to c2fCo in the description
221 !
222 ! Revision 1.2 2004/08/02 19:32:48 wasistho
223 ! changed grid%avgCo to grid%c2fCo
224 !
225 ! Revision 1.1 2004/07/30 17:30:31 wasistho
226 ! initial import routines starting with RFLO_c2fAvg...
227 !
228 !
229 !
230 !******************************************************************************
231 
232 
233 
234 
235 
236 
237 
j indices k indices k
Definition: Indexing.h:6
subroutine rflo_c2favgcoeffsdummyphys(region, lbound, idir, jdir, kdir, indBeg, indEnd, jndBeg, jndEnd, kndBeg, kndEnd)
subroutine registerfunction(global, funName, fileName)
Definition: ModError.F90:449
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
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
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 kdir
subroutine deregisterfunction(global)
Definition: ModError.F90:469