Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TURB_coWlmReadBcSectionFlu.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 in user input related to wall layer model on noslip wall bc.
26 !
27 ! Description: none.
28 !
29 ! Input: boundary condition file.
30 !
31 ! Output: regions = BC data pertinent to wlm.
32 !
33 ! Notes: none.
34 !
35 !******************************************************************************
36 !
37 ! $Id: TURB_coWlmReadBcSectionFlu.F90,v 1.4 2008/12/06 08:44:43 mtcampbe Exp $
38 !
39 ! Copyright: (c) 2001 by the University of Illinois
40 !
41 !******************************************************************************
42 
43 SUBROUTINE turb_cowlmreadbcsection( regions )
44 
45  USE moddatatypes
46  USE modbndpatch, ONLY : t_patch
47  USE moddatastruct, ONLY : t_region
48  USE modglobal, ONLY : t_global
50  USE moderror
51  USE modparameters
53  IMPLICIT NONE
54 
55 ! ... parameters
56  TYPE(t_region), POINTER :: regions(:)
57 
58 ! ... loop variables
59  INTEGER :: ireg, ipatch
60 
61 ! ... local variables
62  CHARACTER(CHRLEN) :: rcsidentstring
63  CHARACTER(15) :: keys(3)
64  CHARACTER(256) :: fname
65  CHARACTER(CHRLEN) :: bcname
66 
67  INTEGER :: brbeg, brend, prbeg, prend, distrib, switch
68  INTEGER :: ijbeg, ijend, errorflag
69 
70  LOGICAL :: defined(3)
71 
72  REAL(RFREAL) :: vals(3)
73 
74  TYPE(t_patch), POINTER :: patch
75  TYPE(t_global), POINTER :: global
76 
77 !******************************************************************************
78 
79  rcsidentstring = '$RCSfile: TURB_coWlmReadBcSectionFlu.F90,v $ $Revision: 1.4 $'
80 
81  global => regions(1)%global
82  CALL registerfunction( global,'TURB_CoWlmReadBcSection',&
83  'TURB_coWlmReadBcSectionFlu.F90' )
84 
85 ! specify keywords and search for them ----------------------------------------
86 
87  keys(1) = 'MODEL'
88  keys(2) = 'REFPOINT'
89  keys(3) = 'ROUGHNESS'
90 
91  CALL readpatchsection( global,if_input,3,keys,vals, &
92  prbeg,prend,distrib,fname,bcname,defined )
93 
94  IF ( prend > global%nPatches ) THEN
95  CALL errorstop(global,err_patch_range,__line__)
96  END IF
97 
98 ! get switches & check if all necessary values defined ------------------------
99 
100  brbeg = lbound(regions,1) ! temporary for now before zonal modeling apply
101  brend = ubound(regions,1)
102 
103  DO ireg=brbeg,brend
104  IF (regions(ireg)%mixtInput%turbModel<=turb_model_none) THEN
105  CALL errorstop( global,err_turb_region,__line__,'Wall model unapplicable.' )
106  ENDIF
107 
108  regions(ireg)%turbInput%wallModel = 0
109  regions(ireg)%turbInput%wallRough = 0._rfreal
110  DO ipatch=prbeg,min(prend,regions(ireg)%grid%nPatches)
111 
112  patch => regions(ireg)%patches(ipatch)
113 
114  IF (patch%bcType>=bc_noslipwall .AND. &
115  patch%bcType<=bc_noslipwall+bc_range) THEN ! my boundary type,
116 
117  IF (patch%bcCoupled == bc_external) THEN ! data from outside
118  patch%valBola%distrib = bcdat_distrib ! => always distribution
119  ELSE
120  patch%valBola%distrib = distrib
121  ENDIF
122 
123 ! ----- get input switches
124 
125  IF (defined(1)) THEN
126  patch%valBola%switches(wlm_input_model)=max( 0,int(vals(1)+0.5_rfreal) )
127  ELSE
128  CALL errorstop( global,err_no_bcswitch,__line__,'WLM model missing.' )
129  ENDIF
130 
131  IF (patch%valBola%switches(wlm_input_model) == wlm_model_nomodel) goto 999
132 
133  IF (defined(2)) THEN
134  patch%valBola%switches(wlm_input_refpoint) = int(vals(2)+0.5_rfreal)
135  ELSE
136  CALL errorstop( global,err_no_bcswitch,__line__, &
137  'WLM reference point missing.' )
138  ENDIF
139 
140 ! ----- allocate memory for the roughness distribution
141 
142  patch%valBola%nData = patch%valBola%nData + 2*tensor_all_nelm + 3 + 9
143  ijbeg = 1
144  ijend = patch%nBFaces
145 
146  ALLOCATE( patch%valBola%vals(ijbeg:ijend,patch%valBola%nData), &
147  stat=errorflag )
148  global%error = errorflag
149  IF (global%error /= 0) CALL errorstop( global,err_allocate,__line__ )
150 
151  IF (patch%valBola%distrib==bcdat_distrib) THEN
152 ! ------- roughness distribution from file
153 ! CALL TURB_WlmReadRoughness( global,fname,patch )
154  CALL errorstop( global,err_val_bcval,__line__,'No variable roughness yet' )
155  ELSE
156 ! ------- distribution has constant value
157  IF (defined(3)) THEN
158  patch%valBola%vals(:,wlm_vals_rough) = vals(3)
159  ELSE
160  patch%valBola%vals(:,wlm_vals_rough) = 0._rfreal
161  ENDIF
162  ENDIF ! distribution?
163 
164  IF (patch%valBola%switches(wlm_input_model) == wlm_model_extern) THEN
165 ! ------- wall stress distribution from file
166 ! CALL TURB_WlmReadWallStress( global,fname,patch )
167  ENDIF
168 
169 999 CONTINUE
170 
171  ENDIF ! my BC
172 
173 ! --- copy max wlm param values to input param for screen-print
174 ! IF (patch%bcType>=BC_NOSLIPWALL .AND. &
175 ! patch%bcType<=BC_NOSLIPWALL+BC_RANGE) THEN
176 
177 ! regions(iReg)%turbInput%wallModel= &
178 ! MAX( regions(iReg)%turbInput%wallModel,INT(vals(1)+0.5_RFREAL) )
179 
180 ! regions(iReg)%turbInput%wlmRefPoint= &
181 ! MAX( regions(iReg)%turbInput%wlmRefPoint,INT(vals(2)+0.5_RFREAL) )
182 
183 ! regions(iReg)%turbInput%wallRough= &
184 ! MAX( regions(iReg)%turbInput%wallRough,vals(3) )
185 
186 ! ENDIF ! my boundary type
187  ENDDO ! iPatch
188  ENDDO ! iReg
189 
190 ! finalize --------------------------------------------------------------------
191 
192  CALL deregisterfunction( global )
193 
194 END SUBROUTINE turb_cowlmreadbcsection
195 
196 !******************************************************************************
197 !
198 ! RCS Revision history:
199 !
200 ! $Log: TURB_coWlmReadBcSectionFlu.F90,v $
201 ! Revision 1.4 2008/12/06 08:44:43 mtcampbe
202 ! Updated license.
203 !
204 ! Revision 1.3 2008/11/19 22:17:55 mtcampbe
205 ! Added Illinois Open Source License/Copyright
206 !
207 ! Revision 1.2 2004/03/27 02:16:42 wasistho
208 ! compiled with Rocflu
209 !
210 ! Revision 1.1 2004/03/25 04:42:58 wasistho
211 ! prepared for RFLU
212 !
213 !
214 !
215 !******************************************************************************
216 
217 
218 
219 
220 
221 
222 
Vector_n max(const Array_n_const &v1, const Array_n_const &v2)
Definition: Vector_n.h:354
subroutine turb_cowlmreadbcsection(regions)
subroutine registerfunction(global, funName, fileName)
Definition: ModError.F90:449
**********************************************************************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 brbeg
subroutine readpatchsection(global, fileID, nvals, keys, vals, brbeg, brend, prbeg, prend, distrib, profType, fname, defined)
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 USE ModDataTypes USE prend
**********************************************************************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 USE ModDataTypes USE prbeg
Vector_n min(const Array_n_const &v1, const Array_n_const &v2)
Definition: Vector_n.h:346
subroutine errorstop(global, errorCode, errorLine, addMessage)
Definition: ModError.F90:483
subroutine deregisterfunction(global)
Definition: ModError.F90:469