Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TURB_WlmFluxPatch.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 total viscous and heat fluxes through current patch using
26 ! wall stress and heat transfer from wall layer model selected.
27 !
28 ! Description: This routine works in the same way as TURB_VisFluxEddyPatch
29 ! or TURB_VFluxHybridPatch but using wall stress from wall layer
30 ! model instead of mu*Sij or SGS-tau_ij, respectively.
31 !
32 ! Input: region = data of current region.
33 ! patch = current patch.
34 !
35 ! Output: mixt%diss = total viscous fluxes added to dissipation
36 !
37 ! Notes: Unlike the general viscous flux patch routines (TURB_visFluxEdduPatch
38 ! and TURB_vFluxHybridPatch), this wlm flux routine coverts both eddy
39 ! viscosity model (EVM, fixed and dynamic Smagorinsky) as well as
40 ! turbulent stress models (TSM, scale similarity and dynamic mixed).
41 !
42 !******************************************************************************
43 !
44 ! $Id: TURB_WlmFluxPatch.F90,v 1.4 2008/12/06 08:44:42 mtcampbe Exp $
45 !
46 ! Copyright: (c) 2001 by the University of Illinois
47 !
48 !******************************************************************************
49 
50 SUBROUTINE turb_wlmfluxpatch( region,patch )
51 
52  USE moddatatypes
53  USE modbndpatch, ONLY : t_patch
54  USE moddatastruct, ONLY : t_region
55  USE modglobal, ONLY : t_global
56 #ifdef RFLO
59 #endif
60  USE moderror
61  USE modparameters
63  IMPLICIT NONE
64 
65 #include "Indexing.h"
66 
67 ! ... parameters
68  TYPE(t_region) :: region
69  TYPE(t_patch) :: patch
70 
71 ! ... loop variables
72  INTEGER :: i, j, k, ic
73 
74 ! ... local variables
75  CHARACTER(CHRLEN) :: rcsidentstring
76  TYPE(t_global), POINTER :: global
77 
78  INTEGER :: bctype, ijkcb0, ijknb, ijkval
79  INTEGER :: ibeg, iend, jbeg, jend, kbeg, kend
80  REAL(RFREAL) :: beta, heatflux
81  REAL(RFREAL) :: fd(4),sf(3),twij(3,3)
82  REAL(RFREAL), POINTER :: diss(:,:),vals(:,:)
83 
84 #ifdef RFLO
85  INTEGER :: inode, jnode, knode, idir, jdir, kdir
86  INTEGER :: ilev, lbound, icoff, ijcoff, inoff, ijnoff
87  REAL(RFREAL) :: sgn
88  REAL(RFREAL), POINTER :: sface(:,:)
89 #endif
90 #ifdef RFLU
91  REAL(RFREAL), POINTER :: fn(:,:)
92 #endif
93 
94 !******************************************************************************
95 
96  rcsidentstring = '$RCSfile: TURB_WlmFluxPatch.F90,v $ $Revision: 1.4 $'
97 
98  global => region%global
99  CALL registerfunction( global,'TURB_WlmFluxPatch',&
100  'TURB_WlmFluxPatch.F90' )
101 
102 ! get dimensions and pointers -------------------------------------------------
103 
104  vals => patch%valBola%vals
105 
106 #ifdef RFLO
107  ilev = region%currLevel
108  lbound = patch%lbound
109  diss => region%levels(ilev)%mixt%diss
110 #endif
111 #ifdef RFLU
112  diss => region%mixt%diss
113 #endif
114 
115 ! get coefficients -----------------------------------------------------------
116 
117  bctype = patch%bcType
118  beta = region%mixtInput%betrk(region%irkStep)
119 
120 #ifdef RFLO
121 
122 ! take the right face vector and make it point outwards ----------------------
123 
124  CALL rflo_getpatchindices( region,patch,ilev,ibeg,iend,jbeg,jend,kbeg,kend )
126  CALL rflo_getcelloffset( region,ilev,icoff,ijcoff )
127  CALL rflo_getnodeoffset( region,ilev,inoff,ijnoff )
128 
129  sgn = +1._rfreal
130  inode = 0
131  jnode = 0
132  knode = 0
133  IF (lbound==2 .OR. lbound==4 .OR. lbound==6) THEN
134  sgn = -1._rfreal
135  inode = -idir
136  jnode = -jdir
137  knode = -kdir
138  ENDIF
139 
140 ! get the appropriate face vector --------------------------------------------
141 
142  IF (lbound==1 .OR. lbound==2) THEN
143  sface => region%levels(ilev)%grid%si
144  ELSE IF (lbound==3 .OR. lbound==4) THEN
145  sface => region%levels(ilev)%grid%sj
146  ELSE
147  sface => region%levels(ilev)%grid%sk
148  ENDIF
149 
150 ! non-conforming region interface --------------------------------------------
151 
152  IF (bctype>=bc_regionint .AND. bctype<=bc_regionint+bc_range) THEN
153 
154  ELSE IF (bctype>=bc_regnonconf .AND. bctype<=bc_regnonconf+bc_range) THEN
155 
156 ! everything else
157 
158  ELSE
159 
160 ! flux in the direction normal to the patch ----------------------------------
161 
162  DO k=kbeg,kend
163  DO j=jbeg,jend
164  DO i=ibeg,iend
165 
166  ijkcb0 = indijk(i ,j ,k ,icoff,ijcoff) ! bnd cells
167  ijknb = indijk(i+inode,j+jnode,k+knode,inoff,ijnoff) ! bnd nodes
168  ijkval = abs(idir)*indij(j-jbeg,k-kbeg,jend-jbeg+1) + &
169  abs(jdir)*indij(k-kbeg,i-ibeg,kend-kbeg+1) + &
170  abs(kdir)*indij(i-ibeg,j-jbeg,iend-ibeg+1)
171 
172  sf(1) = sgn*sface(xcoord,ijknb)
173  sf(2) = sgn*sface(ycoord,ijknb)
174  sf(3) = sgn*sface(zcoord,ijknb)
175 #endif
176 #ifdef RFLU
177  ibeg = 1
178  iend = patch%nBFaces
179  fn => patch%fn
180 
181  DO ic=ibeg,iend
182  ijkcb0 = patch%bf2c(ic)
183  ijknb = ic
184  ijkval = ic
185 
186  sf(1) = fn(xcoord,ijknb)*fn(xyzmag,ijknb)
187  sf(2) = fn(ycoord,ijknb)*fn(xyzmag,ijknb)
188  sf(3) = fn(zcoord,ijknb)*fn(xyzmag,ijknb)
189 #endif
190 
191  twij(1,1) = vals(ijkval,wlm_vals_tauux)
192  twij(1,2) = vals(ijkval,wlm_vals_tauuy)
193  twij(1,3) = vals(ijkval,wlm_vals_tauuz)
194 
195  twij(2,1) = vals(ijkval,wlm_vals_tauvx)
196  twij(2,2) = vals(ijkval,wlm_vals_tauvy)
197  twij(2,3) = vals(ijkval,wlm_vals_tauvz)
198 
199  twij(3,1) = vals(ijkval,wlm_vals_tauwx)
200  twij(3,2) = vals(ijkval,wlm_vals_tauwy)
201  twij(3,3) = vals(ijkval,wlm_vals_tauwz)
202 
203  heatflux = sqrt(sf(1)*sf(1)+sf(2)*sf(2)+sf(3)*sf(3))* &
204  vals(ijkval,wlm_vals_hflux)
205 
206  fd(1) = twij(1,1)*sf(1)+twij(1,2)*sf(2)+twij(1,3)*sf(3)
207  fd(2) = twij(2,1)*sf(1)+twij(2,2)*sf(2)+twij(2,3)*sf(3)
208  fd(3) = twij(3,1)*sf(1)+twij(3,2)*sf(2)+twij(3,3)*sf(3)
209  fd(4) = heatflux
210 
211 !wlmCheckprobe---------------------------------------------------------------
212 ! write(*,*)region%procId,i,j,k,twij(1,2),twij(3,2),twij(2,1),twij(2,3), &
213 ! heatFlux
214 !----------------------------------------------------------------------------
215 
216  diss(cv_mixt_xmom,ijkcb0) = diss(cv_mixt_xmom,ijkcb0)+fd(1)*beta
217  diss(cv_mixt_ymom,ijkcb0) = diss(cv_mixt_ymom,ijkcb0)+fd(2)*beta
218  diss(cv_mixt_zmom,ijkcb0) = diss(cv_mixt_zmom,ijkcb0)+fd(3)*beta
219  diss(cv_mixt_ener,ijkcb0) = diss(cv_mixt_ener,ijkcb0)+fd(4)*beta
220 
221 #ifdef RFLO
222  ENDDO ! i
223  ENDDO ! j
224  ENDDO ! k
225  ENDIF ! bcType
226 #endif
227 #ifdef RFLU
228  ENDDO ! iC
229 #endif
230 
231 ! finalize --------------------------------------------------------------------
232 
233  CALL deregisterfunction( global )
234 
235 END SUBROUTINE turb_wlmfluxpatch
236 
237 !******************************************************************************
238 !
239 ! RCS Revision history:
240 !
241 ! $Log: TURB_WlmFluxPatch.F90,v $
242 ! Revision 1.4 2008/12/06 08:44:42 mtcampbe
243 ! Updated license.
244 !
245 ! Revision 1.3 2008/11/19 22:17:55 mtcampbe
246 ! Added Illinois Open Source License/Copyright
247 !
248 ! Revision 1.2 2004/03/24 03:37:03 wasistho
249 ! prepared for RFLU
250 !
251 ! Revision 1.1 2004/03/05 04:37:00 wasistho
252 ! changed nomenclature
253 !
254 ! Revision 1.2 2004/03/02 03:49:30 wasistho
255 ! forgot colon after Id and Log
256 !
257 !
258 !******************************************************************************
259 
260 
261 
262 
263 
264 
265 
**********************************************************************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 rflo_getpatchdirection(patch, idir, jdir, kdir)
**********************************************************************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 inode
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_getpatchindices(region, patch, iLev, ibeg, iend, jbeg, jend, kbeg, kend)
double sqrt(double d)
Definition: double.h:73
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 jdir
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
**********************************************************************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 idir
subroutine rflo_getcelloffset(region, iLev, iCellOffset, ijCellOffset)
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
**********************************************************************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 kdir
**********************************************************************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
subroutine turb_wlmfluxpatch(region, patch)
**********************************************************************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 jnode