Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RFLU_GetBoundaryValues.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: Obtain boundary values from Genx.
26 !
27 ! Description: None.
28 !
29 ! Input:
30 ! region Dimensions and topology
31 !
32 ! Output:
33 ! region%levels%patch Input values for boundary conditions
34 !
35 ! Notes: None.
36 !
37 ! ******************************************************************************
38 !
39 ! $Id: RFLU_GetBoundaryValues.F90,v 1.18 2008/12/06 08:44:01 mtcampbe Exp $
40 !
41 ! Copyright: (c) 2002-2004 by the University of Illinois
42 !
43 ! ******************************************************************************
44 
45 SUBROUTINE rflu_getboundaryvalues(region)
46 
47  USE moddatatypes
48  USE modglobal, ONLY: t_global
49  USE modbndpatch, ONLY: t_patch
50  USE moddatastruct, ONLY: t_region
51  USE moderror
52  USE modparameters
53  USE modmpi
54 
55  IMPLICIT NONE
56 
57 ! ******************************************************************************
58 ! Definitions and declarations
59 ! ******************************************************************************
60 
61 ! ==============================================================================
62 ! Arguments
63 ! ==============================================================================
64 
65  TYPE(t_region) :: region
66 
67 ! ==============================================================================
68 ! Locals
69 ! ==============================================================================
70 
71  CHARACTER(CHRLEN) :: errorstring,rcsidentstring
72  INTEGER :: ifl,ipatch,bocount,botot
73  REAL(RFREAL), DIMENSION(:,:), POINTER :: pvals
74  TYPE(t_global), POINTER :: global
75  TYPE(t_patch), POINTER :: ppatch
76 
77 ! ******************************************************************************
78 ! Start
79 ! ******************************************************************************
80 
81  rcsidentstring = '$RCSfile: RFLU_GetBoundaryValues.F90,v $ $Revision: 1.18 $'
82 
83  global => region%global
84 
85  CALL registerfunction(global,'RFLU_GetBoundaryValues',&
86  'RFLU_GetBoundaryValues.F90')
87 
88 ! ******************************************************************************
89 ! Loop over ALL boundaries
90 ! ******************************************************************************
91 
92 
93  IF ( global%myProcid == masterproc .AND. &
94  global%verbLevel >= verbose_high ) THEN
95  WRITE(stdout,'(A,1X,A,1X,I3)') solver_name, &
96  'Getting values from GENX buffers...'
97  END IF ! global%myProcid
98 
99  bocount = 0
100  DO ipatch=1,region%grid%nPatches
101  ppatch => region%patches(ipatch)
102 
103  IF ( global%myProcid == masterproc .AND. &
104  global%checkLevel == check_high .AND. &
105  global%verbLevel >= verbose_high ) THEN
106  IF ( ppatch%bcCoupled == bc_not_coupled ) THEN
107  WRITE(stdout,'(A,3X,A,1X,I3,1X,A)') solver_name,'Patch:',ipatch, &
108  '(not interacting)'
109  ELSE IF ( ppatch%bcCoupled == bc_not_burning ) THEN
110  WRITE(stdout,'(A,3X,A,1X,I3,1X,A)') solver_name,'Patch:',ipatch, &
111  '(interacting)'
112  ELSE IF ( ppatch%bcCoupled == bc_burning ) THEN
113  WRITE(stdout,'(A,3X,A,1X,I3,1X,A)') solver_name,'Patch:',ipatch, &
114  '(interacting and burning)'
115  END IF ! pPatch%bcCoupled
116  END IF ! global%myProcid
117 
118 ! ==============================================================================
119 ! Coupled burning boundary
120 ! ==============================================================================
121 
122  IF ( ppatch%bcCoupled == bc_burning )THEN
123  pvals => ppatch%mixt%vals
124  DO ifl = 1,ppatch%nBFaces
125 ! TZ DOES NOT WORK PROPERLY WITH THE ROCMAN EVALUATED MDOT (leaving this in for now)
126 ! pPatch%mdotAlp(ifl) = global%tzRhos*global%tzA*pPatch%pf(ifl)**global%tzN
127 ! Rocman3 has been modified to always pass in the nominal mdots, so we trust the mdot
128 ! coming from Rocman3 now.
129 !
130 ! We've the BFLAG off for faces that have burned out. We need to zero these mdots
131 ! in the fluid RK substeps. The following check accomplishes mdot zeroing for
132 ! burned out faces.
133  IF(ppatch%bflag(ifl) .ne. 0) THEN
134  pvals(bcdat_inject_mfrate,ifl) = ppatch%mdotAlp(ifl)
135  ELSE
136  bocount = bocount + 1
137  pvals(bcdat_inject_mfrate,ifl) = 0.0
138  ppatch%mdotAlp(ifl) = 0.0
139  ENDIF
140  pvals(bcdat_inject_temp ,ifl) = ppatch%tflmAlp(ifl)
141  END DO ! ifl
142 
143  DO ifl = ppatch%nBFaces+1,ppatch%nBFacesTot
144  pvals(bcdat_inject_mfrate,ifl) = REAL(crazy_value_int,kind=rfreal)
145  pvals(bcdat_inject_temp ,ifl) = REAL(crazy_value_int,kind=rfreal)
146  END DO ! ifl
147 
148  IF ( global%myProcid == masterproc .AND. &
149  global%checkLevel == check_high .AND. &
150  global%verbLevel >= verbose_high ) THEN
151  IF ( ppatch%nBFaces > 0 ) THEN
152  WRITE(stdout,'(A,5X,A)') solver_name,'Minimum/maximum values:'
153  WRITE(stdout,'(A,7X,A,2(1X,E15.8))') solver_name,'mdotAlp: ', &
154  minval(ppatch%mdotAlp(1:ppatch%nBFaces)), &
155  maxval(ppatch%mdotAlp(1:ppatch%nBFaces))
156  WRITE(stdout,'(A,7X,A,2(1X,E15.8))') solver_name,'TflmAlp: ', &
157  minval(ppatch%tflmAlp(1:ppatch%nBFaces)), &
158  maxval(ppatch%tflmAlp(1:ppatch%nBFaces))
159  END IF ! pPatch%nBFaces
160  END IF ! global%myProcid
161 
162  IF ( minval(ppatch%mdotAlp(1:ppatch%nBFaces)) < 0.0_rfreal ) THEN
163  WRITE(errorstring,*) 'Patch:',ppatch%iPatchGlobal
164  CALL errorstop(global,err_mdot_negative,__line__,trim(errorstring))
165  END IF ! MINVAL
166 
167  IF ( minval(ppatch%tflmAlp(1:ppatch%nBFaces)) < 0.0_rfreal ) THEN
168  WRITE(errorstring,*) 'Patch:',ppatch%iPatchGlobal
169  CALL errorstop(global,err_tflm_negative,__line__,trim(errorstring))
170  END IF ! MINVAL
171 
172 ! ==============================================================================
173 ! Coupled non-burning boundary. NOTE only copy boundary temperature for
174 ! isothermal no-slip walls.
175 ! ==============================================================================
176 
177  ELSE IF ( ppatch%bcCoupled == bc_not_burning ) THEN
178  IF ( ppatch%bcType == bc_noslipwall_temp ) THEN
179  pvals => ppatch%mixt%vals
180 
181  DO ifl = 1,ppatch%nBFaces
182  pvals(bcdat_noslip_t,ifl) = ppatch%tbAlp(ifl)
183  END DO ! ifl
184 
185  DO ifl = ppatch%nBFaces+1,ppatch%nBFacesTot
186  pvals(bcdat_noslip_t,ifl) = REAL(crazy_value_int,kind=rfreal)
187  END DO ! ifl
188 
189  IF ( global%myProcid == masterproc .AND. &
190  global%checkLevel == check_high .AND. &
191  global%verbLevel >= verbose_high ) THEN
192  IF ( ppatch%nBFaces > 0 ) THEN
193  WRITE(stdout,'(A,5X,A)') solver_name,'Minimum/maximum values:'
194  WRITE(stdout,'(A,7X,A,2(1X,E15.8))') solver_name,'TbAlp: ', &
195  minval(ppatch%tbAlp(1:ppatch%nBFaces)), &
196  maxval(ppatch%tbAlp(1:ppatch%nBFaces))
197  END IF ! pPatch%nBFaces
198  END IF ! global%myProcid
199 
200  IF ( minval(ppatch%tbAlp(1:ppatch%nBFaces)) < 0.0_rfreal ) THEN
201  WRITE(errorstring,*) 'Patch:',ppatch%iPatchGlobal
202  CALL errorstop(global,err_tb_negative,__line__,trim(errorstring))
203  END IF ! MINVAL
204  END IF ! pPatch%bcType
205 
206 ! ==============================================================================
207 ! Noncoupled boundary
208 ! ==============================================================================
209 
210  ELSE IF ( ppatch%bcCoupled == bc_not_coupled ) THEN
211 
212 ! ==============================================================================
213 ! Impossible combination - defensive programming
214 ! ==============================================================================
215 
216  ELSE
217  CALL errorstop(global,err_reached_default,__line__)
218  END IF ! pPatch%bcCoupled
219  END DO ! iPatch
220 
221 ! ******************************************************************************
222 ! End
223 ! ******************************************************************************
224 
225  IF ( global%checkLevel == check_high .AND. bocount > 0) THEN
226  WRITE(stdout,'(A,3X,A,1X,I9,1X,I9)') solver_name, &
227  'Local burned out faces:',bocount,global%myProcid
228  ENDIF
229 
230  IF ( global%myProcid == masterproc .AND. &
231  global%verbLevel >= verbose_high ) THEN
232  WRITE(stdout,'(A,1X,A,1X,I3)') solver_name, &
233  'Getting values from GENX buffers done.'
234  END IF ! global%myProcid
235 
236  CALL deregisterfunction(global)
237 
238 END SUBROUTINE rflu_getboundaryvalues
239 
240 ! ******************************************************************************
241 !
242 ! RCS Revision history:
243 !
244 ! $Log: RFLU_GetBoundaryValues.F90,v $
245 ! Revision 1.18 2008/12/06 08:44:01 mtcampbe
246 ! Updated license.
247 !
248 ! Revision 1.17 2008/11/19 22:17:15 mtcampbe
249 ! Added Illinois Open Source License/Copyright
250 !
251 ! Revision 1.16 2007/04/20 16:07:47 mtcampbe
252 ! Updating for burnout support function RFLU_GENX_InitBFLAG
253 !
254 ! Revision 1.15 2007/04/14 21:54:45 mtcampbe
255 ! Updated for burnout compatibility.
256 !
257 ! Revision 1.14 2007/04/14 14:30:32 mtcampbe
258 ! Updated for TZ
259 !
260 ! Revision 1.13 2006/08/19 15:37:53 mparmar
261 ! Renamed patch variables
262 !
263 ! Revision 1.12 2005/10/14 13:59:46 haselbac
264 ! Added setting of boundary temperature for non-burning patches
265 !
266 ! Revision 1.11 2004/10/19 19:23:04 haselbac
267 ! Removed setting of relative velocity on injecting boundaries, cosmetics
268 !
269 ! Revision 1.10 2003/08/20 02:09:58 haselbac
270 ! Changed verbosity conditions to reduce solver output in GENx runs
271 !
272 ! Revision 1.9 2003/05/13 23:41:35 haselbac
273 ! Added init of dummy faces and check for temp
274 !
275 ! Revision 1.8 2003/05/01 20:44:16 haselbac
276 ! Added check for negative mdot
277 !
278 ! Revision 1.7 2003/05/01 14:06:11 haselbac
279 ! Removed warning for non-burning boundaries
280 !
281 ! Revision 1.6 2003/04/12 21:33:01 haselbac
282 ! Made parallel: Added MASTERPROC checks
283 !
284 ! Revision 1.5 2003/01/28 18:22:28 haselbac
285 ! Cosmetics only
286 !
287 ! Revision 1.4 2002/10/12 19:08:45 haselbac
288 ! Cosmetic changes only
289 !
290 ! Revision 1.3 2002/10/12 14:48:15 haselbac
291 ! Corrected bcFlag bug, some cosmetic changes
292 !
293 ! Revision 1.2 2002/10/07 14:09:32 haselbac
294 ! Changed ModBndpatch to ModBndPatch
295 !
296 ! Revision 1.1 2002/10/05 18:28:18 haselbac
297 ! Initial revision
298 !
299 ! ******************************************************************************
300 
301 
302 
303 
304 
305 
306 
subroutine registerfunction(global, funName, fileName)
Definition: ModError.F90:449
subroutine rflu_getboundaryvalues(region)
subroutine errorstop(global, errorCode, errorLine, addMessage)
Definition: ModError.F90:483
subroutine deregisterfunction(global)
Definition: ModError.F90:469