Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TURB_StatMapping.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 from TURB ID to statistics ID
26 !
27 ! Description: mapping based on parameter turbStatId(:,:) input by user
28 !
29 ! Input: global%turbStatId : TURB statistics ID from user input
30 !
31 ! Output: global%turbStatCode : mapped TURB statistics ID
32 !
33 ! Notes: none.
34 !
35 !******************************************************************************
36 !
37 ! $Id: TURB_StatMapping.F90,v 1.5 2008/12/06 08:44:42 mtcampbe Exp $
38 !
39 ! Copyright: (c) 2001 by the University of Illinois
40 !
41 !******************************************************************************
42 
43 SUBROUTINE turb_statmapping( global ) ! PUBLIC
44 
45  USE moddatatypes
46  USE modglobal, ONLY : t_global
47 #ifdef GENX
49 #endif
50  USE moderror
51  USE modparameters
53  IMPLICIT NONE
54 
55 ! ... parameters
56  TYPE(t_global), POINTER :: global
57 
58 ! ... loop variables
59  INTEGER :: l, n
60 
61 ! ... local variables
62  CHARACTER(CHRLEN) :: rcsidentstring
63 #ifdef GENX
64  CHARACTER(CHRLEN), POINTER :: statname(:,:,:)
65 #endif
66  INTEGER :: errorflag
67  INTEGER, POINTER :: statid(:,:), statcode(:,:,:)
68 
69 !******************************************************************************
70 
71  rcsidentstring = '$RCSfile: TURB_StatMapping.F90,v $'
72 
73  CALL registerfunction( global,'TURB_StatMapping',&
74  'TURB_StatMapping.F90' )
75 
76 ! allocate TURB variables and set pointers ---------------------------------
77 
78  ALLOCATE( global%turbStatCode(2,2,global%turbNStat),stat=errorflag )
79  global%error = errorflag
80  IF (global%error /= 0) CALL errorstop( global,err_allocate,__line__ )
81 
82  statid => global%turbStatId
83  statcode => global%turbStatCode
84 
85 #ifdef GENX
86  ALLOCATE( global%turbStatNm(2,2,global%turbNStat),stat=errorflag )
87  global%error = errorflag
88  IF (global%error /= 0) CALL errorstop( global,err_allocate,__line__ )
89 
90  statname => global%turbStatNm
91 #endif
92 
93 ! set TURB mapping ---------------------------------------------------------
94 
95  DO l=1,global%turbNStat
96  DO n=1,2
97  IF (statid(n,l)==0) THEN
98  statcode(n,:,l) = stat_none
99  ELSE IF (statid(n,l)==1) THEN
100  statcode(n,1,l) = stat_tv
101  statcode(n,2,l) = tv_mixt_muet
102 #ifdef GENX
103  statname(n,1,l) = 'mut'
104  statname(n,2,l) = 'kg/ms'
105 #endif
106  ELSE IF (statid(n,l)==2) THEN
107  statcode(n,1,l) = stat_tv
108  statcode(n,2,l) = tv_mixt_tcot
109 #ifdef GENX
110  statname(n,1,l) = 'tcot'
111  statname(n,2,l) = 'kg m/Ks^3'
112 #endif
113  ELSE IF (statid(n,l)==3) THEN
114  statcode(n,1,l) = stat_dv
115  statcode(n,2,l) = dv_turb_cdyn
116 #ifdef GENX
117  statname(n,1,l) = 'Cd'
118  statname(n,2,l) = ' '
119 #endif
120  ELSE IF (statid(n,l)==4) THEN
121  statcode(n,1,l) = stat_st
122  statcode(n,2,l) = st_turb_var1
123 #ifdef GENX
124  statname(n,1,l) = 'alpha_1'
125  statname(n,2,l) = 'Nm/s'
126 #endif
127  ELSE IF (statid(n,l)==5) THEN
128  statcode(n,1,l) = stat_st
129  statcode(n,2,l) = st_turb_var2
130 #ifdef GENX
131  statname(n,1,l) = 'alpha_2+3'
132  statname(n,2,l) = 'Nm/s'
133 #endif
134  ELSE IF (statid(n,l)==6) THEN
135  statcode(n,1,l) = stat_st
136  statcode(n,2,l) = st_turb_var3
137 #ifdef GENX
138  statname(n,1,l) = 'alpha_4'
139  statname(n,2,l) = 'Nm/s'
140 #endif
141 ! ELSE IF (statId(n,l)==4) THEN
142 ! statCode(n,1,l) = STAT_SV
143 ! statCode(n,2,l) = E11
144 !#ifdef GENX
145 ! statName(n,1,l) = 'tau11'
146 ! statName(n,2,l) = 'N/m^2'
147 !#endif
148 ! ELSE IF (statId(n,l)==5) THEN
149 ! statCode(n,1,l) = STAT_SV
150 ! statCode(n,2,l) = E22
151 !#ifdef GENX
152 ! statName(n,1,l) = 'tau22'
153 ! statName(n,2,l) = 'N/m^2'
154 !#endif
155 ! ELSE IF (statId(n,l)==6) THEN
156 ! statCode(n,1,l) = STAT_SV
157 ! statCode(n,2,l) = E33
158 !#ifdef GENX
159 ! statName(n,1,l) = 'tau33'
160 ! statName(n,2,l) = 'N/m^2'
161 !#endif
162  ELSE IF (statid(n,l)==7) THEN
163  statcode(n,1,l) = stat_sv
164  statcode(n,2,l) = e12
165 #ifdef GENX
166  statname(n,1,l) = 'tau12'
167  statname(n,2,l) = 'N/m^2'
168 #endif
169  ELSE IF (statid(n,l)==8) THEN
170  statcode(n,1,l) = stat_st
171  statcode(n,2,l) = st_turb_var4
172 #ifdef GENX
173  statname(n,1,l) = 'MMij'
174  statname(n,2,l) = 'N^2/m^4'
175 #endif
176  ELSE IF (statid(n,l)==9) THEN
177  statcode(n,1,l) = stat_st
178  statcode(n,2,l) = st_turb_var5
179 #ifdef GENX
180  statname(n,1,l) = 'MLij'
181  statname(n,2,l) = 'N^2/m^4'
182 #endif
183  ELSE
184  CALL errorstop( global,err_stats_indexing,__line__, &
185  'TURB index is not defined.' )
186  ENDIF
187  ENDDO
188  ENDDO
189 
190 #ifdef GENX
191 ! defined names and units of turbulence statistics
192 
193  CALL genxstatnaming( global, ftype_turb )
194 #endif
195 
196 ! finalize --------------------------------------------------------------------
197 
198  CALL deregisterfunction( global )
199 
200 END SUBROUTINE turb_statmapping
201 
202 !******************************************************************************
203 !
204 ! RCS Revision history:
205 !
206 ! $Log: TURB_StatMapping.F90,v $
207 ! Revision 1.5 2008/12/06 08:44:42 mtcampbe
208 ! Updated license.
209 !
210 ! Revision 1.4 2008/11/19 22:17:54 mtcampbe
211 ! Added Illinois Open Source License/Copyright
212 !
213 ! Revision 1.3 2004/10/22 23:33:29 wasistho
214 ! added new turb.statistics ID, alpha1 to alpha4
215 !
216 ! Revision 1.2 2004/06/07 23:10:21 wasistho
217 ! provide Genx statistics names, units, and anytime-activation
218 !
219 ! Revision 1.1 2004/03/05 04:37:00 wasistho
220 ! changed nomenclature
221 !
222 ! Revision 1.3 2003/10/09 23:49:07 wasistho
223 ! added flag ! PUBLIC
224 !
225 ! Revision 1.2 2003/05/24 02:07:49 wasistho
226 ! turbulence statistics expanded
227 !
228 ! Revision 1.1 2002/11/02 02:06:29 wasistho
229 ! Added TURB statistics
230 !
231 !
232 !******************************************************************************
233 
234 
235 
236 
237 
238 
239 
subroutine genxstatnaming(global, fluidType)
subroutine registerfunction(global, funName, fileName)
Definition: ModError.F90:449
const NT & n
subroutine errorstop(global, errorCode, errorLine, addMessage)
Definition: ModError.F90:483
subroutine deregisterfunction(global)
Definition: ModError.F90:469
subroutine turb_statmapping(global)