Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PREP_ReadBcInputFile.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 boundary conditions
26 ! (done on all processors).
27 !
28 ! Description: none.
29 !
30 ! Input: boundary condition file.
31 !
32 ! Output: regions = BC data for all regions.
33 !
34 ! Notes:
35 !
36 !******************************************************************************
37 !
38 ! $Id: PREP_ReadBcInputFile.F90,v 1.5 2008/12/06 08:44:50 mtcampbe Exp $
39 !
40 ! Copyright: (c) 2001 by the University of Illinois
41 !
42 !******************************************************************************
43 
44 SUBROUTINE readbcinputfile( regions )
45 
46  USE moddatatypes
47  USE moddatastruct, ONLY : t_region
48  USE modglobal, ONLY : t_global
49  USE moderror
50  USE modparameters
51  IMPLICIT NONE
52 
53 ! ... parameters
54  TYPE(t_region), POINTER :: regions(:)
55 
56 ! ... local variables
57  CHARACTER(2*CHRLEN+9) :: fname
58  CHARACTER(256) :: line
59 
60  INTEGER :: errorflag
61 
62  TYPE(t_global), POINTER :: global
63 
64 !******************************************************************************
65 
66  global => regions(1)%global
67 
68  CALL registerfunction( global,'ReadBcInputFile',&
69  'PREP_ReadBcInputFile.F90' )
70 
71 ! open file
72 
73  WRITE(fname,'(A)') trim(global%inDir)//trim(global%casename)//'.bc'
74  OPEN(if_input,file=fname,form='formatted',status='old',iostat=errorflag)
75  global%error = errorflag
76  IF (global%error /= 0) &
77  CALL errorstop( global,err_file_open,__line__,'File: '//trim(fname) )
78 
79 ! allocate variables
80 
81  ALLOCATE( global%prepBcDefined(bc_code_max) ,stat=errorflag )
82  global%error = errorflag
83  IF (global%error /= 0) CALL errorstop( global,err_allocate,__line__ )
84 
85 ! read file looking for keywords
86 
87  global%prepBcDefined(:) = .false.
88 
89  DO
90  READ(if_input,'(A256)',err=10,end=86) line
91  SELECT CASE(trim(line))
92 
93  CASE ('# BC_SLIPW')
94  global%prepBcDefined(bc_slipwall) = .true.
95 
96  CASE ('# BC_NOSLIP')
97  global%prepBcDefined(bc_noslipwall) = .true.
98 
99 ! Warning: keep this temporarily for backward compatibility
100  CASE ('# BC_INFLOW')
101  global%prepBcDefined(bc_inflow) = .true.
102 ! END Warning
103 
104  CASE ('# BC_INFLOW_TOTANG')
105  global%prepBcDefined(bc_inflow_totang) = .true.
106 
107  CASE ('# BC_INFLOW_VELTEMP')
108  global%prepBcDefined(bc_inflow_veltemp) = .true.
109 
110  CASE ('# BC_INFLOW_VELPRESS')
111  global%prepBcDefined(bc_inflow_velpress) = .true.
112 
113  CASE ('# BC_OUTFLOW')
114  global%prepBcDefined(bc_outflow) = .true.
115 
116  CASE ('# BC_FARF')
117  global%prepBcDefined(bc_farfield) = .true.
118 
119  CASE ('# BC_INJECT')
120  global%prepBcDefined(bc_injection) = .true.
121 
122  CASE ('# BC_INJECT_APN')
123  global%prepBcDefined(bc_injection) = .true.
124 
125  END SELECT
126  ENDDO
127 
128 86 CONTINUE
129 
130 ! close file ------------------------------------------------------------------
131 
132  CLOSE(if_input,iostat=errorflag)
133  global%error = errorflag
134  IF (global%error /= 0) &
135  CALL errorstop( global,err_file_close,__line__,'File: '//trim(fname) )
136 
137 ! finalization & error handling -----------------------------------------------
138 
139  CALL deregisterfunction( global )
140  goto 999
141 
142 10 CONTINUE
143  CALL errorstop( global,err_file_read,__line__,'File: '//trim(fname) )
144 
145 999 CONTINUE
146 
147 END SUBROUTINE readbcinputfile
148 
149 !******************************************************************************
150 !
151 ! RCS Revision history:
152 !
153 ! $Log: PREP_ReadBcInputFile.F90,v $
154 ! Revision 1.5 2008/12/06 08:44:50 mtcampbe
155 ! Updated license.
156 !
157 ! Revision 1.4 2008/11/19 22:18:00 mtcampbe
158 ! Added Illinois Open Source License/Copyright
159 !
160 ! Revision 1.3 2006/01/29 09:34:50 wasistho
161 ! added injection_apn
162 !
163 ! Revision 1.2 2005/04/29 03:31:10 wasistho
164 ! added distribution bc file generator
165 !
166 ! Revision 1.1 2004/12/03 02:20:08 wasistho
167 ! added prefix
168 !
169 ! Revision 1.1 2004/12/03 00:40:49 wasistho
170 ! lower to upper case
171 !
172 ! Revision 1.1 2004/07/27 20:29:47 wasistho
173 ! added readBcInputFile and checkBcValidity
174 !
175 !
176 !******************************************************************************
177 
178 
179 
180 
181 
182 
183 
CImg< T > & line(const unsigned int y0)
Get a line.
Definition: CImg.h:18421
subroutine registerfunction(global, funName, fileName)
Definition: ModError.F90:449
int status() const
Obtain the status of the attribute.
Definition: Attribute.h:240
**********************************************************************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 form
subroutine readbcinputfile(regions)
subroutine errorstop(global, errorCode, errorLine, addMessage)
Definition: ModError.F90:483
subroutine deregisterfunction(global)
Definition: ModError.F90:469