Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RFLU_PutBoundaryValuesAlpha.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: Put outgoing data into buffers for GENX.
26 !
27 ! Description: None.
28 !
29 ! Input:
30 ! region Dimensions of patches, types of BCs, flow variables
31 !
32 ! Output: None.
33 !
34 ! Notes:
35 ! 1. The normal depends also on the fractional time alpha, but Rocflu does
36 ! not move the mesh inside the Runge-Kutta stages, so copying the normal
37 ! vector here is not necessary.
38 !
39 ! ******************************************************************************
40 !
41 ! $Id: RFLU_PutBoundaryValuesAlpha.F90,v 1.17 2008/12/06 08:44:01 mtcampbe Exp $
42 !
43 ! Copyright: (c) 2002-2004 by the University of Illinois
44 !
45 ! ******************************************************************************
46 
47 SUBROUTINE rflu_putboundaryvaluesalpha(region)
48 
49  USE moddatatypes
50  USE moderror
51  USE modglobal, ONLY: t_global
52  USE modgrid, ONLY: t_grid
53  USE modbndpatch, ONLY: t_patch
54  USE moddatastruct, ONLY: t_region
55  USE modparameters
56  USE modmpi
57 
60 
61  IMPLICIT NONE
62 
63 ! *****************************************************************************
64 ! Definitions and declarations
65 ! *****************************************************************************
66 
67 ! =============================================================================
68 ! Arguments
69 ! =============================================================================
70 
71  TYPE(t_region), TARGET :: region
72  LOGICAL :: initialize
73 
74 ! =============================================================================
75 ! Locals
76 ! =============================================================================
77 
78  CHARACTER(CHRLEN) :: rcsidentstring
79  INTEGER :: c1,distrib,gasmodel,ifl,indcp,indgs,indmol,ipatch
80  REAL(RFREAL) :: cp,dummyreal,fs,fsu,minj,mm,nx,ny,nz,pl,rl,tinj
81  REAL(RFREAL), DIMENSION(:,:), POINTER :: pcv,pdv,pgv,pmixtvals
82  TYPE(t_global), POINTER :: global
83  TYPE(t_grid), POINTER :: pgrid
84  TYPE(t_patch), POINTER :: ppatch
85  TYPE(t_region), POINTER :: pregion
86 
87 ! *****************************************************************************
88 ! Start
89 ! *****************************************************************************
90 
91  rcsidentstring = &
92  '$RCSfile: RFLU_PutBoundaryValuesAlpha.F90,v $ $Revision: 1.17 $'
93 
94  global => region%global
95 
96  CALL registerfunction(global,'RFLU_PutBoundaryValuesAlpha',&
97  'RFLU_PutBoundaryValuesAlpha.F90')
98 
99 ! *****************************************************************************
100 ! Set pointers
101 ! *****************************************************************************
102 
103  pregion => region
104  pgrid => pregion%grid
105  pcv => pregion%mixt%cv
106  pdv => pregion%mixt%dv
107  pgv => pregion%mixt%gv
108 
109  indgs = region%grid%indGs
110  indcp = region%mixtInput%indCp
111  indmol = region%mixtInput%indMol
112  gasmodel = region%mixtInput%gasModel
113 
114 ! *****************************************************************************
115 ! Loop over ALL interacting boundaries
116 ! *****************************************************************************
117 
118  IF ( global%myProcid == masterproc .AND. &
119  global%verbLevel >= verbose_high ) THEN
120  WRITE(stdout,'(A,1X,A,1X,I3)') solver_name,'Putting alpha-dependent '// &
121  'values into GENX buffers...'
122  END IF ! global%myProcid
123 
124  DO ipatch=1,pgrid%nPatches
125  ppatch => region%patches(ipatch)
126 
127  distrib = ppatch%mixt%distrib
128 
129  IF ( global%myProcid == masterproc .AND. &
130  global%checkLevel == check_high .AND. &
131  global%verbLevel >= verbose_high ) THEN
132  IF ( ppatch%bcCoupled == bc_not_coupled ) THEN
133  WRITE(stdout,'(A,3X,A,1X,I3,1X,A)') solver_name,'Patch:',ipatch, &
134  '(not interacting)'
135  ELSE IF ( ppatch%bcCoupled == bc_not_burning ) THEN
136  WRITE(stdout,'(A,3X,A,1X,I3,1X,A)') solver_name,'Patch:',ipatch, &
137  '(interacting)'
138  ELSE IF ( ppatch%bcCoupled == bc_burning ) THEN
139  WRITE(stdout,'(A,3X,A,1X,I3,1X,A)') solver_name,'Patch:',ipatch, &
140  '(interacting and burning)'
141  END IF ! pPatch%bcCoupled
142  END IF ! global%myProcid
143 
144 ! =============================================================================
145 ! Outgoing data (initialized in RFLU_InitGENXInterface)
146 ! =============================================================================
147 
148 ! -----------------------------------------------------------------------------
149 ! Interacting non-burning boundary
150 ! -----------------------------------------------------------------------------
151 
152  IF ( ppatch%bcCoupled == bc_not_burning ) THEN
153  DO ifl = 1,ppatch%nBFaces
154  c1 = ppatch%bf2c(ifl)
155 
156  ppatch%rhofAlp(ifl) = pcv(cv_mixt_dens,c1)
157 
158  ppatch%nfAlp(xcoord,ifl) = ppatch%fn(xcoord,ifl)
159  ppatch%nfAlp(ycoord,ifl) = ppatch%fn(ycoord,ifl)
160  ppatch%nfAlp(zcoord,ifl) = ppatch%fn(zcoord,ifl)
161  END DO ! ifl
162 
163  DO ifl = ppatch%nBFaces+1,ppatch%nBFacesTot
164  ppatch%rhofAlp(ifl) = REAL(crazy_value_int,kind=rfreal)
165 
166  ppatch%nfAlp(xcoord,ifl) = REAL(crazy_value_int,kind=rfreal)
167  ppatch%nfAlp(ycoord,ifl) = REAL(crazy_value_int,kind=rfreal)
168  ppatch%nfAlp(zcoord,ifl) = REAL(crazy_value_int,kind=rfreal)
169  END DO ! ifl
170 
171  IF ( global%myProcid == masterproc .AND. &
172  global%checkLevel == check_high .AND. &
173  global%verbLevel >= verbose_high ) THEN
174  IF ( ppatch%nBFaces > 0 .AND. global%verbLevel >= verbose_high) THEN
175  WRITE(stdout,'(A,5X,A)') solver_name,'Minimum/maximum values:'
176  WRITE(stdout,'(A,7X,A,2(1X,E15.8))') solver_name,'rhofAlp: ', &
177  minval(ppatch%rhofAlp(1:ppatch%nBFaces)), &
178  maxval(ppatch%rhofAlp(1:ppatch%nBFaces))
179  END IF ! pPatch%nBFaces
180  END IF ! global%myProcid
181  END IF ! pPatch%bcCoupled
182 
183 ! -----------------------------------------------------------------------------
184 ! Interacting burning boundary - NOTE call to BcondInjectionPerf only done to
185 ! set rhofAlp, other quantities are not used or set, hence set rhoVrel to
186 ! crazy values and use dummyRealOut
187 ! -----------------------------------------------------------------------------
188 
189  IF ( ppatch%bcCoupled == bc_burning ) THEN
190  pmixtvals => ppatch%mixt%vals
191 
192  DO ifl = 1,ppatch%nBFaces
193  c1 = ppatch%bf2c(ifl)
194 
195  nx = ppatch%fn(xcoord,ifl)
196  ny = ppatch%fn(ycoord,ifl)
197  nz = ppatch%fn(zcoord,ifl)
198 
199  fs = ppatch%gs(indgs*ifl)
200  fsu = rflu_descalegridspeed(pregion,fs)
201 
202  IF ( gasmodel == gas_model_tcperf ) THEN
203  cp = pgv(gv_mixt_cp ,indcp *c1)
204  mm = pgv(gv_mixt_mol,indmol*c1)
205 
206  minj = pmixtvals(bcdat_inject_mfrate,distrib*ifl)
207 
208  IF ( minj > 0.0_rfreal ) THEN ! Surface burning
209  tinj = pmixtvals(bcdat_inject_temp,distrib*ifl)
210 
211  pl = pdv(dv_mixt_pres,c1)
212 
213  CALL rflu_setrindstateinjectperf(cp,mm,nx,ny,nz,minj,tinj,pl, &
214  fsu,rl,dummyreal,dummyreal, &
215  dummyreal,dummyreal)
216  ELSE ! Surface NOT burning
217  rl = pcv(cv_mixt_dens,c1)
218  END IF ! minj
219  ELSE
220  CALL errorstop(global,err_reached_default,__line__)
221  END IF ! gasModel
222 
223  ppatch%rhofAlp(ifl) = rl
224 
225  ppatch%nfAlp(xcoord,ifl) = nx
226  ppatch%nfAlp(ycoord,ifl) = ny
227  ppatch%nfAlp(zcoord,ifl) = nz
228  END DO ! ifl
229 
230  DO ifl = ppatch%nBFaces+1,ppatch%nBFacesTot
231  ppatch%rhofAlp(ifl) = REAL(crazy_value_int,kind=rfreal)
232 
233  ppatch%nfAlp(xcoord,ifl) = REAL(crazy_value_int,kind=rfreal)
234  ppatch%nfAlp(ycoord,ifl) = REAL(crazy_value_int,kind=rfreal)
235  ppatch%nfAlp(zcoord,ifl) = REAL(crazy_value_int,kind=rfreal)
236  END DO ! ifl
237 
238  IF ( global%myProcid == masterproc .AND. &
239  global%checkLevel == check_high .AND. &
240  global%verbLevel >= verbose_high ) THEN
241  IF ( ppatch%nBFaces > 0 .AND. global%verbLevel >= verbose_high) THEN
242  WRITE(stdout,'(A,5X,A)') solver_name,'Minimum/maximum values:'
243  WRITE(stdout,'(A,7X,A,2(1X,E15.8))') solver_name,'rhofAlp: ', &
244  minval(ppatch%rhofAlp(1:ppatch%nBFaces)), &
245  maxval(ppatch%rhofAlp(1:ppatch%nBFaces))
246  END IF ! pPatch%nBFaces
247  END IF ! global%myProcid
248  END IF ! pPatch%bcCoupled
249  END DO ! iPatch
250 
251 ! *****************************************************************************
252 ! End
253 ! *****************************************************************************
254 
255  IF ( global%myProcid == masterproc .AND. &
256  global%verbLevel >= verbose_high ) THEN
257  WRITE(stdout,'(A,1X,A,1X,I3)') solver_name,'Putting alpha-dependent '// &
258  'values into GENX buffers done.'
259  END IF ! global%myProcid
260 
261  CALL deregisterfunction(global)
262 
263 END SUBROUTINE rflu_putboundaryvaluesalpha
264 
265 ! *****************************************************************************
266 !
267 ! RCS Revision history:
268 !
269 ! $Log: RFLU_PutBoundaryValuesAlpha.F90,v $
270 ! Revision 1.17 2008/12/06 08:44:01 mtcampbe
271 ! Updated license.
272 !
273 ! Revision 1.16 2008/11/19 22:17:15 mtcampbe
274 ! Added Illinois Open Source License/Copyright
275 !
276 ! Revision 1.15 2006/08/19 15:37:56 mparmar
277 ! Renamed patch variables
278 !
279 ! Revision 1.14 2005/10/31 21:09:33 haselbac
280 ! Changed specModel and SPEC_MODEL_NONE
281 !
282 ! Revision 1.13 2004/10/19 19:35:59 haselbac
283 ! Changed setting of quantities on burning boundaries, cosmetics
284 !
285 ! Revision 1.12 2004/08/13 22:35:03 haselbac
286 ! Bug fix: pMixtVals only set for burning patches
287 !
288 ! Revision 1.11 2003/09/04 20:19:36 haselbac
289 ! Removed temporary fix for Rocburn problem in GENx
290 !
291 ! Revision 1.10 2003/08/23 21:41:31 haselbac
292 ! Fixed comment
293 !
294 ! Revision 1.9 2003/08/22 20:31:55 haselbac
295 ! Added temporary fix for ignition problems
296 !
297 ! Revision 1.8 2003/08/20 02:09:58 haselbac
298 ! Changed verbosity conditions to reduce solver output in GENx runs
299 !
300 ! Revision 1.7 2003/05/13 23:44:30 haselbac
301 ! Added init of dummy faces
302 !
303 ! Revision 1.6 2003/04/12 21:34:12 haselbac
304 ! Made parallel: Added MASTERPROC checks
305 !
306 ! Revision 1.5 2003/03/05 20:37:16 jiao
307 ! ACH: Changed call to BcondInjectionPerf, see comment
308 !
309 ! Revision 1.4 2003/02/24 23:42:40 haselbac
310 ! Added setting of nfAlp at request of Jim for PC iterations
311 !
312 ! Revision 1.3 2003/01/28 18:27:30 haselbac
313 ! Cosmetics only
314 !
315 ! Revision 1.2 2002/11/27 20:23:30 haselbac
316 ! Fixed bug in setting of variables on burning boundaries
317 !
318 ! Revision 1.1 2002/10/12 19:06:13 haselbac
319 ! Initial revision
320 !
321 ! *****************************************************************************
322 
323 
324 
325 
326 
327 
328 
subroutine, public rflu_setrindstateinjectperf(cpGas, mmGas, nx, ny, nz, mInj, tInj, pl, fs, rl, ul, vl, wl, Hl)
subroutine initialize(G_b, MAN_INIT, inSurf, inInt, INIT_0D, INIT_1D, IN_obt_attr)
Definition: rocburn_2D.f90:83
subroutine registerfunction(global, funName, fileName)
Definition: ModError.F90:449
real(rfreal) function, public rflu_descalegridspeed(pRegion, fs)
subroutine rflu_putboundaryvaluesalpha(region)
subroutine errorstop(global, errorCode, errorLine, addMessage)
Definition: ModError.F90:483
subroutine deregisterfunction(global)
Definition: ModError.F90:469