Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TURB_WlmTauWallMapping.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: Mapping of modeled wall stress in body fitted coordinate to wall
26 ! stress components in Cartesian coordinate.
27 !
28 ! Description: Stress involves second derivatives of velocities. The mapping
29 ! proceeds hence in two steps corresponding with inner and outer
30 ! derivatives. The body fitted coordinate system is patch%lbound
31 ! dependent. Eta axis always directs to region interior in wall
32 ! normal direction. Xi and zeta follows positive i, j, or k
33 ! direction in the patch, and has the same directions for opposite
34 ! patches (lbound 1 and 2, 3 and 4, 5 and 6). Xi, eta, zeta is
35 ! thus right cycled at lbound 1, 3 and 5 and left cycled at 2, 4,
36 ! and 6. The face vector mapping is hence as follow:
37 !
38 ! lbound 1 : s_xi = -s_k, s_et = -si, s_zt = -s_j
39 ! lbound 2 : s_xi = -s_k, s_et = +si, s_zt = -s_j
40 ! lbound 3 : s_xi = -s_i, s_et = -sj, s_zt = -s_k
41 ! lbound 4 : s_xi = -s_i, s_et = +sj, s_zt = -s_k
42 ! lbound 5 : s_xi = -s_j, s_et = -sk, s_zt = -s_i
43 ! lbound 6 : s_xi = -s_j, s_et = +sk, s_zt = -s_i
44 !
45 ! Input: region = data of current region.
46 ! patch = current patch.
47 !
48 ! Output: modeled wall stresses in Cartesian coordinate.
49 !
50 ! Notes: none.
51 !
52 !******************************************************************************
53 !
54 ! $Id: TURB_WlmTauWallMapping.F90,v 1.4 2008/12/06 08:44:42 mtcampbe Exp $
55 !
56 ! Copyright: (c) 2001 by the University of Illinois
57 !
58 !******************************************************************************
59 
60 SUBROUTINE turb_wlmtauwallmapping( region,patch )
61 
62  USE moddatatypes
63  USE modbndpatch, ONLY : t_patch
64  USE moddatastruct, ONLY : t_region
65  USE modglobal, ONLY : t_global
66 #ifdef RFLO
68 
69 #include "Indexing.h"
70 #endif
71  USE moderror
72  USE modparameters
74  IMPLICIT NONE
75 
76 ! ... parameters
77  TYPE(t_region) :: region
78  TYPE(t_patch) :: patch
79 
80 ! ... loop variables
81  INTEGER :: i, j
82 
83 ! ... local variables
84  CHARACTER(CHRLEN) :: rcsidentstring
85  TYPE(t_global), POINTER :: global
86 
87  INTEGER :: ilev, lbound, indxb, indxe, jndxb, jndxe
88  INTEGER :: ibeg, iend, jbeg, jend, kbeg, kend
89  INTEGER :: n1, n2, ioff, ijbeg, ijend, errorflag, ijkval
90 
91  REAL(RFREAL), POINTER :: vals(:,:)
92  REAL(RFREAL), ALLOCATABLE :: tauwalltmp(:,:)
93 
94 !******************************************************************************
95 
96  rcsidentstring = '$RCSfile: TURB_WlmTauWallMapping.F90,v $ $Revision: 1.4 $'
97 
98  global => region%global
99  CALL registerfunction( global,'TURB_WlmTauWallMapping',&
100  'TURB_WlmTauWallMapping.F90' )
101 
102 ! get dimensions and parameters -------------------------------------------------
103 
104  vals => patch%valBola%vals
105 
106 #ifdef RFLO
107  ilev = region%currLevel
108  lbound = patch%lbound
109 
110  CALL rflo_getpatchindices( region,patch,ilev,ibeg,iend,jbeg,jend,kbeg,kend )
111 
112 ! allocate temporary workspace and perform mapping ------------------------------
113 
114  n1 = abs(patch%l1end-patch%l1beg)
115  n2 = abs(patch%l2end-patch%l2beg)
116  ioff = n1 + 1
117  ijbeg = indij( 0, 0,ioff)
118  ijend = indij(n1,n2,ioff)
119 #endif
120 #ifdef RFLU
121  ijbeg = 1
122  ijend = patch%nBFaces
123 #endif
124 
125  ALLOCATE( tauwalltmp(ijbeg:ijend,tensor_all_nelm),stat=errorflag )
126  global%error = errorflag
127  IF (global%error /= 0) CALL errorstop( global,err_allocate,__line__ )
128 
129 ! get begin and end indices for i, j and k directions and check for consistency
130 
131 #ifdef RFLO
132  IF (lbound==1 .OR. lbound==2) THEN
133  indxb = jbeg
134  indxe = jend
135  jndxb = kbeg
136  jndxe = kend
137  ELSEIF (lbound==3 .OR. lbound==4) THEN
138  indxb = kbeg
139  indxe = kend
140  jndxb = ibeg
141  jndxe = iend
142  ELSE
143  indxb = ibeg
144  indxe = iend
145  jndxb = jbeg
146  jndxe = jend
147  ENDIF
148 
149  IF (n1/=(indxe-indxb) .OR. n2/=(jndxe-jndxb)) THEN
150  CALL errorstop( global,err_patch_dimens,__line__, &
151  'Wlm patch dimension inconsistent' )
152  ENDIF
153 
154  DO j=jndxb,jndxe
155  DO i=indxb,indxe
156 
157  ijkval = indij(i-indxb ,j-jndxb ,indxe-indxb+1)
158 #endif
159 #ifdef RFLU
160  DO i=ijbeg,ijend
161  ijkval = i
162 #endif
163 
164 ! --- First step:
165 
166  tauwalltmp(ijkval,a11) = &
167  vals(ijkval,wlm_vals_xix)*vals(ijkval,wlm_vals_tauux) + &
168  vals(ijkval,wlm_vals_etx)*vals(ijkval,wlm_vals_tauuy) + &
169  vals(ijkval,wlm_vals_ztx)*vals(ijkval,wlm_vals_tauuz)
170 
171  tauwalltmp(ijkval,a12) = &
172  vals(ijkval,wlm_vals_xiy)*vals(ijkval,wlm_vals_tauux) + &
173  vals(ijkval,wlm_vals_ety)*vals(ijkval,wlm_vals_tauuy) + &
174  vals(ijkval,wlm_vals_zty)*vals(ijkval,wlm_vals_tauuz)
175 
176  tauwalltmp(ijkval,a13) = &
177  vals(ijkval,wlm_vals_xiz)*vals(ijkval,wlm_vals_tauux) + &
178  vals(ijkval,wlm_vals_etz)*vals(ijkval,wlm_vals_tauuy) + &
179  vals(ijkval,wlm_vals_ztz)*vals(ijkval,wlm_vals_tauuz)
180 ! -----
181  tauwalltmp(ijkval,a21) = &
182  vals(ijkval,wlm_vals_xix)*vals(ijkval,wlm_vals_tauvx) + &
183  vals(ijkval,wlm_vals_etx)*vals(ijkval,wlm_vals_tauvy) + &
184  vals(ijkval,wlm_vals_ztx)*vals(ijkval,wlm_vals_tauvz)
185 
186  tauwalltmp(ijkval,a22) = &
187  vals(ijkval,wlm_vals_xiy)*vals(ijkval,wlm_vals_tauvx) + &
188  vals(ijkval,wlm_vals_ety)*vals(ijkval,wlm_vals_tauvy) + &
189  vals(ijkval,wlm_vals_zty)*vals(ijkval,wlm_vals_tauvz)
190 
191  tauwalltmp(ijkval,a23) = &
192  vals(ijkval,wlm_vals_xiz)*vals(ijkval,wlm_vals_tauvx) + &
193  vals(ijkval,wlm_vals_etz)*vals(ijkval,wlm_vals_tauvy) + &
194  vals(ijkval,wlm_vals_ztz)*vals(ijkval,wlm_vals_tauvz)
195 ! -----
196  tauwalltmp(ijkval,a31) = &
197  vals(ijkval,wlm_vals_xix)*vals(ijkval,wlm_vals_tauwx) + &
198  vals(ijkval,wlm_vals_etx)*vals(ijkval,wlm_vals_tauwy) + &
199  vals(ijkval,wlm_vals_ztx)*vals(ijkval,wlm_vals_tauwz)
200 
201  tauwalltmp(ijkval,a32) = &
202  vals(ijkval,wlm_vals_xiy)*vals(ijkval,wlm_vals_tauwx) + &
203  vals(ijkval,wlm_vals_ety)*vals(ijkval,wlm_vals_tauwy) + &
204  vals(ijkval,wlm_vals_zty)*vals(ijkval,wlm_vals_tauwz)
205 
206  tauwalltmp(ijkval,a33) = &
207  vals(ijkval,wlm_vals_xiz)*vals(ijkval,wlm_vals_tauwx) + &
208  vals(ijkval,wlm_vals_etz)*vals(ijkval,wlm_vals_tauwy) + &
209  vals(ijkval,wlm_vals_ztz)*vals(ijkval,wlm_vals_tauwz)
210 
211 ! --- Second step:
212 
213  vals(ijkval,wlm_vals_tauux) = &
214  vals(ijkval,wlm_vals_xix)*tauwalltmp(ijkval,a11) + &
215  vals(ijkval,wlm_vals_etx)*tauwalltmp(ijkval,a21) + &
216  vals(ijkval,wlm_vals_ztx)*tauwalltmp(ijkval,a31)
217 
218  vals(ijkval,wlm_vals_tauuy) = &
219  vals(ijkval,wlm_vals_xix)*tauwalltmp(ijkval,a12) + &
220  vals(ijkval,wlm_vals_etx)*tauwalltmp(ijkval,a22) + &
221  vals(ijkval,wlm_vals_ztx)*tauwalltmp(ijkval,a32)
222 
223  vals(ijkval,wlm_vals_tauuz) = &
224  vals(ijkval,wlm_vals_xix)*tauwalltmp(ijkval,a13) + &
225  vals(ijkval,wlm_vals_etx)*tauwalltmp(ijkval,a23) + &
226  vals(ijkval,wlm_vals_ztx)*tauwalltmp(ijkval,a33)
227 ! -----
228  vals(ijkval,wlm_vals_tauvx) = &
229  vals(ijkval,wlm_vals_xiy)*tauwalltmp(ijkval,a11) + &
230  vals(ijkval,wlm_vals_ety)*tauwalltmp(ijkval,a21) + &
231  vals(ijkval,wlm_vals_zty)*tauwalltmp(ijkval,a31)
232 
233  vals(ijkval,wlm_vals_tauvy) = &
234  vals(ijkval,wlm_vals_xiy)*tauwalltmp(ijkval,a12) + &
235  vals(ijkval,wlm_vals_ety)*tauwalltmp(ijkval,a22) + &
236  vals(ijkval,wlm_vals_zty)*tauwalltmp(ijkval,a32)
237 
238  vals(ijkval,wlm_vals_tauvz) = &
239  vals(ijkval,wlm_vals_xiy)*tauwalltmp(ijkval,a13) + &
240  vals(ijkval,wlm_vals_ety)*tauwalltmp(ijkval,a23) + &
241  vals(ijkval,wlm_vals_zty)*tauwalltmp(ijkval,a33)
242 ! -----
243  vals(ijkval,wlm_vals_tauwx) = &
244  vals(ijkval,wlm_vals_xiz)*tauwalltmp(ijkval,a11) + &
245  vals(ijkval,wlm_vals_etz)*tauwalltmp(ijkval,a21) + &
246  vals(ijkval,wlm_vals_ztz)*tauwalltmp(ijkval,a31)
247 
248  vals(ijkval,wlm_vals_tauwy) = &
249  vals(ijkval,wlm_vals_xiz)*tauwalltmp(ijkval,a12) + &
250  vals(ijkval,wlm_vals_etz)*tauwalltmp(ijkval,a22) + &
251  vals(ijkval,wlm_vals_ztz)*tauwalltmp(ijkval,a32)
252 
253  vals(ijkval,wlm_vals_tauwz) = &
254  vals(ijkval,wlm_vals_xiz)*tauwalltmp(ijkval,a13) + &
255  vals(ijkval,wlm_vals_etz)*tauwalltmp(ijkval,a23) + &
256  vals(ijkval,wlm_vals_ztz)*tauwalltmp(ijkval,a33)
257 
258 !wlmCheckprobe---------------------------------------------------------------
259 ! write(*,*) region%procId,patch%lbound,i,j, &
260 ! vals(ijkVal,WLM_VALS_TAUUY),vals(ijkVal,WLM_VALS_TAUWY), &
261 ! vals(ijkVal,WLM_VALS_TAUVX),vals(ijkVal,WLM_VALS_TAUVZ)
262 !----------------------------------------------------------------------------
263 #ifdef RFLO
264  ENDDO ! i
265  ENDDO ! j
266 #endif
267 #ifdef RFLU
268  ENDDO ! i
269 #endif
270 
271 ! deallocate temporary workarrays
272 
273  DEALLOCATE( tauwalltmp )
274 
275 ! finalize --------------------------------------------------------------------
276 
277  CALL deregisterfunction( global )
278 
279 END SUBROUTINE turb_wlmtauwallmapping
280 
281 !******************************************************************************
282 !
283 ! RCS Revision history:
284 !
285 ! $Log: TURB_WlmTauWallMapping.F90,v $
286 ! Revision 1.4 2008/12/06 08:44:42 mtcampbe
287 ! Updated license.
288 !
289 ! Revision 1.3 2008/11/19 22:17:55 mtcampbe
290 ! Added Illinois Open Source License/Copyright
291 !
292 ! Revision 1.2 2004/03/25 04:40:41 wasistho
293 ! prepared for RFLU
294 !
295 ! Revision 1.1 2004/03/05 04:37:01 wasistho
296 ! changed nomenclature
297 !
298 ! Revision 1.2 2004/03/02 03:51:04 wasistho
299 ! forgot colon after Id and Log
300 !
301 !
302 !******************************************************************************
303 
304 
305 
306 
307 
308 
309 
**********************************************************************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 ibeg
subroutine registerfunction(global, funName, fileName)
Definition: ModError.F90:449
subroutine rflo_getpatchindices(region, patch, iLev, ibeg, iend, jbeg, jend, kbeg, kend)
subroutine turb_wlmtauwallmapping(region, patch)
Definition: patch.h:74
**********************************************************************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 knode iend
blockLoc i
Definition: read.cpp:79
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 knode jend
subroutine errorstop(global, errorCode, errorLine, addMessage)
Definition: ModError.F90:483
**********************************************************************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 knode jbeg
**********************************************************************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 knode kbeg
subroutine deregisterfunction(global)
Definition: ModError.F90:469