Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RFLO_RoeFluxPatch.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: compute convective fluxes through a patch
26 ! by using Roe`s upwind scheme.
27 !
28 ! Description: none.
29 !
30 ! Input: region = data of current region
31 ! patch = current patch.
32 !
33 ! Output: region%levels%mixt%rhs = convective fluxes added to the residual.
34 !
35 ! Notes: none.
36 !
37 !******************************************************************************
38 !
39 ! $Id: RFLO_RoeFluxPatch.F90,v 1.6 2008/12/06 08:44:28 mtcampbe Exp $
40 !
41 ! Copyright: (c) 2003 by the University of Illinois
42 !
43 !******************************************************************************
44 
45 SUBROUTINE rflo_roefluxpatch( region,patch )
46 
47  USE moddatatypes
48  USE modbndpatch, ONLY : t_patch
49  USE moddatastruct, ONLY : t_region
52  USE moderror
53  USE modparameters
54  IMPLICIT NONE
55 
56 #include "Indexing.h"
57 
58 ! ... parameters
59  TYPE(t_region) :: region
60  TYPE(t_patch) :: patch
61 
62 ! ... loop variables
63  INTEGER :: i, j, k, n1, n2
64 
65 ! ... local variables
66  INTEGER :: ilev, lbound, bctype, distrib, flowmodel, gasmodel, indcp, indmol
67  INTEGER :: ibeg, iend, jbeg, jend, kbeg, kend, idir, jdir, kdir, i2d, noff
68  INTEGER :: icoff, ijcoff, ijkcd, ijkcd1, ijkcd2, ijkcb0, ijkcb1, ijknb
69  INTEGER :: inoff, ijnoff, inode, jnode, knode, indsvel, spaceorder
70  INTEGER :: aerocoeff, j2d
71 
72  REAL(RFREAL) :: sgn, rhoa, rhoua, rhova, rhowa, rhoea, rhovrel(3), pa, &
73  mrate, tburn, rgas, ds, sv, limfac, limfac3, rvolref, &
74  eps2n, uinj, vinj, winj, vcont, rhl, rhr, qsl, qsr, vola, &
75  gam, ggm1, rl, rr, ul, ur, vl, vr, wl, wr, pl, pr, &
76  hl, hr, qsrl, qsrr, eps2(3), dvar(5), dvarm(5), dvarp(5), &
77  deltl(5), deltr(5), sf(3)
78  REAL(RFREAL) :: pref, rref, vref, rcpref
79  REAL(RFREAL), POINTER :: cv(:,:), dv(:,:), gv(:,:), rhs(:,:), vol(:)
80  REAL(RFREAL), POINTER :: sface(:,:), svel(:), vals(:,:)
81 
82 ! ... functions
83  REAL(RFREAL) :: muscl3, af, bf, eps
84 
85 !******************************************************************************
86 ! limiter function
87 
88  muscl3(af,bf,eps) = (bf*(2._rfreal*af*af+eps)+af*(bf*bf+2._rfreal*eps))/ &
89  (2._rfreal*af*af+2._rfreal*bf*bf-af*bf+ &
90  3._rfreal*eps+1.e-30_rfreal)
91 
92  CALL registerfunction( region%global,'RFLO_RoeFluxPatch',&
93  'RFLO_RoeFluxPatch.F90' )
94 
95 ! get dimensions and pointers -------------------------------------------------
96 
97  ilev = region%currLevel
98  lbound = patch%lbound
99 
100  CALL rflo_getpatchindices( region,patch,ilev,ibeg,iend,jbeg,jend,kbeg,kend )
102  CALL rflo_getcelloffset( region,ilev,icoff,ijcoff )
103  CALL rflo_getnodeoffset( region,ilev,inoff,ijnoff )
104 
105  bctype = patch%bcType
106  noff = abs(patch%l1end-patch%l1beg) + 1
107  distrib = patch%mixt%distrib
108  flowmodel = region%mixtInput%flowModel
109  gasmodel = region%mixtInput%gasModel
110  spaceorder = region%mixtInput%spaceOrder
111  indcp = region%levels(ilev)%mixt%indCp
112  indmol = region%levels(ilev)%mixt%indMol
113  indsvel = region%levels(ilev)%grid%indSvel
114  limfac = region%mixtInput%limFac
115 
116  cv => region%levels(ilev)%mixt%cv
117  dv => region%levels(ilev)%mixt%dv
118  gv => region%levels(ilev)%mixt%gv
119  vol => region%levels(ilev)%grid%vol
120  rhs => region%levels(ilev)%mixt%rhs
121  vals => patch%mixt%vals
122 
123  aerocoeff = region%global%aeroCoeffs
124  pref = region%global%refPressure
125  rref = region%global%refDensity
126  vref = region%global%refVelocity
127 
128  rcpref = 2.0_rfreal/(rref*vref*vref)
129 
130 ! to take the right face vector and make it point outwards
131 
132  sgn = +1._rfreal
133  inode = 0
134  jnode = 0
135  knode = 0
136  IF (lbound==2 .OR. lbound==4 .OR. lbound==6) THEN
137  sgn = -1._rfreal
138  inode = -idir
139  jnode = -jdir
140  knode = -kdir
141  ENDIF
142 
143 ! get the appropriate face vector and grid speed
144 
145  IF (lbound==1 .OR. lbound==2) THEN
146  sface => region%levels(ilev)%grid%si
147  svel => region%levels(ilev)%grid%siVel
148  ELSE IF (lbound==3 .OR. lbound==4) THEN
149  sface => region%levels(ilev)%grid%sj
150  svel => region%levels(ilev)%grid%sjVel
151  ELSE IF (lbound==5 .OR. lbound==6) THEN
152  sface => region%levels(ilev)%grid%sk
153  svel => region%levels(ilev)%grid%skVel
154  ENDIF
155 
156 ! normalise epsilon^2 for all limited variables (rho, u, v, w, p) -------------
157 
158  limfac3 = limfac*limfac*limfac
159  rvolref = 1._rfreal/region%global%limVolRef**1.5_rfreal
160  eps2(1) = limfac3*region%global%limRef(1)*region%global%limRef(1)*rvolref
161  eps2(2) = limfac3*region%global%limRef(2)*region%global%limRef(2)*rvolref
162  eps2(3) = limfac3*region%global%limRef(3)*region%global%limRef(3)*rvolref
163 
164 ! stationary grid -------------------------------------------------------------
165 ! slip wall
166 
167  IF (bctype>=bc_slipwall .AND. bctype<=bc_slipwall+bc_range) THEN
168 
169  DO k=kbeg,kend
170  DO j=jbeg,jend
171  DO i=ibeg,iend
172  ijkcb0 = indijk(i ,j ,k ,icoff,ijcoff) ! boundary
173  ijkcb1 = indijk(i+idir ,j+jdir ,k+kdir ,icoff,ijcoff) ! interior
174  ijknb = indijk(i+inode,j+jnode,k+knode,inoff,ijnoff)
175  pa = 0.5_rfreal*(3._rfreal*dv(dv_mixt_pres,ijkcb0)- &
176  dv(dv_mixt_pres,ijkcb1))
177  sf(1) = sgn*sface(xcoord,ijknb)
178  sf(2) = sgn*sface(ycoord,ijknb)
179  sf(3) = sgn*sface(zcoord,ijknb)
180  sv = sgn*svel(ijknb*indsvel)
181 
182  rhs(cv_mixt_xmom,ijkcb0) = rhs(cv_mixt_xmom,ijkcb0) + pa*sf(1)
183  rhs(cv_mixt_ymom,ijkcb0) = rhs(cv_mixt_ymom,ijkcb0) + pa*sf(2)
184  rhs(cv_mixt_zmom,ijkcb0) = rhs(cv_mixt_zmom,ijkcb0) + pa*sf(3)
185  rhs(cv_mixt_ener,ijkcb0) = rhs(cv_mixt_ener,ijkcb0) + pa*sv
186 
187  IF (lbound==1 .OR. lbound==2) THEN
188  n1 = j - jbeg
189  n2 = k - kbeg
190  ELSE IF (lbound==3 .OR. lbound==4) THEN
191  n1 = k - kbeg
192  n2 = i - ibeg
193  ELSE IF (lbound==5 .OR. lbound==6) THEN
194  n1 = i - ibeg
195  n2 = j - jbeg
196  ENDIF
197  j2d = aerocoeff * indij(n1,n2,noff)
198  patch%cp(j2d) = rcpref*(pa - pref)
199 
200  ENDDO ! i
201  ENDDO ! j
202  ENDDO ! k
203 
204 ! noslip wall
205 
206  ELSE IF (bctype>=bc_noslipwall .AND. bctype<=bc_noslipwall+bc_range) THEN
207 
208  DO k=kbeg,kend
209  DO j=jbeg,jend
210  DO i=ibeg,iend
211  ijkcb0 = indijk(i ,j ,k ,icoff,ijcoff) ! boundary
212  ijknb = indijk(i+inode,j+jnode,k+knode,inoff,ijnoff)
213  pa = dv(dv_mixt_pres,ijkcb0)
214  sf(1) = sgn*sface(xcoord,ijknb)
215  sf(2) = sgn*sface(ycoord,ijknb)
216  sf(3) = sgn*sface(zcoord,ijknb)
217  sv = sgn*svel(ijknb*indsvel)
218 
219  rhs(cv_mixt_xmom,ijkcb0) = rhs(cv_mixt_xmom,ijkcb0) + pa*sf(1)
220  rhs(cv_mixt_ymom,ijkcb0) = rhs(cv_mixt_ymom,ijkcb0) + pa*sf(2)
221  rhs(cv_mixt_zmom,ijkcb0) = rhs(cv_mixt_zmom,ijkcb0) + pa*sf(3)
222  rhs(cv_mixt_ener,ijkcb0) = rhs(cv_mixt_ener,ijkcb0) + pa*sv
223 
224  IF (lbound==1 .OR. lbound==2) THEN
225  n1 = j - jbeg
226  n2 = k - kbeg
227  ELSE IF (lbound==3 .OR. lbound==4) THEN
228  n1 = k - kbeg
229  n2 = i - ibeg
230  ELSE IF (lbound==5 .OR. lbound==6) THEN
231  n1 = i - ibeg
232  n2 = j - jbeg
233  ENDIF
234  j2d = aerocoeff * indij(n1,n2,noff)
235  patch%cp(j2d) = rcpref*(pa - pref)
236 
237  ENDDO ! i
238  ENDDO ! j
239  ENDDO ! k
240 
241 ! symmetry boundary
242 
243  ELSE IF (bctype>=bc_symmetry .AND. bctype<=bc_symmetry+bc_range) THEN
244 
245  DO k=kbeg,kend
246  DO j=jbeg,jend
247  DO i=ibeg,iend
248  ijkcb0 = indijk(i ,j ,k ,icoff,ijcoff) ! boundary
249  ijkcd = indijk(i-idir ,j-jdir ,k-kdir ,icoff,ijcoff) ! dummy
250  ijknb = indijk(i+inode,j+jnode,k+knode,inoff,ijnoff)
251  pa = 0.5_rfreal*(dv(dv_mixt_pres,ijkcb0)+dv(dv_mixt_pres,ijkcd))
252  sf(1) = sgn*sface(xcoord,ijknb)
253  sf(2) = sgn*sface(ycoord,ijknb)
254  sf(3) = sgn*sface(zcoord,ijknb)
255  sv = sgn*svel(ijknb*indsvel)
256 
257  rhs(cv_mixt_xmom,ijkcb0) = rhs(cv_mixt_xmom,ijkcb0) + pa*sf(1)
258  rhs(cv_mixt_ymom,ijkcb0) = rhs(cv_mixt_ymom,ijkcb0) + pa*sf(2)
259  rhs(cv_mixt_zmom,ijkcb0) = rhs(cv_mixt_zmom,ijkcb0) + pa*sf(3)
260  rhs(cv_mixt_ener,ijkcb0) = rhs(cv_mixt_ener,ijkcb0) + pa*sv
261 
262  IF (lbound==1 .OR. lbound==2) THEN
263  n1 = j - jbeg
264  n2 = k - kbeg
265  ELSE IF (lbound==3 .OR. lbound==4) THEN
266  n1 = k - kbeg
267  n2 = i - ibeg
268  ELSE IF (lbound==5 .OR. lbound==6) THEN
269  n1 = i - ibeg
270  n2 = j - jbeg
271  ENDIF
272  j2d = aerocoeff * indij(n1,n2,noff)
273  patch%cp(j2d) = rcpref*(pa - pref)
274 
275  ENDDO ! i
276  ENDDO ! j
277  ENDDO ! k
278 
279 ! injection boundary (as wall if mass flow rate <= 0)
280 
281  ELSE IF (bctype>=bc_injection .AND. bctype<=bc_injection+bc_range) THEN
282 
283  DO k=kbeg,kend
284  DO j=jbeg,jend
285  DO i=ibeg,iend
286  ijkcb0 = indijk(i ,j ,k ,icoff,ijcoff) ! boundary
287  ijkcb1 = indijk(i+idir ,j+jdir ,k+kdir ,icoff,ijcoff) ! interior
288  ijknb = indijk(i+inode,j+jnode,k+knode,inoff,ijnoff)
289  sf(1) = sgn*sface(xcoord,ijknb)
290  sf(2) = sgn*sface(ycoord,ijknb)
291  sf(3) = sgn*sface(zcoord,ijknb)
292  sv = sgn*svel(ijknb*indsvel)
293 
294  IF (lbound==1 .OR. lbound==2) THEN
295  n1 = j - jbeg
296  n2 = k - kbeg
297  ELSE IF (lbound==3 .OR. lbound==4) THEN
298  n1 = k - kbeg
299  n2 = i - ibeg
300  ELSE IF (lbound==5 .OR. lbound==6) THEN
301  n1 = i - ibeg
302  n2 = j - jbeg
303  ENDIF
304  i2d = distrib * indij(n1,n2,noff)
305  mrate = vals(bcdat_inject_mfrate,i2d)
306  tburn = vals(bcdat_inject_temp ,i2d)
307  rhovrel(1) = vals(bcdat_inject_rfvfu ,i2d)
308  rhovrel(2) = vals(bcdat_inject_rfvfv ,i2d)
309  rhovrel(3) = vals(bcdat_inject_rfvfw ,i2d)
310 
311  IF (mrate > 0._rfreal) THEN ! surface burning
312  ds = sqrt(sf(1)*sf(1)+sf(2)*sf(2)+sf(3)*sf(3))
313  IF (gasmodel == gas_model_tcperf) THEN
314  CALL bcondinjectionperf( distrib,mrate,tburn,rhovrel, &
315  sf(1)/ds,sf(2)/ds,sf(3)/ds, &
316  gv(gv_mixt_cp ,ijkcb0*indcp ), &
317  gv(gv_mixt_mol ,ijkcb0*indmol), &
318  dv(dv_mixt_pres,ijkcb0 ), &
319  rhoa,rhoua,rhova,rhowa,rhoea,pa, &
320  uinj,vinj,winj )
321  ELSE
322  CALL errorstop( region%global,err_unknown_bc,__line__ )
323  ENDIF
324  vcont = uinj*sf(1) + vinj*sf(2) + winj*sf(3)
325 
326  ELSE ! not burning - slip/noslip wall
327  rhoa = 0._rfreal
328  rhoua = 0._rfreal
329  rhova = 0._rfreal
330  rhowa = 0._rfreal
331  rhoea = 0._rfreal
332  vcont = 0._rfreal
333  IF (flowmodel == flow_euler) THEN
334  pa = 0.5_rfreal*(3._rfreal*dv(dv_mixt_pres,ijkcb0)- &
335  dv(dv_mixt_pres,ijkcb1))
336  ELSE
337  pa = dv(dv_mixt_pres,ijkcb0)
338  ENDIF
339  ENDIF
340 
341  rhs(cv_mixt_dens,ijkcb0) = rhs(cv_mixt_dens,ijkcb0) + vcont*rhoa
342  rhs(cv_mixt_xmom,ijkcb0) = rhs(cv_mixt_xmom,ijkcb0) + vcont*rhoua + &
343  pa*sf(1)
344  rhs(cv_mixt_ymom,ijkcb0) = rhs(cv_mixt_ymom,ijkcb0) + vcont*rhova + &
345  pa*sf(2)
346  rhs(cv_mixt_zmom,ijkcb0) = rhs(cv_mixt_zmom,ijkcb0) + vcont*rhowa + &
347  pa*sf(3)
348  rhs(cv_mixt_ener,ijkcb0) = rhs(cv_mixt_ener,ijkcb0) + &
349  vcont*(rhoea+pa) + pa*sv
350 
351  j2d = aerocoeff * indij(n1,n2,noff)
352  patch%cp(j2d) = rcpref*(pa - pref)
353 
354  ENDDO ! i
355  ENDDO ! j
356  ENDDO ! k
357 
358 ! non-conforming region interface
359 
360  ELSE IF (bctype>=bc_regionint .AND. bctype<=bc_regionint +bc_range) THEN
361 
362  ELSE IF (bctype>=bc_regnonconf .AND. bctype<=bc_regnonconf+bc_range) THEN
363 
364 ! everything else
365 
366  ELSE
367 
368  IF (spaceorder == discr_order_1) THEN
369  DO k=kbeg,kend
370  DO j=jbeg,jend
371  DO i=ibeg,iend
372  ijkcb0 = indijk(i ,j ,k ,icoff,ijcoff) ! boundary
373  ijkcd = indijk(i-idir ,j-jdir ,k-kdir ,icoff,ijcoff) ! dummy
374  ijknb = indijk(i+inode,j+jnode,k+knode,inoff,ijnoff)
375  sf(1) = sgn*sface(xcoord,ijknb)
376  sf(2) = sgn*sface(ycoord,ijknb)
377  sf(3) = sgn*sface(zcoord,ijknb)
378  sv = sgn*svel(ijknb*indsvel)
379  rhl = dv(dv_mixt_pres,ijkcd) + cv(cv_mixt_ener,ijkcd)
380  qsl = dv(dv_mixt_uvel,ijkcd)*sf(1) + &
381  dv(dv_mixt_vvel,ijkcd)*sf(2) + &
382  dv(dv_mixt_wvel,ijkcd)*sf(3) - sv
383  rhr = dv(dv_mixt_pres,ijkcb0) + cv(cv_mixt_ener,ijkcb0)
384  qsr = dv(dv_mixt_uvel,ijkcb0)*sf(1) + &
385  dv(dv_mixt_vvel,ijkcb0)*sf(2) + &
386  dv(dv_mixt_wvel,ijkcb0)*sf(3) - sv
387  pa = 0.5_rfreal*(dv(dv_mixt_pres,ijkcb0)+dv(dv_mixt_pres,ijkcd))
388  rhs(cv_mixt_dens,ijkcb0) = rhs(cv_mixt_dens,ijkcb0) + &
389  0.5_rfreal*(qsl*cv(cv_mixt_dens,ijkcd)+ &
390  qsr*cv(cv_mixt_dens,ijkcb0))
391  rhs(cv_mixt_xmom,ijkcb0) = rhs(cv_mixt_xmom,ijkcb0) + pa*sf(1) + &
392  0.5_rfreal*(qsl*cv(cv_mixt_xmom,ijkcd)+ &
393  qsr*cv(cv_mixt_xmom,ijkcb0))
394  rhs(cv_mixt_ymom,ijkcb0) = rhs(cv_mixt_ymom,ijkcb0) + pa*sf(2) + &
395  0.5_rfreal*(qsl*cv(cv_mixt_ymom,ijkcd)+ &
396  qsr*cv(cv_mixt_ymom,ijkcb0))
397  rhs(cv_mixt_zmom,ijkcb0) = rhs(cv_mixt_zmom,ijkcb0) + pa*sf(3) + &
398  0.5_rfreal*(qsl*cv(cv_mixt_zmom,ijkcd)+ &
399  qsr*cv(cv_mixt_zmom,ijkcb0))
400  rhs(cv_mixt_ener,ijkcb0) = rhs(cv_mixt_ener,ijkcb0) + &
401  0.5_rfreal*(qsl*rhl+qsr*rhr) + sv*pa
402 
403  IF (lbound==1 .OR. lbound==2) THEN
404  n1 = j - jbeg
405  n2 = k - kbeg
406  ELSE IF (lbound==3 .OR. lbound==4) THEN
407  n1 = k - kbeg
408  n2 = i - ibeg
409  ELSE IF (lbound==5 .OR. lbound==6) THEN
410  n1 = i - ibeg
411  n2 = j - jbeg
412  ENDIF
413  j2d = aerocoeff * indij(n1,n2,noff)
414  patch%cp(j2d) = rcpref*(pa - pref)
415 
416  ENDDO ! i
417  ENDDO ! j
418  ENDDO ! k
419  ELSE IF (spaceorder == discr_order_2) THEN
420  DO k=kbeg,kend
421  DO j=jbeg,jend
422  DO i=ibeg,iend
423  ijkcb0 = indijk(i ,j ,k ,icoff,ijcoff) ! boundary
424  ijkcb1 = indijk(i+ idir,j+ jdir,k+ kdir,icoff,ijcoff) ! interior
425  ijkcd1 = indijk(i- idir,j- jdir,k- kdir,icoff,ijcoff) ! dummy 1
426  ijkcd2 = indijk(i-2*idir,j-2*jdir,k-2*kdir,icoff,ijcoff) ! dummy 2
427  ijknb = indijk(i+inode,j+jnode,k+knode,inoff,ijnoff)
428  sf(1) = sgn*sface(xcoord,ijknb)
429  sf(2) = sgn*sface(ycoord,ijknb)
430  sf(3) = sgn*sface(zcoord,ijknb)
431  sv = sgn*svel(ijknb*indsvel)
432  vola = (0.5_rfreal*(vol(ijkcb0)+vol(ijkcd1)))**1.5_rfreal
433 
434  dvar(1) = cv(cv_mixt_dens,ijkcb0) - cv(cv_mixt_dens,ijkcd1)
435  dvar(2) = dv(dv_mixt_uvel,ijkcb0) - dv(dv_mixt_uvel,ijkcd1)
436  dvar(3) = dv(dv_mixt_vvel,ijkcb0) - dv(dv_mixt_vvel,ijkcd1)
437  dvar(4) = dv(dv_mixt_wvel,ijkcb0) - dv(dv_mixt_wvel,ijkcd1)
438  dvar(5) = dv(dv_mixt_pres,ijkcb0) - dv(dv_mixt_pres,ijkcd1)
439 
440  dvarm(1) = cv(cv_mixt_dens,ijkcd1) - cv(cv_mixt_dens,ijkcd2)
441  dvarm(2) = dv(dv_mixt_uvel,ijkcd1) - dv(dv_mixt_uvel,ijkcd2)
442  dvarm(3) = dv(dv_mixt_vvel,ijkcd1) - dv(dv_mixt_vvel,ijkcd2)
443  dvarm(4) = dv(dv_mixt_wvel,ijkcd1) - dv(dv_mixt_wvel,ijkcd2)
444  dvarm(5) = dv(dv_mixt_pres,ijkcd1) - dv(dv_mixt_pres,ijkcd2)
445 
446  dvarp(1) = cv(cv_mixt_dens,ijkcb1) - cv(cv_mixt_dens,ijkcb0)
447  dvarp(2) = dv(dv_mixt_uvel,ijkcb1) - dv(dv_mixt_uvel,ijkcb0)
448  dvarp(3) = dv(dv_mixt_vvel,ijkcb1) - dv(dv_mixt_vvel,ijkcb0)
449  dvarp(4) = dv(dv_mixt_wvel,ijkcb1) - dv(dv_mixt_wvel,ijkcb0)
450  dvarp(5) = dv(dv_mixt_pres,ijkcb1) - dv(dv_mixt_pres,ijkcb0)
451 
452  eps2n = eps2(1)*vola
453  deltl(1) = 0.5_rfreal*muscl3(dvar(1) ,dvarm(1),eps2n)
454  deltr(1) = 0.5_rfreal*muscl3(dvarp(1),dvar(1) ,eps2n)
455  eps2n = eps2(2)*vola
456  deltl(2) = 0.5_rfreal*muscl3(dvar(2) ,dvarm(2),eps2n)
457  deltr(2) = 0.5_rfreal*muscl3(dvarp(2),dvar(2) ,eps2n)
458  deltl(3) = 0.5_rfreal*muscl3(dvar(3) ,dvarm(3),eps2n)
459  deltr(3) = 0.5_rfreal*muscl3(dvarp(3),dvar(3) ,eps2n)
460  deltl(4) = 0.5_rfreal*muscl3(dvar(4) ,dvarm(4),eps2n)
461  deltr(4) = 0.5_rfreal*muscl3(dvarp(4),dvar(4) ,eps2n)
462  eps2n = eps2(3)*vola
463  deltl(5) = 0.5_rfreal*muscl3(dvar(5) ,dvarm(5),eps2n)
464  deltr(5) = 0.5_rfreal*muscl3(dvarp(5),dvar(5) ,eps2n)
465 
466  rgas = 8314.3_rfreal/gv(gv_mixt_mol,ijkcd1*indmol)
467  gam = gv(gv_mixt_cp,ijkcd1*indcp)/(gv(gv_mixt_cp,ijkcd1*indcp)-rgas)
468  ggm1 = gam/(gam-1._rfreal)
469  rl = cv(cv_mixt_dens,ijkcd1) + deltl(1)
470  ul = dv(dv_mixt_uvel,ijkcd1) + deltl(2)
471  vl = dv(dv_mixt_vvel,ijkcd1) + deltl(3)
472  wl = dv(dv_mixt_wvel,ijkcd1) + deltl(4)
473  pl = dv(dv_mixt_pres,ijkcd1) + deltl(5)
474  hl = ggm1*pl/rl + 0.5_rfreal*(ul*ul+vl*vl+wl*wl)
475  qsrl = (ul*sf(1)+vl*sf(2)+ wl*sf(3)-sv)*rl
476 
477  rgas = 8314.3_rfreal/gv(gv_mixt_mol,ijkcb0*indmol)
478  gam = gv(gv_mixt_cp,ijkcb0*indcp)/(gv(gv_mixt_cp,ijkcb0*indcp)-rgas)
479  ggm1 = gam/(gam-1._rfreal)
480  rr = cv(cv_mixt_dens,ijkcb0) - deltr(1)
481  ur = dv(dv_mixt_uvel,ijkcb0) - deltr(2)
482  vr = dv(dv_mixt_vvel,ijkcb0) - deltr(3)
483  wr = dv(dv_mixt_wvel,ijkcb0) - deltr(4)
484  pr = dv(dv_mixt_pres,ijkcb0) - deltr(5)
485  hr = ggm1*pr/rr + 0.5_rfreal*(ur*ur+vr*vr+wr*wr)
486  qsrr = (ur*sf(1)+vr*sf(2)+wr*sf(3)-sv)*rr
487  pa = 0.5_rfreal*(pl+pr)
488 
489  rhs(cv_mixt_dens,ijkcb0) = rhs(cv_mixt_dens,ijkcb0) + &
490  0.5_rfreal*(qsrl +qsrr )
491  rhs(cv_mixt_xmom,ijkcb0) = rhs(cv_mixt_xmom,ijkcb0) + pa*sf(1) + &
492  0.5_rfreal*(qsrl*ul+qsrr*ur)
493  rhs(cv_mixt_ymom,ijkcb0) = rhs(cv_mixt_ymom,ijkcb0) + pa*sf(2) + &
494  0.5_rfreal*(qsrl*vl+qsrr*vr)
495  rhs(cv_mixt_zmom,ijkcb0) = rhs(cv_mixt_zmom,ijkcb0) + pa*sf(3) + &
496  0.5_rfreal*(qsrl*wl+qsrr*wr)
497  rhs(cv_mixt_ener,ijkcb0) = rhs(cv_mixt_ener,ijkcb0) + &
498  0.5_rfreal*(qsrl*hl+qsrr*hr) + sv*pa
499 
500  IF (lbound==1 .OR. lbound==2) THEN
501  n1 = j - jbeg
502  n2 = k - kbeg
503  ELSE IF (lbound==3 .OR. lbound==4) THEN
504  n1 = k - kbeg
505  n2 = i - ibeg
506  ELSE IF (lbound==5 .OR. lbound==6) THEN
507  n1 = i - ibeg
508  n2 = j - jbeg
509  ENDIF
510  j2d = aerocoeff * indij(n1,n2,noff)
511  patch%cp(j2d) = rcpref*(pa - pref)
512 
513  ENDDO ! i
514  ENDDO ! j
515  ENDDO ! k
516  ENDIF ! spaceOrder
517 
518  ENDIF ! bcType
519 
520 ! finalize --------------------------------------------------------------------
521 
522  CALL deregisterfunction( region%global )
523 
524 END SUBROUTINE rflo_roefluxpatch
525 
526 !******************************************************************************
527 !
528 ! RCS Revision history:
529 !
530 ! $Log: RFLO_RoeFluxPatch.F90,v $
531 ! Revision 1.6 2008/12/06 08:44:28 mtcampbe
532 ! Updated license.
533 !
534 ! Revision 1.5 2008/11/19 22:17:38 mtcampbe
535 ! Added Illinois Open Source License/Copyright
536 !
537 ! Revision 1.4 2006/08/19 15:39:42 mparmar
538 ! Renamed patch variables
539 !
540 ! Revision 1.3 2006/03/13 03:41:49 wasistho
541 ! defined aero coeffs
542 !
543 ! Revision 1.2 2005/10/31 21:09:36 haselbac
544 ! Changed specModel and SPEC_MODEL_NONE
545 !
546 ! Revision 1.1 2004/11/29 20:51:40 wasistho
547 ! lower to upper case
548 !
549 ! Revision 1.6 2003/11/20 16:40:40 mdbrandy
550 ! Backing out RocfluidMP changes from 11-17-03
551 !
552 ! Revision 1.2 2003/10/01 23:52:10 jblazek
553 ! Corrected bug in moving noslip wall BC and grid speeds.
554 !
555 ! Revision 1.1 2003/05/29 17:28:43 jblazek
556 ! Implemented Roe scheme.
557 !
558 !******************************************************************************
559 
560 
561 
562 
563 
564 
565 
**********************************************************************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 ibeg
subroutine rflo_getpatchdirection(patch, idir, jdir, kdir)
subroutine bcondinjectionperf(distrib, minj, tinj, rhoVrel, sxn, syn, szn, cpgas, mm, p, rhob, rhoub, rhovb, rhowb, rhoeb, pb, uinj, vinj, winj)
**********************************************************************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 inode
j indices k indices k
Definition: Indexing.h:6
NT rhs
subroutine registerfunction(global, funName, fileName)
Definition: ModError.F90:449
subroutine rflo_getpatchindices(region, patch, iLev, ibeg, iend, jbeg, jend, kbeg, kend)
double sqrt(double d)
Definition: double.h:73
subroutine rflo_getnodeoffset(region, iLev, iNodeOffset, ijNodeOffset)
**********************************************************************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 jdir
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 SUBROUTINE knode iend
blockLoc i
Definition: read.cpp:79
**********************************************************************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 idir
subroutine rflo_getcelloffset(region, iLev, iCellOffset, ijCellOffset)
j indices j
Definition: Indexing.h:6
**********************************************************************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 knode jend
**********************************************************************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 kdir
subroutine errorstop(global, errorCode, errorLine, addMessage)
Definition: ModError.F90:483
**********************************************************************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 knode jbeg
subroutine rflo_roefluxpatch(region, patch)
**********************************************************************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 knode kbeg
subroutine deregisterfunction(global)
Definition: ModError.F90:469
**********************************************************************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 jnode