Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RFLO_C2eAvgCoeffsDegec.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: correct cell2edge averaging coeffs. in degenerated edges/corners.
26 !
27 ! Description: as the e/c is practically no exist, no real coordinates are
28 ! available, hence the 4 point coefficients are set to 0.25.
29 !
30 ! Notes: none.
31 !
32 ! ******************************************************************************
33 !
34 ! $Id: RFLO_C2eAvgCoeffsDegec.F90,v 1.3 2008/12/06 08:44:25 mtcampbe Exp $
35 !
36 ! Copyright: (c) 2004 by the University of Illinois
37 !
38 ! ******************************************************************************
39 
40 SUBROUTINE rflo_c2eavgcoeffsdegec( region )
41 
42  USE moddatatypes
43  USE modglobal, ONLY : t_global
44  USE moddatastruct, ONLY : t_region, t_level
47  USE moderror
48  USE modparameters
49  USE modmpi
50  IMPLICIT NONE
51 
52 #include "Indexing.h"
53 
54 ! ... parameters
55  TYPE(t_region) :: region
56 
57 ! ... loop variables
58  INTEGER :: iedge, icorner, i, j, k
59 
60 ! ... local variables
61  TYPE(t_global), POINTER :: global
62  TYPE(t_level), POINTER :: level
63 
64  INTEGER :: ilev, ijkn, inoff, ijnoff
65  INTEGER :: ibeg, iend, jbeg, jend, kbeg, kend
66  REAL(RFREAL), POINTER :: avgcoi(:,:), avgcoj(:,:), avgcok(:,:)
67 
68 ! ******************************************************************************
69 
70  global => region%global
71 
72  CALL registerfunction(global,'RFLO_C2eAvgCoeffsDegec',&
73  'RFLO_C2eAvgCoeffsDegec.F90')
74 
75 ! get parameters and pointers --------------------------------------------------
76 
77  ilev = region%currLevel
78  level => region%levels(ilev)
79  avgcoi => region%levels(ilev)%grid%c2eCoI
80  avgcoj => region%levels(ilev)%grid%c2eCoJ
81  avgcok => region%levels(ilev)%grid%c2eCoK
82 
83  CALL rflo_getnodeoffset( region,ilev,inoff,ijnoff )
84 
85 ! treat degenerat edges
86 
87  DO iedge = 1,12
88  IF (level%edgeCells(iedge)%degenrt /= degenerat_none) THEN
89  CALL rflo_getedgecellsindices( region,ilev,iedge, &
90  ibeg,iend,jbeg,jend,kbeg,kend )
91  CALL calcavgco
92  ENDIF ! degenrt
93  ENDDO ! iedge
94 
95 ! treat degenerat corners
96 
97  DO icorner = 1,8
98  IF (level%cornerCells(icorner)%degenrt /= degenerat_none) THEN
99  CALL rflo_getcornercellsindices( region,ilev,icorner, &
100  ibeg,iend,jbeg,jend,kbeg,kend )
101  CALL calcavgco
102  ENDIF ! degenrt
103  ENDDO ! icorner
104 
105 ! finalize ---------------------------------------------------------------------
106 
107  CALL deregisterfunction( global )
108 
109 ! =============================================================================
110 ! Averaging coefficients assignment
111 ! =============================================================================
112 
113 CONTAINS
114 
115  SUBROUTINE calcavgco
116 
117 ! - I-edge
118  DO k=kbeg,kend+1
119  DO j=jbeg,jend+1
120  DO i=ibeg,iend
121  ijkn = indijk(i ,j ,k ,inoff,ijnoff)
122  avgcoi(:,ijkn) = 0.25_rfreal
123  ENDDO
124  ENDDO
125  ENDDO
126 
127 ! - J-face
128  DO k=kbeg,kend+1
129  DO j=jbeg,jend
130  DO i=ibeg,iend+1
131  ijkn = indijk(i ,j ,k ,inoff,ijnoff)
132  avgcoj(:,ijkn) = 0.25_rfreal
133  ENDDO
134  ENDDO
135  ENDDO
136 
137 ! - K-face
138  DO k=kbeg,kend
139  DO j=jbeg,jend+1
140  DO i=ibeg,iend+1
141  ijkn = indijk(i ,j ,k ,inoff,ijnoff)
142  avgcok(:,ijkn) = 0.25_rfreal
143  ENDDO
144  ENDDO
145  ENDDO
146 
147  END SUBROUTINE calcavgco
148 
149 END SUBROUTINE rflo_c2eavgcoeffsdegec
150 
151 ! ******************************************************************************
152 !
153 ! RCS Revision history:
154 !
155 ! $Log: RFLO_C2eAvgCoeffsDegec.F90,v $
156 ! Revision 1.3 2008/12/06 08:44:25 mtcampbe
157 ! Updated license.
158 !
159 ! Revision 1.2 2008/11/19 22:17:36 mtcampbe
160 ! Added Illinois Open Source License/Copyright
161 !
162 ! Revision 1.1 2004/11/29 20:51:38 wasistho
163 ! lower to upper case
164 !
165 ! Revision 1.1 2004/08/25 07:49:15 wasistho
166 ! added RFLO_C2f/eAvgCoeffsDegec and RFLO_InitAvgCoeffs
167 !
168 !
169 ! ******************************************************************************
170 
171 
172 
173 
174 
175 
176 
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_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 knode iend
subroutine calcavgco
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 icorner
subroutine rflo_getcornercellsindices(region, iLev, icorner, icbeg, icend, jcbeg, jcend, kcbeg, kcend)
subroutine rflo_c2eavgcoeffsdegec(region)
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
**********************************************************************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