Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RFLO_ReadBcFarfSection.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 far field 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_ReadBcFarfSection.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_readbcfarfsection( 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(5)
64  CHARACTER(256) :: fname
65 
66  INTEGER :: brbeg, brend, prbeg, prend, distrib
67  INTEGER :: n1, n2, ioff, ijbeg, ijend, errorflag
68 
69  LOGICAL :: defined(5)
70 
71  REAL(RFREAL) :: vals(5)
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_ReadBcFarfSection',&
81  'RFLO_ReadBcFarfSection.F90' )
82 
83 ! specify keywords and search for them ----------------------------------------
84 
85  keys(1) = 'MACH'
86  keys(2) = 'ATTACK'
87  keys(3) = 'SLIP'
88  keys(4) = 'PRESS'
89  keys(5) = 'TEMP'
90 
91  CALL readpatchsection( global,if_input,5,keys,vals,brbeg,brend, &
92  prbeg,prend,distrib,fname,defined )
93 
94 ! check if all values defined -------------------------------------------------
95 
96  IF (distrib==bcdat_constant .AND. &
97  (.NOT. (defined(1).eqv..true.) .OR. &
98  .NOT. (defined(2).eqv..true.) .OR. &
99  .NOT. (defined(3).eqv..true.) .OR. &
100  .NOT. (defined(4).eqv..true.) .OR. &
101  .NOT. (defined(5).eqv..true.))) CALL errorstop( global,err_bcval_missing,&
102  __line__ )
103 
104 ! copy values/distribution to variables ---------------------------------------
105 
106  DO ireg=brbeg,brend
107  DO ipatch=prbeg,min(prend,regions(ireg)%nPatches)
108 
109  patch => regions(ireg)%levels(1)%patches(ipatch)
110 
111  IF ((patch%bcType>=bc_farfield .AND. &
112  patch%bcType<=bc_farfield+bc_range) .AND. & ! my boundary type
113  regions(ireg)%procid==global%myProcid .AND. & ! region active and
114  regions(ireg)%active==active) THEN ! on my processor
115 
116  IF (patch%mixt%bcSet.eqv..true.) &
117  CALL errorstop( global,err_patch_overspec,&
118  __line__,'Farfield boundary.' )
119 
120  patch%mixt%nData = 5
121  patch%mixt%nSwitches = 0
122  patch%mixt%bcSet = .true.
123  IF (patch%bcCoupled == bc_external) THEN ! data from outside
124  patch%mixt%distrib = bcdat_distrib ! => always distribution
125  ELSE
126  patch%mixt%distrib = distrib
127  ENDIF
128 
129 ! ----- allocate memory for the values
130 
131  IF (patch%mixt%distrib == bcdat_distrib) THEN
132  n1 = abs(patch%l1end-patch%l1beg)
133  n2 = abs(patch%l2end-patch%l2beg)
134  ioff = n1 + 1
135  ijbeg = indij( 0, 0,ioff)
136  ijend = indij(n1,n2,ioff)
137  ELSE
138  ijbeg = 0
139  ijend = 1
140  ENDIF
141  ALLOCATE( patch%mixt%vals(patch%mixt%nData,ijbeg:ijend), &
142  stat=errorflag )
143  global%error = errorflag
144  IF (global%error /= 0) CALL errorstop( global,err_allocate,&
145  __line__ )
146 
147 ! ----- distribution from file
148 
149  IF (patch%mixt%distrib==bcdat_distrib .AND. &
150  patch%bcCoupled /=bc_external ) THEN
151  CALL rflo_readbcfromfile( global,fname,patch )
152 
153  patch%mixt%vals(bcdat_farf_attack,:) = &
154  patch%mixt%vals(bcdat_farf_attack,:)*global%rad
155  patch%mixt%vals(bcdat_farf_slip ,:) = &
156  patch%mixt%vals(bcdat_farf_slip ,:)*global%rad
157 
158 ! ----- distribution from external source / constant value
159 
160  ELSE
161  patch%mixt%vals(bcdat_farf_mach ,:) = vals(1)
162  patch%mixt%vals(bcdat_farf_attack,:) = vals(2)*global%rad
163  patch%mixt%vals(bcdat_farf_slip ,:) = vals(3)*global%rad
164  patch%mixt%vals(bcdat_farf_press ,:) = vals(4)
165  patch%mixt%vals(bcdat_farf_temp ,:) = vals(5)
166  ENDIF ! distribution?
167 
168  ENDIF ! bcType, active region on my processor
169 
170  ENDDO ! iPatch
171  ENDDO ! iReg
172 
173 ! finalize --------------------------------------------------------------------
174 
175  CALL deregisterfunction( global )
176 
177 END SUBROUTINE rflo_readbcfarfsection
178 
179 !******************************************************************************
180 !
181 ! RCS Revision history:
182 !
183 ! $Log: RFLO_ReadBcFarfSection.F90,v $
184 ! Revision 1.5 2008/12/06 08:44:07 mtcampbe
185 ! Updated license.
186 !
187 ! Revision 1.4 2008/11/19 22:17:20 mtcampbe
188 ! Added Illinois Open Source License/Copyright
189 !
190 ! Revision 1.3 2008/10/23 18:20:53 mtcampbe
191 ! Crazy number of changes to track and fix initialization and
192 ! restart bugs. Many improperly formed logical expressions
193 ! were fixed, and bug in allocation for data associated with
194 ! the BC_INFLOWVELTEMP boundary condition squashed in
195 ! RFLO_ReadBcInflowVelSection.F90.
196 !
197 ! Revision 1.2 2006/08/19 15:38:07 mparmar
198 ! Renamed patch variables
199 !
200 ! Revision 1.1 2004/11/29 21:25:16 wasistho
201 ! lower to upper case
202 !
203 ! Revision 1.6 2003/11/20 16:40:34 mdbrandy
204 ! Backing out RocfluidMP changes from 11-17-03
205 !
206 ! Revision 1.3 2003/05/15 02:57:01 jblazek
207 ! Inlined index function.
208 !
209 ! Revision 1.2 2003/02/11 22:30:21 jferry
210 ! Re-worked BC and TBC input routines to add multi-physics capability
211 !
212 ! Revision 1.1 2002/10/19 00:40:30 jblazek
213 ! Added utility (rflosurf) to write out surface grids for GenX.
214 !
215 ! Revision 1.12 2002/10/12 03:20:50 jblazek
216 ! Replaced [io]stat=global%error with local errorFlag for Rocflo.
217 !
218 ! Revision 1.11 2002/09/27 00:57:10 jblazek
219 ! Changed makefiles - no makelinks needed.
220 !
221 ! Revision 1.10 2002/09/20 22:22:36 jblazek
222 ! Finalized integration into GenX.
223 !
224 ! Revision 1.9 2002/09/17 13:43:00 jferry
225 ! Added Time-dependent boundary conditions
226 !
227 ! Revision 1.8 2002/09/05 17:40:22 jblazek
228 ! Variable global moved into regions().
229 !
230 ! Revision 1.7 2002/02/21 23:25:06 jblazek
231 ! Blocks renamed as regions.
232 !
233 ! Revision 1.6 2002/02/09 01:47:01 jblazek
234 ! Added multi-probe option, residual smoothing, physical time step.
235 !
236 ! Revision 1.5 2002/02/04 15:30:25 jblazek
237 ! Added injection boundary condition.
238 !
239 ! Revision 1.4 2002/01/31 20:56:30 jblazek
240 ! Added basic boundary conditions.
241 !
242 ! Revision 1.3 2002/01/11 17:20:19 jblazek
243 ! Added time stamp or iteration number to file names.
244 !
245 ! Revision 1.2 2001/12/22 00:09:39 jblazek
246 ! Added routines to store grid and solution.
247 !
248 ! Revision 1.1 2001/12/08 00:18:42 jblazek
249 ! Added routines to read BC input file.
250 !
251 !******************************************************************************
252 
253 
254 
255 
256 
257 
258 
subroutine rflo_readbcfromfile(global, fname, patch)
subroutine registerfunction(global, funName, fileName)
Definition: ModError.F90:449
subroutine rflo_readbcfarfsection(regions)
**********************************************************************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