Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TURB_WlmInitia.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: Set initial values of variables needed in wlm computations.
26 !
27 ! Description: Friction velocity u_tau is set to 0.05 u_edge.
28 !
29 ! Input: region = data of current region.
30 ! patch = current patch.
31 !
32 ! Output: initial u_tau.
33 !
34 ! Notes: none.
35 !
36 !******************************************************************************
37 !
38 ! $Id: TURB_WlmInitia.F90,v 1.5 2008/12/06 08:44:42 mtcampbe Exp $
39 !
40 ! Copyright: (c) 2001 by the University of Illinois
41 !
42 !******************************************************************************
43 
44 SUBROUTINE turb_wlminitia( region,patch )
45 
46  USE moddatatypes
47  USE modbndpatch, ONLY : t_patch
48  USE moddatastruct, ONLY : t_region
49  USE modglobal, ONLY : t_global
50 #ifdef RFLO
52 
53 #include "Indexing.h"
54 #endif
55  USE moderror
56  USE modparameters
58  IMPLICIT NONE
59 
60 ! ... parameters
61  TYPE(t_region) :: region
62  TYPE(t_patch) :: patch
63 
64 ! ... loop variables
65  INTEGER :: i, j, k
66 
67 ! ... local variables
68  CHARACTER(CHRLEN) :: rcsidentstring
69  TYPE(t_global), POINTER :: global
70 
71  INTEGER :: ibeg, iend, jbeg, jend, kbeg, kend, ijkc, ijkval
72  REAL(RFREAL) :: u, v, w
73  REAL(RFREAL), POINTER :: vals(:,:)
74 
75 #ifdef RFLO
76  INTEGER :: ilev, lbound, icoff, ijcoff
77  REAL(RFREAL), POINTER :: dv(:,:)
78 #endif
79 #ifdef RFLU
80  REAL(RFREAL) :: rdens
81  REAL(RFREAL), POINTER :: cv(:,:)
82 #endif
83 
84 !******************************************************************************
85 
86  rcsidentstring = '$RCSfile: TURB_WlmInitia.F90,v $ $Revision: 1.5 $'
87 
88  global => region%global
89  CALL registerfunction( global,'TURB_WlmInitia',&
90  'TURB_WlmInitia.F90' )
91 
92 ! get common pointers ---------------------------------------------------------
93 
94  vals => patch%valBola%vals
95 
96 #ifdef RFLO
97 ! get dimensions and parameters -----------------------------------------------
98 
99  ilev = region%currLevel
100  lbound = patch%lbound
101 
102  CALL rflo_getpatchindices( region,patch,ilev,ibeg,iend,jbeg,jend,kbeg,kend )
103  CALL rflo_getcelloffset( region,ilev,icoff,ijcoff )
104 
105 ! get pointers
106 
107  dv => region%levels(ilev)%mixt%dv
108 
109 ! estimate initial friction velocity utau
110 
111  DO k=kbeg,kend
112  DO j=jbeg,jend
113  DO i=ibeg,iend
114 
115  ijkc = indijk(i ,j ,k ,icoff,ijcoff)
116 
117  IF (lbound==1 .OR. lbound==2) THEN
118  ijkval = indij(j-jbeg ,k-kbeg ,jend-jbeg+1)
119  ELSEIF (lbound==3 .OR. lbound==4) THEN
120  ijkval = indij(k-kbeg ,i-ibeg ,kend-kbeg+1)
121  ELSEIF (lbound==5 .OR. lbound==6) THEN
122  ijkval = indij(i-ibeg ,j-jbeg ,iend-ibeg+1)
123  ENDIF
124 
125  u = dv(dv_mixt_uvel,ijkc)
126  v = dv(dv_mixt_vvel,ijkc)
127  w = dv(dv_mixt_wvel,ijkc)
128 #endif
129 #ifdef RFLU
130 ! specific Rocflu, check the state of cv first --------------------------------
131  IF (region%mixt%cvState /= cv_mixt_state_cons) &
132  CALL errorstop(global,err_reached_default,__line__)
133 
134 ! get dimensions and parameters -----------------------------------------------
135 
136  ibeg = 1
137  iend = patch%nBFaces
138 
139 ! get pointers
140 
141  cv => region%mixt%cv
142 
143 ! estimate initial friction velocity utau
144 
145  DO i=ibeg,iend
146  ijkc = patch%bf2c(i)
147  ijkval = i
148 
149  rdens = 1._rfreal/cv(cv_mixt_dens,ijkc)
150  u = cv(cv_mixt_xmom,ijkc)*rdens
151  v = cv(cv_mixt_ymom,ijkc)*rdens
152  w = cv(cv_mixt_zmom,ijkc)*rdens
153 #endif
154  vals(ijkval,wlm_vals_utau) = 0.05*sqrt(u*u+v*v+w*w)
155 
156 #ifdef RFLO
157  ENDDO ! i
158  ENDDO ! j
159  ENDDO ! k
160 #endif
161 #ifdef RFLU
162  ENDDO ! i
163 #endif
164 
165 ! finalize --------------------------------------------------------------------
166 
167  CALL deregisterfunction( global )
168 
169 END SUBROUTINE turb_wlminitia
170 
171 !******************************************************************************
172 !
173 ! RCS Revision history:
174 !
175 ! $Log: TURB_WlmInitia.F90,v $
176 ! Revision 1.5 2008/12/06 08:44:42 mtcampbe
177 ! Updated license.
178 !
179 ! Revision 1.4 2008/11/19 22:17:55 mtcampbe
180 ! Added Illinois Open Source License/Copyright
181 !
182 ! Revision 1.3 2004/03/27 02:16:42 wasistho
183 ! compiled with Rocflu
184 !
185 ! Revision 1.2 2004/03/24 03:37:03 wasistho
186 ! prepared for RFLU
187 !
188 ! Revision 1.1 2004/03/05 04:37:01 wasistho
189 ! changed nomenclature
190 !
191 ! Revision 1.2 2004/03/02 03:49:45 wasistho
192 ! forgot colon after Id and Log
193 !
194 !
195 !******************************************************************************
196 
197 
198 
199 
200 
201 
202 
**********************************************************************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
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
*********************************************************************Illinois Open Source License ****University of Illinois NCSA **Open Source License University of Illinois All rights reserved ****Developed free of to any person **obtaining a copy of this software and associated documentation to deal with the Software without including without limitation the rights to and or **sell copies of the and to permit persons to whom the **Software is furnished to do subject to the following this list of conditions and the following disclaimers ****Redistributions in binary form must reproduce the above **copyright this list of conditions and the following **disclaimers in the documentation and or other materials **provided with the distribution ****Neither the names of the Center for Simulation of Advanced the University of nor the names of its **contributors may be used to endorse or promote products derived **from this Software without specific prior written permission ****THE SOFTWARE IS PROVIDED AS 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 v
Definition: roccomf90.h:20
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
subroutine turb_wlminitia(region, patch)
blockLoc i
Definition: read.cpp:79
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
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