Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TURB_floRansSARoe1stFlux.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 SA convective fluxes based on 1st-order Roe upwind scheme.
26 !
27 ! Description: none.
28 !
29 ! Input: region = data of current region.
30 !
31 ! Output: region%levels%turb%rhs = convective fluxes added to the residual.
32 !
33 ! Notes: none.
34 !
35 !******************************************************************************
36 !
37 ! $Id: TURB_floRansSARoe1stFlux.F90,v 1.4 2008/12/06 08:44:44 mtcampbe Exp $
38 !
39 ! Copyright: (c) 2003 by the University of Illinois
40 !
41 !******************************************************************************
42 
43 SUBROUTINE turb_floranssaroe1stflux( 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) :: qsl, qsr, fc
68  REAL(RFREAL), POINTER :: cv(:,:), dv(:,:), si(:,:), sj(:,:), sk(:,:)
69  REAL(RFREAL), POINTER :: tcv(:,:), trhs(:,:), sivel(:), sjvel(:), skvel(:)
70 
71 !******************************************************************************
72 
73  CALL registerfunction( region%global,'TURB_FloRansSARoe1stFlux',&
74  'TURB_floRansSARoe1stFlux.F90' )
75 
76 ! get dimensions and pointers -------------------------------------------------
77 
78  ilev = region%currLevel
79 
80  CALL rflo_getdimensphys( region,ilev,ipcbeg,ipcend, &
81  jpcbeg,jpcend,kpcbeg,kpcend )
82  CALL rflo_getcelloffset( region,ilev,icoff,ijcoff )
83  CALL rflo_getnodeoffset( region,ilev,inoff,ijnoff )
84 
85  cv => region%levels(ilev)%mixt%cv
86  dv => region%levels(ilev)%mixt%dv
87  tcv => region%levels(ilev)%turb%cv
88  trhs => region%levels(ilev)%turb%rhs
89  si => region%levels(ilev)%grid%si
90  sj => region%levels(ilev)%grid%sj
91  sk => region%levels(ilev)%grid%sk
92  sivel => region%levels(ilev)%grid%siVel
93  sjvel => region%levels(ilev)%grid%sjVel
94  skvel => region%levels(ilev)%grid%skVel
95  indsvel = region%levels(ilev)%grid%indSvel
96 
97 ! flux in i-direction (except through boundary) -------------------------------
98 
99  DO k=kpcbeg,kpcend
100  DO j=jpcbeg,jpcend
101  DO i=ipcbeg+1,ipcend
102  ijkc0 = indijk(i ,j,k,icoff,ijcoff)
103  ijkc1 = indijk(i-1,j,k,icoff,ijcoff)
104  ijkn = indijk(i ,j,k,inoff,ijnoff)
105 
106  qsl = dv(dv_mixt_uvel,ijkc1)*si(xcoord,ijkn) + &
107  dv(dv_mixt_vvel,ijkc1)*si(ycoord,ijkn) + &
108  dv(dv_mixt_wvel,ijkc1)*si(zcoord,ijkn) - sivel(ijkn*indsvel)
109  qsr = dv(dv_mixt_uvel,ijkc0)*si(xcoord,ijkn) + &
110  dv(dv_mixt_vvel,ijkc0)*si(ycoord,ijkn) + &
111  dv(dv_mixt_wvel,ijkc0)*si(zcoord,ijkn) - sivel(ijkn*indsvel)
112 
113  fc = 0.5_rfreal*(qsl*tcv(cv_sa_nutil,ijkc1)+ &
114  qsr*tcv(cv_sa_nutil,ijkc0))
115 
116  trhs(cv_sa_nutil,ijkc0) = trhs(cv_sa_nutil,ijkc0) + fc
117  trhs(cv_sa_nutil,ijkc1) = trhs(cv_sa_nutil,ijkc1) - fc
118  ENDDO ! i
119  ENDDO ! j
120  ENDDO ! k
121 
122 ! flux in j-direction (except through boundary) -------------------------------
123 
124  DO k=kpcbeg,kpcend
125  DO j=jpcbeg+1,jpcend
126  DO i=ipcbeg,ipcend
127  ijkc0 = indijk(i,j ,k,icoff,ijcoff)
128  ijkc1 = indijk(i,j-1,k,icoff,ijcoff)
129  ijkn = indijk(i,j ,k,inoff,ijnoff)
130 
131  qsl = dv(dv_mixt_uvel,ijkc1)*sj(xcoord,ijkn) + &
132  dv(dv_mixt_vvel,ijkc1)*sj(ycoord,ijkn) + &
133  dv(dv_mixt_wvel,ijkc1)*sj(zcoord,ijkn) - sjvel(ijkn*indsvel)
134  qsr = dv(dv_mixt_uvel,ijkc0)*sj(xcoord,ijkn) + &
135  dv(dv_mixt_vvel,ijkc0)*sj(ycoord,ijkn) + &
136  dv(dv_mixt_wvel,ijkc0)*sj(zcoord,ijkn) - sjvel(ijkn*indsvel)
137 
138  fc = 0.5_rfreal*(qsl*tcv(cv_sa_nutil,ijkc1)+ &
139  qsr*tcv(cv_sa_nutil,ijkc0))
140 
141  trhs(cv_sa_nutil,ijkc0) = trhs(cv_sa_nutil,ijkc0) + fc
142  trhs(cv_sa_nutil,ijkc1) = trhs(cv_sa_nutil,ijkc1) - fc
143  ENDDO ! i
144  ENDDO ! j
145  ENDDO ! k
146 
147 ! flux in k-direction (except through boundary) -------------------------------
148 
149  DO k=kpcbeg+1,kpcend
150  DO j=jpcbeg,jpcend
151  DO i=ipcbeg,ipcend
152  ijkc0 = indijk(i,j,k ,icoff,ijcoff)
153  ijkc1 = indijk(i,j,k-1,icoff,ijcoff)
154  ijkn = indijk(i,j,k ,inoff,ijnoff)
155 
156  qsl = dv(dv_mixt_uvel,ijkc1)*sk(xcoord,ijkn) + &
157  dv(dv_mixt_vvel,ijkc1)*sk(ycoord,ijkn) + &
158  dv(dv_mixt_wvel,ijkc1)*sk(zcoord,ijkn) - skvel(ijkn*indsvel)
159  qsr = dv(dv_mixt_uvel,ijkc0)*sk(xcoord,ijkn) + &
160  dv(dv_mixt_vvel,ijkc0)*sk(ycoord,ijkn) + &
161  dv(dv_mixt_wvel,ijkc0)*sk(zcoord,ijkn) - skvel(ijkn*indsvel)
162 
163  fc = 0.5_rfreal*(qsl*tcv(cv_sa_nutil,ijkc1)+ &
164  qsr*tcv(cv_sa_nutil,ijkc0))
165 
166  trhs(cv_sa_nutil,ijkc0) = trhs(cv_sa_nutil,ijkc0) + fc
167  trhs(cv_sa_nutil,ijkc1) = trhs(cv_sa_nutil,ijkc1) - fc
168  ENDDO ! i
169  ENDDO ! j
170  ENDDO ! k
171 
172 ! fluxes through boundaries ---------------------------------------------------
173 
174  DO ipatch=1,region%nPatches
175  CALL turb_floranssaroefluxpatch( region, &
176  region%levels(ilev)%patches(ipatch) )
177  ENDDO
178 
179 ! finalize --------------------------------------------------------------------
180 
181  CALL deregisterfunction( region%global )
182 
183 END SUBROUTINE turb_floranssaroe1stflux
184 
185 !******************************************************************************
186 !
187 ! RCS Revision history:
188 !
189 ! $Log: TURB_floRansSARoe1stFlux.F90,v $
190 ! Revision 1.4 2008/12/06 08:44:44 mtcampbe
191 ! Updated license.
192 !
193 ! Revision 1.3 2008/11/19 22:17:56 mtcampbe
194 ! Added Illinois Open Source License/Copyright
195 !
196 ! Revision 1.2 2004/03/12 02:55:36 wasistho
197 ! changed rocturb routine names
198 !
199 ! Revision 1.1 2004/03/08 23:35:46 wasistho
200 ! changed turb nomenclature
201 !
202 ! Revision 1.1 2003/10/27 04:54:38 wasistho
203 ! added RaNS upwind schemes
204 !
205 !
206 !******************************************************************************
207 
208 
209 
210 
211 
212 
213 
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 turb_floranssaroe1stflux(region)
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)
subroutine turb_floranssaroefluxpatch(region, patch)
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 deregisterfunction(global)
Definition: ModError.F90:469
subroutine rflo_getdimensphys(region, iLev, ipcbeg, ipcend, jpcbeg, jpcend, kpcbeg, kpcend)