85 TYPE(t_patch),
POINTER :: ppatch
86 TYPE(t_region
),
POINTER :: pregion
92 LOGICAL :: corrflag,decideprintflag
93 CHARACTER(CHRLEN) :: rcsidentstring
94 INTEGER,
PARAMETER :: max_inoutflow_locs = 10
95 INTEGER :: c1,bcoptfixed,bcopttype,distrib,ifl,indcp,indgs,indmf,indsd, &
97 INTEGER :: loc(max_inoutflow_locs,min_val:max_val)
98 REAL(RFREAL) :: bp,bt,cml,cp,cvg,cvl,cvv,fs,fsu,icpref,mm,nm,nx,ny,nz, &
99 pl,po,pr,pref,press,ql,qr,rg,rhogr,rholr,rhovr,rgpgl, &
100 rgpgr,rel,rer,rl,rlpll,ro,rul,rv,rvpvl,rvpvr,rur,rvl, &
101 rvr,rwl,rwr,rr,rref,temp,to,ul,ur,vfgr,vflr,vfvr,vl,vr, &
102 vref,wl,wr,xc,yc,zc,ygr,ylr,yvr
103 REAL(RFREAL) :: flx(5)
104 REAL(RFREAL),
DIMENSION(:),
POINTER :: mfmixt
105 REAL(RFREAL),
DIMENSION(:,:),
POINTER :: cv,dv,gv,pcvspec,
rhs,vals,sd
112 rcsidentstring =
'$RCSfile: RFLU_CentralFirstPatch_GL.F90,v $'
114 global => pregion%global
117 'RFLU_CentralFirstPatch_GL.F90')
123 indcp = pregion%mixtInput%indCp
124 indmf = pregion%mixtInput%indMfMixt
125 indsd = pregion%mixtInput%indSd
126 indmol = pregion%mixtInput%indMol
128 indgs = pregion%grid%indGs
130 distrib = ppatch%mixt%distrib
132 cv => pregion%mixt%cv
133 dv => pregion%mixt%dv
134 gv => pregion%mixt%gv
135 rhs => pregion%mixt%rhs
136 sd => pregion%mixt%sd
138 pcvspec => pregion%spec%cv
140 mfmixt => ppatch%mfMixt
146 pref = global%refPressure
147 rref = global%refDensity
148 vref = global%refVelocity
150 icpref = 2.0_rfreal/(rref*vref*vref)
156 ro = global%refDensityLiq
157 po = global%refPressLiq
158 to = global%refTempLiq
159 bp = global%refBetaPLiq
160 bt = global%refBetaTLiq
161 cvl = global%refCvLiq
163 rg =
mixtperf_r_m(pregion%specInput%specType(1)%pMaterial%molw)
166 rv =
mixtperf_r_m(pregion%specInput%specType(2)%pMaterial%molw)
173 SELECT CASE ( ppatch%bcType )
179 CASE ( bc_inflow_veltemp )
180 vals => ppatch%mixt%vals
181 bcopttype = ppatch%mixt%switches(bcswi_inflow_type)
183 DO ifl = 1,ppatch%nBFaces
184 c1 = ppatch%bf2c(ifl)
186 nx = ppatch%fn(xcoord,ifl)
187 ny = ppatch%fn(ycoord,ifl)
188 nz = ppatch%fn(zcoord,ifl)
189 nm = ppatch%fn(xyzmag,ifl)
191 fs = ppatch%gs(indgs*ifl)
193 rl = cv(cv_mixt_dens,c1)
194 rul = cv(cv_mixt_xmom,c1)
195 rvl = cv(cv_mixt_ymom,c1)
196 rwl = cv(cv_mixt_zmom,c1)
197 rel = cv(cv_mixt_ener,c1)
198 pl = dv(dv_mixt_pres,c1)
199 cml = dv(dv_mixt_soun,c1)
201 rgpgl = pcvspec(1,c1)
202 rvpvl = pcvspec(2,c1)
203 rlpll = rl - rgpgl - rvpvl
205 ur = vals(bcdat_inflow_u,distrib*ifl)
206 vr = vals(bcdat_inflow_v,distrib*ifl)
207 wr = vals(bcdat_inflow_w,distrib*ifl)
208 temp = vals(bcdat_inflow_t,distrib*ifl)
210 ygr = ppatch%spec%vals(1,distrib*ifl)
211 yvr = ppatch%spec%vals(2,distrib*ifl)
212 ylr = 1.0_rfreal - ygr - yvr
214 IF ( bcopttype /= bcopt_subsonic )
THEN
215 press = vals(bcdat_inflow_p, distrib*ifl)
219 rr = 1.0_rfreal/(ygr/rhogr + yvr/rhovr + ylr/rholr)
220 vfgr = (rr*ygr)/rhogr
221 vfvr = (rr*yvr)/rhovr
222 vflr = (rr*ylr)/rholr
224 press = pl+(
sqrt(ur*ur+vr*vr+wr*wr) &
225 -
sqrt(ul*ul+vl*vl+wl*wl))*rl*cml
229 rr = 1.0_rfreal/(ygr/rhogr + yvr/rhovr + ylr/rholr)
230 vfgr = (rr*ygr)/rhogr
231 vfvr = (rr*yvr)/rhovr
232 vflr = (rr*ylr)/rholr
236 rg,rv,ur,vr,wr,vfgr,vfvr,vflr,temp, &
237 press,nx,ny,nz,rl,rul,rvl,rwl,rel, &
238 rgpgl,rvpvl,pl,rr,rur,rvr,rwr,rer, &
241 ql = (rul*nx + rvl*ny + rwl*nz)/rl - fs
242 qr = (rur*nx + rvr*ny + rwr*nz)/rr - fs
244 flx(1) = 0.5_rfreal*(ql* rl + qr* rr )*nm
245 flx(2) = 0.5_rfreal*(ql* rul + pl*nx + qr* rur + pr*nx)*nm
246 flx(3) = 0.5_rfreal*(ql* rvl + pl*ny + qr* rvr + pr*ny)*nm
247 flx(4) = 0.5_rfreal*(ql* rwl + pl*nz + qr* rwr + pr*nz)*nm
248 flx(5) = 0.5_rfreal*(ql*(rel + pl) + pl*fs + qr*(rer + pr) + pr*fs)*nm
250 mfmixt(indmf*ifl) = flx(1)
251 ppatch%cp(ifl) = icpref*(0.5_rfreal*(pl + pr) - pref)
253 rhs(cv_mixt_dens,c1) =
rhs(cv_mixt_dens,c1) + flx(1)
254 rhs(cv_mixt_xmom,c1) =
rhs(cv_mixt_xmom,c1) + flx(2)
255 rhs(cv_mixt_ymom,c1) =
rhs(cv_mixt_ymom,c1) + flx(3)
256 rhs(cv_mixt_zmom,c1) =
rhs(cv_mixt_zmom,c1) + flx(4)
257 rhs(cv_mixt_ener,c1) =
rhs(cv_mixt_ener,c1) + flx(5)
259 sd(sd_xmom,c1*indsd) = sd(sd_xmom,c1*indsd) &
260 + 0.5_rfreal*(rul/rl + rur/rr)*flx(1)
261 sd(sd_ymom,c1*indsd) = sd(sd_ymom,c1*indsd) &
262 + 0.5_rfreal*(rvl/rl + rvr/rr)*flx(1)
263 sd(sd_zmom,c1*indsd) = sd(sd_zmom,c1*indsd) &
264 + 0.5_rfreal*(rwl/rl + rwr/rr)*flx(1)
266 IF ( pregion%irkStep == 1 )
THEN
267 global%massIn = global%massIn -
min(flx(1),0.0_rfreal)
268 global%massOut = global%massOut +
max(flx(1),0.0_rfreal)
271 IF ( (global%checkLevel == check_high) .AND. &
272 (global%verbLevel >= verbose_high) .AND. &
273 (global%myProcid == masterproc) .AND. &
274 (decideprintflag .EQV. .true.) )
THEN
275 IF ( flx(1) > 0.0_rfreal )
THEN
278 IF ( nlocs == 1 )
THEN
279 global%warnCounter = global%warnCounter + 1
281 WRITE(stdout,
'(A,1X,A,1X,I9)') solver_name, &
282 '*** WARNING *** Outflow detected at inflow boundary!'
283 WRITE(stdout,
'(A,3X,A,1X,I5.5)') solver_name,
'Global region:', &
284 pregion%iRegionGlobal
285 IF ( global%flowType == flow_unsteady )
THEN
286 WRITE(stdout,
'(A,3X,A,1X,1PE11.5)') solver_name, &
290 WRITE(stdout,
'(A,3X,A,1X,I6.6)') solver_name, &
291 'Current iteration number:', &
295 WRITE(stdout,
'(A,3X,A,1X,I1)') solver_name, &
296 'Runge-Kutta stage:', &
300 IF ( nlocs <= max_inoutflow_locs )
THEN
301 loc(nlocs,min_val:max_val) = c1
312 bcopttype = ppatch%mixt%switches(bcswi_outflow_type)
314 IF ( bcopttype /= bcopt_supersonic )
THEN
315 vals => ppatch%mixt%vals
318 DO ifl = 1,ppatch%nBFaces
319 c1 = ppatch%bf2c(ifl)
321 nx = ppatch%fn(xcoord,ifl)
322 ny = ppatch%fn(ycoord,ifl)
323 nz = ppatch%fn(zcoord,ifl)
324 nm = ppatch%fn(xyzmag,ifl)
326 fs = ppatch%gs(indgs*ifl)
328 rl = cv(cv_mixt_dens,c1)
329 rul = cv(cv_mixt_xmom,c1)
330 rvl = cv(cv_mixt_ymom,c1)
331 rwl = cv(cv_mixt_zmom,c1)
332 rel = cv(cv_mixt_ener,c1)
333 pl = dv(dv_mixt_pres,c1)
335 rgpgl = pcvspec(1,c1)
336 rvpvl = pcvspec(2,c1)
337 rlpll = rl - rgpgl - rvpvl
339 IF ( bcopttype /= bcopt_supersonic )
THEN
340 pr = vals(bcdat_outflow_press,distrib*ifl)
346 cvv,cvg,rg,rv,pr,nx,ny,nz,rl, &
347 rul,rvl,rwl,rel,rgpgl,rvpvl,pl, &
348 rr,rur,rvr,rwr,rer,rgpgr,rvpvr)
350 ql = (rul*nx + rvl*ny + rwl*nz)/rl - fs
351 qr = (rur*nx + rvr*ny + rwr*nz)/rr - fs
353 flx(1) = 0.5_rfreal*(ql* rl + qr* rr )*nm
354 flx(2) = 0.5_rfreal*(ql* rul + pl*nx + qr* rur + pr*nx)*nm
355 flx(3) = 0.5_rfreal*(ql* rvl + pl*ny + qr* rvr + pr*ny)*nm
356 flx(4) = 0.5_rfreal*(ql* rwl + pl*nz + qr* rwr + pr*nz)*nm
357 flx(5) = 0.5_rfreal*(ql*(rel + pl) + pl*fs + qr*(rer + pr) + pr*fs)*nm
359 mfmixt(indmf*ifl) = flx(1)
360 ppatch%cp(ifl) = icpref*(0.5_rfreal*(pl + pr) - pref)
362 rhs(cv_mixt_dens,c1) =
rhs(cv_mixt_dens,c1) + flx(1)
363 rhs(cv_mixt_xmom,c1) =
rhs(cv_mixt_xmom,c1) + flx(2)
364 rhs(cv_mixt_ymom,c1) =
rhs(cv_mixt_ymom,c1) + flx(3)
365 rhs(cv_mixt_zmom,c1) =
rhs(cv_mixt_zmom,c1) + flx(4)
366 rhs(cv_mixt_ener,c1) =
rhs(cv_mixt_ener,c1) + flx(5)
368 sd(sd_xmom,c1*indsd) = sd(sd_xmom,c1*indsd) &
369 + 0.5_rfreal*(rul/rl + rur/rr)*flx(1)
370 sd(sd_ymom,c1*indsd) = sd(sd_ymom,c1*indsd) &
371 + 0.5_rfreal*(rvl/rl + rvr/rr)*flx(1)
372 sd(sd_zmom,c1*indsd) = sd(sd_zmom,c1*indsd) &
373 + 0.5_rfreal*(rwl/rl + rwr/rr)*flx(1)
375 IF ( pregion%irkStep == 1 )
THEN
376 global%massIn = global%massIn -
min(flx(1),0.0_rfreal)
377 global%massOut = global%massOut +
max(flx(1),0.0_rfreal)
380 IF ( (global%checkLevel == check_high) .AND. &
381 (global%verbLevel >= verbose_high) .AND. &
382 (global%myProcid == masterproc) .AND. &
383 (decideprintflag .EQV. .true.) )
THEN
384 IF ( flx(1) < 0.0_rfreal )
THEN
387 IF ( nlocs == 1 )
THEN
388 global%warnCounter = global%warnCounter + 1
390 WRITE(stdout,
'(A,1X,A,1X,I9)') solver_name, &
391 '*** WARNING *** Inflow detected at outflow boundary!'
392 WRITE(stdout,
'(A,3X,A,1X,I5.5)') solver_name,
'Global region:', &
393 pregion%iRegionGlobal
394 IF ( global%flowType == flow_unsteady )
THEN
395 WRITE(stdout,
'(A,3X,A,1X,1PE11.5)') solver_name, &
399 WRITE(stdout,
'(A,3X,A,1X,I6.6)') solver_name, &
400 'Current iteration number:', &
404 WRITE(stdout,
'(A,3X,A,1X,I1)') solver_name, &
405 'Runge-Kutta stage:', &
409 IF ( nlocs <= max_inoutflow_locs )
THEN
410 loc(nlocs,min_val:max_val) = c1
420 IF ( (global%checkLevel == check_high) .AND. &
421 (global%verbLevel >= verbose_high) .AND. &
422 (global%myProcid == masterproc) .AND. &
423 (decideprintflag .EQV. .true.) .AND. &
425 IF ( nlocs > max_inoutflow_locs )
THEN
426 WRITE(stdout,
'(A,3X,A,1X,I3,1X,A,1X,I9,1X,A)') solver_name, &
427 'Only wrote the first',max_inoutflow_locs,
'of',nlocs, &
428 'outflow faces with inflow.'
430 locinfo_mode_silent,output_mode_anybody)
433 locinfo_mode_silent,output_mode_anybody)
442 DO ifl = 1,ppatch%nBFaces
443 c1 = ppatch%bf2c(ifl)
445 nx = ppatch%fn(xcoord,ifl)
446 ny = ppatch%fn(ycoord,ifl)
447 nz = ppatch%fn(zcoord,ifl)
448 nm = ppatch%fn(xyzmag,ifl)
450 fs = ppatch%gs(indgs*ifl)
453 rl = cv(cv_mixt_dens,c1)
454 rul = cv(cv_mixt_xmom,c1)
455 rvl = cv(cv_mixt_ymom,c1)
456 rwl = cv(cv_mixt_zmom,c1)
457 pl = dv(dv_mixt_pres,c1)
459 cp = gv(gv_mixt_cp ,indcp *c1)
460 mm = gv(gv_mixt_mol,indmol*c1)
470 mfmixt(indmf*ifl) = 0.0_rfreal
471 ppatch%cp(ifl) = icpref*(pl - pref)
473 rhs(cv_mixt_xmom,c1) =
rhs(cv_mixt_xmom,c1) + flx(2)
474 rhs(cv_mixt_ymom,c1) =
rhs(cv_mixt_ymom,c1) + flx(3)
475 rhs(cv_mixt_zmom,c1) =
rhs(cv_mixt_zmom,c1) + flx(4)
476 rhs(cv_mixt_ener,c1) =
rhs(cv_mixt_ener,c1) + flx(5)
483 CASE ( bc_noslipwall )
484 DO ifl = 1,ppatch%nBFaces
485 c1 = ppatch%bf2c(ifl)
487 nx = ppatch%fn(xcoord,ifl)
488 ny = ppatch%fn(ycoord,ifl)
489 nz = ppatch%fn(zcoord,ifl)
490 nm = ppatch%fn(xyzmag,ifl)
492 fs = ppatch%gs(indgs*ifl)
494 pl = dv(dv_mixt_pres,c1)
501 mfmixt(indmf*ifl) = 0.0_rfreal
502 ppatch%cp(ifl) = icpref*(pl - pref)
504 rhs(cv_mixt_xmom,c1) =
rhs(cv_mixt_xmom,c1) + flx(2)
505 rhs(cv_mixt_ymom,c1) =
rhs(cv_mixt_ymom,c1) + flx(3)
506 rhs(cv_mixt_zmom,c1) =
rhs(cv_mixt_zmom,c1) + flx(4)
507 rhs(cv_mixt_ener,c1) =
rhs(cv_mixt_ener,c1) + flx(5)
514 CASE ( bc_periodic, &
523 CALL
errorstop(global,err_reached_default,__line__)
subroutine, public rflu_setrindstateinjectperf(cpGas, mmGas, nx, ny, nz, mInj, tInj, pl, fs, rl, ul, vl, wl, Hl)
real(rfreal) function mixtperf_p_deogvm2(D, Eo, G, Vm2)
real(rfreal) function mixtperf_r_m(M)
subroutine, public rflu_setrindstateslipwallperf(cpGas, mmGas, nx, ny, nz, rl, rul, rvl, rwl, fs, pl)
Vector_n max(const Array_n_const &v1, const Array_n_const &v2)
subroutine registerfunction(global, funName, fileName)
real(rfreal) function mixtperf_d_prt(P, R, T)
real(rfreal) function mixtperf_r_cpg(Cp, G)
real(rfreal) function, public rflu_descalegridspeed(pRegion, fs)
subroutine rflu_centralfirstpatch_gl(pRegion, pPatch)
subroutine, public rflu_setrindstatefarfieldperf(global, cpGas, mmGas, nx, ny, nz, machInf, pInf, tInf, alphaInf, betaInf, corrFlag, liftCoef, xc, yc, zc, rl, rul, rvl, rwl, rel, rr, rur, rvr, rwr, rer, pr)
Vector_n min(const Array_n_const &v1, const Array_n_const &v2)
real(rfreal) function mixtliq_d_dobpppobttto(Dz, Bp, Bt, P, Po, T, To)
subroutine rflu_printlocinfo(pRegion, locUnsorted, nLocUnsorted, locInfoMode, outputMode)
subroutine bcondinflowperf_gl(bcOptType, ro, po, to, Bp, Bt, cvl, cvv, cvg, Rg, Rv, ur, vr, wr, vfgr, vfvr, vflr, temp, press, nx, ny, nz, rl, rul, rvl, rwl, rel, rgpgl, rvpvl, pl, rr, rur, rvr, rwr, rer, rgpgr, rvpvr, pr)
LOGICAL function rflu_decideprint(global)
real(rfreal) function mixtperf_eo_dgpuvw(D, G, P, U, V, W)
subroutine errorstop(global, errorCode, errorLine, addMessage)
subroutine bcondoutflowperf_gl(bcOpt, ro, Po, To, betaP, betaT, cvl, cvv, cvg, Rg, Rv, pout, sxn, syn, szn, rho, rhou, rhov, rhow, rhoe, rhogpg, rhovpv, pin, rhob, rhoub, rhovb, rhowb, rhoeb, rhogpgb, rhovpvb)
subroutine deregisterfunction(global)
real(rfreal) function mixtperf_g_cpr(Cp, R)
real(rfreal) function mixtperf_cv_cpr(Cp, R)
real(rfreal) function mixtperf_p_drt(D, R, T)