Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TURB_CalcVortic.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 vorticity components at cells.
26 !
27 ! Description: Velocity gradients at faces first averaged into cells.
28 ! The resulting cell gradients are then used to compute vorticity
29 ! components.
30 !
31 ! Input: region = data of current region
32 !
33 ! Output: x,y,z-vorticity, stored in turb%vort(XCOORD:ZCOORD,:)
34 !
35 ! Notes: none.
36 !
37 !******************************************************************************
38 !
39 ! $Id: TURB_CalcVortic.F90,v 1.7 2009/08/26 12:28:52 mtcampbe Exp $
40 !
41 ! Copyright: (c) 2001 by the University of Illinois
42 !
43 !******************************************************************************
44 
45 SUBROUTINE turb_calcvortic( region )
46 
47  USE moddatatypes
48  USE moddatastruct, ONLY : t_region
49  USE modglobal, ONLY : t_global
50  USE moderror
51  USE modparameters
53 #ifdef RFLO
54  USE modinterfaces, ONLY : rflo_getdimensdummy, &
56 #include "Indexing.h"
57 #endif
58  IMPLICIT NONE
59 
60 ! ... parameters
61  TYPE(t_region) :: region
62 
63 ! ... loop variables
64  INTEGER :: i, j, k, ic, idgr
65 
66 ! ... local variables
67  TYPE(t_global), POINTER :: global
68 
69  INTEGER :: errorflag
70  REAL(RFREAL), POINTER :: vort(:,:)
71 
72 #ifdef RFLO
73  INTEGER :: ilev, icoff, ijcoff, inoff, ijnoff
74  INTEGER :: ijkc, ijkn, ijkni, ijknj, ijknk
75  INTEGER :: idcbeg, idcend, jdcbeg, jdcend, kdcbeg, kdcend
76  REAL(RFREAL) :: oo6, grvel(gr_mixt_ux:gr_mixt_tz)
77  REAL(RFREAL), POINTER :: gradi(:,:), gradj(:,:), gradk(:,:)
78 #endif
79 #ifdef RFLU
80  REAL(RFREAL) :: grvel(xcoord:zcoord, grc_mixt_xvel:grc_mixt_zvel)
81  REAL(RFREAL), POINTER :: gradc(:,:,:)
82 #endif
83 
84 !******************************************************************************
85 
86  global => region%global
87  CALL registerfunction( global,'TURB_CalcVortic',&
88  'TURB_CalcVortic.F90' )
89 
90 #ifdef RFLO
91 ! get RFLO dimensions, pointers and parameters --------------------------------
92  ilev = region%currLevel
93 
94  CALL rflo_getdimensdummy( region,ilev,idcbeg,idcend, &
95  jdcbeg,jdcend,kdcbeg,kdcend )
96  CALL rflo_getcelloffset( region,ilev,icoff,ijcoff )
97  CALL rflo_getnodeoffset( region,ilev,inoff,ijnoff )
98 
99  gradi => region%levels(ilev)%mixt%gradi
100  gradj => region%levels(ilev)%mixt%gradj
101  gradk => region%levels(ilev)%mixt%gradk
102  vort => region%levels(ilev)%turb%vort
103 
104  oo6 = 1._rfreal/6._rfreal
105 
106 ! compute vorticities
107 
108  DO k = kdcbeg,kdcend
109  DO j = jdcbeg,jdcend
110  DO i = idcbeg,idcend
111  ijkc = indijk(i ,j ,k ,icoff,ijcoff)
112  ijkn = indijk(i ,j ,k ,inoff,ijnoff)
113  ijkni= indijk(i+1 ,j ,k ,inoff,ijnoff)
114  ijknj= indijk(i ,j+1 ,k ,inoff,ijnoff)
115  ijknk= indijk(i ,j ,k+1 ,inoff,ijnoff)
116 
117  DO idgr = gr_mixt_ux, gr_mixt_tz
118  grvel(idgr) = gradi(idgr,ijkn) + gradi(idgr,ijkni) + &
119  gradj(idgr,ijkn) + gradj(idgr,ijknj) + &
120  gradk(idgr,ijkn) + gradk(idgr,ijknk)
121  ENDDO
122 
123  vort(xcoord,ijkc) = oo6*(grvel(gr_mixt_wy) - grvel(gr_mixt_vz))
124  vort(ycoord,ijkc) = oo6*(grvel(gr_mixt_uz) - grvel(gr_mixt_wx))
125  vort(zcoord,ijkc) = oo6*(grvel(gr_mixt_vx) - grvel(gr_mixt_uy))
126  ENDDO ! i
127  ENDDO ! j
128  ENDDO ! k
129 #endif
130 
131 #ifdef RFLU
132 ! get RFLU dimensions, pointers and parameters --------------------------------
133 
134  IF (ASSOCIATED( region%mixt%gradCell ) .eqv. .true.) THEN
135  gradc => region%mixt%gradCell
136  vort => region%turb%vort
137 
138 ! - compute vorticities
139 
140  DO ic = 1,region%grid%nCellsTot
141  vort(xcoord,ic) = gradc(ycoord,grc_mixt_zvel,ic) - &
142  gradc(zcoord,grc_mixt_yvel,ic)
143  vort(ycoord,ic) = gradc(zcoord,grc_mixt_xvel,ic) - &
144  gradc(xcoord,grc_mixt_zvel,ic)
145  vort(zcoord,ic) = gradc(xcoord,grc_mixt_yvel,ic) - &
146  gradc(ycoord,grc_mixt_xvel,ic)
147  ENDDO ! ic
148  ENDIF ! gradCell allocated?
149 #endif
150 
151 ! finalize --------------------------------------------------------------------
152 
153  CALL deregisterfunction( global )
154 
155 END SUBROUTINE turb_calcvortic
156 
157 !******************************************************************************
158 !
159 ! RCS Revision history:
160 !
161 ! $Log: TURB_CalcVortic.F90,v $
162 ! Revision 1.7 2009/08/26 12:28:52 mtcampbe
163 ! Ported to Hera. Fixed logical expression syntax errors. Replaced all
164 ! IF (logical_variable) with IF (logical_variable .eqv. .true.) as
165 ! consistent with the specification. Also changed: IF( ASSOCIATED(expr) )
166 ! to IF ( ASSOCIATED(expr) .eqv. .true. ). Intel compilers produce code
167 ! which silently fails for some mal-formed expressions, so these changes
168 ! are a net which should ensure that they are evaluated as intended.
169 !
170 ! Revision 1.6 2008/12/06 08:44:41 mtcampbe
171 ! Updated license.
172 !
173 ! Revision 1.5 2008/11/19 22:17:53 mtcampbe
174 ! Added Illinois Open Source License/Copyright
175 !
176 ! Revision 1.4 2006/03/16 01:04:49 wasistho
177 ! compute RFLU vorticity only if gradCell allocated
178 !
179 ! Revision 1.3 2004/03/27 02:16:42 wasistho
180 ! compiled with Rocflu
181 !
182 ! Revision 1.2 2004/03/19 02:45:02 wasistho
183 ! prepared for RFLU
184 !
185 ! Revision 1.1 2004/03/05 04:37:00 wasistho
186 ! changed nomenclature
187 !
188 ! Revision 1.2 2004/02/12 22:16:55 wasistho
189 ! changed RFLO_GetDimensPhys to RFLO_GetDimensDummy
190 !
191 ! Revision 1.1 2003/08/06 15:58:41 wasistho
192 ! added vorticities computation
193 !
194 !
195 !
196 !******************************************************************************
197 
198 
199 
200 
201 
202 
203 
**********************************************************************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
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 ic
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
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 iEndG gradi(:,:)
subroutine turb_calcvortic(region)
**********************************************************************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 deregisterfunction(global)
Definition: ModError.F90:469
**********************************************************************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 iEndG gradj(:,:)