Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RADI_floFlimCentFlux.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: compute central convective flux FLD eq. by average of variables.
26 !
27 ! Description: none.
28 !
29 ! Input: region = data of current region.
30 !
31 ! Output: region%levels%radi%rhs = convective fluxes added to FLD residual.
32 !
33 ! Notes: grid speeds si,j,kVel already contain face area
34 !
35 !******************************************************************************
36 !
37 ! $Id: RADI_floFlimCentFlux.F90,v 1.3 2008/12/06 08:44:38 mtcampbe Exp $
38 !
39 ! Copyright: (c) 2003 by the University of Illinois
40 !
41 !******************************************************************************
42 
43 SUBROUTINE radi_floflimcentflux( region )
44 
45  USE moddatatypes
46  USE moddatastruct, ONLY : t_region
50  USE moderror
51  USE modparameters
53  IMPLICIT NONE
54 
55 #include "Indexing.h"
56 
57 ! ... parameters
58  TYPE(t_region) :: region
59 
60 ! ... loop variables
61  INTEGER :: i, j, k, ipatch
62 
63 ! ... local variables
64  INTEGER :: ipcbeg, ipcend, jpcbeg, jpcend, kpcbeg, kpcend
65  INTEGER :: ilev, icoff, ijcoff, inoff, ijnoff, ijkc0, ijkc1, ijkn, indsvel
66 
67  REAL(RFREAL) :: radea, ua, va, wa, vcont, svel, fc
68  REAL(RFREAL), POINTER :: dv(:,:), rcv(:,:), rrhs(:,:)
69  REAL(RFREAL), POINTER :: aci(:,:), acj(:,:), ack(:,:)
70  REAL(RFREAL), POINTER :: si(:,:), sj(:,:), sk(:,:)
71  REAL(RFREAL), POINTER :: sivel(:), sjvel(:), skvel(:)
72 
73 !******************************************************************************
74 
75  CALL registerfunction( region%global,'RADI_FloFlimCentFlux',&
76  'RADI_floFlimCentFlux.F90' )
77 
78 ! get dimensions and pointers -------------------------------------------------
79 
80  ilev = region%currLevel
81 
82  CALL rflo_getdimensphys( region,ilev,ipcbeg,ipcend, &
83  jpcbeg,jpcend,kpcbeg,kpcend )
84  CALL rflo_getcelloffset( region,ilev,icoff,ijcoff )
85  CALL rflo_getnodeoffset( region,ilev,inoff,ijnoff )
86 
87  dv => region%levels(ilev)%mixt%dv
88  rcv => region%levels(ilev)%radi%cv
89  rrhs => region%levels(ilev)%radi%rhs
90  aci => region%levels(ilev)%grid%c2fCoI
91  acj => region%levels(ilev)%grid%c2fCoJ
92  ack => region%levels(ilev)%grid%c2fCoK
93  si => region%levels(ilev)%grid%si
94  sj => region%levels(ilev)%grid%sj
95  sk => region%levels(ilev)%grid%sk
96  sivel => region%levels(ilev)%grid%siVel
97  sjvel => region%levels(ilev)%grid%sjVel
98  skvel => region%levels(ilev)%grid%skVel
99  indsvel = region%levels(ilev)%grid%indSvel
100 
101 ! flux in i-direction (except through boundary) -------------------------------
102 
103  DO k=kpcbeg,kpcend
104  DO j=jpcbeg,jpcend
105  DO i=ipcbeg+1,ipcend
106  ijkc0 = indijk(i ,j,k,icoff,ijcoff)
107  ijkc1 = indijk(i-1,j,k,icoff,ijcoff)
108  ijkn = indijk(i ,j,k,inoff,ijnoff)
109 
110  radea = aci(2,ijkn)*rcv(cv_radi_ener,ijkc0)+ &
111  aci(1,ijkn)*rcv(cv_radi_ener,ijkc1)
112  ua = aci(2,ijkn)*dv(dv_mixt_uvel,ijkc0)+ &
113  aci(1,ijkn)*dv(dv_mixt_uvel,ijkc1)
114  va = aci(2,ijkn)*dv(dv_mixt_vvel,ijkc0)+ &
115  aci(1,ijkn)*dv(dv_mixt_vvel,ijkc1)
116  wa = aci(2,ijkn)*dv(dv_mixt_wvel,ijkc0)+ &
117  aci(1,ijkn)*dv(dv_mixt_wvel,ijkc1)
118 
119  svel = sivel(ijkn*indsvel)
120  vcont = ua*si(xcoord,ijkn)+va*si(ycoord,ijkn)+wa*si(zcoord,ijkn)-svel
121 
122  fc = vcont*radea
123 
124  rrhs(cv_radi_ener,ijkc0) = rrhs(cv_radi_ener,ijkc0) + fc
125  rrhs(cv_radi_ener,ijkc1) = rrhs(cv_radi_ener,ijkc1) - fc
126  ENDDO ! i
127  ENDDO ! j
128  ENDDO ! k
129 
130 ! flux in j-direction (except through boundary) -------------------------------
131 
132  DO k=kpcbeg,kpcend
133  DO j=jpcbeg+1,jpcend
134  DO i=ipcbeg,ipcend
135  ijkc0 = indijk(i,j ,k,icoff,ijcoff)
136  ijkc1 = indijk(i,j-1,k,icoff,ijcoff)
137  ijkn = indijk(i,j ,k,inoff,ijnoff)
138 
139  radea = acj(2,ijkn)*rcv(cv_radi_ener,ijkc0)+ &
140  acj(1,ijkn)*rcv(cv_radi_ener,ijkc1)
141  ua = acj(2,ijkn)*dv(dv_mixt_uvel,ijkc0)+ &
142  acj(1,ijkn)*dv(dv_mixt_uvel,ijkc1)
143  va = acj(2,ijkn)*dv(dv_mixt_vvel,ijkc0)+ &
144  acj(1,ijkn)*dv(dv_mixt_vvel,ijkc1)
145  wa = acj(2,ijkn)*dv(dv_mixt_wvel,ijkc0)+ &
146  acj(1,ijkn)*dv(dv_mixt_wvel,ijkc1)
147 
148  svel = sjvel(ijkn*indsvel)
149  vcont = ua*sj(xcoord,ijkn)+va*sj(ycoord,ijkn)+wa*sj(zcoord,ijkn)-svel
150 
151  fc = vcont*radea
152 
153  rrhs(cv_radi_ener,ijkc0) = rrhs(cv_radi_ener,ijkc0) + fc
154  rrhs(cv_radi_ener,ijkc1) = rrhs(cv_radi_ener,ijkc1) - fc
155  ENDDO ! i
156  ENDDO ! j
157  ENDDO ! k
158 
159 ! flux in k-direction (except through boundary) -------------------------------
160 
161  DO k=kpcbeg+1,kpcend
162  DO j=jpcbeg,jpcend
163  DO i=ipcbeg,ipcend
164  ijkc0 = indijk(i,j,k ,icoff,ijcoff)
165  ijkc1 = indijk(i,j,k-1,icoff,ijcoff)
166  ijkn = indijk(i,j,k ,inoff,ijnoff)
167 
168  radea = ack(2,ijkn)*rcv(cv_radi_ener,ijkc0)+ &
169  ack(1,ijkn)*rcv(cv_radi_ener,ijkc1)
170  ua = ack(2,ijkn)*dv(dv_mixt_uvel,ijkc0)+ &
171  ack(1,ijkn)*dv(dv_mixt_uvel,ijkc1)
172  va = ack(2,ijkn)*dv(dv_mixt_vvel,ijkc0)+ &
173  ack(1,ijkn)*dv(dv_mixt_vvel,ijkc1)
174  wa = ack(2,ijkn)*dv(dv_mixt_wvel,ijkc0)+ &
175  ack(1,ijkn)*dv(dv_mixt_wvel,ijkc1)
176 
177  svel = skvel(ijkn*indsvel)
178  vcont = ua*sk(xcoord,ijkn)+va*sk(ycoord,ijkn)+wa*sk(zcoord,ijkn)-svel
179 
180  fc = vcont*radea
181 
182  rrhs(cv_radi_ener,ijkc0) = rrhs(cv_radi_ener,ijkc0) + fc
183  rrhs(cv_radi_ener,ijkc1) = rrhs(cv_radi_ener,ijkc1) - fc
184  ENDDO ! i
185  ENDDO ! j
186  ENDDO ! k
187 
188 ! fluxes through boundaries ---------------------------------------------------
189 
190  DO ipatch=1,region%nPatches
191  CALL radi_floflimcentfluxpatch( region, &
192  region%levels(ilev)%patches(ipatch) )
193  ENDDO
194 
195 ! finalize --------------------------------------------------------------------
196 
197  CALL deregisterfunction( region%global )
198 
199 END SUBROUTINE radi_floflimcentflux
200 
201 !******************************************************************************
202 !
203 ! RCS Revision history:
204 !
205 ! $Log: RADI_floFlimCentFlux.F90,v $
206 ! Revision 1.3 2008/12/06 08:44:38 mtcampbe
207 ! Updated license.
208 !
209 ! Revision 1.2 2008/11/19 22:17:50 mtcampbe
210 ! Added Illinois Open Source License/Copyright
211 !
212 ! Revision 1.1 2004/09/30 17:49:10 wasistho
213 ! prepared for full FLD radiation model
214 !
215 !
216 !
217 !******************************************************************************
218 
219 
220 
221 
222 
223 
224 
subroutine radi_floflimcentflux(region)
j indices k indices k
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 kpcbeg
subroutine registerfunction(global, funName, fileName)
Definition: ModError.F90:449
**********************************************************************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 jpcbeg
**********************************************************************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 ipcend
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 ipcbeg
blockLoc i
Definition: read.cpp:79
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 jpcend
subroutine radi_floflimcentfluxpatch(region, patch)
subroutine deregisterfunction(global)
Definition: ModError.F90:469
subroutine rflo_getdimensphys(region, iLev, ipcbeg, ipcend, jpcbeg, jpcend, kpcbeg, kpcend)