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