Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RFLO_CalcControlVolumes.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: calculate cell volumes.
26 !
27 ! Description: cell volumes are calculated based on the divergence theorem.
28 ! See the corresponding subroutine for the reference.
29 !
30 ! Input: region%levels%grid = dimensions, coordinates, face vectors
31 ! (current region)
32 !
33 ! Output: region%levels%grid%vol = cell volumes
34 !
35 ! Notes: volumes are first calculated for all cells. In a second step,
36 ! volumes are copied from interior to dummy cells at all but
37 ! inter-region or periodic boundaries. Face vectors must be already
38 ! defined before this routine is called.
39 !
40 !******************************************************************************
41 !
42 ! $Id: RFLO_CalcControlVolumes.F90,v 1.3 2008/12/06 08:44:26 mtcampbe Exp $
43 !
44 ! Copyright: (c) 2001 by the University of Illinois
45 !
46 !******************************************************************************
47 
48 SUBROUTINE rflo_calccontrolvolumes( region )
49 
50  USE moddatatypes
51  USE moddatastruct, ONLY : t_region
55  USE moderror
56  IMPLICIT NONE
57 
58 #include "Indexing.h"
59 
60 ! ... parameters
61  TYPE(t_region) :: region
62 
63 ! ... loop variables
64  INTEGER :: ilev, i, j, k
65 
66 ! ... local variables
67  INTEGER :: idcbeg, idcend, jdcbeg, jdcend, kdcbeg, kdcend
68  INTEGER :: icoff, ijcoff, inoff, ijnoff, ijkcell, corner(8)
69 
70  REAL(RFREAL) :: xyzhexa(3,8), facevecs(3,6)
71  REAL(RFREAL), POINTER :: xyz(:,:), si(:,:), sj(:,:), sk(:,:), vol(:)
72 
73 !******************************************************************************
74 
75  CALL registerfunction( region%global,'RFLO_CalcControlVolumes',&
76  'RFLO_CalcControlVolumes.F90' )
77 
78 ! volumes of all cells
79 
80  DO ilev=1,region%nGridLevels ! all grid levels
81 
82  CALL rflo_getdimensdummy( region,ilev,idcbeg,idcend, &
83  jdcbeg,jdcend,kdcbeg,kdcend )
84  CALL rflo_getcelloffset( region,ilev,icoff,ijcoff )
85  CALL rflo_getnodeoffset( region,ilev,inoff,ijnoff )
86 
87  xyz => region%levels(ilev)%grid%xyz
88  si => region%levels(ilev)%grid%si
89  sj => region%levels(ilev)%grid%sj
90  sk => region%levels(ilev)%grid%sk
91  vol => region%levels(ilev)%grid%vol
92 
93  DO k=kdcbeg,kdcend
94  DO j=jdcbeg,jdcend
95  DO i=idcbeg,idcend
96  ijkcell = indijk(i,j,k,icoff,ijcoff)
97  corner(1) = indijk(i ,j ,k ,inoff,ijnoff)
98  corner(2) = indijk(i ,j ,k+1,inoff,ijnoff)
99  corner(3) = indijk(i ,j+1,k+1,inoff,ijnoff)
100  corner(4) = indijk(i ,j+1,k ,inoff,ijnoff)
101  corner(5) = indijk(i+1,j ,k ,inoff,ijnoff)
102  corner(6) = indijk(i+1,j ,k+1,inoff,ijnoff)
103  corner(7) = indijk(i+1,j+1,k+1,inoff,ijnoff)
104  corner(8) = indijk(i+1,j+1,k ,inoff,ijnoff)
105 
106  xyzhexa(1:3,1) = xyz(1:3,corner(1))
107  xyzhexa(1:3,2) = xyz(1:3,corner(2))
108  xyzhexa(1:3,3) = xyz(1:3,corner(3))
109  xyzhexa(1:3,4) = xyz(1:3,corner(4))
110  xyzhexa(1:3,5) = xyz(1:3,corner(5))
111  xyzhexa(1:3,6) = xyz(1:3,corner(6))
112  xyzhexa(1:3,7) = xyz(1:3,corner(7))
113  xyzhexa(1:3,8) = xyz(1:3,corner(8))
114 
115  facevecs(1:3,1) = si(1:3,corner(1))
116  facevecs(1:3,2) = -si(1:3,corner(5))
117  facevecs(1:3,3) = sj(1:3,corner(1))
118  facevecs(1:3,4) = -sj(1:3,corner(4))
119  facevecs(1:3,5) = sk(1:3,corner(1))
120  facevecs(1:3,6) = -sk(1:3,corner(2))
121 
122  CALL volumehexa( xyzhexa,facevecs,vol(ijkcell) )
123  ENDDO
124  ENDDO
125  ENDDO
126 
127 ! - copy to dummy cells at patches
128 
129  CALL rflo_copyvectorpatches( ilev,region,vol )
130 
131 ! - copy to dummy cells at edges
132 
133  CALL rflo_copyvectoredges( ilev,region,vol )
134 
135 ! - copy to dummy cells at corners
136 
137  CALL rflo_copyvectorcorners( ilev,region,vol )
138 
139  ENDDO ! iLev
140 
141 ! finalize
142 
143  CALL deregisterfunction( region%global )
144 
145 END SUBROUTINE rflo_calccontrolvolumes
146 
147 !******************************************************************************
148 !
149 ! RCS Revision history:
150 !
151 ! $Log: RFLO_CalcControlVolumes.F90,v $
152 ! Revision 1.3 2008/12/06 08:44:26 mtcampbe
153 ! Updated license.
154 !
155 ! Revision 1.2 2008/11/19 22:17:37 mtcampbe
156 ! Added Illinois Open Source License/Copyright
157 !
158 ! Revision 1.1 2004/11/29 20:51:38 wasistho
159 ! lower to upper case
160 !
161 ! Revision 1.9 2003/11/20 16:40:36 mdbrandy
162 ! Backing out RocfluidMP changes from 11-17-03
163 !
164 ! Revision 1.5 2003/05/15 02:57:03 jblazek
165 ! Inlined index function.
166 !
167 ! Revision 1.4 2002/09/05 17:40:21 jblazek
168 ! Variable global moved into regions().
169 !
170 ! Revision 1.3 2002/02/21 23:25:05 jblazek
171 ! Blocks renamed as regions.
172 !
173 ! Revision 1.2 2002/01/23 03:51:25 jblazek
174 ! Added low-level time-stepping routines.
175 !
176 ! Revision 1.1 2002/01/08 22:09:17 jblazek
177 ! Added calculation of face vectors and volumes.
178 !
179 !******************************************************************************
180 
181 
182 
183 
184 
185 
186 
**********************************************************************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 idcend
j indices k indices k
Definition: Indexing.h:6
subroutine registerfunction(global, funName, fileName)
Definition: ModError.F90:449
subroutine rflo_copyvectorpatches(iLev, region, vec)
subroutine rflo_calccontrolvolumes(region)
subroutine rflo_getnodeoffset(region, iLev, iNodeOffset, ijNodeOffset)
subroutine rflo_getdimensdummy(region, iLev, idcbeg, idcend, jdcbeg, jdcend, kdcbeg, kdcend)
**********************************************************************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 kdcbeg
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 idcbeg
**********************************************************************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 jdcend
j indices j
Definition: Indexing.h:6
subroutine volumehexa(xyzNodes, faceVecs, volume)
**********************************************************************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 jdcbeg
subroutine rflo_copyvectorcorners(iLev, region, vec)
subroutine deregisterfunction(global)
Definition: ModError.F90:469
subroutine rflo_copyvectoredges(iLev, region, vec)
subroutine rflo_getdimensphys(region, iLev, ipcbeg, ipcend, jpcbeg, jpcend, kpcbeg, kpcend)