Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RFLO_ExchangeCornerEdgeCells.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: copy values to edge and corner cells of an adjacent region.
26 !
27 ! Description: this is for the case if the other region is located
28 ! on the same processor.
29 !
30 ! Input: regions = data of all regions
31 ! iReg = current region.
32 !
33 ! Output: new values of conservative variables.
34 !
35 ! Notes: none.
36 !
37 !******************************************************************************
38 !
39 ! $Id: RFLO_ExchangeCornerEdgeCells.F90,v 1.4 2008/12/06 08:44:26 mtcampbe Exp $
40 !
41 ! Copyright: (c) 2001 by the University of Illinois
42 !
43 !******************************************************************************
44 
45 SUBROUTINE rflo_exchangecorneredgecells( regions,iReg )
46 
47  USE moddatatypes
48  USE moddatastruct, ONLY : t_region, t_level
49  USE modglobal, ONLY : t_global
52  USE moderror
53  USE modparameters
54  IMPLICIT NONE
55 
56 #include "Indexing.h"
57 
58 ! ... parameters
59  TYPE(t_region), POINTER :: regions(:)
60 
61  INTEGER :: ireg
62 
63 ! ... loop variables
64  INTEGER :: iedge, icorner, ijk, i, j, k
65 
66 ! ... local variables
67  INTEGER :: icell, iregsrc, ilev, gasmodel, icoff, ijcoff, ijkd
68  INTEGER :: ibeg, iend, jbeg, jend, kbeg, kend
69 
70  REAL(RFREAL), POINTER :: cv(:,:), cvsrc(:,:)
71 
72  TYPE(t_global), POINTER :: global
73  TYPE(t_level), POINTER :: level
74 
75 !******************************************************************************
76 
77  global => regions(ireg)%global
78 
79  CALL registerfunction( global,'RFLO_ExchangeCornerEdgeCells',&
80  'RFLO_ExchangeCornerEdgeCells.F90' )
81 
82 ! get dimensions and pointers
83 
84  ilev = regions(ireg)%currLevel
85 
86  CALL rflo_getcelloffset( regions(ireg),ilev,icoff,ijcoff )
87 
88  gasmodel = regions(ireg)%mixtInput%gasModel
89  level => regions(ireg)%levels(ilev)
90  cv => level%mixt%cv
91 
92 ! edge cells
93 
94  DO iedge=1,12
95  IF (level%edgeCells(iedge)%interact .AND. &
96  level%edgeCells(iedge)%degenrt==degenerat_none) THEN
97  CALL rflo_getedgecellsindices( regions(ireg),ilev,iedge, &
98  ibeg,iend,jbeg,jend,kbeg,kend )
99  ijk = 0
100  DO k=kbeg,kend
101  DO j=jbeg,jend
102  DO i=ibeg,iend
103  ijk = ijk + 1
104  ijkd = indijk(i,j,k,icoff,ijcoff)
105  icell = level%edgeCells(iedge)%cells(ijk)%srcCell
106  iregsrc = level%edgeCells(iedge)%cells(ijk)%srcRegion
107  IF (iregsrc > 0) THEN
108  IF (regions(iregsrc)%procid == global%myProcid) THEN
109  cvsrc => regions(iregsrc)%levels(ilev)%mixt%cv
110 
111  IF (level%edgeCells(iedge)%cells(ijk)%rotate) THEN
112  ! rotational periodicity
113  ELSE
114  cv(cv_mixt_dens,ijkd) = cvsrc(cv_mixt_dens,icell)
115  cv(cv_mixt_xmom,ijkd) = cvsrc(cv_mixt_xmom,icell)
116  cv(cv_mixt_ymom,ijkd) = cvsrc(cv_mixt_ymom,icell)
117  cv(cv_mixt_zmom,ijkd) = cvsrc(cv_mixt_zmom,icell)
118  cv(cv_mixt_ener,ijkd) = cvsrc(cv_mixt_ener,icell)
119  ENDIF
120 
121  IF (gasmodel == gas_model_tcperf) THEN
122  CALL mixtureproperties( regions(ireg),ijkd,ijkd,.false. )
123  ELSE
124  CALL mixtureproperties( regions(ireg),ijkd,ijkd,.true. )
125  ENDIF
126  ENDIF
127  ENDIF
128  ENDDO ! i
129  ENDDO ! j
130  ENDDO ! k
131  ENDIF ! interact
132  ENDDO ! iedge
133 
134 ! corner cells
135 
136  DO icorner=1,8
137  IF (level%cornerCells(icorner)%interact .AND. &
138  level%cornerCells(icorner)%degenrt==degenerat_none) THEN
139  CALL rflo_getcornercellsindices( regions(ireg),ilev,icorner, &
140  ibeg,iend,jbeg,jend,kbeg,kend )
141  ijk = 0
142  DO k=kbeg,kend
143  DO j=jbeg,jend
144  DO i=ibeg,iend
145  ijk = ijk + 1
146  ijkd = indijk(i,j,k,icoff,ijcoff)
147  icell = level%cornerCells(icorner)%cells(ijk)%srcCell
148  iregsrc = level%cornerCells(icorner)%cells(ijk)%srcRegion
149  IF (iregsrc > 0) THEN
150  IF (regions(iregsrc)%procid == global%myProcid) THEN
151  cvsrc => regions(iregsrc)%levels(ilev)%mixt%cv
152 
153  IF (level%cornerCells(icorner)%cells(ijk)%rotate) THEN
154  ! rotational periodicity
155  ELSE
156  cv(cv_mixt_dens,ijkd) = cvsrc(cv_mixt_dens,icell)
157  cv(cv_mixt_xmom,ijkd) = cvsrc(cv_mixt_xmom,icell)
158  cv(cv_mixt_ymom,ijkd) = cvsrc(cv_mixt_ymom,icell)
159  cv(cv_mixt_zmom,ijkd) = cvsrc(cv_mixt_zmom,icell)
160  cv(cv_mixt_ener,ijkd) = cvsrc(cv_mixt_ener,icell)
161  ENDIF
162 
163  IF (gasmodel == gas_model_tcperf) THEN
164  CALL mixtureproperties( regions(ireg),ijkd,ijkd,.false. )
165  ELSE
166  CALL mixtureproperties( regions(ireg),ijkd,ijkd,.true. )
167  ENDIF
168  ENDIF
169  ENDIF
170  ENDDO ! i
171  ENDDO ! j
172  ENDDO ! k
173  ENDIF ! interact
174  ENDDO ! icorner
175 
176 ! finalize
177 
178  CALL deregisterfunction( global )
179 
180 END SUBROUTINE rflo_exchangecorneredgecells
181 
182 !******************************************************************************
183 !
184 ! RCS Revision history:
185 !
186 ! $Log: RFLO_ExchangeCornerEdgeCells.F90,v $
187 ! Revision 1.4 2008/12/06 08:44:26 mtcampbe
188 ! Updated license.
189 !
190 ! Revision 1.3 2008/11/19 22:17:37 mtcampbe
191 ! Added Illinois Open Source License/Copyright
192 !
193 ! Revision 1.2 2005/10/31 21:09:36 haselbac
194 ! Changed specModel and SPEC_MODEL_NONE
195 !
196 ! Revision 1.1 2004/11/29 20:51:39 wasistho
197 ! lower to upper case
198 !
199 ! Revision 1.13 2004/09/02 01:35:02 wasistho
200 ! replaced 0 with DEGENERAT_NONE
201 !
202 ! Revision 1.12 2004/09/02 01:22:52 wasistho
203 ! do not exchange and send/recv for degenerated e/c
204 !
205 ! Revision 1.11 2003/11/20 16:40:39 mdbrandy
206 ! Backing out RocfluidMP changes from 11-17-03
207 !
208 ! Revision 1.7 2003/05/15 02:57:03 jblazek
209 ! Inlined index function.
210 !
211 ! Revision 1.6 2003/02/14 22:32:37 jblazek
212 ! Finished implementation of corener and edge cells.
213 !
214 ! Revision 1.5 2003/02/03 19:20:47 jblazek
215 ! Added treatment of edge and corner cells for one processor.
216 !
217 ! Revision 1.4 2002/09/05 17:40:21 jblazek
218 ! Variable global moved into regions().
219 !
220 ! Revision 1.3 2002/03/18 23:11:33 jblazek
221 ! Finished multiblock and MPI.
222 !
223 ! Revision 1.2 2002/02/21 23:25:06 jblazek
224 ! Blocks renamed as regions.
225 !
226 ! Revision 1.1 2002/01/31 20:20:13 jblazek
227 ! Added treatment of edge & corner cells.
228 !
229 !******************************************************************************
230 
231 
232 
233 
234 
235 
236 
subroutine rflo_getedgecellsindices(region, iLev, iedge, iebeg, ieend, jebeg, jeend, kebeg, keend)
**********************************************************************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
j indices k indices k
Definition: Indexing.h:6
subroutine registerfunction(global, funName, fileName)
Definition: ModError.F90:449
subroutine rflo_exchangecorneredgecells(regions, iReg)
**********************************************************************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
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 icorner
subroutine rflo_getcornercellsindices(region, iLev, icorner, icbeg, icend, jcbeg, jcend, kcbeg, kcend)
**********************************************************************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 icell
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 knode jbeg
subroutine mixtureproperties(region, inBeg, inEnd, gasUpdate)
**********************************************************************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