83 TYPE(t_patch),
POINTER :: ppatch
84 TYPE(t_region
),
POINTER :: pregion
90 LOGICAL :: corrflag,decideprintflag
91 CHARACTER(CHRLEN) :: rcsidentstring
92 INTEGER,
PARAMETER :: max_inoutflow_locs = 10
93 INTEGER :: c1,bcoptfixed,bcopttype,distrib,gasmodel,ifl,indcp,indgs,indmf, &
95 INTEGER :: loc(max_inoutflow_locs,min_val:max_val)
96 REAL(RFREAL) :: aoa,aos,betah,betav,corr,cp,er,fs,fsu,
g,hl,icmassref,icpref, &
97 irl,irr,liftcoef,mach,mf,minj,mm,nm,nx,ny,nz,pa,pl,pf,pr, &
98 pref,ptot,ql,qr,rgas,rhoa,rhoea,rhoua,rhova,rhowa,rl,rel, &
99 rer,rul,rur,rvl,rvr,rwl,rwr,rr,rref,
term,tf,tinj,tr,ttot, &
100 uinj,ul,ur,vcont,vinj,vl,vm2,vr,vref,winj,wl,wr,xc,yc,zc
101 REAL(RFREAL) :: flx(5)
102 REAL(RFREAL),
DIMENSION(:),
POINTER :: mfmixt
103 REAL(RFREAL),
DIMENSION(:,:),
POINTER :: cv,dv,gv,
rhs,vals,sd
110 rcsidentstring =
'$RCSfile: RFLU_CentralFirstPatch.F90,v $ $Revision: 1.33 $'
112 global => pregion%global
115 'RFLU_CentralFirstPatch.F90')
121 indcp = pregion%mixtInput%indCp
122 indmf = pregion%mixtInput%indMfMixt
123 indsd = pregion%mixtInput%indSd
124 indmol = pregion%mixtInput%indMol
125 gasmodel = pregion%mixtInput%gasModel
127 indgs = pregion%grid%indGs
129 distrib = ppatch%mixt%distrib
131 cv => pregion%mixt%cv
132 dv => pregion%mixt%dv
133 gv => pregion%mixt%gv
134 rhs => pregion%mixt%rhs
135 sd => pregion%mixt%sd
137 mfmixt => ppatch%mfMixt
143 pref = global%refPressure
144 rref = global%refDensity
145 vref = global%refVelocity
147 icpref = 2.0_rfreal/(rref*vref*vref)
148 icmassref = 1.0_rfreal/(rref*vref)
154 SELECT CASE ( ppatch%bcType )
160 CASE ( bc_inflow_totang )
161 vals => ppatch%mixt%vals
162 bcopttype = ppatch%mixt%switches(bcswi_inflow_type)
163 bcoptfixed = ppatch%mixt%switches(bcswi_inflow_fixed)
165 DO ifl = 1,ppatch%nBFaces
166 c1 = ppatch%bf2c(ifl)
168 nx = ppatch%fn(xcoord,ifl)
169 ny = ppatch%fn(ycoord,ifl)
170 nz = ppatch%fn(zcoord,ifl)
171 nm = ppatch%fn(xyzmag,ifl)
173 fs = ppatch%gs(indgs*ifl)
175 rl = cv(cv_mixt_dens,c1)
176 rul = cv(cv_mixt_xmom,c1)
177 rvl = cv(cv_mixt_ymom,c1)
178 rwl = cv(cv_mixt_zmom,c1)
179 rel = cv(cv_mixt_ener,c1)
180 pl = dv(dv_mixt_pres,c1)
182 ptot = vals(bcdat_inflow_ptot, distrib*ifl)
183 ttot = vals(bcdat_inflow_ttot, distrib*ifl)
184 betah = vals(bcdat_inflow_betah,distrib*ifl)
185 betav = vals(bcdat_inflow_betav,distrib*ifl)
187 IF ( bcopttype /= bcopt_subsonic )
THEN
188 mach = vals(bcdat_inflow_mach,distrib*ifl)
193 IF ( gasmodel == gas_model_tcperf )
THEN
194 cp = gv(gv_mixt_cp ,indcp *c1)
195 mm = gv(gv_mixt_mol,indmol*c1)
198 mach,nx,ny,nz,cp,mm,rl,rul,rvl,rwl,rr,rur, &
201 CALL
errorstop(global,err_reached_default,__line__)
204 ql = (rul*nx + rvl*ny + rwl*nz)/rl - fs
205 qr = (rur*nx + rvr*ny + rwr*nz)/rr - fs
214 flx(1) = 0.5_rfreal*(ql* rl + qr* rr )*nm
215 flx(2) = 0.5_rfreal*(ql* rul + pl*nx + qr* rur + pr*nx)*nm
216 flx(3) = 0.5_rfreal*(ql* rvl + pl*ny + qr* rvr + pr*ny)*nm
217 flx(4) = 0.5_rfreal*(ql* rwl + pl*nz + qr* rwr + pr*nz)*nm
218 flx(5) = 0.5_rfreal*(ql*(rel + pl) + pl*fs + qr*(rer + pr) + pr*fs)*nm
220 mfmixt(indmf*ifl) = flx(1)
222 ppatch%cp(ifl) = icpref*(0.5_rfreal*(pl + pr) - pref)
223 ppatch%cmass(ifl) = icmassref*flx(1)/nm
224 ppatch%cmom(xcoord,ifl) = icpref*0.5_rfreal*(ul+ur)*flx(1)/nm
225 ppatch%cmom(ycoord,ifl) = icpref*0.5_rfreal*(vl+vr)*flx(1)/nm
226 ppatch%cmom(zcoord,ifl) = icpref*0.5_rfreal*(wl+wr)*flx(1)/nm
228 rhs(cv_mixt_dens,c1) =
rhs(cv_mixt_dens,c1) + flx(1)
229 rhs(cv_mixt_xmom,c1) =
rhs(cv_mixt_xmom,c1) + flx(2)
230 rhs(cv_mixt_ymom,c1) =
rhs(cv_mixt_ymom,c1) + flx(3)
231 rhs(cv_mixt_zmom,c1) =
rhs(cv_mixt_zmom,c1) + flx(4)
232 rhs(cv_mixt_ener,c1) =
rhs(cv_mixt_ener,c1) + flx(5)
234 sd(sd_xmom,c1*indsd) = sd(sd_xmom,c1*indsd) + 0.5_rfreal*(rul/rl + rur/rr)*flx(1)
235 sd(sd_ymom,c1*indsd) = sd(sd_ymom,c1*indsd) + 0.5_rfreal*(rvl/rl + rvr/rr)*flx(1)
236 sd(sd_zmom,c1*indsd) = sd(sd_zmom,c1*indsd) + 0.5_rfreal*(rwl/rl + rwr/rr)*flx(1)
238 IF ( pregion%irkStep == 1 )
THEN
239 global%massIn = global%massIn -
min(flx(1),0.0_rfreal)
240 global%massOut = global%massOut +
max(flx(1),0.0_rfreal)
244 IF ( (global%checkLevel == check_high) .AND. &
245 (global%verbLevel >= verbose_high) .AND. &
246 (global%myProcid == masterproc) .AND. &
247 (decideprintflag .EQV. .true.) )
THEN
248 IF ( flx(1) > 0.0_rfreal )
THEN
251 IF ( nlocs == 1 )
THEN
252 global%warnCounter = global%warnCounter + 1
254 WRITE(stdout,
'(A,1X,A,1X,I9)') solver_name, &
255 '*** WARNING *** Outflow detected at inflow boundary!'
256 WRITE(stdout,
'(A,3X,A,1X,I5.5)') solver_name,
'Global region:', &
257 pregion%iRegionGlobal
258 IF ( global%flowType == flow_unsteady )
THEN
259 WRITE(stdout,
'(A,3X,A,1X,1PE11.5)') solver_name, &
263 WRITE(stdout,
'(A,3X,A,1X,I6.6)') solver_name, &
264 'Current iteration number:', &
268 WRITE(stdout,
'(A,3X,A,1X,I1)') solver_name, &
269 'Runge-Kutta stage:', &
273 IF ( nlocs <= max_inoutflow_locs )
THEN
274 loc(nlocs,min_val:max_val) = c1
284 IF ( (global%checkLevel == check_high) .AND. &
285 (global%verbLevel >= verbose_high) .AND. &
286 (global%myProcid == masterproc) .AND. &
287 (decideprintflag .EQV. .true.) .AND. &
289 IF ( nlocs > max_inoutflow_locs )
THEN
290 WRITE(stdout,
'(A,3X,A,1X,I3,1X,A,1X,I9,1X,A)') solver_name, &
291 'Only wrote the first',max_inoutflow_locs,
'of',nlocs, &
292 'inflow faces with outflow.'
294 locinfo_mode_silent,output_mode_anybody)
297 locinfo_mode_silent,output_mode_anybody)
305 CASE ( bc_inflow_veltemp )
306 vals => ppatch%mixt%vals
307 bcopttype = ppatch%mixt%switches(bcswi_inflow_type)
309 DO ifl = 1,ppatch%nBFaces
310 c1 = ppatch%bf2c(ifl)
312 nx = ppatch%fn(xcoord,ifl)
313 ny = ppatch%fn(ycoord,ifl)
314 nz = ppatch%fn(zcoord,ifl)
315 nm = ppatch%fn(xyzmag,ifl)
317 fs = ppatch%gs(indgs*ifl)
319 rl = cv(cv_mixt_dens,c1)
320 rul = cv(cv_mixt_xmom,c1)
321 rvl = cv(cv_mixt_ymom,c1)
322 rwl = cv(cv_mixt_zmom,c1)
323 rel = cv(cv_mixt_ener,c1)
324 pl = dv(dv_mixt_pres,c1)
326 ur = vals(bcdat_inflow_u,distrib*ifl)
327 vr = vals(bcdat_inflow_v,distrib*ifl)
328 wr = vals(bcdat_inflow_w,distrib*ifl)
329 tr = vals(bcdat_inflow_t,distrib*ifl)
331 IF ( gasmodel == gas_model_tcperf )
THEN
332 cp = gv(gv_mixt_cp ,indcp *c1)
333 mm = gv(gv_mixt_mol,indmol*c1)
337 IF ( bcopttype /= bcopt_subsonic )
THEN
338 pr = vals(bcdat_inflow_p,distrib*ifl)
347 CALL
errorstop(global,err_reached_default,__line__)
354 ql = (rul*nx + rvl*ny + rwl*nz)/rl - fs
355 qr = (rur*nx + rvr*ny + rwr*nz)/rr - fs
361 flx(1) = 0.5_rfreal*(ql* rl + qr* rr )*nm
362 flx(2) = 0.5_rfreal*(ql* rul + pl*nx + qr* rur + pr*nx)*nm
363 flx(3) = 0.5_rfreal*(ql* rvl + pl*ny + qr* rvr + pr*ny)*nm
364 flx(4) = 0.5_rfreal*(ql* rwl + pl*nz + qr* rwr + pr*nz)*nm
365 flx(5) = 0.5_rfreal*(ql*(rel + pl) + pl*fs + qr*(rer + pr) + pr*fs)*nm
367 mfmixt(indmf*ifl) = flx(1)
369 ppatch%cp(ifl) = icpref*(0.5_rfreal*(pl + pr) - pref)
370 ppatch%cmass(ifl) = icmassref*flx(1)/nm
371 ppatch%cmom(xcoord,ifl) = icpref*0.5_rfreal*(ul+ur)*flx(1)/nm
372 ppatch%cmom(ycoord,ifl) = icpref*0.5_rfreal*(vl+vr)*flx(1)/nm
373 ppatch%cmom(zcoord,ifl) = icpref*0.5_rfreal*(wl+wr)*flx(1)/nm
375 rhs(cv_mixt_dens,c1) =
rhs(cv_mixt_dens,c1) + flx(1)
376 rhs(cv_mixt_xmom,c1) =
rhs(cv_mixt_xmom,c1) + flx(2)
377 rhs(cv_mixt_ymom,c1) =
rhs(cv_mixt_ymom,c1) + flx(3)
378 rhs(cv_mixt_zmom,c1) =
rhs(cv_mixt_zmom,c1) + flx(4)
379 rhs(cv_mixt_ener,c1) =
rhs(cv_mixt_ener,c1) + flx(5)
381 sd(sd_xmom,c1*indsd) = sd(sd_xmom,c1*indsd) + 0.5_rfreal*(rul/rl + rur/rr)*flx(1)
382 sd(sd_ymom,c1*indsd) = sd(sd_ymom,c1*indsd) + 0.5_rfreal*(rvl/rl + rvr/rr)*flx(1)
383 sd(sd_zmom,c1*indsd) = sd(sd_zmom,c1*indsd) + 0.5_rfreal*(rwl/rl + rwr/rr)*flx(1)
385 IF ( pregion%irkStep == 1 )
THEN
386 global%massIn = global%massIn -
min(flx(1),0.0_rfreal)
387 global%massOut = global%massOut +
max(flx(1),0.0_rfreal)
391 IF ( (global%checkLevel == check_high) .AND. &
392 (global%verbLevel >= verbose_high) .AND. &
393 (global%myProcid == masterproc) .AND. &
394 (decideprintflag .EQV. .true.) )
THEN
395 IF ( flx(1) > 0.0_rfreal )
THEN
398 IF ( nlocs == 1 )
THEN
399 global%warnCounter = global%warnCounter + 1
401 WRITE(stdout,
'(A,1X,A,1X,I9)') solver_name, &
402 '*** WARNING *** Outflow detected at inflow boundary!'
403 WRITE(stdout,
'(A,3X,A,1X,I5.5)') solver_name,
'Global region:', &
404 pregion%iRegionGlobal
405 IF ( global%flowType == flow_unsteady )
THEN
406 WRITE(stdout,
'(A,3X,A,1X,1PE11.5)') solver_name, &
410 WRITE(stdout,
'(A,3X,A,1X,I6.6)') solver_name, &
411 'Current iteration number:', &
415 WRITE(stdout,
'(A,3X,A,1X,I1)') solver_name, &
416 'Runge-Kutta stage:', &
420 IF ( nlocs <= max_inoutflow_locs )
THEN
421 loc(nlocs,min_val:max_val) = c1
431 IF ( (global%checkLevel == check_high) .AND. &
432 (global%verbLevel >= verbose_high) .AND. &
433 (global%myProcid == masterproc) .AND. &
434 (decideprintflag .EQV. .true.) .AND. &
436 IF ( nlocs > max_inoutflow_locs )
THEN
437 WRITE(stdout,
'(A,3X,A,1X,I3,1X,A,1X,I9,1X,A)') solver_name, &
438 'Only wrote the first',max_inoutflow_locs,
'of',nlocs, &
439 'inflow faces with outflow.'
441 locinfo_mode_silent,output_mode_anybody)
444 locinfo_mode_silent,output_mode_anybody)
453 bcopttype = ppatch%mixt%switches(bcswi_outflow_type)
455 IF ( bcopttype /= bcopt_supersonic )
THEN
456 vals => ppatch%mixt%vals
459 DO ifl = 1,ppatch%nBFaces
460 c1 = ppatch%bf2c(ifl)
462 nx = ppatch%fn(xcoord,ifl)
463 ny = ppatch%fn(ycoord,ifl)
464 nz = ppatch%fn(zcoord,ifl)
465 nm = ppatch%fn(xyzmag,ifl)
467 fs = ppatch%gs(indgs*ifl)
469 rl = cv(cv_mixt_dens,c1)
470 rul = cv(cv_mixt_xmom,c1)
471 rvl = cv(cv_mixt_ymom,c1)
472 rwl = cv(cv_mixt_zmom,c1)
473 rel = cv(cv_mixt_ener,c1)
474 pl = dv(dv_mixt_pres,c1)
476 IF ( bcopttype /= bcopt_supersonic )
THEN
477 pr = vals(bcdat_outflow_press,distrib*ifl)
482 IF ( gasmodel == gas_model_tcperf )
THEN
483 cp = gv(gv_mixt_cp ,indcp *c1)
484 mm = gv(gv_mixt_mol,indmol*c1)
486 CALL
bcondoutflowperf(bcopttype,pr,nx,ny,nz,cp,mm,rl,rul,rvl,rwl, &
487 rel,pl,rr,rur,rvr,rwr,rer)
489 CALL
errorstop(global,err_reached_default,__line__)
492 ql = (rul*nx + rvl*ny + rwl*nz)/rl - fs
493 qr = (rur*nx + rvr*ny + rwr*nz)/rr - fs
502 flx(1) = 0.5_rfreal*(ql* rl + qr* rr )*nm
503 flx(2) = 0.5_rfreal*(ql* rul + pl*nx + qr* rur + pr*nx)*nm
504 flx(3) = 0.5_rfreal*(ql* rvl + pl*ny + qr* rvr + pr*ny)*nm
505 flx(4) = 0.5_rfreal*(ql* rwl + pl*nz + qr* rwr + pr*nz)*nm
506 flx(5) = 0.5_rfreal*(ql*(rel + pl) + pl*fs + qr*(rer + pr) + pr*fs)*nm
508 mfmixt(indmf*ifl) = flx(1)
510 ppatch%cp(ifl) = icpref*(0.5_rfreal*(pl + pr) - pref)
511 ppatch%cmass(ifl) = icmassref*flx(1)/nm
512 ppatch%cmom(xcoord,ifl) = icpref*0.5_rfreal*(ul+ur)*flx(1)/nm
513 ppatch%cmom(ycoord,ifl) = icpref*0.5_rfreal*(vl+vr)*flx(1)/nm
514 ppatch%cmom(zcoord,ifl) = icpref*0.5_rfreal*(wl+wr)*flx(1)/nm
516 rhs(cv_mixt_dens,c1) =
rhs(cv_mixt_dens,c1) + flx(1)
517 rhs(cv_mixt_xmom,c1) =
rhs(cv_mixt_xmom,c1) + flx(2)
518 rhs(cv_mixt_ymom,c1) =
rhs(cv_mixt_ymom,c1) + flx(3)
519 rhs(cv_mixt_zmom,c1) =
rhs(cv_mixt_zmom,c1) + flx(4)
520 rhs(cv_mixt_ener,c1) =
rhs(cv_mixt_ener,c1) + flx(5)
522 sd(sd_xmom,c1*indsd) = sd(sd_xmom,c1*indsd) + 0.5_rfreal*(rul/rl + rur/rr)*flx(1)
523 sd(sd_ymom,c1*indsd) = sd(sd_ymom,c1*indsd) + 0.5_rfreal*(rvl/rl + rvr/rr)*flx(1)
524 sd(sd_zmom,c1*indsd) = sd(sd_zmom,c1*indsd) + 0.5_rfreal*(rwl/rl + rwr/rr)*flx(1)
526 IF ( pregion%irkStep == 1 )
THEN
527 global%massIn = global%massIn -
min(flx(1),0.0_rfreal)
528 global%massOut = global%massOut +
max(flx(1),0.0_rfreal)
531 IF ( (global%checkLevel == check_high) .AND. &
532 (global%verbLevel >= verbose_high) .AND. &
533 (global%myProcid == masterproc) .AND. &
534 (decideprintflag .EQV. .true.) )
THEN
535 IF ( flx(1) < 0.0_rfreal )
THEN
538 IF ( nlocs == 1 )
THEN
539 global%warnCounter = global%warnCounter + 1
541 WRITE(stdout,
'(A,1X,A,1X,I9)') solver_name, &
542 '*** WARNING *** Inflow detected at outflow boundary!'
543 WRITE(stdout,
'(A,3X,A,1X,I5.5)') solver_name,
'Global region:', &
544 pregion%iRegionGlobal
545 IF ( global%flowType == flow_unsteady )
THEN
546 WRITE(stdout,
'(A,3X,A,1X,1PE11.5)') solver_name, &
550 WRITE(stdout,
'(A,3X,A,1X,I6.6)') solver_name, &
551 'Current iteration number:', &
555 WRITE(stdout,
'(A,3X,A,1X,I1)') solver_name, &
556 'Runge-Kutta stage:', &
560 IF ( nlocs <= max_inoutflow_locs )
THEN
561 loc(nlocs,min_val:max_val) = c1
571 IF ( (global%checkLevel == check_high) .AND. &
572 (global%verbLevel >= verbose_high) .AND. &
573 (global%myProcid == masterproc) .AND. &
574 (decideprintflag .EQV. .true.) .AND. &
576 IF ( nlocs > max_inoutflow_locs )
THEN
577 WRITE(stdout,
'(A,3X,A,1X,I3,1X,A,1X,I9,1X,A)') solver_name, &
578 'Only wrote the first',max_inoutflow_locs,
'of',nlocs, &
579 'outflow faces with inflow.'
581 locinfo_mode_silent,output_mode_anybody)
584 locinfo_mode_silent,output_mode_anybody)
593 DO ifl = 1,ppatch%nBFaces
594 c1 = ppatch%bf2c(ifl)
596 nx = ppatch%fn(xcoord,ifl)
597 ny = ppatch%fn(ycoord,ifl)
598 nz = ppatch%fn(zcoord,ifl)
599 nm = ppatch%fn(xyzmag,ifl)
601 fs = ppatch%gs(indgs*ifl)
604 rl = cv(cv_mixt_dens,c1)
605 rul = cv(cv_mixt_xmom,c1)
606 rvl = cv(cv_mixt_ymom,c1)
607 rwl = cv(cv_mixt_zmom,c1)
608 pl = dv(dv_mixt_pres,c1)
610 SELECT CASE ( pregion%mixtInput%gasModel )
611 CASE ( gas_model_tcperf, &
612 gas_model_mixt_tcperf, &
613 gas_model_mixt_pseudo )
614 cp = gv(gv_mixt_cp ,indcp *c1)
615 mm = gv(gv_mixt_mol,indmol*c1)
620 CALL
errorstop(global,err_reached_default,__line__)
628 mfmixt(indmf*ifl) = 0.0_rfreal
630 ppatch%cp(ifl) = icpref*(pl - pref)
631 ppatch%cmass(ifl) = 0.0_rfreal
632 ppatch%cmom(xcoord,ifl) = 0.0_rfreal
633 ppatch%cmom(ycoord,ifl) = 0.0_rfreal
634 ppatch%cmom(zcoord,ifl) = 0.0_rfreal
636 rhs(cv_mixt_xmom,c1) =
rhs(cv_mixt_xmom,c1) + flx(2)
637 rhs(cv_mixt_ymom,c1) =
rhs(cv_mixt_ymom,c1) + flx(3)
638 rhs(cv_mixt_zmom,c1) =
rhs(cv_mixt_zmom,c1) + flx(4)
639 rhs(cv_mixt_ener,c1) =
rhs(cv_mixt_ener,c1) + flx(5)
647 CASE ( bc_noslipwall_hflux,bc_noslipwall_temp )
648 DO ifl = 1,ppatch%nBFaces
649 c1 = ppatch%bf2c(ifl)
651 nx = ppatch%fn(xcoord,ifl)
652 ny = ppatch%fn(ycoord,ifl)
653 nz = ppatch%fn(zcoord,ifl)
654 nm = ppatch%fn(xyzmag,ifl)
656 fs = ppatch%gs(indgs*ifl)
658 pl = dv(dv_mixt_pres,c1)
665 mfmixt(indmf*ifl) = 0.0_rfreal
667 ppatch%cp(ifl) = icpref*(pl - pref)
668 ppatch%cmass(ifl) = 0.0_rfreal
669 ppatch%cmom(xcoord,ifl) = 0.0_rfreal
670 ppatch%cmom(ycoord,ifl) = 0.0_rfreal
671 ppatch%cmom(zcoord,ifl) = 0.0_rfreal
673 rhs(cv_mixt_xmom,c1) =
rhs(cv_mixt_xmom,c1) + flx(2)
674 rhs(cv_mixt_ymom,c1) =
rhs(cv_mixt_ymom,c1) + flx(3)
675 rhs(cv_mixt_zmom,c1) =
rhs(cv_mixt_zmom,c1) + flx(4)
676 rhs(cv_mixt_ener,c1) =
rhs(cv_mixt_ener,c1) + flx(5)
684 corr = ppatch%mixt%switches(bcswi_farf_corr)
686 IF ( corr == bcopt_corr_yes )
THEN
690 liftcoef = 0.0_rfreal
693 vals => ppatch%mixt%vals
695 DO ifl = 1,ppatch%nBFaces
696 c1 = ppatch%bf2c(ifl)
698 nx = ppatch%fn(xcoord,ifl)
699 ny = ppatch%fn(ycoord,ifl)
700 nz = ppatch%fn(zcoord,ifl)
701 nm = ppatch%fn(xyzmag,ifl)
703 xc = ppatch%fc(xcoord,ifl)
704 yc = ppatch%fc(ycoord,ifl)
705 zc = ppatch%fc(zcoord,ifl)
707 fs = ppatch%gs(indgs*ifl)
709 rl = cv(cv_mixt_dens,c1)
710 rul = cv(cv_mixt_xmom,c1)
711 rvl = cv(cv_mixt_ymom,c1)
712 rwl = cv(cv_mixt_zmom,c1)
713 rel = cv(cv_mixt_ener,c1)
714 pl = dv(dv_mixt_pres,c1)
716 mf = vals(bcdat_farf_mach ,distrib*ifl)
717 aoa = vals(bcdat_farf_attack,distrib*ifl)
718 aos = vals(bcdat_farf_slip ,distrib*ifl)
719 pf = vals(bcdat_farf_press ,distrib*ifl)
720 tf = vals(bcdat_farf_temp ,distrib*ifl)
722 IF ( gasmodel == gas_model_tcperf )
THEN
723 cp = gv(gv_mixt_cp ,indcp *c1)
724 mm = gv(gv_mixt_mol,indmol*c1)
727 aoa,aos,corrflag,liftcoef,xc,yc, &
728 zc,rl,rul,rvl,rwl,rel,rr,rur, &
732 ql = (rul*nx + rvl*ny + rwl*nz)/rl - fs
733 qr = (rur*nx + rvr*ny + rwr*nz)/rr - fs
742 flx(1) = 0.5_rfreal*(ql* rl + qr* rr )*nm
743 flx(2) = 0.5_rfreal*(ql* rul + pl*nx + qr* rur + pr*nx)*nm
744 flx(3) = 0.5_rfreal*(ql* rvl + pl*ny + qr* rvr + pr*ny)*nm
745 flx(4) = 0.5_rfreal*(ql* rwl + pl*nz + qr* rwr + pr*nz)*nm
746 flx(5) = 0.5_rfreal*(ql*(rel + pl) + pl*fs + qr*(rer + pr) + pr*fs)*nm
748 mfmixt(indmf*ifl) = flx(1)
750 ppatch%cp(ifl) = icpref*(0.5_rfreal*(pl + pr) - pref)
751 ppatch%cmass(ifl) = icmassref*flx(1)/nm
752 ppatch%cmom(xcoord,ifl) = icpref*0.5_rfreal*(ul+ur)*flx(1)/nm
753 ppatch%cmom(ycoord,ifl) = icpref*0.5_rfreal*(vl+vr)*flx(1)/nm
754 ppatch%cmom(zcoord,ifl) = icpref*0.5_rfreal*(wl+wr)*flx(1)/nm
756 rhs(cv_mixt_dens,c1) =
rhs(cv_mixt_dens,c1) + flx(1)
757 rhs(cv_mixt_xmom,c1) =
rhs(cv_mixt_xmom,c1) + flx(2)
758 rhs(cv_mixt_ymom,c1) =
rhs(cv_mixt_ymom,c1) + flx(3)
759 rhs(cv_mixt_zmom,c1) =
rhs(cv_mixt_zmom,c1) + flx(4)
760 rhs(cv_mixt_ener,c1) =
rhs(cv_mixt_ener,c1) + flx(5)
762 sd(sd_xmom,c1*indsd) = sd(sd_xmom,c1*indsd) + 0.5_rfreal*(rul/rl + rur/rr)*flx(1)
763 sd(sd_ymom,c1*indsd) = sd(sd_ymom,c1*indsd) + 0.5_rfreal*(rvl/rl + rvr/rr)*flx(1)
764 sd(sd_zmom,c1*indsd) = sd(sd_zmom,c1*indsd) + 0.5_rfreal*(rwl/rl + rwr/rr)*flx(1)
766 IF ( pregion%irkStep == 1 )
THEN
767 global%massIn = global%massIn -
min(flx(1),0.0_rfreal)
768 global%massOut = global%massOut +
max(flx(1),0.0_rfreal)
776 CASE ( bc_injection )
777 vals => ppatch%mixt%vals
779 DO ifl = 1,ppatch%nBFaces
780 c1 = ppatch%bf2c(ifl)
782 nx = ppatch%fn(xcoord,ifl)
783 ny = ppatch%fn(ycoord,ifl)
784 nz = ppatch%fn(zcoord,ifl)
785 nm = ppatch%fn(xyzmag,ifl)
787 fs = ppatch%gs(indgs*ifl)
790 IF ( gasmodel == gas_model_tcperf )
THEN
791 cp = gv(gv_mixt_cp ,indcp *c1)
792 mm = gv(gv_mixt_mol,indmol*c1)
794 minj = vals(bcdat_inject_mfrate,distrib*ifl)
796 IF ( minj > 0.0_rfreal )
THEN
797 tinj = vals(bcdat_inject_temp,distrib*ifl)
799 pl = dv(dv_mixt_pres,c1)
805 flx(2) = (-minj*ul + pl*nx)*nm
806 flx(3) = (-minj*vl + pl*ny)*nm
807 flx(4) = (-minj*wl + pl*nz)*nm
808 flx(5) = (-minj*hl + pl*fs)*nm
810 rl = cv(cv_mixt_dens,c1)
811 rul = cv(cv_mixt_xmom,c1)
812 rvl = cv(cv_mixt_ymom,c1)
813 rwl = cv(cv_mixt_zmom,c1)
814 pl = dv(dv_mixt_pres,c1)
830 CALL
errorstop(global,err_reached_default,__line__)
833 mfmixt(indmf*ifl) = flx(1)
835 ppatch%cp(ifl) = icpref*(pl - pref)
836 ppatch%cmass(ifl) = icmassref*flx(1)/nm
837 ppatch%cmom(xcoord,ifl) = icpref*0.5_rfreal*(ul+ur)*flx(1)/nm
838 ppatch%cmom(ycoord,ifl) = icpref*0.5_rfreal*(vl+vr)*flx(1)/nm
839 ppatch%cmom(zcoord,ifl) = icpref*0.5_rfreal*(wl+wr)*flx(1)/nm
841 rhs(cv_mixt_dens,c1) =
rhs(cv_mixt_dens,c1) + flx(1)
842 rhs(cv_mixt_xmom,c1) =
rhs(cv_mixt_xmom,c1) + flx(2)
843 rhs(cv_mixt_ymom,c1) =
rhs(cv_mixt_ymom,c1) + flx(3)
844 rhs(cv_mixt_zmom,c1) =
rhs(cv_mixt_zmom,c1) + flx(4)
845 rhs(cv_mixt_ener,c1) =
rhs(cv_mixt_ener,c1) + flx(5)
847 sd(sd_xmom,c1*indsd) = sd(sd_xmom,c1*indsd) + ul*flx(1)
848 sd(sd_ymom,c1*indsd) = sd(sd_ymom,c1*indsd) + vl*flx(1)
849 sd(sd_zmom,c1*indsd) = sd(sd_zmom,c1*indsd) + wl*flx(1)
851 IF ( pregion%irkStep == 1 )
THEN
852 global%massIn = global%massIn -
min(flx(1),0.0_rfreal)
853 global%massOut = global%massOut +
max(flx(1),0.0_rfreal)
861 CASE ( bc_periodic, &
870 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 bcondfarfieldperf(machInf, alphaInf, betaInf, pInf, tInf, sxn, syn, szn, cpgas, mol, rho, rhou, rhov, rhow, rhoe, press, rhob, rhoub, rhovb, rhowb, rhoeb, pb)
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, public rflu_descalegridspeed(pRegion, fs)
subroutine bcondoutflowperf(bcOpt, pout, sxn, syn, szn, cpgas, mol, rho, rhou, rhov, rhow, rhoe, press, rhob, rhoub, rhovb, rhowb, rhoeb)
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)
subroutine bcondinflowperf(bcOptType, bcOptFixed, ptot, ttot, betah, betav, mach, sxn, syn, szn, cpgas, mm, rl, rul, rvl, rwl, rr, rur, rvr, rwr, rer, pr)
Vector_n min(const Array_n_const &v1, const Array_n_const &v2)
subroutine rflu_printlocinfo(pRegion, locUnsorted, nLocUnsorted, locInfoMode, outputMode)
LOGICAL function rflu_decideprint(global)
real(rfreal) function mixtperf_eo_dgpuvw(D, G, P, U, V, W)
subroutine rflu_centralfirstpatch(pRegion, pPatch)
subroutine errorstop(global, errorCode, errorLine, addMessage)
subroutine deregisterfunction(global)
real(rfreal) function mixtperf_g_cpr(Cp, R)
real(rfreal) function mixtperf_p_drt(D, R, T)