Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RFLO_ReadBcNoslipSection.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 noslip wall boundary condition.
26 !
27 ! Description: none.
28 !
29 ! Input: boundary condition file.
30 !
31 ! Output: regions = BC data.
32 !
33 ! Notes: none.
34 !
35 !******************************************************************************
36 !
37 ! $Id: RFLO_ReadBcNoslipSection.F90,v 1.5 2008/12/06 08:44:07 mtcampbe Exp $
38 !
39 ! Copyright: (c) 2001 by the University of Illinois
40 !
41 !******************************************************************************
42 
43 SUBROUTINE rflo_readbcnoslipsection( 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
52  IMPLICIT NONE
53 
54 #include "Indexing.h"
55 
56 ! ... parameters
57  TYPE(t_region), POINTER :: regions(:)
58 
59 ! ... loop variables
60  INTEGER :: ireg, ipatch
61 
62 ! ... local variables
63  CHARACTER(10) :: keys(2)
64  CHARACTER(256) :: fname
65 
66  INTEGER :: brbeg, brend, prbeg, prend, distrib, switch
67  INTEGER :: n1, n2, ioff, ijbeg, ijend, errorflag
68 
69  LOGICAL :: defined(2)
70 
71  REAL(RFREAL) :: vals(2)
72 
73  TYPE(t_patch), POINTER :: patch
74  TYPE(t_global), POINTER :: global
75 
76 !******************************************************************************
77 
78  global => regions(1)%global
79 
80  CALL registerfunction( global,'RFLO_ReadBcNoslipSection',&
81  'RFLO_ReadBcNoslipSection.F90' )
82 
83 ! specify keywords and search for them ----------------------------------------
84 
85  keys(1) = 'ADIABAT'
86  keys(2) = 'TWALL'
87 
88  CALL readpatchsection( global,if_input,2,keys,vals,brbeg,brend, &
89  prbeg,prend,distrib,fname,defined )
90 
91 ! get switches & check if all necessary values defined ------------------------
92 
93  DO ireg=brbeg,brend
94  DO ipatch=prbeg,min(prend,regions(ireg)%nPatches)
95 
96  patch => regions(ireg)%levels(1)%patches(ipatch)
97 
98  IF ((patch%bcType>=bc_noslipwall .AND. &
99  patch%bcType<=bc_noslipwall+bc_range) .AND. & ! my boundary type,
100  regions(ireg)%procid==global%myProcid .AND. & ! region active and
101  regions(ireg)%active==active) THEN ! on my processor
102 
103  IF (patch%mixt%bcSet .eqv. .true.) &
104  CALL errorstop( global,err_patch_overspec,__line__,'Noslip boundary.' )
105 
106  patch%mixt%nData = 0
107  patch%mixt%nSwitches = 1
108  IF (patch%bcCoupled == bc_external) THEN ! data from outside
109  patch%mixt%distrib = bcdat_distrib ! => always distribution
110  ELSE
111  patch%mixt%distrib = distrib
112  ENDIF
113 
114  ALLOCATE( patch%mixt%switches(patch%mixt%nSwitches), &
115  stat=errorflag )
116  global%error = errorflag
117  IF (global%error /= 0) CALL errorstop( global,err_allocate,__line__ )
118 
119 ! ----- check if switch defined
120  IF (defined(1).eqv..true.) THEN
121  patch%mixt%switches(bcswi_noslip_adiabat) = bcopt_adiabat
122  IF (vals(1) < 0.1) &
123  patch%mixt%switches(bcswi_noslip_adiabat) = bcopt_non_adiabat
124  ELSE
125  CALL errorstop( global,err_no_bcswitch,__line__,'(adiabatic wall yes/no).' )
126  ENDIF
127 
128 ! ----- check if Twall specified (value or file with distribution)
129  IF (patch%mixt%switches(bcswi_noslip_adiabat) == &
130  bcopt_non_adiabat) THEN
131  IF (patch%mixt%distrib==bcdat_constant .AND. &
132  (.NOT. (defined(2).eqv..true.))) CALL errorstop( global,err_bcval_missing,__line__ )
133  ENDIF
134 
135 ! ----- set flag to BC specified
136  patch%mixt%bcSet = .true.
137 
138  ENDIF ! my BC & processor, active
139  ENDDO
140  ENDDO
141 
142 ! copy values/distribution to variables ---------------------------------------
143 
144  DO ireg=brbeg,brend
145  DO ipatch=prbeg,min(prend,regions(ireg)%nPatches)
146 
147  patch => regions(ireg)%levels(1)%patches(ipatch)
148 
149  IF ((patch%bcType>=bc_noslipwall .AND. &
150  patch%bcType<=bc_noslipwall+bc_range) .AND. & ! my boundary type,
151  regions(ireg)%procid==global%myProcid .AND. & ! region active and
152  regions(ireg)%active==active) THEN ! on my processor
153  switch = patch%mixt%switches(bcswi_noslip_adiabat)
154  ELSE
155  switch = bcopt_adiabat
156  ENDIF
157 
158  IF ((patch%bcType>=bc_noslipwall .AND. &
159  patch%bcType<=bc_noslipwall+bc_range) .AND. & ! my boundary type,
160  switch==bcopt_non_adiabat .AND. & ! Twall required,
161  regions(ireg)%procid==global%myProcid .AND. & ! region active and
162  regions(ireg)%active==active) THEN ! on my processor
163 
164 ! ----- allocate memory for the values
165 
166  patch%mixt%nData = 1
167 
168  IF (patch%mixt%distrib == bcdat_distrib) THEN
169  n1 = abs(patch%l1end-patch%l1beg)
170  n2 = abs(patch%l2end-patch%l2beg)
171  ioff = n1 + 1
172  ijbeg = indij( 0, 0,ioff)
173  ijend = indij(n1,n2,ioff)
174  ELSE
175  ijbeg = 0
176  ijend = 1
177  ENDIF
178  ALLOCATE( patch%mixt%vals(patch%mixt%nData,ijbeg:ijend), &
179  stat=errorflag )
180  global%error = errorflag
181  IF (global%error /= 0) CALL errorstop( global,err_allocate,__line__ )
182 
183 ! ----- distribution from file
184 
185  IF (patch%mixt%distrib==bcdat_distrib .AND. &
186  patch%bcCoupled /=bc_external ) THEN
187  CALL rflo_readbcfromfile( global,fname,patch )
188 
189 ! ----- distribution from external source / constant value
190 
191  ELSE
192  patch%mixt%vals(bcdat_noslip_twall,:) = vals(2)
193  ENDIF ! distribution?
194 
195  ENDIF ! bcType, Twall req., active region on my processor
196 
197  ENDDO ! iPatch
198  ENDDO ! iReg
199 
200 ! finalize --------------------------------------------------------------------
201 
202  CALL deregisterfunction( global )
203 
204 END SUBROUTINE rflo_readbcnoslipsection
205 
206 !******************************************************************************
207 !
208 ! RCS Revision history:
209 !
210 ! $Log: RFLO_ReadBcNoslipSection.F90,v $
211 ! Revision 1.5 2008/12/06 08:44:07 mtcampbe
212 ! Updated license.
213 !
214 ! Revision 1.4 2008/11/19 22:17:20 mtcampbe
215 ! Added Illinois Open Source License/Copyright
216 !
217 ! Revision 1.3 2008/10/23 18:20:53 mtcampbe
218 ! Crazy number of changes to track and fix initialization and
219 ! restart bugs. Many improperly formed logical expressions
220 ! were fixed, and bug in allocation for data associated with
221 ! the BC_INFLOWVELTEMP boundary condition squashed in
222 ! RFLO_ReadBcInflowVelSection.F90.
223 !
224 ! Revision 1.2 2006/08/19 15:38:17 mparmar
225 ! Renamed patch variables
226 !
227 ! Revision 1.1 2004/11/29 21:25:16 wasistho
228 ! lower to upper case
229 !
230 ! Revision 1.6 2003/11/20 16:40:34 mdbrandy
231 ! Backing out RocfluidMP changes from 11-17-03
232 !
233 ! Revision 1.3 2003/05/15 02:57:01 jblazek
234 ! Inlined index function.
235 !
236 ! Revision 1.2 2003/02/11 22:30:21 jferry
237 ! Re-worked BC and TBC input routines to add multi-physics capability
238 !
239 ! Revision 1.1 2002/10/19 00:40:30 jblazek
240 ! Added utility (rflosurf) to write out surface grids for GenX.
241 !
242 ! Revision 1.11 2002/10/12 03:20:50 jblazek
243 ! Replaced [io]stat=global%error with local errorFlag for Rocflo.
244 !
245 ! Revision 1.10 2002/09/27 00:57:10 jblazek
246 ! Changed makefiles - no makelinks needed.
247 !
248 ! Revision 1.9 2002/09/20 22:22:36 jblazek
249 ! Finalized integration into GenX.
250 !
251 ! Revision 1.8 2002/09/17 13:43:00 jferry
252 ! Added Time-dependent boundary conditions
253 !
254 ! Revision 1.7 2002/09/05 17:40:22 jblazek
255 ! Variable global moved into regions().
256 !
257 ! Revision 1.6 2002/02/21 23:25:06 jblazek
258 ! Blocks renamed as regions.
259 !
260 ! Revision 1.5 2002/02/09 01:47:01 jblazek
261 ! Added multi-probe option, residual smoothing, physical time step.
262 !
263 ! Revision 1.4 2002/01/31 20:56:30 jblazek
264 ! Added basic boundary conditions.
265 !
266 ! Revision 1.3 2002/01/11 17:20:19 jblazek
267 ! Added time stamp or iteration number to file names.
268 !
269 ! Revision 1.2 2001/12/22 00:09:39 jblazek
270 ! Added routines to store grid and solution.
271 !
272 ! Revision 1.1 2001/12/08 00:18:42 jblazek
273 ! Added routines to read BC input file.
274 !
275 !******************************************************************************
276 
277 
278 
279 
280 
281 
282 
subroutine rflo_readbcfromfile(global, fname, patch)
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 rflo_readbcnoslipsection(regions)
subroutine errorstop(global, errorCode, errorLine, addMessage)
Definition: ModError.F90:483
subroutine deregisterfunction(global)
Definition: ModError.F90:469