Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RFLO_C2eAvgCoeffs.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: Construct cell to edge (four points) averaging coefficients.
26 !
27 ! Description: the coefficients are obtained following an i,j,k cycle:
28 ! coefficients surrounding edge-i are computed by first performing
29 ! cell2face averaging in the j direction and then face2edge in the
30 ! k direction. The same way for edge-j and edge-k.
31 !
32 ! Input: region = info of current region data
33 !
34 ! Output: c2eCoI, c2eCoJ, c2eCoK = averaging coefficients at i, j and k edges
35 !
36 ! Notes: none.
37 !
38 !******************************************************************************
39 !
40 ! $Id: RFLO_C2eAvgCoeffs.F90,v 1.3 2008/12/06 08:44:25 mtcampbe Exp $
41 !
42 ! Copyright: (c) 2001 by the University of Illinois
43 !
44 !******************************************************************************
45 SUBROUTINE rflo_c2eavgcoeffs( region )
46 
47  USE moddatatypes
48  USE moddatastruct, ONLY : t_region
49  USE modglobal, ONLY : t_global
50  USE modinterfaces, ONLY : rflo_getdimensdummy, &
53  USE moderror
54  USE modparameters
55  IMPLICIT NONE
56 
57 #include "Indexing.h"
58 
59 ! ... parameters
60  TYPE(t_region) :: region
61 
62 ! ... loop variables
63  INTEGER :: i, j, k
64 
65 ! ... local variables
66  TYPE(t_global), POINTER :: global
67 
68  INTEGER :: idcbeg,idcend,jdcbeg,jdcend,kdcbeg,kdcend
69  INTEGER :: ilev,icoff,ijcoff,inoff,ijnoff
70  INTEGER, PARAMETER :: idir=1, jdir=2, kdir=3
71 
72  REAL(RFREAL), POINTER :: avgco(:,:), c2fco2(:,:), c2fco3(:,:)
73 
74 !******************************************************************************
75 
76  global => region%global
77  CALL registerfunction( global,'RFLO_C2eAvgCoeffs',&
78  'RFLO_C2eAvgCoeffs.F90' )
79 
80 ! get indices and pointers ---------------------------------------------------
81 
82  ilev = region%currLevel
83 
84  CALL rflo_getdimensdummy( region,ilev,idcbeg,idcend, &
85  jdcbeg,jdcend,kdcbeg,kdcend )
86  CALL rflo_getcelloffset( region,ilev,icoff,ijcoff )
87  CALL rflo_getnodeoffset( region,ilev,inoff,ijnoff )
88 
89 ! compute averaging coefficient at i, j, k edges
90 
91  CALL computeavgco( idir )
92  CALL computeavgco( jdir )
93  CALL computeavgco( kdir )
94 
95 ! correct averaging coefficients at degenerated edges/corners -----------------
96 
97  IF (global%degenrtEc) THEN
98  CALL rflo_c2eavgcoeffsdegec( region )
99  ENDIF
100 
101 ! finalize --------------------------------------------------------------------
102 
103  CALL deregisterfunction( global )
104 
105 ! =============================================================================
106 ! Averaging coefficients computation subroutine
107 ! =============================================================================
108 
109 CONTAINS
110 
111  SUBROUTINE computeavgco( ijk )
112 
113 ! ... parameters
114  INTEGER :: ijk
115 
116 ! ... local variables
117  INTEGER :: ibeg,iend,jbeg,jend,kbeg,kend
118  INTEGER :: i2,j2,k2, i3,j3,k3
119  INTEGER :: corner(3)
120  REAL(RFREAL) :: ec0, ec1
121 
122 ! - Set limits and pointers ---------------------------------------------------
123  IF (ijk==idir) THEN
124  ibeg = idcbeg
125  iend = idcend
126  jbeg = jdcbeg+1
127  jend = jdcend
128  kbeg = kdcbeg+1
129  kend = kdcend
130  i2 = 0
131  j2 = 0
132  k2 = -1
133  i3 = 0
134  j3 = -1
135  k3 = 0
136  avgco => region%levels(ilev)%grid%c2eCoI
137  c2fco2 => region%levels(ilev)%grid%c2fCoJ
138  c2fco3 => region%levels(ilev)%grid%c2fCoK
139  ELSEIF (ijk==jdir) THEN
140  ibeg = idcbeg+1
141  iend = idcend
142  jbeg = jdcbeg
143  jend = jdcend
144  kbeg = kdcbeg+1
145  kend = kdcend
146  i2 = -1
147  j2 = 0
148  k2 = 0
149  i3 = 0
150  j3 = 0
151  k3 = -1
152  avgco => region%levels(ilev)%grid%c2eCoJ
153  c2fco2 => region%levels(ilev)%grid%c2fCoK
154  c2fco3 => region%levels(ilev)%grid%c2fCoI
155  ELSEIF (ijk==kdir) THEN
156  ibeg = idcbeg+1
157  iend = idcend
158  jbeg = jdcbeg+1
159  jend = jdcend
160  kbeg = kdcbeg
161  kend = kdcend
162  i2 = 0
163  j2 = -1
164  k2 = 0
165  i3 = -1
166  j3 = 0
167  k3 = 0
168  avgco => region%levels(ilev)%grid%c2eCoK
169  c2fco2 => region%levels(ilev)%grid%c2fCoI
170  c2fco3 => region%levels(ilev)%grid%c2fCoJ
171  ENDIF
172 
173 ! - define 4-points averaging coefficients for non-uniform grid
174 
175  DO k=kbeg,kend
176  DO j=jbeg,jend
177  DO i=ibeg,iend
178  corner(1) = indijk(i ,j ,k ,inoff,ijnoff)
179  corner(2) = indijk(i+i2 ,j+j2 ,k+k2 ,inoff,ijnoff)
180  corner(3) = indijk(i+i3 ,j+j3 ,k+k3 ,inoff,ijnoff)
181 
182  ec0 = 0.5_rfreal*(c2fco3(1,corner(1))+c2fco3(1,corner(3)))
183  ec1 = 1._rfreal-ec0
184 
185  avgco(1,corner(1)) = ec1*c2fco2(2,corner(2))
186  avgco(2,corner(1)) = ec1*c2fco2(1,corner(2))
187  avgco(3,corner(1)) = ec0*c2fco2(1,corner(1))
188  avgco(4,corner(1)) = ec0*c2fco2(2,corner(1))
189  ENDDO ! i
190  ENDDO ! j
191  ENDDO ! k
192 
193  END SUBROUTINE computeavgco
194 
195 END SUBROUTINE rflo_c2eavgcoeffs
196 
197 !******************************************************************************
198 !
199 ! RCS Revision history:
200 !
201 ! $Log: RFLO_C2eAvgCoeffs.F90,v $
202 ! Revision 1.3 2008/12/06 08:44:25 mtcampbe
203 ! Updated license.
204 !
205 ! Revision 1.2 2008/11/19 22:17:36 mtcampbe
206 ! Added Illinois Open Source License/Copyright
207 !
208 ! Revision 1.1 2004/11/29 20:51:38 wasistho
209 ! lower to upper case
210 !
211 ! Revision 1.3 2004/08/25 07:45:33 wasistho
212 ! added RFLO_C2eAvgCoeffsDegec
213 !
214 ! Revision 1.2 2004/08/09 21:44:00 wasistho
215 ! removed TURB_ModParameters
216 !
217 ! Revision 1.1 2004/08/03 22:46:50 wasistho
218 ! added RFLO_c2eAvgCoeffs
219 !
220 !
221 !******************************************************************************
222 
223 
224 
225 
226 
227 
228 
**********************************************************************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
**********************************************************************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 rflo_c2eavgcoeffs(region)
subroutine registerfunction(global, funName, fileName)
Definition: ModError.F90:449
subroutine computeavgco(ijk)
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
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 knode iend
**********************************************************************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
**********************************************************************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)
**********************************************************************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
subroutine rflo_c2eavgcoeffsdegec(region)
**********************************************************************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
**********************************************************************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 jdcbeg
**********************************************************************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
**********************************************************************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
**********************************************************************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