Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RFLO_TimeStepInviscid.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 max. allowable local/global time step in the case
26 ! of inviscid flow.
27 !
28 ! Description: none.
29 !
30 ! Input: regions = data of all grid regions.
31 !
32 ! Output: regions%levels%dt = local time step
33 ! regions%levels%srad = convective spectral radii
34 ! global%dtMin = global time step for all regions on this
35 ! processor(if unsteady flow).
36 !
37 ! Notes: none.
38 !
39 !******************************************************************************
40 !
41 ! $Id: RFLO_TimeStepInviscid.F90,v 1.3 2008/12/06 08:44:28 mtcampbe Exp $
42 !
43 ! Copyright: (c) 2001 by the University of Illinois
44 !
45 !******************************************************************************
46 
47 SUBROUTINE rflo_timestepinviscid( region )
48 
49  USE moddatatypes
50  USE moddatastruct, ONLY : t_region
51  USE modglobal, ONLY : t_global
56  USE moderror
57  USE modparameters
58  IMPLICIT NONE
59 
60 #include "Indexing.h"
61 
62 ! ... parameters
63  TYPE(t_region) :: region
64 
65 ! ... loop variables
66  INTEGER :: i, j, k
67 
68 ! ... local variables
69  INTEGER :: idcbeg, idcend, jdcbeg, jdcend, kdcbeg, kdcend
70  INTEGER :: ipcbeg, ipcend, jpcbeg, jpcend, kpcbeg, kpcend
71  INTEGER :: ilev, icoff, ijcoff, inoff, ijnoff, ijkc, ijkn, ijkn1, indsvel
72 
73  REAL(RFREAL) :: rrho, u, v, w, sx, sy, sz, ds, svel, vc, cs, sumsrad, dtmin
74  REAL(RFREAL), POINTER :: cv(:,:), dv(:,:), dt(:)
75  REAL(RFREAL), POINTER :: si(:,:), sj(:,:), sk(:,:), vol(:)
76  REAL(RFREAL), POINTER :: sivel(:), sjvel(:), skvel(:)
77  REAL(RFREAL), POINTER :: srad(:,:)
78 
79  TYPE(t_global), POINTER :: global
80 
81 !******************************************************************************
82 
83  global => region%global
84 
85  CALL registerfunction( global,'RFLO_TimeStepInviscid',&
86  'RFLO_TimeStepInviscid.F90' )
87 
88 ! get dimensions and pointers -------------------------------------------------
89 
90  ilev = region%currLevel
91 
92  CALL rflo_getdimensdummy( region,ilev,idcbeg,idcend,jdcbeg,jdcend, &
93  kdcbeg,kdcend )
94  CALL rflo_getdimensphys( region,ilev,ipcbeg,ipcend,jpcbeg,jpcend, &
95  kpcbeg,kpcend )
96  CALL rflo_getcelloffset( region,ilev,icoff,ijcoff )
97  CALL rflo_getnodeoffset( region,ilev,inoff,ijnoff )
98 
99  cv => region%levels(ilev)%mixt%cv
100  dv => region%levels(ilev)%mixt%dv
101  dt => region%levels(ilev)%dt
102 
103  si => region%levels(ilev)%grid%si
104  sj => region%levels(ilev)%grid%sj
105  sk => region%levels(ilev)%grid%sk
106  vol => region%levels(ilev)%grid%vol
107  sivel => region%levels(ilev)%grid%siVel
108  sjvel => region%levels(ilev)%grid%sjVel
109  skvel => region%levels(ilev)%grid%skVel
110  indsvel = region%levels(ilev)%grid%indSvel
111 
112  srad => region%levels(ilev)%mixt%srad
113 
114 ! local time step, spectral radii ---------------------------------------------
115 
116  DO k=kdcbeg,kdcend
117  DO j=jdcbeg,jdcend
118  DO i=idcbeg,idcend
119  ijkc = indijk(i,j,k,icoff,ijcoff)
120  ijkn = indijk(i,j,k,inoff,ijnoff)
121  rrho = 1._rfreal/cv(cv_mixt_dens,ijkc)
122  u = cv(cv_mixt_xmom,ijkc)*rrho
123  v = cv(cv_mixt_ymom,ijkc)*rrho
124  w = cv(cv_mixt_zmom,ijkc)*rrho
125 
126  ijkn1 = indijk(i+1,j,k,inoff,ijnoff)
127  sx = 0.5_rfreal*(si(xcoord,ijkn)+si(xcoord,ijkn1))
128  sy = 0.5_rfreal*(si(ycoord,ijkn)+si(ycoord,ijkn1))
129  sz = 0.5_rfreal*(si(zcoord,ijkn)+si(zcoord,ijkn1))
130  ds = sqrt(sx*sx+sy*sy+sz*sz)
131  svel = 0.5_rfreal*(sivel(ijkn*indsvel)+sivel(ijkn1*indsvel))
132  vc = sx*u + sy*v + sz*w - svel
133  cs = dv(dv_mixt_soun,ijkc)*ds
134  srad(icoord,ijkc) = abs(vc) + cs
135 
136  ijkn1 = indijk(i,j+1,k,inoff,ijnoff)
137  sx = 0.5_rfreal*(sj(xcoord,ijkn)+sj(xcoord,ijkn1))
138  sy = 0.5_rfreal*(sj(ycoord,ijkn)+sj(ycoord,ijkn1))
139  sz = 0.5_rfreal*(sj(zcoord,ijkn)+sj(zcoord,ijkn1))
140  ds = sqrt(sx*sx+sy*sy+sz*sz)
141  svel = 0.5_rfreal*(sjvel(ijkn*indsvel)+sjvel(ijkn1*indsvel))
142  vc = sx*u + sy*v + sz*w - svel
143  cs = dv(dv_mixt_soun,ijkc)*ds
144  srad(jcoord,ijkc) = abs(vc) + cs
145 
146  ijkn1 = indijk(i,j,k+1,inoff,ijnoff)
147  sx = 0.5_rfreal*(sk(xcoord,ijkn)+sk(xcoord,ijkn1))
148  sy = 0.5_rfreal*(sk(ycoord,ijkn)+sk(ycoord,ijkn1))
149  sz = 0.5_rfreal*(sk(zcoord,ijkn)+sk(zcoord,ijkn1))
150  ds = sqrt(sx*sx+sy*sy+sz*sz)
151  svel = 0.5_rfreal*(skvel(ijkn*indsvel)+skvel(ijkn1*indsvel))
152  vc = sx*u + sy*v + sz*w - svel
153  cs = dv(dv_mixt_soun,ijkc)*ds
154  srad(kcoord,ijkc) = abs(vc) + cs
155 
156  sumsrad = srad(icoord,ijkc) + srad(jcoord,ijkc) + srad(kcoord,ijkc)
157  sumsrad = max(sumsrad,1.e-30_rfreal)
158  dt(ijkc) = vol(ijkc)/sumsrad
159  ENDDO ! i
160  ENDDO ! j
161  ENDDO ! k
162 
163 ! treat dummy cells -----------------------------------------------------------
164 
165  CALL rflo_copyvectorpatches( ilev,region,dt )
166  CALL rflo_copyvectoredges( ilev,region,dt )
167  CALL rflo_copyvectorcorners( ilev,region,dt )
168 
169  CALL rflo_copymatrixpatches( ilev,region,srad )
170  CALL rflo_copymatrixedges( ilev,region,srad )
171  CALL rflo_copymatrixcorners( ilev,region,srad )
172 
173 ! global time step (this processor) -------------------------------------------
174 
175  IF (global%flowType == flow_unsteady) THEN
176  dtmin = global%dtMin
177 
178  DO k=kpcbeg,kpcend
179  DO j=jpcbeg,jpcend
180  DO i=ipcbeg,ipcend
181  ijkc = indijk(i,j,k,icoff,ijcoff)
182  dtmin = min(dtmin,dt(ijkc))
183  ENDDO ! i
184  ENDDO ! j
185  ENDDO ! k
186 
187  global%dtMin = dtmin
188  ENDIF
189 
190 ! finalize --------------------------------------------------------------------
191 
192  CALL deregisterfunction( global )
193 
194 END SUBROUTINE rflo_timestepinviscid
195 
196 !******************************************************************************
197 !
198 ! RCS Revision history:
199 !
200 ! $Log: RFLO_TimeStepInviscid.F90,v $
201 ! Revision 1.3 2008/12/06 08:44:28 mtcampbe
202 ! Updated license.
203 !
204 ! Revision 1.2 2008/11/19 22:17:39 mtcampbe
205 ! Added Illinois Open Source License/Copyright
206 !
207 ! Revision 1.1 2004/11/29 20:51:40 wasistho
208 ! lower to upper case
209 !
210 ! Revision 1.12 2003/11/20 16:40:40 mdbrandy
211 ! Backing out RocfluidMP changes from 11-17-03
212 !
213 ! Revision 1.8 2003/10/01 23:52:10 jblazek
214 ! Corrected bug in moving noslip wall BC and grid speeds.
215 !
216 ! Revision 1.7 2003/05/15 02:57:04 jblazek
217 ! Inlined index function.
218 !
219 ! Revision 1.6 2002/09/05 17:40:22 jblazek
220 ! Variable global moved into regions().
221 !
222 ! Revision 1.5 2002/08/30 18:25:55 jblazek
223 ! Forgot to multiply grid speeds by face area ...
224 !
225 ! Revision 1.4 2002/08/29 22:45:56 jblazek
226 ! Added support for moving grids.
227 !
228 ! Revision 1.3 2002/08/15 19:48:05 jblazek
229 ! Implemented grid deformation capability.
230 !
231 ! Revision 1.2 2002/02/21 23:25:06 jblazek
232 ! Blocks renamed as regions.
233 !
234 ! Revision 1.1 2002/02/09 01:47:01 jblazek
235 ! Added multi-probe option, residual smoothing, physical time step.
236 !
237 !******************************************************************************
238 
239 
240 
241 
242 
243 
244 
**********************************************************************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
**********************************************************************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
Vector_n max(const Array_n_const &v1, const Array_n_const &v2)
Definition: Vector_n.h:354
subroutine registerfunction(global, funName, fileName)
Definition: ModError.F90:449
subroutine rflo_copyvectorpatches(iLev, region, vec)
double sqrt(double d)
Definition: double.h:73
**********************************************************************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
*********************************************************************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)
**********************************************************************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
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
Vector_n min(const Array_n_const &v1, const Array_n_const &v2)
Definition: Vector_n.h:346
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
**********************************************************************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)
subroutine rflo_timestepinviscid(region)