84 TYPE(t_patch),
POINTER :: ppatch
85 TYPE(t_region
),
POINTER :: pregion
91 LOGICAL :: corrflag,decideprintflag
92 CHARACTER(CHRLEN) :: rcsidentstring
93 INTEGER,
PARAMETER :: max_inoutflow_locs = 10
94 INTEGER :: c1,bcoptfixed,bcopttype,distrib,gasmodel,ifl,indcp,indgs,indmf, &
96 INTEGER :: loc(max_inoutflow_locs,min_val:max_val)
97 REAL(RFREAL) :: aoa,aos,betah,betav,corr,cp,cx,cy,
dx,
dy,
dz,er,fs,fsu,
g,hl, &
98 icmassref,icpref,irl,irr,liftcoef,mach,mf,minj,mm,nm,nx,ny, &
99 nz,pa,pl,pf,pr,pref,ptot,ql,qr,rgas,rhoa,rhoea,rhoua,rhova, &
100 rhowa,rl,rel,rer,rul,rur,rvl,rvr,rwl,rwr,rr,rref,tf,tinj, &
101 tr,ttot,uinj,ul,ur,vcont,vinj,vl,vm2,vr,vref,winj,wl,wr,xc, &
103 REAL(RFREAL) :: flx(5)
104 REAL(RFREAL),
DIMENSION(:),
POINTER :: mfmixt
105 REAL(RFREAL),
DIMENSION(:,:),
POINTER :: cv,dv,gv,
rhs,vals,sd
106 REAL(RFREAL),
DIMENSION(:,:,:),
POINTER :: grad
113 rcsidentstring =
'$RCSfile: RFLU_CentralSecondPatch.F90,v $ $Revision: 1.25 $'
115 global => pregion%global
118 'RFLU_CentralSecondPatch.F90')
124 indcp = pregion%mixtInput%indCp
125 indmf = pregion%mixtInput%indMfMixt
126 indsd = pregion%mixtInput%indSd
127 indmol = pregion%mixtInput%indMol
128 gasmodel = pregion%mixtInput%gasModel
130 indgs = pregion%grid%indGs
132 distrib = ppatch%mixt%distrib
134 cv => pregion%mixt%cv
135 dv => pregion%mixt%dv
136 gv => pregion%mixt%gv
137 grad => pregion%mixt%gradCell
138 rhs => pregion%mixt%rhs
139 sd => pregion%mixt%sd
141 mfmixt => ppatch%mfMixt
147 pref = global%refPressure
148 rref = global%refDensity
149 vref = global%refVelocity
151 icpref = 2.0_rfreal/(rref*vref*vref)
152 icmassref = 1.0_rfreal/(rref*vref)
158 SELECT CASE ( ppatch%bcType )
164 CASE ( bc_inflow_totang )
165 vals => ppatch%mixt%vals
166 bcopttype = ppatch%mixt%switches(bcswi_inflow_type)
167 bcoptfixed = ppatch%mixt%switches(bcswi_inflow_fixed)
169 DO ifl = 1,ppatch%nBFaces
170 c1 = ppatch%bf2c(ifl)
172 nx = ppatch%fn(xcoord,ifl)
173 ny = ppatch%fn(ycoord,ifl)
174 nz = ppatch%fn(zcoord,ifl)
175 nm = ppatch%fn(xyzmag,ifl)
177 xc = ppatch%fc(xcoord,ifl)
178 yc = ppatch%fc(ycoord,ifl)
179 zc = ppatch%fc(zcoord,ifl)
181 fs = ppatch%gs(indgs*ifl)
183 rl = cv(cv_mixt_dens,c1)
186 ul = cv(cv_mixt_xmom,c1)*irl
187 vl = cv(cv_mixt_ymom,c1)*irl
188 wl = cv(cv_mixt_zmom,c1)*irl
189 pl = dv(dv_mixt_pres,c1)
191 dx = xc - pregion%grid%cofg(xcoord,c1)
192 dy = yc - pregion%grid%cofg(ycoord,c1)
193 dz = zc - pregion%grid%cofg(zcoord,c1)
195 rl = rl + grad(xcoord,grc_mixt_dens,c1)*
dx &
196 + grad(ycoord,grc_mixt_dens,c1)*
dy &
197 + grad(zcoord,grc_mixt_dens,c1)*
dz
198 ul = ul + grad(xcoord,grc_mixt_xvel,c1)*
dx &
199 + grad(ycoord,grc_mixt_xvel,c1)*
dy &
200 + grad(zcoord,grc_mixt_xvel,c1)*
dz
201 vl = vl + grad(xcoord,grc_mixt_yvel,c1)*
dx &
202 + grad(ycoord,grc_mixt_yvel,c1)*
dy &
203 + grad(zcoord,grc_mixt_yvel,c1)*
dz
204 wl = wl + grad(xcoord,grc_mixt_zvel,c1)*
dx &
205 + grad(ycoord,grc_mixt_zvel,c1)*
dy &
206 + grad(zcoord,grc_mixt_zvel,c1)*
dz
207 pl = pl + grad(xcoord,grc_mixt_pres,c1)*
dx &
208 + grad(ycoord,grc_mixt_pres,c1)*
dy &
209 + grad(zcoord,grc_mixt_pres,c1)*
dz
215 ptot = vals(bcdat_inflow_ptot, distrib*ifl)
216 ttot = vals(bcdat_inflow_ttot, distrib*ifl)
217 betah = vals(bcdat_inflow_betah,distrib*ifl)
218 betav = vals(bcdat_inflow_betav,distrib*ifl)
220 IF ( bcopttype /= bcopt_subsonic )
THEN
221 mach = vals(bcdat_inflow_mach,distrib*ifl)
226 IF ( gasmodel == gas_model_tcperf )
THEN
227 cp = gv(gv_mixt_cp ,indcp *c1)
228 mm = gv(gv_mixt_mol,indmol*c1)
235 mach,nx,ny,nz,cp,mm,rl,rul,rvl,rwl,rr,rur, &
238 CALL
errorstop(global,err_reached_default,__line__)
241 ql = (rul*nx + rvl*ny + rwl*nz)/rl - fs
242 qr = (rur*nx + rvr*ny + rwr*nz)/rr - fs
251 flx(1) = 0.5_rfreal*(ql* rl + qr* rr )*nm
252 flx(2) = 0.5_rfreal*(ql* rul + pl*nx + qr* rur + pr*nx)*nm
253 flx(3) = 0.5_rfreal*(ql* rvl + pl*ny + qr* rvr + pr*ny)*nm
254 flx(4) = 0.5_rfreal*(ql* rwl + pl*nz + qr* rwr + pr*nz)*nm
255 flx(5) = 0.5_rfreal*(ql*(rel + pl) + pl*fs + qr*(rer + pr) + pr*fs)*nm
257 mfmixt(indmf*ifl) = flx(1)
259 ppatch%cp(ifl) = icpref*(0.5_rfreal*(pl + pr) - pref)
260 ppatch%cmass(ifl) = icmassref*flx(1)/nm
261 ppatch%cmom(xcoord,ifl) = icpref*0.5_rfreal*(ul+ur)*flx(1)/nm
262 ppatch%cmom(ycoord,ifl) = icpref*0.5_rfreal*(vl+vr)*flx(1)/nm
263 ppatch%cmom(zcoord,ifl) = icpref*0.5_rfreal*(wl+wr)*flx(1)/nm
265 rhs(cv_mixt_dens,c1) =
rhs(cv_mixt_dens,c1) + flx(1)
266 rhs(cv_mixt_xmom,c1) =
rhs(cv_mixt_xmom,c1) + flx(2)
267 rhs(cv_mixt_ymom,c1) =
rhs(cv_mixt_ymom,c1) + flx(3)
268 rhs(cv_mixt_zmom,c1) =
rhs(cv_mixt_zmom,c1) + flx(4)
269 rhs(cv_mixt_ener,c1) =
rhs(cv_mixt_ener,c1) + flx(5)
271 sd(sd_xmom,c1*indsd) = sd(sd_xmom,c1*indsd) + 0.5_rfreal*(rul/rl + rur/rr)*flx(1)
272 sd(sd_ymom,c1*indsd) = sd(sd_ymom,c1*indsd) + 0.5_rfreal*(rvl/rl + rvr/rr)*flx(1)
273 sd(sd_zmom,c1*indsd) = sd(sd_zmom,c1*indsd) + 0.5_rfreal*(rwl/rl + rwr/rr)*flx(1)
275 IF ( pregion%irkStep == 1 )
THEN
276 global%massIn = global%massIn -
min(flx(1),0.0_rfreal)
277 global%massOut = global%massOut +
max(flx(1),0.0_rfreal)
281 IF ( (global%checkLevel == check_high) .AND. &
282 (global%verbLevel >= verbose_high) .AND. &
283 (global%myProcid == masterproc) .AND. &
284 (decideprintflag .EQV. .true.) )
THEN
285 IF ( flx(1) > 0.0_rfreal )
THEN
288 IF ( nlocs == 1 )
THEN
289 global%warnCounter = global%warnCounter + 1
291 WRITE(stdout,
'(A,1X,A,1X,I9)') solver_name, &
292 '*** WARNING *** Outflow detected at inflow boundary!'
293 WRITE(stdout,
'(A,3X,A,1X,I5.5)') solver_name,
'Global region:', &
294 pregion%iRegionGlobal
295 IF ( global%flowType == flow_unsteady )
THEN
296 WRITE(stdout,
'(A,3X,A,1X,1PE11.5)') solver_name, &
300 WRITE(stdout,
'(A,3X,A,1X,I6.6)') solver_name, &
301 'Current iteration number:', &
305 WRITE(stdout,
'(A,3X,A,1X,I1)') solver_name, &
306 'Runge-Kutta stage:', &
310 IF ( nlocs <= max_inoutflow_locs )
THEN
311 loc(nlocs,min_val:max_val) = c1
321 IF ( (global%checkLevel == check_high) .AND. &
322 (global%verbLevel >= verbose_high) .AND. &
323 (global%myProcid == masterproc) .AND. &
324 (decideprintflag .EQV. .true.) .AND. &
326 IF ( nlocs > max_inoutflow_locs )
THEN
327 WRITE(stdout,
'(A,3X,A,1X,I3,1X,A,1X,I9,1X,A)') solver_name, &
328 'Only wrote the first',max_inoutflow_locs,
'of',nlocs, &
329 'inflow faces with outflow.'
331 locinfo_mode_silent,output_mode_anybody)
334 locinfo_mode_silent,output_mode_anybody)
342 CASE ( bc_inflow_veltemp )
343 vals => ppatch%mixt%vals
344 bcopttype = ppatch%mixt%switches(bcswi_inflow_type)
346 DO ifl = 1,ppatch%nBFaces
347 c1 = ppatch%bf2c(ifl)
349 nx = ppatch%fn(xcoord,ifl)
350 ny = ppatch%fn(ycoord,ifl)
351 nz = ppatch%fn(zcoord,ifl)
352 nm = ppatch%fn(xyzmag,ifl)
354 xc = ppatch%fc(xcoord,ifl)
355 yc = ppatch%fc(ycoord,ifl)
356 zc = ppatch%fc(zcoord,ifl)
358 fs = ppatch%gs(indgs*ifl)
360 rl = cv(cv_mixt_dens,c1)
363 ul = cv(cv_mixt_xmom,c1)*irl
364 vl = cv(cv_mixt_ymom,c1)*irl
365 wl = cv(cv_mixt_zmom,c1)*irl
366 pl = dv(dv_mixt_pres,c1)
368 dx = xc - pregion%grid%cofg(xcoord,c1)
369 dy = yc - pregion%grid%cofg(ycoord,c1)
370 dz = zc - pregion%grid%cofg(zcoord,c1)
372 rl = rl + grad(xcoord,grc_mixt_dens,c1)*
dx &
373 + grad(ycoord,grc_mixt_dens,c1)*
dy &
374 + grad(zcoord,grc_mixt_dens,c1)*
dz
375 ul = ul + grad(xcoord,grc_mixt_xvel,c1)*
dx &
376 + grad(ycoord,grc_mixt_xvel,c1)*
dy &
377 + grad(zcoord,grc_mixt_xvel,c1)*
dz
378 vl = vl + grad(xcoord,grc_mixt_yvel,c1)*
dx &
379 + grad(ycoord,grc_mixt_yvel,c1)*
dy &
380 + grad(zcoord,grc_mixt_yvel,c1)*
dz
381 wl = wl + grad(xcoord,grc_mixt_zvel,c1)*
dx &
382 + grad(ycoord,grc_mixt_zvel,c1)*
dy &
383 + grad(zcoord,grc_mixt_zvel,c1)*
dz
384 pl = pl + grad(xcoord,grc_mixt_pres,c1)*
dx &
385 + grad(ycoord,grc_mixt_pres,c1)*
dy &
386 + grad(zcoord,grc_mixt_pres,c1)*
dz
392 ur = vals(bcdat_inflow_u,distrib*ifl)
393 vr = vals(bcdat_inflow_v,distrib*ifl)
394 wr = vals(bcdat_inflow_w,distrib*ifl)
395 tr = vals(bcdat_inflow_t,distrib*ifl)
397 IF ( gasmodel == gas_model_tcperf )
THEN
398 cp = gv(gv_mixt_cp ,indcp *c1)
399 mm = gv(gv_mixt_mol,indmol*c1)
403 IF ( bcopttype /= bcopt_subsonic )
THEN
404 pr = vals(bcdat_inflow_p,distrib*ifl)
414 CALL
errorstop(global,err_reached_default,__line__)
421 ql = (rul*nx + rvl*ny + rwl*nz)/rl - fs
422 qr = (rur*nx + rvr*ny + rwr*nz)/rr - fs
428 flx(1) = 0.5_rfreal*(ql* rl + qr* rr )*nm
429 flx(2) = 0.5_rfreal*(ql* rul + pl*nx + qr* rur + pr*nx)*nm
430 flx(3) = 0.5_rfreal*(ql* rvl + pl*ny + qr* rvr + pr*ny)*nm
431 flx(4) = 0.5_rfreal*(ql* rwl + pl*nz + qr* rwr + pr*nz)*nm
432 flx(5) = 0.5_rfreal*(ql*(rel + pl) + pl*fs + qr*(rer + pr) + pr*fs)*nm
434 mfmixt(indmf*ifl) = flx(1)
436 ppatch%cp(ifl) = icpref*(0.5_rfreal*(pl + pr) - pref)
437 ppatch%cmass(ifl) = icmassref*flx(1)/nm
438 ppatch%cmom(xcoord,ifl) = icpref*0.5_rfreal*(ul+ur)*flx(1)/nm
439 ppatch%cmom(ycoord,ifl) = icpref*0.5_rfreal*(vl+vr)*flx(1)/nm
440 ppatch%cmom(zcoord,ifl) = icpref*0.5_rfreal*(wl+wr)*flx(1)/nm
442 rhs(cv_mixt_dens,c1) =
rhs(cv_mixt_dens,c1) + flx(1)
443 rhs(cv_mixt_xmom,c1) =
rhs(cv_mixt_xmom,c1) + flx(2)
444 rhs(cv_mixt_ymom,c1) =
rhs(cv_mixt_ymom,c1) + flx(3)
445 rhs(cv_mixt_zmom,c1) =
rhs(cv_mixt_zmom,c1) + flx(4)
446 rhs(cv_mixt_ener,c1) =
rhs(cv_mixt_ener,c1) + flx(5)
448 sd(sd_xmom,c1*indsd) = sd(sd_xmom,c1*indsd) + 0.5_rfreal*(rul/rl + rur/rr)*flx(1)
449 sd(sd_ymom,c1*indsd) = sd(sd_ymom,c1*indsd) + 0.5_rfreal*(rvl/rl + rvr/rr)*flx(1)
450 sd(sd_zmom,c1*indsd) = sd(sd_zmom,c1*indsd) + 0.5_rfreal*(rwl/rl + rwr/rr)*flx(1)
452 IF ( pregion%irkStep == 1 )
THEN
453 global%massIn = global%massIn -
min(flx(1),0.0_rfreal)
454 global%massOut = global%massOut +
max(flx(1),0.0_rfreal)
458 IF ( (global%checkLevel == check_high) .AND. &
459 (global%verbLevel >= verbose_high) .AND. &
460 (global%myProcid == masterproc) .AND. &
461 (decideprintflag .EQV. .true.) )
THEN
462 IF ( flx(1) > 0.0_rfreal )
THEN
465 IF ( nlocs == 1 )
THEN
466 global%warnCounter = global%warnCounter + 1
468 WRITE(stdout,
'(A,1X,A,1X,I9)') solver_name, &
469 '*** WARNING *** Outflow detected at inflow boundary!'
470 WRITE(stdout,
'(A,3X,A,1X,I5.5)') solver_name,
'Global region:', &
471 pregion%iRegionGlobal
472 IF ( global%flowType == flow_unsteady )
THEN
473 WRITE(stdout,
'(A,3X,A,1X,1PE11.5)') solver_name, &
477 WRITE(stdout,
'(A,3X,A,1X,I6.6)') solver_name, &
478 'Current iteration number:', &
482 WRITE(stdout,
'(A,3X,A,1X,I1)') solver_name, &
483 'Runge-Kutta stage:', &
487 IF ( nlocs <= max_inoutflow_locs )
THEN
488 loc(nlocs,min_val:max_val) = c1
498 IF ( (global%checkLevel == check_high) .AND. &
499 (global%verbLevel >= verbose_high) .AND. &
500 (global%myProcid == masterproc) .AND. &
501 (decideprintflag .EQV. .true.) .AND. &
503 IF ( nlocs > max_inoutflow_locs )
THEN
504 WRITE(stdout,
'(A,3X,A,1X,I3,1X,A,1X,I9,1X,A)') solver_name, &
505 'Only wrote the first',max_inoutflow_locs,
'of',nlocs, &
506 'inflow faces with outflow.'
508 locinfo_mode_silent,output_mode_anybody)
511 locinfo_mode_silent,output_mode_anybody)
520 bcopttype = ppatch%mixt%switches(bcswi_outflow_type)
522 IF ( bcopttype /= bcopt_supersonic )
THEN
523 vals => ppatch%mixt%vals
526 DO ifl = 1,ppatch%nBFaces
527 c1 = ppatch%bf2c(ifl)
529 nx = ppatch%fn(xcoord,ifl)
530 ny = ppatch%fn(ycoord,ifl)
531 nz = ppatch%fn(zcoord,ifl)
532 nm = ppatch%fn(xyzmag,ifl)
534 xc = ppatch%fc(xcoord,ifl)
535 yc = ppatch%fc(ycoord,ifl)
536 zc = ppatch%fc(zcoord,ifl)
538 fs = ppatch%gs(indgs*ifl)
540 rl = cv(cv_mixt_dens,c1)
543 ul = cv(cv_mixt_xmom,c1)*irl
544 vl = cv(cv_mixt_ymom,c1)*irl
545 wl = cv(cv_mixt_zmom,c1)*irl
546 pl = dv(dv_mixt_pres,c1)
548 dx = xc - pregion%grid%cofg(xcoord,c1)
549 dy = yc - pregion%grid%cofg(ycoord,c1)
550 dz = zc - pregion%grid%cofg(zcoord,c1)
552 rl = rl + grad(xcoord,grc_mixt_dens,c1)*
dx &
553 + grad(ycoord,grc_mixt_dens,c1)*
dy &
554 + grad(zcoord,grc_mixt_dens,c1)*
dz
555 ul = ul + grad(xcoord,grc_mixt_xvel,c1)*
dx &
556 + grad(ycoord,grc_mixt_xvel,c1)*
dy &
557 + grad(zcoord,grc_mixt_xvel,c1)*
dz
558 vl = vl + grad(xcoord,grc_mixt_yvel,c1)*
dx &
559 + grad(ycoord,grc_mixt_yvel,c1)*
dy &
560 + grad(zcoord,grc_mixt_yvel,c1)*
dz
561 wl = wl + grad(xcoord,grc_mixt_zvel,c1)*
dx &
562 + grad(ycoord,grc_mixt_zvel,c1)*
dy &
563 + grad(zcoord,grc_mixt_zvel,c1)*
dz
564 pl = pl + grad(xcoord,grc_mixt_pres,c1)*
dx &
565 + grad(ycoord,grc_mixt_pres,c1)*
dy &
566 + grad(zcoord,grc_mixt_pres,c1)*
dz
572 IF ( bcopttype /= bcopt_supersonic )
THEN
573 pr = vals(bcdat_outflow_press,distrib*ifl)
578 IF ( gasmodel == gas_model_tcperf )
THEN
579 cp = gv(gv_mixt_cp ,indcp *c1)
580 mm = gv(gv_mixt_mol,indmol*c1)
586 CALL
bcondoutflowperf(bcopttype,pr,nx,ny,nz,cp,mm,rl,rul,rvl,rwl, &
587 rel,pl,rr,rur,rvr,rwr,rer)
589 CALL
errorstop(global,err_reached_default,__line__)
592 ql = (rul*nx + rvl*ny + rwl*nz)/rl - fs
593 qr = (rur*nx + rvr*ny + rwr*nz)/rr - fs
602 flx(1) = 0.5_rfreal*(ql* rl + qr* rr )*nm
603 flx(2) = 0.5_rfreal*(ql* rul + pl*nx + qr* rur + pr*nx)*nm
604 flx(3) = 0.5_rfreal*(ql* rvl + pl*ny + qr* rvr + pr*ny)*nm
605 flx(4) = 0.5_rfreal*(ql* rwl + pl*nz + qr* rwr + pr*nz)*nm
606 flx(5) = 0.5_rfreal*(ql*(rel + pl) + pl*fs + qr*(rer + pr) + pr*fs)*nm
608 mfmixt(indmf*ifl) = flx(1)
610 ppatch%cp(ifl) = icpref*(0.5_rfreal*(pl + pr) - pref)
611 ppatch%cmass(ifl) = icmassref*flx(1)/nm
612 ppatch%cmom(xcoord,ifl) = icpref*0.5_rfreal*(ul+ur)*flx(1)/nm
613 ppatch%cmom(ycoord,ifl) = icpref*0.5_rfreal*(vl+vr)*flx(1)/nm
614 ppatch%cmom(zcoord,ifl) = icpref*0.5_rfreal*(wl+wr)*flx(1)/nm
616 rhs(cv_mixt_dens,c1) =
rhs(cv_mixt_dens,c1) + flx(1)
617 rhs(cv_mixt_xmom,c1) =
rhs(cv_mixt_xmom,c1) + flx(2)
618 rhs(cv_mixt_ymom,c1) =
rhs(cv_mixt_ymom,c1) + flx(3)
619 rhs(cv_mixt_zmom,c1) =
rhs(cv_mixt_zmom,c1) + flx(4)
620 rhs(cv_mixt_ener,c1) =
rhs(cv_mixt_ener,c1) + flx(5)
622 sd(sd_xmom,c1*indsd) = sd(sd_xmom,c1*indsd) + 0.5_rfreal*(rul/rl + rur/rr)*flx(1)
623 sd(sd_ymom,c1*indsd) = sd(sd_ymom,c1*indsd) + 0.5_rfreal*(rvl/rl + rvr/rr)*flx(1)
624 sd(sd_zmom,c1*indsd) = sd(sd_zmom,c1*indsd) + 0.5_rfreal*(rwl/rl + rwr/rr)*flx(1)
627 IF ( pregion%irkStep == 1 )
THEN
628 global%massIn = global%massIn -
min(flx(1),0.0_rfreal)
629 global%massOut = global%massOut +
max(flx(1),0.0_rfreal)
632 IF ( (global%checkLevel == check_high) .AND. &
633 (global%verbLevel >= verbose_high) .AND. &
634 (global%myProcid == masterproc) .AND. &
635 (decideprintflag .EQV. .true.) )
THEN
636 IF ( flx(1) < 0.0_rfreal )
THEN
639 IF ( nlocs == 1 )
THEN
640 global%warnCounter = global%warnCounter + 1
642 WRITE(stdout,
'(A,1X,A,1X,I9)') solver_name, &
643 '*** WARNING *** Inflow detected at outflow boundary!'
644 WRITE(stdout,
'(A,3X,A,1X,I5.5)') solver_name,
'Global region:', &
645 pregion%iRegionGlobal
646 IF ( global%flowType == flow_unsteady )
THEN
647 WRITE(stdout,
'(A,3X,A,1X,1PE11.5)') solver_name, &
651 WRITE(stdout,
'(A,3X,A,1X,I6.6)') solver_name, &
652 'Current iteration number:', &
656 WRITE(stdout,
'(A,3X,A,1X,I1)') solver_name, &
657 'Runge-Kutta stage:', &
661 IF ( nlocs <= max_inoutflow_locs )
THEN
662 loc(nlocs,min_val:max_val) = c1
672 IF ( (global%checkLevel == check_high) .AND. &
673 (global%verbLevel >= verbose_high) .AND. &
674 (global%myProcid == masterproc) .AND. &
675 (decideprintflag .EQV. .true.) .AND. &
677 IF ( nlocs > max_inoutflow_locs )
THEN
678 WRITE(stdout,
'(A,3X,A,1X,I3,1X,A,1X,I9,1X,A)') solver_name, &
679 'Only wrote the first',max_inoutflow_locs,
'of',nlocs, &
680 'outflow faces with inflow.'
682 locinfo_mode_silent,output_mode_anybody)
685 locinfo_mode_silent,output_mode_anybody)
694 DO ifl = 1,ppatch%nBFaces
695 c1 = ppatch%bf2c(ifl)
697 nx = ppatch%fn(xcoord,ifl)
698 ny = ppatch%fn(ycoord,ifl)
699 nz = ppatch%fn(zcoord,ifl)
700 nm = ppatch%fn(xyzmag,ifl)
702 xc = ppatch%fc(xcoord,ifl)
703 yc = ppatch%fc(ycoord,ifl)
704 zc = ppatch%fc(zcoord,ifl)
706 fs = ppatch%gs(indgs*ifl)
709 rl = cv(cv_mixt_dens,c1)
712 ul = cv(cv_mixt_xmom,c1)*irl
713 vl = cv(cv_mixt_ymom,c1)*irl
714 wl = cv(cv_mixt_zmom,c1)*irl
715 pl = dv(dv_mixt_pres,c1)
717 dx = xc - pregion%grid%cofg(xcoord,c1)
718 dy = yc - pregion%grid%cofg(ycoord,c1)
719 dz = zc - pregion%grid%cofg(zcoord,c1)
721 rl = rl + grad(xcoord,grc_mixt_dens,c1)*
dx &
722 + grad(ycoord,grc_mixt_dens,c1)*
dy &
723 + grad(zcoord,grc_mixt_dens,c1)*
dz
724 ul = ul + grad(xcoord,grc_mixt_xvel,c1)*
dx &
725 + grad(ycoord,grc_mixt_xvel,c1)*
dy &
726 + grad(zcoord,grc_mixt_xvel,c1)*
dz
727 vl = vl + grad(xcoord,grc_mixt_yvel,c1)*
dx &
728 + grad(ycoord,grc_mixt_yvel,c1)*
dy &
729 + grad(zcoord,grc_mixt_yvel,c1)*
dz
730 wl = wl + grad(xcoord,grc_mixt_zvel,c1)*
dx &
731 + grad(ycoord,grc_mixt_zvel,c1)*
dy &
732 + grad(zcoord,grc_mixt_zvel,c1)*
dz
733 pl = pl + grad(xcoord,grc_mixt_pres,c1)*
dx &
734 + grad(ycoord,grc_mixt_pres,c1)*
dy &
735 + grad(zcoord,grc_mixt_pres,c1)*
dz
741 SELECT CASE ( pregion%mixtInput%gasModel )
742 CASE ( gas_model_tcperf, &
743 gas_model_mixt_tcperf, &
744 gas_model_mixt_pseudo )
745 cp = gv(gv_mixt_cp ,indcp *c1)
746 mm = gv(gv_mixt_mol,indmol*c1)
751 CALL
errorstop(global,err_reached_default,__line__)
759 mfmixt(indmf*ifl) = 0.0_rfreal
761 ppatch%cp(ifl) = icpref*(pl - pref)
762 ppatch%cmass(ifl) = 0.0_rfreal
763 ppatch%cmom(xcoord,ifl) = 0.0_rfreal
764 ppatch%cmom(ycoord,ifl) = 0.0_rfreal
765 ppatch%cmom(zcoord,ifl) = 0.0_rfreal
767 rhs(cv_mixt_xmom,c1) =
rhs(cv_mixt_xmom,c1) + flx(2)
768 rhs(cv_mixt_ymom,c1) =
rhs(cv_mixt_ymom,c1) + flx(3)
769 rhs(cv_mixt_zmom,c1) =
rhs(cv_mixt_zmom,c1) + flx(4)
770 rhs(cv_mixt_ener,c1) =
rhs(cv_mixt_ener,c1) + flx(5)
778 CASE ( bc_noslipwall_hflux,bc_noslipwall_temp )
780 DO ifl = 1,ppatch%nBFaces
781 c1 = ppatch%bf2c(ifl)
783 nx = ppatch%fn(xcoord,ifl)
784 ny = ppatch%fn(ycoord,ifl)
785 nz = ppatch%fn(zcoord,ifl)
786 nm = ppatch%fn(xyzmag,ifl)
788 xc = ppatch%fc(xcoord,ifl)
789 yc = ppatch%fc(ycoord,ifl)
790 zc = ppatch%fc(zcoord,ifl)
792 fs = ppatch%gs(indgs*ifl)
794 pl = dv(dv_mixt_pres,c1)
796 dx = xc - pregion%grid%cofg(xcoord,c1)
797 dy = yc - pregion%grid%cofg(ycoord,c1)
798 dz = zc - pregion%grid%cofg(zcoord,c1)
800 pl = pl + grad(xcoord,grc_mixt_pres,c1)*
dx &
801 + grad(ycoord,grc_mixt_pres,c1)*
dy &
802 + grad(zcoord,grc_mixt_pres,c1)*
dz
809 mfmixt(indmf*ifl) = 0.0_rfreal
811 ppatch%cp(ifl) = icpref*(pl - pref)
812 ppatch%cmass(ifl) = 0.0_rfreal
813 ppatch%cmom(xcoord,ifl) = 0.0_rfreal
814 ppatch%cmom(ycoord,ifl) = 0.0_rfreal
815 ppatch%cmom(zcoord,ifl) = 0.0_rfreal
817 rhs(cv_mixt_xmom,c1) =
rhs(cv_mixt_xmom,c1) + flx(2)
818 rhs(cv_mixt_ymom,c1) =
rhs(cv_mixt_ymom,c1) + flx(3)
819 rhs(cv_mixt_zmom,c1) =
rhs(cv_mixt_zmom,c1) + flx(4)
820 rhs(cv_mixt_ener,c1) =
rhs(cv_mixt_ener,c1) + flx(5)
828 corr = ppatch%mixt%switches(bcswi_farf_corr)
830 vals => ppatch%mixt%vals
832 IF ( corr == bcopt_corr_yes )
THEN
836 aoa = vals(bcdat_farf_attack,0)
838 cx = pregion%forceCoeffsGlobal(xcoord,comp_pres,2)
839 cy = pregion%forceCoeffsGlobal(ycoord,comp_pres,2)
841 liftcoef = cy*
cos(aoa) - cx*
sin(aoa)
845 liftcoef = 0.0_rfreal
848 DO ifl = 1,ppatch%nBFaces
849 c1 = ppatch%bf2c(ifl)
851 nx = ppatch%fn(xcoord,ifl)
852 ny = ppatch%fn(ycoord,ifl)
853 nz = ppatch%fn(zcoord,ifl)
854 nm = ppatch%fn(xyzmag,ifl)
856 xc = ppatch%fc(xcoord,ifl)
857 yc = ppatch%fc(ycoord,ifl)
858 zc = ppatch%fc(zcoord,ifl)
860 fs = ppatch%gs(indgs*ifl)
862 rl = cv(cv_mixt_dens,c1)
865 ul = cv(cv_mixt_xmom,c1)*irl
866 vl = cv(cv_mixt_ymom,c1)*irl
867 wl = cv(cv_mixt_zmom,c1)*irl
868 pl = dv(dv_mixt_pres,c1)
870 dx = xc - pregion%grid%cofg(xcoord,c1)
871 dy = yc - pregion%grid%cofg(ycoord,c1)
872 dz = zc - pregion%grid%cofg(zcoord,c1)
874 rl = rl + grad(xcoord,grc_mixt_dens,c1)*
dx &
875 + grad(ycoord,grc_mixt_dens,c1)*
dy &
876 + grad(zcoord,grc_mixt_dens,c1)*
dz
877 ul = ul + grad(xcoord,grc_mixt_xvel,c1)*
dx &
878 + grad(ycoord,grc_mixt_xvel,c1)*
dy &
879 + grad(zcoord,grc_mixt_xvel,c1)*
dz
880 vl = vl + grad(xcoord,grc_mixt_yvel,c1)*
dx &
881 + grad(ycoord,grc_mixt_yvel,c1)*
dy &
882 + grad(zcoord,grc_mixt_yvel,c1)*
dz
883 wl = wl + grad(xcoord,grc_mixt_zvel,c1)*
dx &
884 + grad(ycoord,grc_mixt_zvel,c1)*
dy &
885 + grad(zcoord,grc_mixt_zvel,c1)*
dz
886 pl = pl + grad(xcoord,grc_mixt_pres,c1)*
dx &
887 + grad(ycoord,grc_mixt_pres,c1)*
dy &
888 + grad(zcoord,grc_mixt_pres,c1)*
dz
894 mf = vals(bcdat_farf_mach ,distrib*ifl)
895 aoa = vals(bcdat_farf_attack,distrib*ifl)
896 aos = vals(bcdat_farf_slip ,distrib*ifl)
897 pf = vals(bcdat_farf_press ,distrib*ifl)
898 tf = vals(bcdat_farf_temp ,distrib*ifl)
900 IF ( gasmodel == gas_model_tcperf )
THEN
901 cp = gv(gv_mixt_cp ,indcp *c1)
902 mm = gv(gv_mixt_mol,indmol*c1)
909 aoa,aos,corrflag,liftcoef,xc,yc, &
910 zc,rl,rul,rvl,rwl,rel,rr,rur, &
913 CALL
errorstop(global,err_reached_default,__line__)
916 ql = (rul*nx + rvl*ny + rwl*nz)/rl - fs
917 qr = (rur*nx + rvr*ny + rwr*nz)/rr - fs
926 flx(1) = 0.5_rfreal*(ql* rl + qr* rr )*nm
927 flx(2) = 0.5_rfreal*(ql* rul + pl*nx + qr* rur + pr*nx)*nm
928 flx(3) = 0.5_rfreal*(ql* rvl + pl*ny + qr* rvr + pr*ny)*nm
929 flx(4) = 0.5_rfreal*(ql* rwl + pl*nz + qr* rwr + pr*nz)*nm
930 flx(5) = 0.5_rfreal*(ql*(rel + pl) + pl*fs + qr*(rer + pr) + pr*fs)*nm
932 mfmixt(indmf*ifl) = flx(1)
934 ppatch%cp(ifl) = icpref*(0.5_rfreal*(pl + pr) - pref)
935 ppatch%cmass(ifl) = icmassref*flx(1)/nm
936 ppatch%cmom(xcoord,ifl) = icpref*0.5_rfreal*(ul+ur)*flx(1)/nm
937 ppatch%cmom(ycoord,ifl) = icpref*0.5_rfreal*(vl+vr)*flx(1)/nm
938 ppatch%cmom(zcoord,ifl) = icpref*0.5_rfreal*(wl+wr)*flx(1)/nm
940 rhs(cv_mixt_dens,c1) =
rhs(cv_mixt_dens,c1) + flx(1)
941 rhs(cv_mixt_xmom,c1) =
rhs(cv_mixt_xmom,c1) + flx(2)
942 rhs(cv_mixt_ymom,c1) =
rhs(cv_mixt_ymom,c1) + flx(3)
943 rhs(cv_mixt_zmom,c1) =
rhs(cv_mixt_zmom,c1) + flx(4)
944 rhs(cv_mixt_ener,c1) =
rhs(cv_mixt_ener,c1) + flx(5)
946 sd(sd_xmom,c1*indsd) = sd(sd_xmom,c1*indsd) + 0.5_rfreal*(rul/rl + rur/rr)*flx(1)
947 sd(sd_ymom,c1*indsd) = sd(sd_ymom,c1*indsd) + 0.5_rfreal*(rvl/rl + rvr/rr)*flx(1)
948 sd(sd_zmom,c1*indsd) = sd(sd_zmom,c1*indsd) + 0.5_rfreal*(rwl/rl + rwr/rr)*flx(1)
950 IF ( pregion%irkStep == 1 )
THEN
951 global%massIn = global%massIn -
min(flx(1),0.0_rfreal)
952 global%massOut = global%massOut +
max(flx(1),0.0_rfreal)
960 CASE ( bc_injection )
961 vals => ppatch%mixt%vals
963 DO ifl = 1,ppatch%nBFaces
964 c1 = ppatch%bf2c(ifl)
966 nx = ppatch%fn(xcoord,ifl)
967 ny = ppatch%fn(ycoord,ifl)
968 nz = ppatch%fn(zcoord,ifl)
969 nm = ppatch%fn(xyzmag,ifl)
971 xc = ppatch%fc(xcoord,ifl)
972 yc = ppatch%fc(ycoord,ifl)
973 zc = ppatch%fc(zcoord,ifl)
975 fs = ppatch%gs(indgs*ifl)
978 rl = cv(cv_mixt_dens,c1)
981 ul = cv(cv_mixt_xmom,c1)*irl
982 vl = cv(cv_mixt_ymom,c1)*irl
983 wl = cv(cv_mixt_zmom,c1)*irl
984 pl = dv(dv_mixt_pres,c1)
986 dx = xc - pregion%grid%cofg(xcoord,c1)
987 dy = yc - pregion%grid%cofg(ycoord,c1)
988 dz = zc - pregion%grid%cofg(zcoord,c1)
990 rl = rl + grad(xcoord,grc_mixt_dens,c1)*
dx &
991 + grad(ycoord,grc_mixt_dens,c1)*
dy &
992 + grad(zcoord,grc_mixt_dens,c1)*
dz
993 ul = ul + grad(xcoord,grc_mixt_xvel,c1)*
dx &
994 + grad(ycoord,grc_mixt_xvel,c1)*
dy &
995 + grad(zcoord,grc_mixt_xvel,c1)*
dz
996 vl = vl + grad(xcoord,grc_mixt_yvel,c1)*
dx &
997 + grad(ycoord,grc_mixt_yvel,c1)*
dy &
998 + grad(zcoord,grc_mixt_yvel,c1)*
dz
999 wl = wl + grad(xcoord,grc_mixt_zvel,c1)*
dx &
1000 + grad(ycoord,grc_mixt_zvel,c1)*
dy &
1001 + grad(zcoord,grc_mixt_zvel,c1)*
dz
1002 pl = pl + grad(xcoord,grc_mixt_pres,c1)*
dx &
1003 + grad(ycoord,grc_mixt_pres,c1)*
dy &
1004 + grad(zcoord,grc_mixt_pres,c1)*
dz
1010 IF ( gasmodel == gas_model_tcperf )
THEN
1011 cp = gv(gv_mixt_cp ,indcp *c1)
1012 mm = gv(gv_mixt_mol,indmol*c1)
1014 minj = vals(bcdat_inject_mfrate,distrib*ifl)
1016 IF ( minj > 0.0_rfreal )
THEN
1017 tinj = vals(bcdat_inject_temp,distrib*ifl)
1023 flx(2) = (-minj*ul + pl*nx)*nm
1024 flx(3) = (-minj*vl + pl*ny)*nm
1025 flx(4) = (-minj*wl + pl*nz)*nm
1026 flx(5) = (-minj*hl + pl*fs)*nm
1042 CALL
errorstop(global,err_reached_default,__line__)
1045 mfmixt(indmf*ifl) = flx(1)
1047 ppatch%cp(ifl) = icpref*(pl - pref)
1048 ppatch%cmass(ifl) = icmassref*flx(1)/nm
1049 ppatch%cmom(xcoord,ifl) = icpref*0.5_rfreal*(ul+ur)*flx(1)/nm
1050 ppatch%cmom(ycoord,ifl) = icpref*0.5_rfreal*(vl+vr)*flx(1)/nm
1051 ppatch%cmom(zcoord,ifl) = icpref*0.5_rfreal*(wl+wr)*flx(1)/nm
1053 rhs(cv_mixt_dens,c1) =
rhs(cv_mixt_dens,c1) + flx(1)
1054 rhs(cv_mixt_xmom,c1) =
rhs(cv_mixt_xmom,c1) + flx(2)
1055 rhs(cv_mixt_ymom,c1) =
rhs(cv_mixt_ymom,c1) + flx(3)
1056 rhs(cv_mixt_zmom,c1) =
rhs(cv_mixt_zmom,c1) + flx(4)
1057 rhs(cv_mixt_ener,c1) =
rhs(cv_mixt_ener,c1) + flx(5)
1059 sd(sd_xmom,c1*indsd) = sd(sd_xmom,c1*indsd) + ul*flx(1)
1060 sd(sd_ymom,c1*indsd) = sd(sd_ymom,c1*indsd) + vl*flx(1)
1061 sd(sd_zmom,c1*indsd) = sd(sd_zmom,c1*indsd) + wl*flx(1)
1063 IF ( pregion%irkStep == 1 )
THEN
1064 global%massIn = global%massIn -
min(flx(1),0.0_rfreal)
1065 global%massOut = global%massOut +
max(flx(1),0.0_rfreal)
1073 CASE ( bc_periodic, &
1082 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)
subroutine rflu_centralsecondpatch(pRegion, pPatch)
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 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)