Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TURB_WlmUpdateBndlay.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: Model wall stresses based on turbulent BL assumption with mixing
26 ! length model for eddy viscosity, and pressure gradient as well as
27 ! usteady terms taken into account.
28 !
29 ! Description: Wall stresses are derived from modeling terms in BL equations.
30 ! Viscous term has been modeled in routine TURB_FloWlmUpdateLoglay
31 ! based on mixing lenth eddy viscosity model which equivalent to
32 ! log layer assumption at zero pressure gradient with surface
33 ! roughness included. BL convective term is neglected. Pressure
34 ! gradient and time derivative term are computed here and added
35 ! to the viscous model. The method is inspired by paper of
36 ! Hoffman and Benocci, "Approximate wall BC for LES", 5th
37 ! Advances in Turbulence, Siena, Italy 1994. Surface roughness
38 ! were not considered in their model.
39 !
40 ! Input: region = data of current region.
41 ! patch = current patch.
42 !
43 ! Output: total and wall parallel components of wall stresses in body fitted
44 ! coordinate.
45 !
46 ! Notes: Unsteady term is not modeled yet. Its model term may be included
47 ! in future.
48 !
49 !******************************************************************************
50 !
51 ! $Id: TURB_WlmUpdateBndlay.F90,v 1.5 2008/12/06 08:44:43 mtcampbe Exp $
52 !
53 ! Copyright: (c) 2001 by the University of Illinois
54 !
55 !******************************************************************************
56 
57 SUBROUTINE turb_wlmupdatebndlay( region,patch )
58 
59  USE moddatatypes
60  USE modbndpatch, ONLY : t_patch
61  USE moddatastruct, ONLY : t_region
62  USE modglobal, ONLY : t_global
63  USE moderror
65  IMPLICIT NONE
66 
67 #ifdef RFLO
68 #include "Indexing.h"
69 #endif
70 
71 ! ... parameters
72  TYPE(t_region) :: region
73  TYPE(t_patch) :: patch
74 
75 ! ... loop variables
76  INTEGER :: ijkval
77 
78 ! ... local variables
79  CHARACTER(CHRLEN) :: rcsidentstring
80  TYPE(t_global), POINTER :: global
81 
82  INTEGER :: ijbeg, ijend
83  REAL(RFREAL) :: wdist, dpdxi, dpdzt, utau, abvel
84  REAL(RFREAL), POINTER :: vals(:,:)
85 
86 #ifdef RFLO
87  INTEGER :: n1, n2, ioff
88 #endif
89 
90 !******************************************************************************
91 
92  rcsidentstring = '$RCSfile: TURB_WlmUpdateBndlay.F90,v $ $Revision: 1.5 $'
93 
94  global => region%global
95  CALL registerfunction( global,'TURB_WlmUpdateBndlay',&
96  'TURB_WlmUpdateBndlay.F90' )
97 
98 ! get pointers ----------------------------------------------------------------
99 
100  vals => patch%valBola%vals
101 
102 ! get dimensions
103 
104 #ifdef RFLO
105  n1 = abs(patch%l1end-patch%l1beg)
106  n2 = abs(patch%l2end-patch%l2beg)
107  ioff = n1 + 1
108  ijbeg = indij( 0, 0,ioff)
109  ijend = indij(n1,n2,ioff)
110 #endif
111 #ifdef RFLU
112  ijbeg = 1
113  ijend = patch%nBFaces
114 #endif
115 
116 ! compute tau-wall and heat flux from total contributions
117 
118  DO ijkval=ijbeg,ijend
119 
120  wdist = vals(ijkval,wlm_vals_wdist)
121  dpdxi = vals(ijkval,wlm_vals_dpdxi)
122  dpdzt = vals(ijkval,wlm_vals_dpdzt)
123 
124  vals(ijkval,wlm_vals_tauuy) = vals(ijkval,wlm_vals_tauuy)-wdist*dpdxi
125  vals(ijkval,wlm_vals_tauwy) = vals(ijkval,wlm_vals_tauwy)-wdist*dpdzt
126 
127  vals(ijkval,wlm_vals_tauvx) = vals(ijkval,wlm_vals_tauuy)
128  vals(ijkval,wlm_vals_tauvz) = vals(ijkval,wlm_vals_tauwy)
129 
130 ! - store total wall stress in heat-flux array for heat transfer comp. later
131  vals(ijkval,wlm_vals_hflux) = &
132  sqrt( vals(ijkval,wlm_vals_tauuy)*vals(ijkval,wlm_vals_tauuy) + &
133  vals(ijkval,wlm_vals_tauwy)*vals(ijkval,wlm_vals_tauwy) )
134 
135 ! - Note: utau should not be derived from here (effect of pressure gradient
136 ! exist), as it is used to initiate iteration on utau at the next stage
137 ! in TURB_FloWlmUpdateLoglay (model for BL viscous term), in which pressure
138 ! gradient is not (yet) taken into account. On the contrary, for post-
139 ! processing/visualisation utau has to be extracted separately from wall
140 ! stress tauWall computed in this routine: utau=sqrt(tauWall/rho)
141 
142 !checkprobe--------------------------------------------------------------------
143 ! utau = SQRT( vals(ijkVal,WLM_VALS_HFLUX)/vals(ijkVal,WLM_VALS_DENS) )
144 ! abVel= SQRT( vals(ijkVal,WLM_VALS_XIV)**2+vals(ijkVal,WLM_VALS_ZTV)**2 )
145 ! write(*,*) region%procId,patch%lbound,ijkVal,vals(ijkVal,WLM_VALS_TAUUY), &
146 ! vals(ijkVal,WLM_VALS_TAUWY),utau/abVel,dPdXi,dPdZt
147 !------------------------------------------------------------------------------
148 
149  ENDDO ! ijkVal
150 
151 ! finalize --------------------------------------------------------------------
152 
153  CALL deregisterfunction( global )
154 
155 END SUBROUTINE turb_wlmupdatebndlay
156 
157 !******************************************************************************
158 !
159 ! RCS Revision history:
160 !
161 ! $Log: TURB_WlmUpdateBndlay.F90,v $
162 ! Revision 1.5 2008/12/06 08:44:43 mtcampbe
163 ! Updated license.
164 !
165 ! Revision 1.4 2008/11/19 22:17:55 mtcampbe
166 ! Added Illinois Open Source License/Copyright
167 !
168 ! Revision 1.3 2004/03/24 03:37:03 wasistho
169 ! prepared for RFLU
170 !
171 ! Revision 1.2 2004/03/12 02:55:35 wasistho
172 ! changed rocturb routine names
173 !
174 ! Revision 1.1 2004/03/05 04:37:01 wasistho
175 ! changed nomenclature
176 !
177 ! Revision 1.3 2004/03/02 03:51:27 wasistho
178 ! forgot colon after Id and Log
179 !
180 !
181 !******************************************************************************
182 
183 
184 
185 
186 
187 
188 
subroutine turb_wlmupdatebndlay(region, patch)
subroutine registerfunction(global, funName, fileName)
Definition: ModError.F90:449
double sqrt(double d)
Definition: double.h:73
Definition: patch.h:74
subroutine deregisterfunction(global)
Definition: ModError.F90:469