Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TURB_UserInput.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: Read TURB user input and store it in TURB data structure.
26 !
27 ! Description: TURB simulation parameters are first set to default values.
28 ! They are then overruled by user input parameters. Based
29 ! on this, derived TURB variables are defined. Finally,
30 ! necessary checkings are performed against inconsistencies.
31 !
32 ! Input: regions = user input in all regions
33 !
34 ! Output: regions = TURB user input, parameters and derived variables
35 !
36 ! Notes: none.
37 !
38 !******************************************************************************
39 !
40 ! $Id: TURB_UserInput.F90,v 1.9 2009/08/26 12:28:53 mtcampbe Exp $
41 !
42 ! Copyright: (c) 2001 by the University of Illinois
43 !
44 !******************************************************************************
45 
46 SUBROUTINE turb_userinput( regions ) ! PUBLIC
47 
48  USE moddatatypes
49  USE moddatastruct, ONLY : t_region
50  USE modglobal, ONLY : t_global
54  USE modturbulence
55  USE moderror
56  USE modmpi
57  USE modparameters
59  IMPLICIT NONE
60 
61 ! ... parameters
62  TYPE (t_region), POINTER :: regions(:)
63 
64 ! ... loop variables
65  INTEGER :: ireg
66 
67 ! ... local variables
68  CHARACTER(CHRLEN) :: rcsidentstring
69  TYPE(t_global), POINTER :: global
70  INTEGER :: sndinteg, rcvinteg
71  CHARACTER(2*CHRLEN+4) :: fname
72  INTEGER :: errorflag
73 !******************************************************************************
74 
75  rcsidentstring = '$RCSfile: TURB_UserInput.F90,v $'
76 
77  global => regions(1)%global
78  CALL registerfunction( global,'TURB_UserInput',&
79  'TURB_UserInput.F90' )
80 
81 ! initialize parameters --------------------------------------------------
82 
83  CALL turb_initinputvalues( regions )
84 
85 ! read user input
86 
87 
88 
89  CALL turb_readinputfile( regions )
90 
91 ! global test for active turbulence and assign global values
92 
93 #ifdef RFLO
94  DO ireg = 1,global%nRegions
95 #endif
96 #ifdef RFLU
97  DO ireg = lbound(regions,1),ubound(regions,1)
98 #endif
99  IF ((regions(ireg)%mixtInput%flowModel == flow_navst) .AND. &
100  (regions(ireg)%mixtInput%turbModel /= turb_model_none)) THEN
101  global%turbActive = .true.
102 
103  IF ((regions(ireg)%mixtInput%turbModel == turb_model_sa) .OR. &
104  (regions(ireg)%mixtInput%turbModel == turb_model_dessa) .OR. &
105  (regions(ireg)%mixtInput%turbModel == turb_model_hdessa)) THEN
106  global%turbCalcWDist = .true.
107  ENDIF
108  global%calcCellCtr = global%turbCalcWDist
109  ENDIF
110  ENDDO ! iReg
111 
112 #ifdef RFLU
113 #ifdef MPI
114 ! broadcast .true. global values
115 
116 ! sndInteg = 0
117 ! IF (global%turbActive .eqv. .true.) THEN
118 ! sndInteg = 1
119 ! CALL MPI_ALLREDUCE( sndInteg,rcvInteg,1,MPI_INTEGER, MPI_SUM, &
120 ! global%mpiComm, global%mpierr )
121 ! ENDIF
122 ! IF (rcvInteg > 0) global%turbActive = .TRUE.
123 
124 ! sndInteg = 0
125 ! IF (global%turbCalcWDist .eqv. .true.) THEN
126 ! sndInteg = 1
127 ! CALL MPI_ALLREDUCE( sndInteg,rcvInteg,1,MPI_INTEGER, MPI_SUM, &
128 ! global%mpiComm, global%mpierr )
129 ! ENDIF
130 ! IF (rcvInteg > 0) global%turbCalcWDist = .TRUE.
131 ! global%calcCellCtr = global%turbCalcWDist
132 #endif
133 #endif
134 
135  IF (global%turbActive .eqv. .true.) THEN
136 
137 ! - read boundary conditions
138 
139  CALL turb_readbcinputfile( regions )
140 
141 ! - set model & turbulence parameters from user input
142 
143  CALL turb_derivedinputvalues( regions )
144 
145 ! - check user input and parameters set in the code
146 
147  CALL turb_checkparaminput( regions )
148 
149  ENDIF ! turbActive
150 
151 ! finalize --------------------------------------------------------
152 
153  CALL deregisterfunction( global )
154 
155 END SUBROUTINE turb_userinput
156 
157 !******************************************************************************
158 !
159 ! RCS Revision history:
160 !
161 ! $Log: TURB_UserInput.F90,v $
162 ! Revision 1.9 2009/08/26 12:28:53 mtcampbe
163 ! Ported to Hera. Fixed logical expression syntax errors. Replaced all
164 ! IF (logical_variable) with IF (logical_variable .eqv. .true.) as
165 ! consistent with the specification. Also changed: IF( ASSOCIATED(expr) )
166 ! to IF ( ASSOCIATED(expr) .eqv. .true. ). Intel compilers produce code
167 ! which silently fails for some mal-formed expressions, so these changes
168 ! are a net which should ensure that they are evaluated as intended.
169 !
170 ! Revision 1.8 2008/12/06 08:44:42 mtcampbe
171 ! Updated license.
172 !
173 ! Revision 1.7 2008/11/19 22:17:54 mtcampbe
174 ! Added Illinois Open Source License/Copyright
175 !
176 ! Revision 1.6 2008/10/23 18:20:57 mtcampbe
177 ! Crazy number of changes to track and fix initialization and
178 ! restart bugs. Many improperly formed logical expressions
179 ! were fixed, and bug in allocation for data associated with
180 ! the BC_INFLOWVELTEMP boundary condition squashed in
181 ! RFLO_ReadBcInflowVelSection.F90.
182 !
183 ! Revision 1.5 2005/12/29 19:45:37 wasistho
184 ! removed CHARM stuff
185 !
186 ! Revision 1.4 2005/04/15 15:07:36 haselbac
187 ! Removed Charm/FEM stuff
188 !
189 ! Revision 1.3 2005/03/09 06:36:01 wasistho
190 ! incorporated HDESSA
191 !
192 ! Revision 1.2 2004/03/19 02:48:20 wasistho
193 ! prepared for RFLU
194 !
195 ! Revision 1.1 2004/03/05 04:37:00 wasistho
196 ! changed nomenclature
197 !
198 ! Revision 1.4 2003/10/07 02:07:48 wasistho
199 ! initial installation of RaNS-SA and DES
200 !
201 ! Revision 1.3 2003/08/01 22:17:20 wasistho
202 ! prepared rocturb for Genx
203 !
204 ! Revision 1.2 2003/05/31 01:48:23 wasistho
205 ! installed turb. wall layer model
206 !
207 ! Revision 1.1 2002/10/14 23:55:30 wasistho
208 ! Install Rocturb
209 !
210 !
211 !******************************************************************************
212 
213 
214 
215 
216 
217 
218 
subroutine turb_derivedinputvalues(regions)
subroutine turb_checkparaminput(regions)
subroutine registerfunction(global, funName, fileName)
Definition: ModError.F90:449
subroutine turb_initinputvalues(regions)
subroutine turb_userinput(regions)
subroutine turb_readbcinputfile(regions)
subroutine deregisterfunction(global)
Definition: ModError.F90:469
subroutine turb_readinputfile(regions)