Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RFLO_ExchangeDummyConf.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: exchange values between interior and dummy cells of the
26 ! corresponding patches of the adjacent regions (both regions
27 ! are on the same processor).
28 !
29 ! Description: none.
30 !
31 ! Input: region = current region
32 ! regionSrc = source region
33 ! patch = current patch of region
34 ! patchSrc = source patch of regionSrc.
35 !
36 ! Output: regions%levels%mixt%cv = flow variables in dummy cells.
37 !
38 ! Notes: intended for conforming grid boundaries only.
39 !
40 !******************************************************************************
41 !
42 ! $Id: RFLO_ExchangeDummyConf.F90,v 1.4 2008/12/06 08:44:26 mtcampbe Exp $
43 !
44 ! Copyright: (c) 2001 by the University of Illinois
45 !
46 !******************************************************************************
47 
48 SUBROUTINE rflo_exchangedummyconf( region,regionSrc,patch,patchSrc )
49 
50  USE moddatatypes
51  USE modbndpatch, ONLY : t_patch
52  USE moddatastruct, ONLY : t_region
53  USE modindexing, ONLY : indijkmap
56  USE moderror
57  USE modparameters
58  IMPLICIT NONE
59 
60 #include "Indexing.h"
61 
62 ! ... parameters
63  TYPE(t_region) :: region, regionsrc
64  TYPE(t_patch) :: patch, patchsrc
65 
66 ! ... loop variables
67  INTEGER :: idum, i, j, k, ii, jj, kk
68 
69 ! ... local variables
70  INTEGER :: ibeg, iend, jbeg, jend, kbeg, kend, idir, jdir, kdir, &
71  icoff, ijcoff, ijkd, ilev, gasmodel
72  INTEGER :: ibegsrc, iendsrc, jbegsrc, jendsrc, kbegsrc, kendsrc, &
73  idirsrc, jdirsrc, kdirsrc, icoffsrc, ijcoffsrc, ijkcsrc
74  INTEGER :: lb, lbs, l1srcdir, l2srcdir, mapmat(3,4)
75 
76  LOGICAL :: align
77 
78  REAL(RFREAL), POINTER :: cv(:,:), cvsrc(:,:)
79 
80 !******************************************************************************
81 
82  CALL registerfunction( region%global,'RFLO_ExchangeDummyConf',&
83  'RFLO_ExchangeDummyConf.F90' )
84 
85 ! check if the source region is active
86 
87  IF (regionsrc%active == off) THEN
88  CALL errorstop( region%global,err_srcregion_off,__line__ )
89  ENDIF
90 
91 ! get dimensions and pointers
92 
93  ilev = region%currLevel
94 
95  CALL rflo_getpatchindices( region,patch,ilev,ibeg,iend, &
96  jbeg,jend,kbeg,kend )
97  CALL rflo_getpatchindices( regionsrc,patchsrc,ilev,ibegsrc,iendsrc, &
98  jbegsrc,jendsrc,kbegsrc,kendsrc )
100  CALL rflo_getpatchdirection( patchsrc,idirsrc,jdirsrc,kdirsrc )
101  CALL rflo_getcelloffset( region ,ilev,icoff ,ijcoff )
102  CALL rflo_getcelloffset( regionsrc,ilev,icoffsrc,ijcoffsrc )
103 
104  gasmodel = region%mixtInput%gasModel
105 
106  cv => region%levels(ilev)%mixt%cv
107  cvsrc => regionsrc%levels(ilev)%mixt%cv
108 
109 ! mapping between patches
110 
111  l1srcdir = 1
112  IF (patch%srcL1beg > patch%srcL1end) l1srcdir = -1
113  l2srcdir = 1
114  IF (patch%srcL2beg > patch%srcL2end) l2srcdir = -1
115 
116  lb = patch%lbound
117  lbs = patch%srcLbound
118  align = patch%align
119 
120  CALL rflo_getpatchmapping( lb,lbs,l1srcdir,l2srcdir,align, &
121  idir,jdir,kdir,idirsrc,jdirsrc,kdirsrc, &
122  ibeg,iend,jbeg,jend,kbeg,kend, &
123  ibegsrc,iendsrc,jbegsrc,jendsrc,kbegsrc,kendsrc, &
124  mapmat )
125 
126 ! loop over dummy nodes of current patch
127 
128  DO idum=1,region%nDumCells
129  DO k=kbeg,kend
130  DO j=jbeg,jend
131  DO i=ibeg,iend
132  ii = i - idum*idir
133  jj = j - idum*jdir
134  kk = k - idum*kdir
135  ijkd = indijk(ii,jj,kk,icoff,ijcoff)
136  ijkcsrc = indijkmap(ii,jj,kk,mapmat,icoffsrc,ijcoffsrc)
137 
138  cv(cv_mixt_dens,ijkd) = cvsrc(cv_mixt_dens,ijkcsrc)
139  cv(cv_mixt_xmom,ijkd) = cvsrc(cv_mixt_xmom,ijkcsrc)
140  cv(cv_mixt_ymom,ijkd) = cvsrc(cv_mixt_ymom,ijkcsrc)
141  cv(cv_mixt_zmom,ijkd) = cvsrc(cv_mixt_zmom,ijkcsrc)
142  cv(cv_mixt_ener,ijkd) = cvsrc(cv_mixt_ener,ijkcsrc)
143 
144  IF (gasmodel == gas_model_tcperf) THEN
145  CALL mixtureproperties( region,ijkd,ijkd,.false. )
146  ELSE
147  CALL mixtureproperties( region,ijkd,ijkd,.true. )
148  ENDIF
149  ENDDO ! i
150  ENDDO ! j
151  ENDDO ! k
152  ENDDO ! idum
153 
154 ! finalize
155 
156  CALL deregisterfunction( region%global )
157 
158 END SUBROUTINE rflo_exchangedummyconf
159 
160 !******************************************************************************
161 !
162 ! RCS Revision history:
163 !
164 ! $Log: RFLO_ExchangeDummyConf.F90,v $
165 ! Revision 1.4 2008/12/06 08:44:26 mtcampbe
166 ! Updated license.
167 !
168 ! Revision 1.3 2008/11/19 22:17:37 mtcampbe
169 ! Added Illinois Open Source License/Copyright
170 !
171 ! Revision 1.2 2005/10/31 21:09:36 haselbac
172 ! Changed specModel and SPEC_MODEL_NONE
173 !
174 ! Revision 1.1 2004/11/29 20:51:39 wasistho
175 ! lower to upper case
176 !
177 ! Revision 1.12 2003/11/20 16:40:39 mdbrandy
178 ! Backing out RocfluidMP changes from 11-17-03
179 !
180 ! Revision 1.8 2003/05/15 02:57:04 jblazek
181 ! Inlined index function.
182 !
183 ! Revision 1.7 2002/09/27 00:57:10 jblazek
184 ! Changed makefiles - no makelinks needed.
185 !
186 ! Revision 1.6 2002/09/05 17:40:21 jblazek
187 ! Variable global moved into regions().
188 !
189 ! Revision 1.5 2002/08/16 21:33:48 jblazek
190 ! Changed interface to MixtureProperties.
191 !
192 ! Revision 1.4 2002/03/18 23:11:33 jblazek
193 ! Finished multiblock and MPI.
194 !
195 ! Revision 1.3 2002/02/21 23:25:06 jblazek
196 ! Blocks renamed as regions.
197 !
198 ! Revision 1.2 2002/01/31 20:56:30 jblazek
199 ! Added basic boundary conditions.
200 !
201 ! Revision 1.1 2002/01/28 23:55:22 jblazek
202 ! Added flux computation (central scheme).
203 !
204 !******************************************************************************
205 
206 
207 
208 
209 
210 
211 
**********************************************************************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
subroutine rflo_getpatchdirection(patch, idir, jdir, kdir)
j indices k indices k
Definition: Indexing.h:6
INTEGER function indijkmap(i, j, k, mapMat, iOffset, ijOffset)
Definition: ModIndexing.F90:67
subroutine registerfunction(global, funName, fileName)
Definition: ModError.F90:449
subroutine rflo_getpatchindices(region, patch, iLev, ibeg, iend, jbeg, jend, kbeg, kend)
subroutine rflo_exchangedummyconf(region, regionSrc, patch, patchSrc)
**********************************************************************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
subroutine errorstop(global, errorCode, errorLine, addMessage)
Definition: ModError.F90:483
**********************************************************************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 mixtureproperties(region, inBeg, inEnd, gasUpdate)
subroutine rflo_getpatchmapping(lb, lbs, l1SrcDir, l2SrcDir, align, idir, jdir, kdir, idirSrc, jdirSrc, kdirSrc, ibeg, iend, jbeg, jend, kbeg, kend, ibegSrc, iendSrc, jbegSrc, jendSrc, kbegSrc, kendSrc, mapMat)
**********************************************************************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