Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PEUL_SpectralRadii.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 spectral radii for smoke
26 !
27 ! Description: none.
28 !
29 ! Input: regions = data of all grid regions.
30 !
31 ! Output: regions%levels%peul%srad = convective spectral radii for smoke
32 !
33 ! Notes: none.
34 !
35 !******************************************************************************
36 !
37 ! $Id: PEUL_SpectralRadii.F90,v 1.3 2008/12/06 08:44:39 mtcampbe Exp $
38 !
39 ! Copyright: (c) 2002 by the University of Illinois
40 !
41 !******************************************************************************
42 
43 SUBROUTINE peul_spectralradii( region ) ! PUBLIC
44 
45  USE moddatatypes
46  USE moddatastruct, ONLY : t_region
47  USE modglobal, ONLY : t_global
52  USE moderror
53  USE modparameters
54  IMPLICIT NONE
55 
56 #include "Indexing.h"
57 
58 ! ... parameters
59  TYPE(t_region), INTENT(INOUT) :: region
60 
61 ! ... loop variables
62  INTEGER :: i, j, k
63 
64 ! ... local variables
65  CHARACTER(CHRLEN) :: rcsidentstring
66 
67  INTEGER :: idcbeg, idcend, jdcbeg, jdcend, kdcbeg, kdcend
68  INTEGER :: ilev, icoff, ijcoff, inoff, ijnoff, ijkc, ijkn, ijkn1, indsvel
69 
70  REAL(RFREAL) :: rrho, u, v, w, sx, sy, sz, ds, svel, vc
71  REAL(RFREAL), POINTER :: cv(:,:)
72  REAL(RFREAL), POINTER :: si(:,:), sj(:,:), sk(:,:), vol(:)
73  REAL(RFREAL), POINTER :: sivel(:), sjvel(:), skvel(:)
74  REAL(RFREAL), POINTER :: srad(:,:)
75 
76  TYPE(t_global), POINTER :: global
77 
78 !******************************************************************************
79 
80  rcsidentstring = '$RCSfile: PEUL_SpectralRadii.F90,v $ $Revision: 1.3 $'
81 
82  global => region%global
83 
84  CALL registerfunction( global,'PEUL_SpectralRadii',&
85  'PEUL_SpectralRadii.F90' )
86 
87 ! get dimensions and pointers -------------------------------------------------
88 
89  ilev = region%currLevel
90 
91  CALL rflo_getdimensdummy( region,ilev,idcbeg,idcend,jdcbeg,jdcend, &
92  kdcbeg,kdcend )
93  CALL rflo_getcelloffset( region,ilev,icoff,ijcoff )
94  CALL rflo_getnodeoffset( region,ilev,inoff,ijnoff )
95 
96  cv => region%levels(ilev)%mixt%cv
97 
98  si => region%levels(ilev)%grid%si
99  sj => region%levels(ilev)%grid%sj
100  sk => region%levels(ilev)%grid%sk
101  vol => region%levels(ilev)%grid%vol
102  sivel => region%levels(ilev)%grid%siVel
103  sjvel => region%levels(ilev)%grid%sjVel
104  skvel => region%levels(ilev)%grid%skVel
105  indsvel = region%levels(ilev)%grid%indSvel
106 
107  srad => region%levels(ilev)%peul%srad
108 
109 ! local time step, spectral radii ---------------------------------------------
110 
111  DO k=kdcbeg,kdcend
112  DO j=jdcbeg,jdcend
113  DO i=idcbeg,idcend
114  ijkc = indijk(i,j,k,icoff,ijcoff)
115  ijkn = indijk(i,j,k,inoff,ijnoff)
116  rrho = 1._rfreal/cv(cv_mixt_dens,ijkc)
117  u = cv(cv_mixt_xmom,ijkc)*rrho
118  v = cv(cv_mixt_ymom,ijkc)*rrho
119  w = cv(cv_mixt_zmom,ijkc)*rrho
120 
121  ijkn1 = indijk(i+1,j,k,inoff,ijnoff)
122  sx = 0.5_rfreal*(si(xcoord,ijkn)+si(xcoord,ijkn1))
123  sy = 0.5_rfreal*(si(ycoord,ijkn)+si(ycoord,ijkn1))
124  sz = 0.5_rfreal*(si(zcoord,ijkn)+si(zcoord,ijkn1))
125  ds = sqrt(sx*sx+sy*sy+sz*sz)
126  svel = 0.5_rfreal*(sivel(ijkn*indsvel)+sivel(ijkn1*indsvel))
127  vc = sx*u + sy*v + sz*w - svel*ds
128  srad(icoord,ijkc) = abs(vc)
129 
130  ijkn1 = indijk(i,j+1,k,inoff,ijnoff)
131  sx = 0.5_rfreal*(sj(xcoord,ijkn)+sj(xcoord,ijkn1))
132  sy = 0.5_rfreal*(sj(ycoord,ijkn)+sj(ycoord,ijkn1))
133  sz = 0.5_rfreal*(sj(zcoord,ijkn)+sj(zcoord,ijkn1))
134  ds = sqrt(sx*sx+sy*sy+sz*sz)
135  svel = 0.5_rfreal*(sjvel(ijkn*indsvel)+sjvel(ijkn1*indsvel))
136  vc = sx*u + sy*v + sz*w - svel*ds
137  srad(jcoord,ijkc) = abs(vc)
138 
139  ijkn1 = indijk(i,j,k+1,inoff,ijnoff)
140  sx = 0.5_rfreal*(sk(xcoord,ijkn)+sk(xcoord,ijkn1))
141  sy = 0.5_rfreal*(sk(ycoord,ijkn)+sk(ycoord,ijkn1))
142  sz = 0.5_rfreal*(sk(zcoord,ijkn)+sk(zcoord,ijkn1))
143  ds = sqrt(sx*sx+sy*sy+sz*sz)
144  svel = 0.5_rfreal*(skvel(ijkn*indsvel)+skvel(ijkn1*indsvel))
145  vc = sx*u + sy*v + sz*w - svel*ds
146  srad(kcoord,ijkc) = abs(vc)
147 
148  ENDDO ! i
149  ENDDO ! j
150  ENDDO ! k
151 
152 ! treat dummy cells -----------------------------------------------------------
153 
154  CALL rflo_copymatrixpatches( ilev,region,srad )
155  CALL rflo_copymatrixedges( ilev,region,srad )
156  CALL rflo_copymatrixcorners( ilev,region,srad )
157 
158 ! finalize --------------------------------------------------------------------
159 
160  CALL deregisterfunction( global )
161 
162 END SUBROUTINE peul_spectralradii
163 
164 !******************************************************************************
165 !
166 ! RCS Revision history:
167 !
168 ! $Log: PEUL_SpectralRadii.F90,v $
169 ! Revision 1.3 2008/12/06 08:44:39 mtcampbe
170 ! Updated license.
171 !
172 ! Revision 1.2 2008/11/19 22:17:52 mtcampbe
173 ! Added Illinois Open Source License/Copyright
174 !
175 ! Revision 1.1 2004/12/01 21:10:01 haselbac
176 ! Initial revision after changing case
177 !
178 ! Revision 1.2 2003/05/15 02:57:05 jblazek
179 ! Inlined index function.
180 !
181 ! Revision 1.1 2003/02/11 22:52:51 jferry
182 ! Initial import of Rocsmoke
183 !
184 !
185 !******************************************************************************
186 
187 
188 
189 
190 
191 
192 
**********************************************************************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
subroutine peul_spectralradii(region)
j indices k indices k
Definition: Indexing.h:6
subroutine registerfunction(global, funName, fileName)
Definition: ModError.F90:449
subroutine rflo_copyvectorpatches(iLev, region, vec)
double sqrt(double d)
Definition: double.h:73
*********************************************************************Illinois Open Source License ****University of Illinois NCSA **Open Source License University of Illinois All rights reserved ****Developed free of to any person **obtaining a copy of this software and associated documentation to deal with the Software without including without limitation the rights to and or **sell copies of the and to permit persons to whom the **Software is furnished to do subject to the following this list of conditions and the following disclaimers ****Redistributions in binary form must reproduce the above **copyright this list of conditions and the following **disclaimers in the documentation and or other materials **provided with the distribution ****Neither the names of the Center for Simulation of Advanced the University of nor the names of its **contributors may be used to endorse or promote products derived **from this Software without specific prior written permission ****THE SOFTWARE IS PROVIDED AS 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 v
Definition: roccomf90.h:20
subroutine rflo_copymatrixpatches(iLev, region, mat)
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
subroutine rflo_copymatrixcorners(iLev, region, mat)
subroutine rflo_copymatrixedges(iLev, region, mat)
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
**********************************************************************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)