Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TURB_WlmReyAnalogy.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 wall heat flux (heat transfer) assuming Reynolds analogy
26 ! between heat and momentum transfer.
27 !
28 ! Description: Reynolds analogy:
29 ! St/(0.5*Cf) = Prt^(-0.66).
30 ! With Stanton number, St = qw/(rho*cp*(Tw-Te)*ue), and
31 ! assuming (Te-Tw)/ue = (T1-Tw)/u1, heat flux (written dotless)
32 ! qw = tau_w*cp*(Tw-T1)/u1.
33 ! Heat transfer coefficient: cq = qw/(Tw-Te)
34 !
35 ! Input: region = data of current region.
36 ! patch = current patch.
37 !
38 ! Output: wall heat flux.
39 !
40 ! Notes: - Avoiding complication determining BL-edge, heat transfer coefficient
41 ! if desired should, currently, be computed externally.
42 ! - Total wall stress already stored in vals(:,WLM_VALS_HFLUX) to use.
43 !
44 !******************************************************************************
45 !
46 ! $Id: TURB_WlmReyAnalogy.F90,v 1.6 2008/12/06 08:44:42 mtcampbe Exp $
47 !
48 ! Copyright: (c) 2001 by the University of Illinois
49 !
50 !******************************************************************************
51 
52 SUBROUTINE turb_wlmreyanalogy( region,patch )
53 
54  USE moddatatypes
55  USE modbndpatch, ONLY : t_patch
56  USE moddatastruct, ONLY : t_region
57  USE modglobal, ONLY : t_global
58 #ifdef RFLO
61 
62 #include "Indexing.h"
63 #endif
64  USE moderror
65  USE modparameters
67  IMPLICIT NONE
68 
69 ! ... parameters
70  TYPE(t_region) :: region
71  TYPE(t_patch) :: patch
72 
73 ! ... loop variables
74  INTEGER :: i, j, k
75 
76 ! ... local variables
77  CHARACTER(CHRLEN) :: rcsidentstring
78  TYPE(t_global), POINTER :: global
79 
80  INTEGER :: ibeg, iend, jbeg, jend, kbeg, kend
81  INTEGER :: ijbeg, ijend, indcp, bcopt, distrib, ijkval, ijkc, ijkce
82  REAL(RFREAL) :: twall, tauwall, abvel, ratio, prt, cp, utau
83  REAL(RFREAL), POINTER :: dv(:,:), gv(:,:), vals(:,:), mvals(:,:)
84 
85 #ifdef RFLO
86  INTEGER :: n1, n2, ioff, icoff, ijcoff
87  INTEGER :: ilev, idir, jdir, kdir, iedge, jedge, kedge, nedge, neta
88 #endif
89 #ifdef RFLU
90  REAL(RFREAL), POINTER :: cv(:,:)
91 #endif
92 
93 !******************************************************************************
94 
95  rcsidentstring = '$RCSfile: TURB_WlmReyAnalogy.F90,v $ $Revision: 1.6 $'
96 
97  global => region%global
98  CALL registerfunction( global,'TURB_WlmReyAnalogy',&
99  'TURB_WlmReyAnalogy.F90' )
100 
101 ! get dimensions, pointers and parameters -------------------------------------
102 
103  bcopt = patch%mixt%switches(bcswi_noslip_adiabat)
104  mvals => patch%mixt%vals
105  vals => patch%valBola%vals
106 
107 #ifdef RFLO
108  n1 = abs(patch%l1end-patch%l1beg)
109  n2 = abs(patch%l2end-patch%l2beg)
110  ioff = n1 + 1
111  ijbeg = indij( 0, 0,ioff)
112  ijend = indij(n1,n2,ioff)
113 #endif
114 #ifdef RFLU
115  ijbeg = 1
116  ijend = patch%nBFaces
117 #endif
118 
119 ! adiabatic wall : skip heat flux computation and set it to zero
120 
121  IF (bcopt == bcopt_adiabat) THEN
122  DO ijkval=ijbeg,ijend
123  vals(ijkval,wlm_vals_hflux) = 0._rfreal
124  ENDDO
125  goto 999
126  ENDIF
127 
128 ! isothermal wall: proceed with heat flux computation
129 
130 #ifdef RFLO
131  ilev = region%currLevel
132 
133  dv => region%levels(ilev)%mixt%dv
134  gv => region%levels(ilev)%mixt%gv
135  indcp = region%levels(ilev)%mixt%indCp
136  prt = region%levels(ilev)%mixt%prTurb
137 #endif
138 #ifdef RFLU
139  cv => region%mixt%cv
140  dv => region%mixt%dv
141  gv => region%mixt%gv
142  indcp = region%mixtInput%indCp
143  prt = region%mixtInput%prTurb
144 #endif
145  ratio = prt**(-0.66_rfreal)
146  distrib = patch%mixt%distrib
147 
148 #ifdef RFLO
149  CALL rflo_getpatchindices( region,patch,ilev,ibeg,iend,jbeg,jend,kbeg,kend )
151  CALL rflo_getcelloffset( region,ilev,icoff,ijcoff )
152 
153  neta = abs(idir)*region%levels(ilev)%grid%ipc + &
154  abs(jdir)*region%levels(ilev)%grid%jpc + &
155  abs(kdir)*region%levels(ilev)%grid%kpc
156  nedge = min( 8,neta )
157  iedge = idir*nedge
158  jedge = jdir*nedge
159  kedge = kdir*nedge
160 
161 ! Compute wall heat flux.
162 ! Note that total wall stress has been stored in vals(:,WLM_VALS_HFLUX).
163 
164  DO k=kbeg,kend
165  DO j=jbeg,jend
166  DO i=ibeg,iend
167  ijkval = abs(idir)*indij(j-jbeg,k-kbeg,jend-jbeg+1) + &
168  abs(jdir)*indij(k-kbeg,i-ibeg,kend-kbeg+1) + &
169  abs(kdir)*indij(i-ibeg,j-jbeg,iend-ibeg+1)
170  ijkc = indijk(i ,j ,k ,icoff,ijcoff)
171  ijkce = indijk(i+iedge,j+jedge,k+kedge,icoff,ijcoff)
172 
173  abvel = sqrt( dv(dv_mixt_uvel,ijkce)**2+dv(dv_mixt_vvel,ijkce)**2+ &
174  dv(dv_mixt_wvel,ijkce)**2 )
175 #endif
176 #ifdef RFLU
177 ! Specific Rocflu, check the state of cv first
178  IF (region%mixt%cvState /= cv_mixt_state_cons) &
179  CALL errorstop(global,err_reached_default,__line__)
180  ibeg = 1
181  iend = patch%nBFaces
182 
183  DO i=ibeg,iend
184  ijkval = i
185  ijkc = patch%bf2c(i)
186  ijkce = ijkc
187 
188  abvel = sqrt( cv(cv_mixt_xmom,ijkce)**2+cv(cv_mixt_ymom,ijkce)**2+ &
189  cv(cv_mixt_zmom,ijkce)**2 )/cv(cv_mixt_dens,ijkce)
190 #endif
191  twall = mvals(bcdat_noslip_twall,distrib*ijkval)
192  cp = gv(gv_mixt_cp,ijkc*indcp)
193  tauwall= vals(ijkval,wlm_vals_hflux)
194  vals(ijkval,wlm_vals_hflux) = ratio*tauwall*cp* &
195  (twall-dv(dv_mixt_temp,ijkce))/abvel
196 
197 !wlmCheckprobe-----------------------------------------------------------------
198 ! utau = SQRT( tauWall/vals(ijkVal,WLM_VALS_DENS) )
199 ! write(*,*)region%procId,nEta,ijkVal,vals(ijkVal,WLM_VALS_DENS),utau, &
200 ! tauWall,vals(ijkVal,WLM_VALS_HFLUX)
201 !------------------------------------------------------------------------------
202 #ifdef RFLO
203  ENDDO ! i
204  ENDDO ! j
205  ENDDO ! k
206 #endif
207 #ifdef RFLU
208  ENDDO ! i
209 #endif
210 
211 999 CONTINUE
212 
213 ! finalize --------------------------------------------------------------------
214 
215  CALL deregisterfunction( global )
216 
217 END SUBROUTINE turb_wlmreyanalogy
218 
219 !******************************************************************************
220 !
221 ! RCS Revision history:
222 !
223 ! $Log: TURB_WlmReyAnalogy.F90,v $
224 ! Revision 1.6 2008/12/06 08:44:42 mtcampbe
225 ! Updated license.
226 !
227 ! Revision 1.5 2008/11/19 22:17:55 mtcampbe
228 ! Added Illinois Open Source License/Copyright
229 !
230 ! Revision 1.4 2006/08/19 15:40:42 mparmar
231 ! Renamed patch variables
232 !
233 ! Revision 1.3 2004/03/27 02:16:42 wasistho
234 ! compiled with Rocflu
235 !
236 ! Revision 1.2 2004/03/25 04:40:41 wasistho
237 ! prepared for RFLU
238 !
239 ! Revision 1.1 2004/03/05 04:37:01 wasistho
240 ! changed nomenclature
241 !
242 ! Revision 1.2 2004/03/02 03:50:55 wasistho
243 ! forgot colon after Id and Log
244 !
245 !
246 !******************************************************************************
247 
248 
249 
250 
251 
252 
253 
**********************************************************************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)
subroutine turb_wlmreyanalogy(region, patch)
j indices k indices k
Definition: Indexing.h:6
subroutine registerfunction(global, funName, fileName)
Definition: ModError.F90:449
subroutine rflo_getpatchindices(region, patch, iLev, ibeg, iend, jbeg, jend, kbeg, kend)
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 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)
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 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
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