86 CHARACTER(CHRLEN),
PRIVATE :: &
87 RCSIdentString =
'$RCSfile: RFLU_ModNSCBC.F90,v $ $Revision: 1.7 $'
160 TYPE(t_patch),
POINTER :: ppatch
161 TYPE(t_region
),
POINTER :: pregion
167 LOGICAL :: decideprintflag
168 CHARACTER(CHRLEN) :: rcsidentstring
169 INTEGER,
PARAMETER :: max_inoutflow_locs = 10
170 INTEGER :: c1,ifl,indgs,nlocs,loc(max_inoutflow_locs,min_val:max_val)
171 REAL(RFREAL) :: ah,cpgas,de,dissfact,dp,dq,dr,du,dv1,dv2,dv5,dw,efc,epsentr, &
172 fs,ggas,hh,hl,hr,icmassref,icpref,irl,irr,l1,l2,l5,nm,nx,ny, &
173 nz,pl,pr,pref,qh,ql,qr,rgas,rh,rl,rr,rref,sh,tl,tr,t1,t2,t3, &
174 t5,uh,ul,ur,vh,vl,vr,vref,wh,wl,wr,wt,xc,yc,zc
175 REAL(RFREAL) :: flxconv(5),flxdiss(5),flx(5)
176 REAL(RFREAL),
DIMENSION(:),
POINTER :: mfmixt
177 REAL(RFREAL),
DIMENSION(:,:),
POINTER :: cv,dv,gv,
rhs,vals,sd
184 global => pregion%global
193 indgs = pregion%grid%indGs
194 epsentr = pregion%mixtInput%epsentr
195 dissfact = pregion%mixtInput%dissFact
197 cv => pregion%mixt%cv
198 dv => pregion%mixt%dv
199 gv => pregion%mixt%gv
200 rhs => pregion%mixt%rhs
201 sd => pregion%mixt%sd
207 pref = global%refPressure
208 rref = global%refDensity
209 vref = global%refVelocity
211 icpref = 2.0_rfreal/(rref*vref*vref)
212 icmassref = 1.0_rfreal/(rref*vref)
219 ggas = global%refGamma
226 DO ifl = 1,ppatch%nBFaces
227 c1 = ppatch%bf2c(ifl)
229 nx = ppatch%fn(xcoord,ifl)
230 ny = ppatch%fn(ycoord,ifl)
231 nz = ppatch%fn(zcoord,ifl)
232 nm = ppatch%fn(xyzmag,ifl)
234 xc = ppatch%fc(xcoord,ifl)
235 yc = ppatch%fc(ycoord,ifl)
236 zc = ppatch%fc(zcoord,ifl)
238 fs = ppatch%gs(indgs*ifl)
248 rl = cv(cv_mixt_dens,c1)
251 ul = cv(cv_mixt_xmom,c1)*irl
252 vl = cv(cv_mixt_ymom,c1)*irl
253 wl = cv(cv_mixt_zmom,c1)*irl
254 pl = dv(dv_mixt_pres,c1)
259 ql = ul*nx + vl*ny + wl*nz - fs
265 rr = ppatch%mixt%cv(cv_mixt_dens,ifl)
268 ur = ppatch%mixt%cv(cv_mixt_xmom,ifl)*irr
269 vr = ppatch%mixt%cv(cv_mixt_ymom,ifl)*irr
270 wr = ppatch%mixt%cv(cv_mixt_zmom,ifl)*irr
271 pr = ppatch%mixt%dv(dv_mixt_pres,ifl)
276 qr = ur*nx + vr*ny + wr*nz - fs
285 uh = wt*ul + (1.0_rfreal-wt)*ur
286 vh = wt*vl + (1.0_rfreal-wt)*vr
287 wh = wt*wl + (1.0_rfreal-wt)*wr
288 hh = wt*hl + (1.0_rfreal-wt)*hr
290 qh = uh*nx + vh*ny + wh*nz - fs
291 sh = 0.5_rfreal*(uh*uh + vh*vh + wh*wh)
321 dq = du*nx + de*ny + dw*nz
323 dv1 = (dp - rh*ah*dq)/(2.0_rfreal*ah*ah)
324 dv5 = (dp + rh*ah*dq)/(2.0_rfreal*ah*ah)
325 dv2 = dr - dp/(ah*ah)
340 flxconv(1) = 0.5_rfreal*(ql*rl + qr*rr )*nm
341 flxconv(2) = 0.5_rfreal*(ql*rl*ul + pl*nx + qr*rr*ur + pr*nx)*nm
342 flxconv(3) = 0.5_rfreal*(ql*rl*vl + pl*ny + qr*rr*vr + pr*ny)*nm
343 flxconv(4) = 0.5_rfreal*(ql*rl*wl + pl*nz + qr*rr*wr + pr*nz)*nm
344 flxconv(5) = 0.5_rfreal*(ql*rl*hl + pl*fs + qr*rr*hr + pr*fs)*nm
350 flxdiss(1) = 0.5_rfreal*dissfact*(t1 + t2 + t5 )*nm
351 flxdiss(2) = 0.5_rfreal*dissfact*(t1*(uh-nx*ah) + t2*uh + t3*(du-nx*dq) + t5*(uh+nx*ah))*nm
352 flxdiss(3) = 0.5_rfreal*dissfact*(t1*(vh-ny*ah) + t2*vh + t3*(de-ny*dq) + t5*(vh+ny*ah))*nm
353 flxdiss(4) = 0.5_rfreal*dissfact*(t1*(wh-nz*ah) + t2*wh + t3*(dw-nz*dq) + t5*(wh+nz*ah))*nm
354 flxdiss(5) = 0.5_rfreal*dissfact*(t1*(hh-qh*ah) + t2*sh + t3*(uh*du+vh*de+wh*dw-qh*dq) + t5*(hh+qh*ah))*nm
360 rhs(cv_mixt_dens,c1) =
rhs(cv_mixt_dens,c1) + (flxconv(1) - flxdiss(1))
361 rhs(cv_mixt_xmom,c1) =
rhs(cv_mixt_xmom,c1) + (flxconv(2) - flxdiss(2))
362 rhs(cv_mixt_ymom,c1) =
rhs(cv_mixt_ymom,c1) + (flxconv(3) - flxdiss(3))
363 rhs(cv_mixt_zmom,c1) =
rhs(cv_mixt_zmom,c1) + (flxconv(4) - flxdiss(4))
364 rhs(cv_mixt_ener,c1) =
rhs(cv_mixt_ener,c1) + (flxconv(5) - flxdiss(5))
366 flx(1) = flxconv(1) - flxdiss(1)
367 flx(2) = flxconv(2) - flxdiss(2)
368 flx(3) = flxconv(3) - flxdiss(3)
369 flx(4) = flxconv(4) - flxdiss(4)
370 flx(5) = flxconv(5) - flxdiss(5)
372 ppatch%cp(ifl) = icpref*(0.5_rfreal*(pl + pr) - pref)
373 ppatch%cmass(ifl) = icmassref*flx(1)/nm
374 ppatch%cmom(xcoord,ifl) = icpref*0.5_rfreal*(ul+ur)*flx(1)/nm
375 ppatch%cmom(ycoord,ifl) = icpref*0.5_rfreal*(vl+vr)*flx(1)/nm
376 ppatch%cmom(zcoord,ifl) = icpref*0.5_rfreal*(wl+wr)*flx(1)/nm
378 IF ( pregion%irkStep == 1 )
THEN
379 global%massIn = global%massIn -
min(flx(1),0.0_rfreal)
380 global%massOut = global%massOut +
max(flx(1),0.0_rfreal)
383 IF ( (global%checkLevel == check_high) .AND. &
384 (global%verbLevel >= verbose_high) .AND. &
385 (global%myProcid == masterproc) .AND. &
386 (decideprintflag .EQV. .true.) )
THEN
387 IF ( ppatch%bcType == bc_outflow )
THEN
388 IF ( flx(1) < 0.0_rfreal )
THEN
391 IF ( nlocs == 1 )
THEN
392 global%warnCounter = global%warnCounter + 1
394 WRITE(stdout,
'(A,1X,A,1X,I9)') solver_name, &
395 '*** WARNING *** Inflow detected at outflow boundary!'
396 WRITE(stdout,
'(A,3X,A,1X,I5.5)') solver_name,
'Global region:', &
397 pregion%iRegionGlobal
398 IF ( global%flowType == flow_unsteady )
THEN
399 WRITE(stdout,
'(A,3X,A,1X,1PE11.5)') solver_name, &
403 WRITE(stdout,
'(A,3X,A,1X,I6.6)') solver_name, &
404 'Current iteration number:', &
408 WRITE(stdout,
'(A,3X,A,1X,I1)') solver_name, &
409 'Runge-Kutta stage:', &
413 IF ( nlocs <= max_inoutflow_locs )
THEN
414 loc(nlocs,min_val:max_val) = c1
425 IF ( (global%checkLevel == check_high) .AND. &
426 (global%verbLevel >= verbose_high) .AND. &
427 (global%myProcid == masterproc) .AND. &
428 (decideprintflag .EQV. .true.) .AND. &
430 IF ( ppatch%bcType == bc_outflow )
THEN
431 IF ( nlocs > max_inoutflow_locs )
THEN
432 WRITE(stdout,
'(A,3X,A,1X,I3,1X,A,1X,I9,1X,A)') solver_name, &
433 'Only wrote the first',max_inoutflow_locs,
'of',nlocs, &
434 'outflow faces with inflow.'
436 locinfo_mode_silent,output_mode_anybody)
439 locinfo_mode_silent,output_mode_anybody)
490 TYPE(t_patch),
POINTER :: ppatch
491 TYPE(t_region
),
POINTER :: pregion
497 LOGICAL :: decideprintflag
498 CHARACTER(CHRLEN) :: rcsidentstring
499 INTEGER,
PARAMETER :: max_inoutflow_locs = 10
500 INTEGER :: c1,ifl,indgs,nlocs,loc(max_inoutflow_locs,min_val:max_val)
501 REAL(RFREAL) :: ah,cpgas,de,dissfact,dp,dq,dr,du,dv1,dv2,dv5,dw,efc,epsentr, &
502 fs,ggas,hh,hl,hr,icmassref,icpref,irl,irr,l1,l2,l5,nm,nx,ny, &
503 nz,pl,pr,pref,qh,ql,qr,rgas,rh,rl,rr,rref,sh,tl,tr,t1,t2,t3, &
504 t5,uh,ul,ur,vh,vl,vr,vref,wh,wl,wr,wt,xc,yc,zc
505 REAL(RFREAL) :: flxconv(5),flxdiss(5),flx(5)
506 REAL(RFREAL),
DIMENSION(:),
POINTER :: mfmixt
507 REAL(RFREAL),
DIMENSION(:,:),
POINTER :: cv,dv,gv,
rhs,vals,sd
514 global => pregion%global
523 indgs = pregion%grid%indGs
524 epsentr = pregion%mixtInput%epsentr
525 dissfact = pregion%mixtInput%dissFact
527 cv => pregion%mixt%cv
528 dv => pregion%mixt%dv
529 gv => pregion%mixt%gv
530 rhs => pregion%mixt%rhs
531 sd => pregion%mixt%sd
537 pref = global%refPressure
538 rref = global%refDensity
539 vref = global%refVelocity
541 icpref = 2.0_rfreal/(rref*vref*vref)
542 icmassref = 1.0_rfreal/(rref*vref)
549 ggas = global%refGamma
556 DO ifl = 1,ppatch%nBFaces
557 c1 = ppatch%bf2c(ifl)
559 nx = ppatch%fn(xcoord,ifl)
560 ny = ppatch%fn(ycoord,ifl)
561 nz = ppatch%fn(zcoord,ifl)
562 nm = ppatch%fn(xyzmag,ifl)
564 xc = ppatch%fc(xcoord,ifl)
565 yc = ppatch%fc(ycoord,ifl)
566 zc = ppatch%fc(zcoord,ifl)
568 fs = ppatch%gs(indgs*ifl)
578 rr = ppatch%mixt%cv(cv_mixt_dens,ifl)
581 ur = ppatch%mixt%cv(cv_mixt_xmom,ifl)*irr
582 vr = ppatch%mixt%cv(cv_mixt_ymom,ifl)*irr
583 wr = ppatch%mixt%cv(cv_mixt_zmom,ifl)*irr
584 pr = ppatch%mixt%dv(dv_mixt_pres,ifl)
589 qr = ur*nx + vr*ny + wr*nz - fs
614 uh = wt*ul + (1.0_rfreal-wt)*ur
615 vh = wt*vl + (1.0_rfreal-wt)*vr
616 wh = wt*wl + (1.0_rfreal-wt)*wr
617 hh = wt*hl + (1.0_rfreal-wt)*hr
619 qh = uh*nx + vh*ny + wh*nz - fs
620 sh = 0.5_rfreal*(uh*uh + vh*vh + wh*wh)
650 dq = du*nx + de*ny + dw*nz
652 dv1 = (dp - rh*ah*dq)/(2.0_rfreal*ah*ah)
653 dv5 = (dp + rh*ah*dq)/(2.0_rfreal*ah*ah)
654 dv2 = dr - dp/(ah*ah)
669 flxconv(1) = 0.5_rfreal*(ql*rl + qr*rr )*nm
670 flxconv(2) = 0.5_rfreal*(ql*rl*ul + pl*nx + qr*rr*ur + pr*nx)*nm
671 flxconv(3) = 0.5_rfreal*(ql*rl*vl + pl*ny + qr*rr*vr + pr*ny)*nm
672 flxconv(4) = 0.5_rfreal*(ql*rl*wl + pl*nz + qr*rr*wr + pr*nz)*nm
673 flxconv(5) = 0.5_rfreal*(ql*rl*hl + pl*fs + qr*rr*hr + pr*fs)*nm
679 flxdiss(1) = 0.5_rfreal*dissfact*(t1 + t2 + t5 )*nm
680 flxdiss(2) = 0.5_rfreal*dissfact*(t1*(uh-nx*ah) + t2*uh + t3*(du-nx*dq) + t5*(uh+nx*ah))*nm
681 flxdiss(3) = 0.5_rfreal*dissfact*(t1*(vh-ny*ah) + t2*vh + t3*(de-ny*dq) + t5*(vh+ny*ah))*nm
682 flxdiss(4) = 0.5_rfreal*dissfact*(t1*(wh-nz*ah) + t2*wh + t3*(dw-nz*dq) + t5*(wh+nz*ah))*nm
683 flxdiss(5) = 0.5_rfreal*dissfact*(t1*(hh-qh*ah) + t2*sh + t3*(uh*du+vh*de+wh*dw-qh*dq) + t5*(hh+qh*ah))*nm
689 rhs(cv_mixt_dens,c1) =
rhs(cv_mixt_dens,c1) + (flxconv(1) - flxdiss(1))
690 rhs(cv_mixt_xmom,c1) =
rhs(cv_mixt_xmom,c1) + (flxconv(2) - flxdiss(2))
691 rhs(cv_mixt_ymom,c1) =
rhs(cv_mixt_ymom,c1) + (flxconv(3) - flxdiss(3))
692 rhs(cv_mixt_zmom,c1) =
rhs(cv_mixt_zmom,c1) + (flxconv(4) - flxdiss(4))
693 rhs(cv_mixt_ener,c1) =
rhs(cv_mixt_ener,c1) + (flxconv(5) - flxdiss(5))
695 flx(1) = flxconv(1) - flxdiss(1)
696 flx(2) = flxconv(2) - flxdiss(2)
697 flx(3) = flxconv(3) - flxdiss(3)
698 flx(4) = flxconv(4) - flxdiss(4)
699 flx(5) = flxconv(5) - flxdiss(5)
701 ppatch%cp(ifl) = icpref*(0.5_rfreal*(pl + pr) - pref)
702 ppatch%cmass(ifl) = icmassref*flx(1)/nm
703 ppatch%cmom(xcoord,ifl) = icpref*0.5_rfreal*(ul+ur)*flx(1)/nm
704 ppatch%cmom(ycoord,ifl) = icpref*0.5_rfreal*(vl+vr)*flx(1)/nm
705 ppatch%cmom(zcoord,ifl) = icpref*0.5_rfreal*(wl+wr)*flx(1)/nm
707 IF ( pregion%irkStep == 1 )
THEN
708 global%massIn = global%massIn -
min(flx(1),0.0_rfreal)
709 global%massOut = global%massOut +
max(flx(1),0.0_rfreal)
712 IF ( (global%checkLevel == check_high) .AND. &
713 (global%verbLevel >= verbose_high) .AND. &
714 (global%myProcid == masterproc) .AND. &
715 (decideprintflag .EQV. .true.) )
THEN
716 IF ( ppatch%bcType == bc_outflow )
THEN
717 IF ( flx(1) < 0.0_rfreal )
THEN
720 IF ( nlocs == 1 )
THEN
721 global%warnCounter = global%warnCounter + 1
723 WRITE(stdout,
'(A,1X,A,1X,I9)') solver_name, &
724 '*** WARNING *** Inflow detected at outflow boundary!'
725 WRITE(stdout,
'(A,3X,A,1X,I5.5)') solver_name,
'Global region:', &
726 pregion%iRegionGlobal
728 IF ( global%flowType == flow_unsteady )
THEN
729 WRITE(stdout,
'(A,3X,A,1X,1PE11.5)') solver_name, &
733 WRITE(stdout,
'(A,3X,A,1X,I6.6)') solver_name, &
734 'Current iteration number:', &
738 WRITE(stdout,
'(A,3X,A,1X,I1)') solver_name, &
739 'Runge-Kutta stage:', &
743 IF ( nlocs <= max_inoutflow_locs )
THEN
744 loc(nlocs,min_val:max_val) = c1
755 IF ( (global%checkLevel == check_high) .AND. &
756 (global%verbLevel >= verbose_high) .AND. &
757 (global%myProcid == masterproc) .AND. &
758 (decideprintflag .EQV. .true.) .AND. &
760 IF ( ppatch%bcType == bc_outflow )
THEN
761 IF ( nlocs > max_inoutflow_locs )
THEN
762 WRITE(stdout,
'(A,3X,A,1X,I3,1X,A,1X,I9,1X,A)') solver_name, &
763 'Only wrote the first',max_inoutflow_locs,
'of',nlocs, &
764 'outflow faces with inflow.'
766 locinfo_mode_silent,output_mode_anybody)
769 locinfo_mode_silent,output_mode_anybody)
817 TYPE(t_patch),
POINTER :: ppatch
818 TYPE(t_region
),
POINTER :: pregion
824 LOGICAL :: decideprintflag
825 CHARACTER(CHRLEN) :: rcsidentstring
826 INTEGER,
PARAMETER :: max_inoutflow_locs = 10
827 INTEGER :: c1,ifl,indgs,nlocs,loc(max_inoutflow_locs,min_val:max_val)
828 REAL(RFREAL) :: ah,cpgas,de,dissfact,dp,dq,dr,
dx,
dy,
dz,du,dv1,dv2,dv5,dw,efc, &
829 epsentr,fs,ggas,hh,hl,hr,icmassref,icpref,irl,irr,l1,l2,l5, &
830 nm,nx,ny,nz,pl,pr,pref,qh,ql,qr,rgas,rh,rl,rr,rref,sh,tl,tr, &
831 t1,t2,t3,t5,uh,ul,ur,vh,vl,vr,vref,wh,wl,wr,wt,xc,yc,zc
832 REAL(RFREAL) :: flxconv(5),flxdiss(5),flx(5)
833 REAL(RFREAL),
DIMENSION(:),
POINTER :: mfmixt
834 REAL(RFREAL),
DIMENSION(:,:),
POINTER :: cv,dv,gv,
rhs,vals,sd
835 REAL(RFREAL),
DIMENSION(:,:,:),
POINTER :: grad
842 global => pregion%global
851 indgs = pregion%grid%indGs
852 epsentr = pregion%mixtInput%epsentr
853 dissfact = pregion%mixtInput%dissFact
855 cv => pregion%mixt%cv
856 dv => pregion%mixt%dv
857 gv => pregion%mixt%gv
858 grad => pregion%mixt%gradCell
859 rhs => pregion%mixt%rhs
860 sd => pregion%mixt%sd
866 pref = global%refPressure
867 rref = global%refDensity
868 vref = global%refVelocity
870 icpref = 2.0_rfreal/(rref*vref*vref)
871 icmassref = 1.0_rfreal/(rref*vref)
878 ggas = global%refGamma
885 DO ifl = 1,ppatch%nBFaces
886 c1 = ppatch%bf2c(ifl)
888 nx = ppatch%fn(xcoord,ifl)
889 ny = ppatch%fn(ycoord,ifl)
890 nz = ppatch%fn(zcoord,ifl)
891 nm = ppatch%fn(xyzmag,ifl)
893 xc = ppatch%fc(xcoord,ifl)
894 yc = ppatch%fc(ycoord,ifl)
895 zc = ppatch%fc(zcoord,ifl)
897 fs = ppatch%gs(indgs*ifl)
907 rl = cv(cv_mixt_dens,c1)
910 ul = cv(cv_mixt_xmom,c1)*irl
911 vl = cv(cv_mixt_ymom,c1)*irl
912 wl = cv(cv_mixt_zmom,c1)*irl
913 pl = dv(dv_mixt_pres,c1)
915 dx = xc - pregion%grid%cofg(xcoord,c1)
916 dy = yc - pregion%grid%cofg(ycoord,c1)
917 dz = zc - pregion%grid%cofg(zcoord,c1)
919 rl = rl + grad(xcoord,grc_mixt_dens,c1)*
dx &
920 + grad(ycoord,grc_mixt_dens,c1)*
dy &
921 + grad(zcoord,grc_mixt_dens,c1)*
dz
922 ul = ul + grad(xcoord,grc_mixt_xvel,c1)*
dx &
923 + grad(ycoord,grc_mixt_xvel,c1)*
dy &
924 + grad(zcoord,grc_mixt_xvel,c1)*
dz
925 vl = vl + grad(xcoord,grc_mixt_yvel,c1)*
dx &
926 + grad(ycoord,grc_mixt_yvel,c1)*
dy &
927 + grad(zcoord,grc_mixt_yvel,c1)*
dz
928 wl = wl + grad(xcoord,grc_mixt_zvel,c1)*
dx &
929 + grad(ycoord,grc_mixt_zvel,c1)*
dy &
930 + grad(zcoord,grc_mixt_zvel,c1)*
dz
931 pl = pl + grad(xcoord,grc_mixt_pres,c1)*
dx &
932 + grad(ycoord,grc_mixt_pres,c1)*
dy &
933 + grad(zcoord,grc_mixt_pres,c1)*
dz
938 ql = ul*nx + vl*ny + wl*nz - fs
944 rr = ppatch%mixt%cv(cv_mixt_dens,ifl)
947 ur = ppatch%mixt%cv(cv_mixt_xmom,ifl)*irr
948 vr = ppatch%mixt%cv(cv_mixt_ymom,ifl)*irr
949 wr = ppatch%mixt%cv(cv_mixt_zmom,ifl)*irr
950 pr = ppatch%mixt%dv(dv_mixt_pres,ifl)
955 qr = ur*nx + vr*ny + wr*nz - fs
964 uh = wt*ul + (1.0_rfreal-wt)*ur
965 vh = wt*vl + (1.0_rfreal-wt)*vr
966 wh = wt*wl + (1.0_rfreal-wt)*wr
967 hh = wt*hl + (1.0_rfreal-wt)*hr
969 qh = uh*nx + vh*ny + wh*nz - fs
970 sh = 0.5_rfreal*(uh*uh + vh*vh + wh*wh)
1000 dq = du*nx + de*ny + dw*nz
1002 dv1 = (dp - rh*ah*dq)/(2.0_rfreal*ah*ah)
1003 dv5 = (dp + rh*ah*dq)/(2.0_rfreal*ah*ah)
1004 dv2 = dr - dp/(ah*ah)
1019 flxconv(1) = 0.5_rfreal*(ql*rl + qr*rr )*nm
1020 flxconv(2) = 0.5_rfreal*(ql*rl*ul + pl*nx + qr*rr*ur + pr*nx)*nm
1021 flxconv(3) = 0.5_rfreal*(ql*rl*vl + pl*ny + qr*rr*vr + pr*ny)*nm
1022 flxconv(4) = 0.5_rfreal*(ql*rl*wl + pl*nz + qr*rr*wr + pr*nz)*nm
1023 flxconv(5) = 0.5_rfreal*(ql*rl*hl + pl*fs + qr*rr*hr + pr*fs)*nm
1029 flxdiss(1) = 0.5_rfreal*dissfact*(t1 + t2 + t5 )*nm
1030 flxdiss(2) = 0.5_rfreal*dissfact*(t1*(uh-nx*ah) + t2*uh + t3*(du-nx*dq) + t5*(uh+nx*ah))*nm
1031 flxdiss(3) = 0.5_rfreal*dissfact*(t1*(vh-ny*ah) + t2*vh + t3*(de-ny*dq) + t5*(vh+ny*ah))*nm
1032 flxdiss(4) = 0.5_rfreal*dissfact*(t1*(wh-nz*ah) + t2*wh + t3*(dw-nz*dq) + t5*(wh+nz*ah))*nm
1033 flxdiss(5) = 0.5_rfreal*dissfact*(t1*(hh-qh*ah) + t2*sh + t3*(uh*du+vh*de+wh*dw-qh*dq) + t5*(hh+qh*ah))*nm
1039 rhs(cv_mixt_dens,c1) =
rhs(cv_mixt_dens,c1) + (flxconv(1) - flxdiss(1))
1040 rhs(cv_mixt_xmom,c1) =
rhs(cv_mixt_xmom,c1) + (flxconv(2) - flxdiss(2))
1041 rhs(cv_mixt_ymom,c1) =
rhs(cv_mixt_ymom,c1) + (flxconv(3) - flxdiss(3))
1042 rhs(cv_mixt_zmom,c1) =
rhs(cv_mixt_zmom,c1) + (flxconv(4) - flxdiss(4))
1043 rhs(cv_mixt_ener,c1) =
rhs(cv_mixt_ener,c1) + (flxconv(5) - flxdiss(5))
1045 flx(1) = flxconv(1) - flxdiss(1)
1046 flx(2) = flxconv(2) - flxdiss(2)
1047 flx(3) = flxconv(3) - flxdiss(3)
1048 flx(4) = flxconv(4) - flxdiss(4)
1049 flx(5) = flxconv(5) - flxdiss(5)
1051 ppatch%cp(ifl) = icpref*(0.5_rfreal*(pl + pr) - pref)
1052 ppatch%cmass(ifl) = icmassref*flx(1)/nm
1053 ppatch%cmom(xcoord,ifl) = icpref*0.5_rfreal*(ul+ur)*flx(1)/nm
1054 ppatch%cmom(ycoord,ifl) = icpref*0.5_rfreal*(vl+vr)*flx(1)/nm
1055 ppatch%cmom(zcoord,ifl) = icpref*0.5_rfreal*(wl+wr)*flx(1)/nm
1057 IF ( pregion%irkStep == 1 )
THEN
1058 global%massIn = global%massIn -
min(flx(1),0.0_rfreal)
1059 global%massOut = global%massOut +
max(flx(1),0.0_rfreal)
1062 IF ( (global%checkLevel == check_high) .AND. &
1063 (global%verbLevel >= verbose_high) .AND. &
1064 (global%myProcid == masterproc) .AND. &
1065 (decideprintflag .EQV. .true.) )
THEN
1066 IF ( ppatch%bcType == bc_outflow )
THEN
1067 IF ( flx(1) < 0.0_rfreal )
THEN
1070 IF ( nlocs == 1 )
THEN
1071 global%warnCounter = global%warnCounter + 1
1073 WRITE(stdout,
'(A,1X,A,1X,I9)') solver_name, &
1074 '*** WARNING *** Reverse flow detected at global patch', &
1076 WRITE(stdout,
'(A,3X,A,1X,I5.5)') solver_name,
'Global region:', &
1077 pregion%iRegionGlobal
1078 IF ( global%flowType == flow_unsteady )
THEN
1079 WRITE(stdout,
'(A,3X,A,1X,1PE11.5)') solver_name, &
1083 WRITE(stdout,
'(A,3X,A,1X,I6.6)') solver_name, &
1084 'Current iteration number:', &
1088 WRITE(stdout,
'(A,3X,A,1X,I1)') solver_name, &
1089 'Runge-Kutta stage:', &
1093 IF ( nlocs <= max_inoutflow_locs )
THEN
1094 loc(nlocs,min_val:max_val) = c1
1105 IF ( (global%checkLevel == check_high) .AND. &
1106 (global%verbLevel >= verbose_high) .AND. &
1107 (global%myProcid == masterproc) .AND. &
1108 (decideprintflag .EQV. .true.) .AND. &
1110 IF ( ppatch%bcType == bc_outflow )
THEN
1111 IF ( nlocs > max_inoutflow_locs )
THEN
1112 WRITE(stdout,
'(A,3X,A,1X,I3,1X,A,1X,I9,1X,A)') solver_name, &
1113 'Only wrote the first',max_inoutflow_locs,
'of',nlocs, &
1114 'outflow faces with inflow.'
1116 locinfo_mode_silent,output_mode_anybody)
1119 locinfo_mode_silent,output_mode_anybody)
1166 TYPE(t_region
),
POINTER :: pregion
1172 INTEGER :: errorflag,ipatch
1173 INTEGER :: varinfo(cv_mixt_xvel:cv_mixt_temp)
1174 TYPE(t_patch),
POINTER :: ppatch
1181 global => pregion%global
1184 'RFLU_ModNSCBC.F90')
1192 DO ipatch = 1,pregion%grid%nPatches
1193 ppatch => pregion%patches(ipatch)
1199 grbf_mixt_dens,grbf_mixt_pres, &
1200 pregion%mixt%cv,ppatch%mixt%gradFace)
1212 DO ipatch = 1,pregion%grid%nPatches
1213 ppatch => pregion%patches(ipatch)
1215 IF ( ppatch%bcKind == bc_kind_nscbc )
THEN
1216 SELECT CASE( ppatch%bcType )
1219 CASE (bc_noslipwall_hflux)
1221 CASE (bc_noslipwall_temp)
1223 CASE (bc_inflow_totang)
1225 CASE (bc_inflow_veltemp)
1234 CALL
errorstop(global,err_reached_default,__line__)
1285 TYPE(t_patch),
POINTER :: ppatch
1286 TYPE(t_region
),
POINTER :: pregion
1292 LOGICAL :: farfieldinflow,farfieldsupersonic
1293 INTEGER :: c1,distrib,errorflag,ifl,indcp,indmol
1294 REAL(RFREAL) ::
a,aoa,aos,cp,d1,d2,d3,d4,d5,dotproduct,dndx,dndy,dndz,dpdn, &
1295 dpds,dpdt,dpdx,dpdy,dpdz,drdn,drds,drdt,drdx,drdy,drdz,dsdx, &
1296 dsdy,dsdz,dtdx,dtdy,dtdz,dudn,duds,dudt,dudx,dudy,dudz,dundn, &
1297 dunds,dundt,dusdn,dusds,dusdt,dutdn,dutds,dutdt,dvdn,dvds, &
1298 dvdt,dvdx,dvdy,dvdz,dwdn,dwds,dwdt,dwdx,dwdy,dwdz,dxdn,dxds, &
1299 dxdt,dydn,dyds,dydt,dzdn,dzds,dzdt,
g,l1,l2,l3,l4,l5,lambda1, &
1300 lambda2,lambda3,lambda4,lambda5,mm,mf,mfnormal,nx,ny,nz,p,
r, &
1301 rgas,rhs1,rhs2,rhs3,rhs4,rhs5,ru,rv,rw,sx,sy,sz,tx,ty,tz,u, &
1303 REAL(RFREAL),
POINTER,
DIMENSION(:,:) :: pcv,pdv,prhs,pgv,vals
1304 REAL(RFREAL),
DIMENSION(:,:,:),
POINTER :: pgradface
1311 global => pregion%global
1314 'RFLU_ModNSCBC.F90')
1320 vals => ppatch%mixt%vals
1322 distrib = ppatch%mixt%distrib
1324 indcp = pregion%mixtInput%indCp
1325 indmol = pregion%mixtInput%indMol
1327 pcv => ppatch%mixt%cv
1328 pdv => ppatch%mixt%dv
1329 pgv => pregion%mixt%gv
1330 prhs => ppatch%mixt%rhs
1332 pgradface => ppatch%mixt%gradFace
1334 DO ifl = 1,ppatch%nBFaces
1335 c1 = ppatch%bf2c(ifl)
1337 cp = pgv(gv_mixt_cp ,indcp *c1)
1338 mm = pgv(gv_mixt_mol,indmol*c1)
1342 r = pcv(cv_mixt_dens,ifl)
1343 ru = pcv(cv_mixt_xmom,ifl)
1344 rv = pcv(cv_mixt_ymom,ifl)
1345 rw = pcv(cv_mixt_zmom,ifl)
1346 p = pdv(dv_mixt_pres,ifl)
1347 a = pdv(dv_mixt_soun,ifl)
1353 drdx = pgradface(xcoord,grbf_mixt_dens,ifl)
1354 drdy = pgradface(ycoord,grbf_mixt_dens,ifl)
1355 drdz = pgradface(zcoord,grbf_mixt_dens,ifl)
1357 dudx = pgradface(xcoord,grbf_mixt_xvel,ifl)
1358 dudy = pgradface(ycoord,grbf_mixt_xvel,ifl)
1359 dudz = pgradface(zcoord,grbf_mixt_xvel,ifl)
1361 dvdx = pgradface(xcoord,grbf_mixt_yvel,ifl)
1362 dvdy = pgradface(ycoord,grbf_mixt_yvel,ifl)
1363 dvdz = pgradface(zcoord,grbf_mixt_yvel,ifl)
1365 dwdx = pgradface(xcoord,grbf_mixt_zvel,ifl)
1366 dwdy = pgradface(ycoord,grbf_mixt_zvel,ifl)
1367 dwdz = pgradface(zcoord,grbf_mixt_zvel,ifl)
1369 dpdx = pgradface(xcoord,grbf_mixt_pres,ifl)
1370 dpdy = pgradface(ycoord,grbf_mixt_pres,ifl)
1371 dpdz = pgradface(zcoord,grbf_mixt_pres,ifl)
1377 nx = ppatch%fn(xcoord,ifl)
1378 ny = ppatch%fn(ycoord,ifl)
1379 nz = ppatch%fn(zcoord,ifl)
1381 SELECT CASE ( pregion%mixtInput%dimens )
1399 CALL
errorstop(global,err_reached_default,__line__)
1431 aoa = vals(bcdat_farf_attack,distrib*ifl)
1432 aos = vals(bcdat_farf_slip ,distrib*ifl)
1434 dotproduct = nx*(
cos(aoa)*
cos(aos)) + ny*(
sin(aoa)*
cos(aos)) + nz*
sin(aos)
1436 IF ( dotproduct < 0.0_rfreal )
THEN
1437 farfieldinflow = .true.
1439 farfieldinflow = .false.
1442 mf = vals(bcdat_farf_mach ,distrib*ifl)
1443 mfnormal = mf*abs(dotproduct)
1445 IF ( mfnormal > 1.0_rfreal )
THEN
1446 farfieldsupersonic = .true.
1448 farfieldsupersonic = .false.
1455 drdn = drdx*dxdn + drdy*dydn + drdz*dzdn
1456 drds = drdx*dxds + drdy*dyds + drdz*dzds
1457 drdt = drdx*dxdt + drdy*dydt + drdz*dzdt
1459 dudn = dudx*dxdn + dudy*dydn + dudz*dzdn
1460 duds = dudx*dxds + dudy*dyds + dudz*dzds
1461 dudt = dudx*dxdt + dudy*dydt + dudz*dzdt
1463 dvdn = dvdx*dxdn + dvdy*dydn + dvdz*dzdn
1464 dvds = dvdx*dxds + dvdy*dyds + dvdz*dzds
1465 dvdt = dvdx*dxdt + dvdy*dydt + dvdz*dzdt
1467 dwdn = dwdx*dxdn + dwdy*dydn + dwdz*dzdn
1468 dwds = dwdx*dxds + dwdy*dyds + dwdz*dzds
1469 dwdt = dwdx*dxdt + dwdy*dydt + dwdz*dzdt
1471 dpdn = dpdx*dxdn + dpdy*dydn + dpdz*dzdn
1472 dpds = dpdx*dxds + dpdy*dyds + dpdz*dzds
1473 dpdt = dpdx*dxdt + dpdy*dydt + dpdz*dzdt
1479 un = u*dndx +
v*dndy + w*dndz
1480 us = u*dsdx +
v*dsdy + w*dsdz
1481 ut = u*dtdx +
v*dtdy + w*dtdz
1487 dundn = dudn*dndx + dvdn*dndy + dwdn*dndz
1488 dunds = duds*dndx + dvds*dndy + dwds*dndz
1489 dundt = dudt*dndx + dvdt*dndy + dwdt*dndz
1491 dusdn = dudn*dsdx + dvdn*dsdy + dwdn*dsdz
1492 dusds = duds*dsdx + dvds*dsdy + dwds*dsdz
1493 dusdt = dudt*dsdx + dvdt*dsdy + dwdt*dsdz
1495 dutdn = dudn*dtdx + dvdn*dtdy + dwdn*dtdz
1496 dutds = duds*dtdx + dvds*dtdy + dwds*dtdz
1497 dutdt = dudt*dtdx + dvdt*dtdy + dwdt*dtdz
1513 IF ( farfieldinflow .EQV. .true. )
THEN
1514 IF ( farfieldsupersonic .EQV. .true. )
THEN
1521 l5 = lambda5*(dpdn +
r*
a*dundn)
1528 IF ( farfieldsupersonic .EQV. .true. )
THEN
1529 l2 = lambda2*(
a*
a*drdn - dpdn)
1532 l5 = lambda5*(dpdn +
r*
a*dundn)
1533 l1 = lambda1*(dpdn -
r*
a*dundn)
1535 l2 = lambda2*(
a*
a*drdn - dpdn)
1538 l5 = lambda5*(dpdn +
r*
a*dundn)
1547 d1 = (l2 + 0.5_rfreal*(l1+l5))/(
a*
a)
1548 d2 = 0.5_rfreal*(l1+l5)
1549 d3 = (l5-l1)/(2.0_rfreal*
r*
a)
1557 rhs1 = d1 +
r*dusds + us*drds +
r*dutdt + ut*drdt
1558 rhs2 = un*d1 +
r*d3 +
r*un*dusds +
r*us*dunds + un*us*drds &
1559 +
r*un*dutdt +
r*ut*dundt + un*ut*drdt
1560 rhs3 = us*d1 +
r*d4 + dpds &
1561 + 2.0_rfreal*
r*us*dusds + us*us*drds &
1562 +
r*us*dutdt +
r*ut*dusdt + us*ut*drdt
1563 rhs4 = ut*d1 +
r*d5 + dpdt &
1564 +
r*ut*dusds +
r*us*dutds + ut*us*drds &
1565 + 2.0_rfreal*
r*ut*dutdt + ut*ut*drdt
1566 rhs5 = 0.5_rfreal*(un*un+us*us+ut*ut)*d1 + d2/(
g-1.0_rfreal) &
1567 +
r*un*d3 +
r*us*d4 +
r*ut*d5 &
1568 + us*( 0.5_rfreal*(un*un+us*us+ut*ut)*drds &
1569 +
r*(un*dunds+us*dusds+ut*dutds) &
1570 +
g*dpds/(
g-1.0_rfreal) ) &
1571 + (0.5_rfreal*
r*(un*un+us*us+ut*ut) &
1572 +
g*p/(
g-1.0_rfreal))*dusds &
1573 + ut*( 0.5_rfreal*(un*un+us*us+ut*ut)*drdt &
1574 +
r*(un*dundt+us*dusdt+ut*dutdt) &
1575 +
g*dpdt/(
g-1.0_rfreal) ) &
1576 + (0.5_rfreal*
r*(un*un+us*us+ut*ut) &
1577 +
g*p/(
g-1.0_rfreal))*dutdt
1579 prhs(cv_mixt_dens,ifl) = rhs1
1580 prhs(cv_mixt_xmom,ifl) = rhs2*dxdn + rhs3*dxds + rhs4*dxdt
1581 prhs(cv_mixt_ymom,ifl) = rhs2*dydn + rhs3*dyds + rhs4*dydt
1582 prhs(cv_mixt_zmom,ifl) = rhs2*dzdn + rhs3*dzds + rhs4*dzdt
1583 prhs(cv_mixt_ener,ifl) = rhs5
1628 TYPE(t_patch),
POINTER :: ppatch
1629 TYPE(t_region
),
POINTER :: pregion
1641 global => pregion%global
1644 'RFLU_ModNSCBC.F90')
1650 ppatch%mixt%rhs = 0.0_rfreal
1696 TYPE(t_patch),
POINTER :: ppatch
1697 TYPE(t_region
),
POINTER :: pregion
1703 INTEGER :: c1,distrib,errorflag,ifl,indcp,indmol
1704 REAL(RFREAL) ::
a,aoa,aos,bc_dudt,bc_dvdt,bc_dwdt,bc_dtdt,bc_dundt,bc_dusdt, &
1705 bc_dutdt,cp,d1,d2,d3,d4,d5,dotproduct,dndx,dndy,dndz,dpdn, &
1706 dpds,dpdt,dpdx,dpdy,dpdz,drdn,drds,drdt,drdx,drdy,drdz,dsdx, &
1707 dsdy,dsdz,dtdx,dtdy,dtdz,dudn,duds,dudt,dudx,dudy,dudz,dundn, &
1708 dunds,dundt,dusdn,dusds,dusdt,dutdn,dutds,dutdt,dvdn,dvds, &
1709 dvdt,dvdx,dvdy,dvdz,dwdn,dwds,dwdt,dwdx,dwdy,dwdz,dxdn,dxds, &
1710 dxdt,dydn,dyds,dydt,dzdn,dzds,dzdt,
g,l1,l2,l3,l4,l5,lambda1, &
1711 lambda2,lambda3,lambda4,lambda5,mm,mf,mfnormal,nx,ny,nz,p,
r, &
1712 rgas,rhs1,rhs2,rhs3,rhs4,rhs5,ru,rv,rw,sx,sy,sz,t,tx,ty,tz, &
1714 REAL(RFREAL),
POINTER,
DIMENSION(:,:) :: pcv,pdv,prhs,pgv
1715 REAL(RFREAL),
DIMENSION(:,:,:),
POINTER :: pgradface
1722 global => pregion%global
1725 'RFLU_ModNSCBC.F90')
1731 indcp = pregion%mixtInput%indCp
1732 indmol = pregion%mixtInput%indMol
1734 pcv => ppatch%mixt%cv
1735 pdv => ppatch%mixt%dv
1736 pgv => pregion%mixt%gv
1737 prhs => ppatch%mixt%rhs
1739 pgradface => ppatch%mixt%gradFace
1741 DO ifl = 1,ppatch%nBFaces
1742 c1 = ppatch%bf2c(ifl)
1744 cp = pgv(gv_mixt_cp ,indcp *c1)
1745 mm = pgv(gv_mixt_mol,indmol*c1)
1749 r = pcv(cv_mixt_dens,ifl)
1750 ru = pcv(cv_mixt_xmom,ifl)
1751 rv = pcv(cv_mixt_ymom,ifl)
1752 rw = pcv(cv_mixt_zmom,ifl)
1753 p = pdv(dv_mixt_pres,ifl)
1754 t = pdv(dv_mixt_temp,ifl)
1755 a = pdv(dv_mixt_soun,ifl)
1761 drdx = pgradface(xcoord,grbf_mixt_dens,ifl)
1762 drdy = pgradface(ycoord,grbf_mixt_dens,ifl)
1763 drdz = pgradface(zcoord,grbf_mixt_dens,ifl)
1765 dudx = pgradface(xcoord,grbf_mixt_xvel,ifl)
1766 dudy = pgradface(ycoord,grbf_mixt_xvel,ifl)
1767 dudz = pgradface(zcoord,grbf_mixt_xvel,ifl)
1769 dvdx = pgradface(xcoord,grbf_mixt_yvel,ifl)
1770 dvdy = pgradface(ycoord,grbf_mixt_yvel,ifl)
1771 dvdz = pgradface(zcoord,grbf_mixt_yvel,ifl)
1773 dwdx = pgradface(xcoord,grbf_mixt_zvel,ifl)
1774 dwdy = pgradface(ycoord,grbf_mixt_zvel,ifl)
1775 dwdz = pgradface(zcoord,grbf_mixt_zvel,ifl)
1777 dpdx = pgradface(xcoord,grbf_mixt_pres,ifl)
1778 dpdy = pgradface(ycoord,grbf_mixt_pres,ifl)
1779 dpdz = pgradface(zcoord,grbf_mixt_pres,ifl)
1785 bc_dudt = 0.0_rfreal
1786 bc_dvdt = 0.0_rfreal
1787 bc_dwdt = 0.0_rfreal
1788 bc_dtdt = 0.0_rfreal
1794 nx = ppatch%fn(xcoord,ifl)
1795 ny = ppatch%fn(ycoord,ifl)
1796 nz = ppatch%fn(zcoord,ifl)
1798 SELECT CASE ( pregion%mixtInput%dimens )
1816 CALL
errorstop(global,err_reached_default,__line__)
1847 drdn = drdx*dxdn + drdy*dydn + drdz*dzdn
1848 drds = drdx*dxds + drdy*dyds + drdz*dzds
1849 drdt = drdx*dxdt + drdy*dydt + drdz*dzdt
1851 dudn = dudx*dxdn + dudy*dydn + dudz*dzdn
1852 duds = dudx*dxds + dudy*dyds + dudz*dzds
1853 dudt = dudx*dxdt + dudy*dydt + dudz*dzdt
1855 dvdn = dvdx*dxdn + dvdy*dydn + dvdz*dzdn
1856 dvds = dvdx*dxds + dvdy*dyds + dvdz*dzds
1857 dvdt = dvdx*dxdt + dvdy*dydt + dvdz*dzdt
1859 dwdn = dwdx*dxdn + dwdy*dydn + dwdz*dzdn
1860 dwds = dwdx*dxds + dwdy*dyds + dwdz*dzds
1861 dwdt = dwdx*dxdt + dwdy*dydt + dwdz*dzdt
1863 dpdn = dpdx*dxdn + dpdy*dydn + dpdz*dzdn
1864 dpds = dpdx*dxds + dpdy*dyds + dpdz*dzds
1865 dpdt = dpdx*dxdt + dpdy*dydt + dpdz*dzdt
1871 un = u*dndx +
v*dndy + w*dndz
1872 us = u*dsdx +
v*dsdy + w*dsdz
1873 ut = u*dtdx +
v*dtdy + w*dtdz
1879 dundn = dudn*dndx + dvdn*dndy + dwdn*dndz
1880 dunds = duds*dndx + dvds*dndy + dwds*dndz
1881 dundt = dudt*dndx + dvdt*dndy + dwdt*dndz
1883 dusdn = dudn*dsdx + dvdn*dsdy + dwdn*dsdz
1884 dusds = duds*dsdx + dvds*dsdy + dwds*dsdz
1885 dusdt = dudt*dsdx + dvdt*dsdy + dwdt*dsdz
1887 dutdn = dudn*dtdx + dvdn*dtdy + dwdn*dtdz
1888 dutds = duds*dtdx + dvds*dtdy + dwds*dtdz
1889 dutdt = dudt*dtdx + dvdt*dtdy + dwdt*dtdz
1895 bc_dundt = bc_dudt*dndx + bc_dvdt*dndy + bc_dwdt*dndz
1896 bc_dusdt = bc_dudt*dsdx + bc_dvdt*dsdy + bc_dwdt*dsdz
1897 bc_dutdt = bc_dudt*dtdx + bc_dvdt*dtdy + bc_dwdt*dtdz
1913 IF ( ppatch%mixt%switches(bcswi_inflow_type) /= bcopt_supersonic )
THEN
1914 IF ( ppatch%reflect == bc_reflecting )
THEN
1915 l5 = lambda5*(dpdn +
r*
a*dundn)
1916 l1 = l5 + 2.0_rfreal*
r*
a*bc_dundt
1917 l2 = 0.5_rfreal*(
g-1.0_rfreal)*(l1+l5) + (
r*
a*
a/t)*bc_dtdt
1921 l5 = lambda5*(dpdn +
r*
a*dundn)
1939 d1 = (l2 + 0.5_rfreal*(l1+l5))/(
a*
a)
1940 d2 = 0.5_rfreal*(l1+l5)
1941 d3 = (l5-l1)/(2.0_rfreal*
r*
a)
1949 rhs1 = d1 +
r*dusds + us*drds +
r*dutdt + ut*drdt
1950 rhs2 = un*d1 +
r*d3 +
r*un*dusds +
r*us*dunds + un*us*drds &
1951 +
r*un*dutdt +
r*ut*dundt + un*ut*drdt
1952 rhs3 = us*d1 +
r*d4 + dpds &
1953 + 2.0_rfreal*
r*us*dusds + us*us*drds &
1954 +
r*us*dutdt +
r*ut*dusdt + us*ut*drdt
1955 rhs4 = ut*d1 +
r*d5 + dpdt &
1956 +
r*ut*dusds +
r*us*dutds + ut*us*drds &
1957 + 2.0_rfreal*
r*ut*dutdt + ut*ut*drdt
1958 rhs5 = 0.5_rfreal*(un*un+us*us+ut*ut)*d1 + d2/(
g-1.0_rfreal) &
1959 +
r*un*d3 +
r*us*d4 +
r*ut*d5 &
1960 + us*( 0.5_rfreal*(un*un+us*us+ut*ut)*drds &
1961 +
r*(un*dunds+us*dusds+ut*dutds) &
1962 +
g*dpds/(
g-1.0_rfreal) ) &
1963 + (0.5_rfreal*
r*(un*un+us*us+ut*ut) &
1964 +
g*p/(
g-1.0_rfreal))*dusds &
1965 + ut*( 0.5_rfreal*(un*un+us*us+ut*ut)*drdt &
1966 +
r*(un*dundt+us*dusdt+ut*dutdt) &
1967 +
g*dpdt/(
g-1.0_rfreal) ) &
1968 + (0.5_rfreal*
r*(un*un+us*us+ut*ut) &
1969 +
g*p/(
g-1.0_rfreal))*dutdt
1971 prhs(cv_mixt_dens,ifl) = rhs1
1972 prhs(cv_mixt_xmom,ifl) = rhs2*dxdn + rhs3*dxds + rhs4*dxdt
1973 prhs(cv_mixt_ymom,ifl) = rhs2*dydn + rhs3*dyds + rhs4*dydt
1974 prhs(cv_mixt_zmom,ifl) = rhs2*dzdn + rhs3*dzds + rhs4*dzdt
1975 prhs(cv_mixt_ener,ifl) = rhs5
1977 IF ( ppatch%mixt%switches(bcswi_inflow_type) /= bcopt_supersonic )
THEN
1978 IF ( ppatch%reflect == bc_reflecting )
THEN
1979 prhs(cv_mixt_xmom,ifl) = 0.0_rfreal
1980 prhs(cv_mixt_ymom,ifl) = 0.0_rfreal
1981 prhs(cv_mixt_zmom,ifl) = 0.0_rfreal
1982 prhs(cv_mixt_ener,ifl) = 0.0_rfreal
2030 TYPE(t_patch),
POINTER :: ppatch
2031 TYPE(t_region
),
POINTER :: pregion
2043 global => pregion%global
2046 'RFLU_ModNSCBC.F90')
2052 ppatch%mixt%rhs = 0.0_rfreal
2096 TYPE(t_patch),
POINTER :: ppatch
2097 TYPE(t_region
),
POINTER :: pregion
2109 global => pregion%global
2112 'RFLU_ModNSCBC.F90')
2118 ppatch%mixt%rhs = 0.0_rfreal
2162 TYPE(t_patch),
POINTER :: ppatch
2163 TYPE(t_region
),
POINTER :: pregion
2175 global => pregion%global
2178 'RFLU_ModNSCBC.F90')
2184 ppatch%mixt%rhs = 0.0_rfreal
2228 TYPE(t_patch),
POINTER :: ppatch
2229 TYPE(t_region
),
POINTER :: pregion
2235 INTEGER :: bcopttype,c1,distrib,errorflag,ifl,indcp,indmol
2236 REAL(RFREAL) ::
a,aoa,aos,cp,d1,d2,d3,d4,d5,dotproduct,dndx,dndy,dndz,dpdn, &
2237 dpds,dpdt,dpdx,dpdy,dpdz,drdn,drds,drdt,drdx,drdy,drdz,dsdx, &
2238 dsdy,dsdz,dtdx,dtdy,dtdz,dudn,duds,dudt,dudx,dudy,dudz,dundn, &
2239 dunds,dundt,dusdn,dusds,dusdt,dutdn,dutds,dutdt,dvdn,dvds, &
2240 dvdt,dvdx,dvdy,dvdz,dwdn,dwds,dwdt,dwdx,dwdy,dwdz,dxdn,dxds, &
2241 dxdt,dydn,dyds,dydt,dzdn,dzds,dzdt,
g,l1,l2,l3,l4,l5,lambda1, &
2242 lambda2,lambda3,lambda4,lambda5,mm,mf,mfnormal,nscbck,nx,ny, &
2243 nz,p,pinf,
r,rgas,rhs1,rhs2,rhs3,rhs4,rhs5,ru,rv,rw,sx,sy,sz, &
2244 t,tx,ty,tz,u,un,us,ut,
v,w
2245 REAL(RFREAL),
POINTER,
DIMENSION(:,:) :: pcv,pdv,prhs,pgv,vals
2246 REAL(RFREAL),
DIMENSION(:,:,:),
POINTER :: pgradface
2253 global => pregion%global
2256 'RFLU_ModNSCBC.F90')
2262 distrib = ppatch%mixt%distrib
2263 bcopttype = ppatch%mixt%switches(bcswi_outflow_type)
2265 IF ( bcopttype /= bcopt_supersonic )
THEN
2266 vals => ppatch%mixt%vals
2269 indcp = pregion%mixtInput%indCp
2270 indmol = pregion%mixtInput%indMol
2272 pcv => ppatch%mixt%cv
2273 pdv => ppatch%mixt%dv
2274 pgv => pregion%mixt%gv
2275 prhs => ppatch%mixt%rhs
2277 pgradface => ppatch%mixt%gradFace
2279 DO ifl = 1,ppatch%nBFaces
2280 c1 = ppatch%bf2c(ifl)
2282 cp = pgv(gv_mixt_cp ,indcp *c1)
2283 mm = pgv(gv_mixt_mol,indmol*c1)
2287 r = pcv(cv_mixt_dens,ifl)
2288 ru = pcv(cv_mixt_xmom,ifl)
2289 rv = pcv(cv_mixt_ymom,ifl)
2290 rw = pcv(cv_mixt_zmom,ifl)
2291 p = pdv(dv_mixt_pres,ifl)
2292 a = pdv(dv_mixt_soun,ifl)
2298 drdx = pgradface(xcoord,grbf_mixt_dens,ifl)
2299 drdy = pgradface(ycoord,grbf_mixt_dens,ifl)
2300 drdz = pgradface(zcoord,grbf_mixt_dens,ifl)
2302 dudx = pgradface(xcoord,grbf_mixt_xvel,ifl)
2303 dudy = pgradface(ycoord,grbf_mixt_xvel,ifl)
2304 dudz = pgradface(zcoord,grbf_mixt_xvel,ifl)
2306 dvdx = pgradface(xcoord,grbf_mixt_yvel,ifl)
2307 dvdy = pgradface(ycoord,grbf_mixt_yvel,ifl)
2308 dvdz = pgradface(zcoord,grbf_mixt_yvel,ifl)
2310 dwdx = pgradface(xcoord,grbf_mixt_zvel,ifl)
2311 dwdy = pgradface(ycoord,grbf_mixt_zvel,ifl)
2312 dwdz = pgradface(zcoord,grbf_mixt_zvel,ifl)
2314 dpdx = pgradface(xcoord,grbf_mixt_pres,ifl)
2315 dpdy = pgradface(ycoord,grbf_mixt_pres,ifl)
2316 dpdz = pgradface(zcoord,grbf_mixt_pres,ifl)
2322 nx = ppatch%fn(xcoord,ifl)
2323 ny = ppatch%fn(ycoord,ifl)
2324 nz = ppatch%fn(zcoord,ifl)
2326 SELECT CASE ( pregion%mixtInput%dimens )
2344 CALL
errorstop(global,err_reached_default,__line__)
2375 drdn = drdx*dxdn + drdy*dydn + drdz*dzdn
2376 drds = drdx*dxds + drdy*dyds + drdz*dzds
2377 drdt = drdx*dxdt + drdy*dydt + drdz*dzdt
2379 dudn = dudx*dxdn + dudy*dydn + dudz*dzdn
2380 duds = dudx*dxds + dudy*dyds + dudz*dzds
2381 dudt = dudx*dxdt + dudy*dydt + dudz*dzdt
2383 dvdn = dvdx*dxdn + dvdy*dydn + dvdz*dzdn
2384 dvds = dvdx*dxds + dvdy*dyds + dvdz*dzds
2385 dvdt = dvdx*dxdt + dvdy*dydt + dvdz*dzdt
2387 dwdn = dwdx*dxdn + dwdy*dydn + dwdz*dzdn
2388 dwds = dwdx*dxds + dwdy*dyds + dwdz*dzds
2389 dwdt = dwdx*dxdt + dwdy*dydt + dwdz*dzdt
2391 dpdn = dpdx*dxdn + dpdy*dydn + dpdz*dzdn
2392 dpds = dpdx*dxds + dpdy*dyds + dpdz*dzds
2393 dpdt = dpdx*dxdt + dpdy*dydt + dpdz*dzdt
2399 un = u*dndx +
v*dndy + w*dndz
2400 us = u*dsdx +
v*dsdy + w*dsdz
2401 ut = u*dtdx +
v*dtdy + w*dtdz
2407 dundn = dudn*dndx + dvdn*dndy + dwdn*dndz
2408 dunds = duds*dndx + dvds*dndy + dwds*dndz
2409 dundt = dudt*dndx + dvdt*dndy + dwdt*dndz
2411 dusdn = dudn*dsdx + dvdn*dsdy + dwdn*dsdz
2412 dusds = duds*dsdx + dvds*dsdy + dwds*dsdz
2413 dusdt = dudt*dsdx + dvdt*dsdy + dwdt*dsdz
2415 dutdn = dudn*dtdx + dvdn*dtdy + dwdn*dtdz
2416 dutds = duds*dtdx + dvds*dtdy + dwds*dtdz
2417 dutdt = dudt*dtdx + dvdt*dtdy + dwdt*dtdz
2423 nscbck = ppatch%nscbcK
2425 IF ( bcopttype /= bcopt_supersonic )
THEN
2426 pinf = vals(bcdat_outflow_press,distrib*ifl)
2441 IF ( ppatch%mixt%switches(bcswi_outflow_type) == bcopt_supersonic )
THEN
2442 l2 = lambda2*(
a*
a*drdn - dpdn)
2445 l5 = lambda5*(dpdn +
r*
a*dundn)
2446 l1 = lambda1*(dpdn -
r*
a*dundn)
2448 IF ( ppatch%reflect == bc_reflecting )
THEN
2449 l2 = lambda2*(
a*
a*drdn - dpdn)
2452 l5 = lambda5*(dpdn +
r*
a*dundn)
2455 l2 = lambda2*(
a*
a*drdn - dpdn)
2458 l5 = lambda5*(dpdn +
r*
a*dundn)
2459 l1 = nscbck*(p-pinf)
2467 d1 = (l2 + 0.5_rfreal*(l1+l5))/(
a*
a)
2468 d2 = 0.5_rfreal*(l1+l5)
2469 d3 = (l5-l1)/(2.0_rfreal*
r*
a)
2477 rhs1 = d1 +
r*dusds + us*drds +
r*dutdt + ut*drdt
2478 rhs2 = un*d1 +
r*d3 +
r*un*dusds +
r*us*dunds + un*us*drds &
2479 +
r*un*dutdt +
r*ut*dundt + un*ut*drdt
2480 rhs3 = us*d1 +
r*d4 + dpds &
2481 + 2.0_rfreal*
r*us*dusds + us*us*drds &
2482 +
r*us*dutdt +
r*ut*dusdt + us*ut*drdt
2483 rhs4 = ut*d1 +
r*d5 + dpdt &
2484 +
r*ut*dusds +
r*us*dutds + ut*us*drds &
2485 + 2.0_rfreal*
r*ut*dutdt + ut*ut*drdt
2486 rhs5 = 0.5_rfreal*(un*un+us*us+ut*ut)*d1 + d2/(
g-1.0_rfreal) &
2487 +
r*un*d3 +
r*us*d4 +
r*ut*d5 &
2488 + us*( 0.5_rfreal*(un*un+us*us+ut*ut)*drds &
2489 +
r*(un*dunds+us*dusds+ut*dutds) &
2490 +
g*dpds/(
g-1.0_rfreal) ) &
2491 + (0.5_rfreal*
r*(un*un+us*us+ut*ut) &
2492 +
g*p/(
g-1.0_rfreal))*dusds &
2493 + ut*( 0.5_rfreal*(un*un+us*us+ut*ut)*drdt &
2494 +
r*(un*dundt+us*dusdt+ut*dutdt) &
2495 +
g*dpdt/(
g-1.0_rfreal) ) &
2496 + (0.5_rfreal*
r*(un*un+us*us+ut*ut) &
2497 +
g*p/(
g-1.0_rfreal))*dutdt
2499 prhs(cv_mixt_dens,ifl) = rhs1
2500 prhs(cv_mixt_xmom,ifl) = rhs2*dxdn + rhs3*dxds + rhs4*dxdt
2501 prhs(cv_mixt_ymom,ifl) = rhs2*dydn + rhs3*dyds + rhs4*dydt
2502 prhs(cv_mixt_zmom,ifl) = rhs2*dzdn + rhs3*dzds + rhs4*dzdt
2504 IF ( ppatch%mixt%switches(bcswi_outflow_type) == bcopt_supersonic )
THEN
2505 prhs(cv_mixt_ener,ifl) = rhs5
2506 ELSE IF ( ppatch%mixt%switches(bcswi_outflow_type) == bcopt_subsonic )
THEN
2507 IF ( ppatch%reflect == bc_reflecting )
THEN
2508 prhs(cv_mixt_ener,ifl) = 0.0_rfreal
2510 prhs(cv_mixt_ener,ifl) = rhs5
2561 TYPE(t_patch),
POINTER :: ppatch
2562 TYPE(t_region
),
POINTER :: pregion
2568 INTEGER :: bcopttype,c1,distrib,errorflag,ifl,indcp,indmol
2569 REAL(RFREAL) ::
a,aoa,aos,cp,d1,d2,d3,d4,d5,dotproduct,dndx,dndy,dndz,dpdn, &
2570 dpds,dpdt,dpdx,dpdy,dpdz,drdn,drds,drdt,drdx,drdy,drdz,dsdx, &
2571 dsdy,dsdz,dtdx,dtdy,dtdz,dudn,duds,dudt,dudx,dudy,dudz,dundn, &
2572 dunds,dundt,dusdn,dusds,dusdt,dutdn,dutds,dutdt,dvdn,dvds, &
2573 dvdt,dvdx,dvdy,dvdz,dwdn,dwds,dwdt,dwdx,dwdy,dwdz,dxdn,dxds, &
2574 dxdt,dydn,dyds,dydt,dzdn,dzds,dzdt,
g,l1,l2,l3,l4,l5,lambda1, &
2575 lambda2,lambda3,lambda4,lambda5,mm,mf,mfnormal,nscbck,nx,ny, &
2576 nz,p,pinf,
r,rgas,rhs1,rhs2,rhs3,rhs4,rhs5,ru,rv,rw,sx,sy,sz, &
2577 t,tx,ty,tz,u,un,us,ut,
v,w
2578 REAL(RFREAL),
POINTER,
DIMENSION(:,:) :: pcv,pdv,prhs,pgv,vals
2579 REAL(RFREAL),
DIMENSION(:,:,:),
POINTER :: pgradface
2586 global => pregion%global
2589 'RFLU_ModNSCBC.F90')
2595 indcp = pregion%mixtInput%indCp
2596 indmol = pregion%mixtInput%indMol
2598 pcv => ppatch%mixt%cv
2599 pdv => ppatch%mixt%dv
2600 pgv => pregion%mixt%gv
2601 prhs => ppatch%mixt%rhs
2603 pgradface => ppatch%mixt%gradFace
2605 DO ifl = 1,ppatch%nBFaces
2606 c1 = ppatch%bf2c(ifl)
2608 cp = pgv(gv_mixt_cp ,indcp *c1)
2609 mm = pgv(gv_mixt_mol,indmol*c1)
2613 nx = ppatch%fn(xcoord,ifl)
2614 ny = ppatch%fn(ycoord,ifl)
2615 nz = ppatch%fn(zcoord,ifl)
2617 r = pcv(cv_mixt_dens,ifl)
2618 ru = pcv(cv_mixt_xmom,ifl)
2619 rv = pcv(cv_mixt_ymom,ifl)
2620 rw = pcv(cv_mixt_zmom,ifl)
2621 p = pdv(dv_mixt_pres,ifl)
2622 a = pdv(dv_mixt_soun,ifl)
2628 drdx = pgradface(xcoord,grbf_mixt_dens,ifl)
2629 drdy = pgradface(ycoord,grbf_mixt_dens,ifl)
2630 drdz = pgradface(zcoord,grbf_mixt_dens,ifl)
2632 dudx = pgradface(xcoord,grbf_mixt_xvel,ifl)
2633 dudy = pgradface(ycoord,grbf_mixt_xvel,ifl)
2634 dudz = pgradface(zcoord,grbf_mixt_xvel,ifl)
2636 dvdx = pgradface(xcoord,grbf_mixt_yvel,ifl)
2637 dvdy = pgradface(ycoord,grbf_mixt_yvel,ifl)
2638 dvdz = pgradface(zcoord,grbf_mixt_yvel,ifl)
2640 dwdx = pgradface(xcoord,grbf_mixt_zvel,ifl)
2641 dwdy = pgradface(ycoord,grbf_mixt_zvel,ifl)
2642 dwdz = pgradface(zcoord,grbf_mixt_zvel,ifl)
2644 dpdx = pgradface(xcoord,grbf_mixt_pres,ifl)
2645 dpdy = pgradface(ycoord,grbf_mixt_pres,ifl)
2646 dpdz = pgradface(zcoord,grbf_mixt_pres,ifl)
2663 l2 = lambda2*(
a*
a*drdy - dpdy)
2669 l5 = lambda5*(dpdy +
r*
a*dvdy)
2672 l1 = lambda1*(dpdy -
r*
a*dvdy)
2680 d1 = (l2 + 0.5_rfreal*(l1+l5))/(
a*
a)
2681 d2 = 0.5_rfreal*(l1+l5)
2683 d4 = (l5-l1)/(2.0_rfreal*
r*
a)
2690 prhs(cv_mixt_dens,ifl) =
r*dudx + u*drdx + d1 +
r*dwdz + w*drdz
2691 prhs(cv_mixt_xmom,ifl) = u*d1 +
r*d3 + dpdx &
2692 + 2.0_rfreal*
r*u*dudx + u*u*drdx &
2693 +
r*u*dwdz +
r*w*dudz + u*w*drdz
2697 prhs(cv_mixt_ymom,ifl) = 0.0_rfreal
2699 prhs(cv_mixt_zmom,ifl) = w*d1 +
r*d5 + dpdz &
2700 +
r*w*dudx +
r*u*dwdx + w*u*drdx &
2701 + 2.0_rfreal*
r*w*dwdz + w*w*drdz
2703 prhs(cv_mixt_ener,ifl) = 0.5_rfreal*(u*u+
v*
v+w*w)*d1 + d2/(
g-1.0_rfreal) &
2704 +
r*u*d3 +
r*
v*d4 +
r*w*d5 &
2705 + u*( 0.5_rfreal*(u*u+
v*
v+w*w)*drdx &
2706 +
r*(u*dudx+
v*dvdx+w*dwdx) &
2707 +
g*dpdx/(
g-1.0_rfreal) ) &
2708 + (0.5_rfreal*
r*(u*u+
v*
v+w*w)+
g*p/(
g-1.0_rfreal))*dudx &
2709 + w*( 0.5_rfreal*(u*u+
v*
v+w*w)*drdz &
2710 +
r*(u*dudz+
v*dvdz+w*dwdz) &
2711 +
g*dpdz/(
g-1.0_rfreal) ) &
2712 + (0.5_rfreal*
r*(u*u+
v*
v+w*w)+
g*p/(
g-1.0_rfreal))*dwdz
2759 TYPE(t_region
),
POINTER :: pregion
2766 TYPE(t_patch),
POINTER :: ppatch
2773 global => pregion%global
2776 'RFLU_ModNSCBC.F90')
2788 patchloop:
DO ipatch = 1,pregion%grid%nPatches
2789 ppatch => pregion%patches(ipatch)
2791 IF ( ppatch%bcKind == bc_kind_nscbc )
THEN
2840 TYPE(t_patch),
POINTER :: ppatch
2841 TYPE(t_region
),
POINTER :: pregion
2848 INTEGER :: errorflag,ifl,c1,bcopttype,distrib,gasmodel,indcp,indgs,indmol
2849 REAL(RFREAL) :: aoa,aos,corr,cp,irl,eo,
g,gc,liftcoef,mf,mw,nm,nx,ny,nz,pf, &
2850 pl,pr,rel,rer,rl,rr,rul,rur,rvl,rvr,rwl,rwr,tf,ul,vl,wl,xc, &
2852 REAL(RFREAL),
DIMENSION(:,:),
POINTER :: cv,dv,gv,vals
2859 global => pregion%global
2862 'RFLU_ModNSCBC.F90')
2868 corr = ppatch%mixt%switches(bcswi_farf_corr)
2870 vals => ppatch%mixt%vals
2872 IF ( corr == bcopt_corr_yes )
THEN
2876 liftcoef = 0.0_rfreal
2879 indcp = pregion%mixtInput%indCp
2880 indmol = pregion%mixtInput%indMol
2881 gasmodel = pregion%mixtInput%gasModel
2883 distrib = ppatch%mixt%distrib
2885 ppatch%mixt%cvState = cv_mixt_state_cons
2887 IF (pregion%mixt%cvState /= cv_mixt_state_cons )
THEN
2888 CALL
errorstop(global,err_cv_state_invalid,__line__, &
2889 'region mixt cvState is incompatible...')
2892 DO ifl = 1,ppatch%nBFaces
2893 c1 = ppatch%bf2c(ifl)
2895 nx = ppatch%fn(xcoord,ifl)
2896 ny = ppatch%fn(ycoord,ifl)
2897 nz = ppatch%fn(zcoord,ifl)
2898 nm = ppatch%fn(xyzmag,ifl)
2900 xc = ppatch%fc(xcoord,ifl)
2901 yc = ppatch%fc(ycoord,ifl)
2902 zc = ppatch%fc(zcoord,ifl)
2904 rl = pregion%mixt%cv(cv_mixt_dens,c1)
2906 rul = pregion%mixt%cv(cv_mixt_xmom,c1)*irl
2907 rvl = pregion%mixt%cv(cv_mixt_ymom,c1)*irl
2908 rwl = pregion%mixt%cv(cv_mixt_zmom,c1)*irl
2909 rel = pregion%mixt%cv(cv_mixt_ener,c1)*irl
2911 pl = pregion%mixt%dv(dv_mixt_pres,c1)
2913 mf = vals(bcdat_farf_mach ,distrib*ifl)
2914 aoa = vals(bcdat_farf_attack,distrib*ifl)
2915 aos = vals(bcdat_farf_slip ,distrib*ifl)
2916 pf = vals(bcdat_farf_press ,distrib*ifl)
2917 tf = vals(bcdat_farf_temp ,distrib*ifl)
2919 IF ( gasmodel == gas_model_tcperf )
THEN
2921 mw = pregion%mixt%gv(gv_mixt_mol,indmol*c1)
2922 cp = pregion%mixt%gv(gv_mixt_cp ,indcp *c1)
2929 aoa,aos,corrflag,liftcoef,xc,yc, &
2930 zc,rl,rul,rvl,rwl,rel,rr,rur, &
2933 CALL
errorstop(global,err_reached_default,__line__)
2936 ppatch%mixt%cv(cv_mixt_dens,ifl) = rr
2937 ppatch%mixt%cv(cv_mixt_xmom,ifl) = rur
2938 ppatch%mixt%cv(cv_mixt_ymom,ifl) = rvr
2939 ppatch%mixt%cv(cv_mixt_zmom,ifl) = rwr
2940 ppatch%mixt%cv(cv_mixt_ener,ifl) = rer
2944 ppatch%mixt%cv(cv_mixt_dens,ifl) = pregion%mixt%cv(cv_mixt_dens,c1)
2945 ppatch%mixt%cv(cv_mixt_xmom,ifl) = pregion%mixt%cv(cv_mixt_xmom,c1)
2946 ppatch%mixt%cv(cv_mixt_ymom,ifl) = pregion%mixt%cv(cv_mixt_ymom,c1)
2947 ppatch%mixt%cv(cv_mixt_zmom,ifl) = pregion%mixt%cv(cv_mixt_zmom,c1)
2948 ppatch%mixt%cv(cv_mixt_ener,ifl) = pregion%mixt%cv(cv_mixt_ener,c1)
2994 TYPE(t_patch),
POINTER :: ppatch
2995 TYPE(t_region
),
POINTER :: pregion
3001 INTEGER :: errorflag,ifl,c1
3002 INTEGER :: bcoptfixed,bcopttype,distrib,gasmodel,indcp,indgs,indmol
3003 REAL(RFREAL) :: cp,betah,betav,
g,gc,mach,mw,nx,ny,nz,nm,pr,ptot,rer,rl,rr, &
3004 rul,rvl,rwl,rur,rvr,rwr,ttot
3005 REAL(RFREAL),
DIMENSION(:,:),
POINTER :: cv,dv,gv,vals
3012 global => pregion%global
3015 'RFLU_ModNSCBC.F90')
3021 indcp = pregion%mixtInput%indCp
3022 indmol = pregion%mixtInput%indMol
3024 distrib = ppatch%mixt%distrib
3025 bcopttype = ppatch%mixt%switches(bcswi_inflow_type)
3026 bcoptfixed = ppatch%mixt%switches(bcswi_inflow_fixed)
3028 vals => ppatch%mixt%vals
3030 ppatch%mixt%cvState = cv_mixt_state_cons
3032 IF (pregion%mixt%cvState /= cv_mixt_state_cons )
THEN
3033 CALL
errorstop(global,err_cv_state_invalid,__line__, &
3034 'region mixt cvState is incompatible...')
3037 DO ifl = 1,ppatch%nBFaces
3038 c1 = ppatch%bf2c(ifl)
3040 mw = pregion%mixt%gv(gv_mixt_mol,indmol*c1)
3041 cp = pregion%mixt%gv(gv_mixt_cp ,indcp *c1)
3046 nx = ppatch%fn(xcoord,ifl)
3047 ny = ppatch%fn(ycoord,ifl)
3048 nz = ppatch%fn(zcoord,ifl)
3049 nm = ppatch%fn(xyzmag,ifl)
3051 rl = pregion%mixt%cv(cv_mixt_dens,c1)
3052 rul = pregion%mixt%cv(cv_mixt_xmom,c1)
3053 rvl = pregion%mixt%cv(cv_mixt_ymom,c1)
3054 rwl = pregion%mixt%cv(cv_mixt_zmom,c1)
3056 ptot = vals(bcdat_inflow_ptot, distrib*ifl)
3057 ttot = vals(bcdat_inflow_ttot, distrib*ifl)
3058 betah = vals(bcdat_inflow_betah,distrib*ifl)
3059 betav = vals(bcdat_inflow_betav,distrib*ifl)
3061 IF ( bcopttype == bcopt_supersonic )
THEN
3062 mach = vals(bcdat_inflow_mach,distrib*ifl)
3068 mach,nx,ny,nz,cp,mw,rl,rul,rvl,rwl,rr,rur, &
3071 ppatch%mixt%cv(cv_mixt_dens,ifl) = rr
3072 ppatch%mixt%cv(cv_mixt_xmom,ifl) = rur
3073 ppatch%mixt%cv(cv_mixt_ymom,ifl) = rvr
3074 ppatch%mixt%cv(cv_mixt_zmom,ifl) = rwr
3075 ppatch%mixt%cv(cv_mixt_ener,ifl) = rer
3118 TYPE(t_patch),
POINTER :: ppatch
3119 TYPE(t_region
),
POINTER :: pregion
3125 INTEGER :: errorflag,ifl,c1,bcopttype,distrib,gasmodel,indcp,indgs,indmol
3126 REAL(RFREAL) :: cp,eo,
g,gc,mw,pr,rl,rr,rur,rvr,rwr,tr,ur,vr,wr
3127 REAL(RFREAL),
DIMENSION(:,:),
POINTER :: cv,dv,gv,vals
3134 global => pregion%global
3137 'RFLU_ModNSCBC.F90')
3143 indcp = pregion%mixtInput%indCp
3144 indmol = pregion%mixtInput%indMol
3146 distrib = ppatch%mixt%distrib
3147 bcopttype = ppatch%mixt%switches(bcswi_inflow_type)
3149 vals => ppatch%mixt%vals
3151 ppatch%mixt%cvState = cv_mixt_state_cons
3153 IF (pregion%mixt%cvState /= cv_mixt_state_cons )
THEN
3154 CALL
errorstop(global,err_cv_state_invalid,__line__, &
3155 'region mixt cvState is incompatible...')
3158 DO ifl = 1,ppatch%nBFaces
3159 c1 = ppatch%bf2c(ifl)
3161 mw = pregion%mixt%gv(gv_mixt_mol,indmol*c1)
3162 cp = pregion%mixt%gv(gv_mixt_cp ,indcp *c1)
3167 rl = pregion%mixt%cv(cv_mixt_dens,c1)
3169 ur = vals(bcdat_inflow_u,distrib*ifl)
3170 vr = vals(bcdat_inflow_v,distrib*ifl)
3171 wr = vals(bcdat_inflow_w,distrib*ifl)
3172 tr = vals(bcdat_inflow_t,distrib*ifl)
3174 IF ( bcopttype == bcopt_supersonic )
THEN
3175 pr = vals(bcdat_inflow_p,distrib*ifl)
3186 ppatch%mixt%cv(cv_mixt_dens,ifl) = rr
3187 ppatch%mixt%cv(cv_mixt_xmom,ifl) = rur
3188 ppatch%mixt%cv(cv_mixt_ymom,ifl) = rvr
3189 ppatch%mixt%cv(cv_mixt_zmom,ifl) = rwr
3193 ppatch%mixt%cv(cv_mixt_ener,ifl) = rr*eo
3238 TYPE(t_patch),
POINTER :: ppatch
3239 TYPE(t_region
),
POINTER :: pregion
3251 global => pregion%global
3254 'RFLU_ModNSCBC.F90')
3260 ppatch%mixt%cv = 0.0_rfreal
3262 ppatch%mixt%cvState = cv_mixt_state_cons
3306 TYPE(t_patch),
POINTER :: ppatch
3307 TYPE(t_region
),
POINTER :: pregion
3319 global => pregion%global
3322 'RFLU_ModNSCBC.F90')
3328 ppatch%mixt%cv = 0.0_rfreal
3330 ppatch%mixt%cvState = cv_mixt_state_cons
3373 TYPE(t_patch),
POINTER :: ppatch
3374 TYPE(t_region
),
POINTER :: pregion
3386 global => pregion%global
3389 'RFLU_ModNSCBC.F90')
3395 ppatch%mixt%cv = 0.0_rfreal
3397 ppatch%mixt%cvState = cv_mixt_state_cons
3440 TYPE(t_patch),
POINTER :: ppatch
3441 TYPE(t_region
),
POINTER :: pregion
3447 INTEGER :: errorflag,ifl,c1,bcopttype,distrib,gasmodel,indcp,indgs,indmol
3448 REAL(RFREAL) :: cp,eo,
g,gc,mw,pl,pr,rl,rul,rvl,rwl,rel,ul,vl,wl
3449 REAL(RFREAL),
DIMENSION(:,:),
POINTER :: cv,dv,gv,vals
3456 global => pregion%global
3459 'RFLU_ModNSCBC.F90')
3465 indcp = pregion%mixtInput%indCp
3466 indmol = pregion%mixtInput%indMol
3468 distrib = ppatch%mixt%distrib
3469 bcopttype = ppatch%mixt%switches(bcswi_outflow_type)
3471 IF ( bcopttype /= bcopt_supersonic )
THEN
3472 vals => ppatch%mixt%vals
3475 ppatch%mixt%cvState = cv_mixt_state_cons
3477 IF (pregion%mixt%cvState /= cv_mixt_state_cons )
THEN
3478 CALL
errorstop(global,err_cv_state_invalid,__line__, &
3479 'region mixt cvState is incompatible...')
3482 DO ifl = 1,ppatch%nBFaces
3483 c1 = ppatch%bf2c(ifl)
3485 mw = pregion%mixt%gv(gv_mixt_mol,indmol*c1)
3486 cp = pregion%mixt%gv(gv_mixt_cp ,indcp *c1)
3491 rl = pregion%mixt%cv(cv_mixt_dens,c1)
3492 rul = pregion%mixt%cv(cv_mixt_xmom,c1)
3493 rvl = pregion%mixt%cv(cv_mixt_ymom,c1)
3494 rwl = pregion%mixt%cv(cv_mixt_zmom,c1)
3495 rel = pregion%mixt%cv(cv_mixt_ener,c1)
3501 pl = pregion%mixt%dv(dv_mixt_pres,c1)
3503 IF ( bcopttype /= bcopt_supersonic )
THEN
3504 pr = vals(bcdat_outflow_press,distrib*ifl)
3509 ppatch%mixt%cv(cv_mixt_dens,ifl) = rl
3510 ppatch%mixt%cv(cv_mixt_xmom,ifl) = rul
3511 ppatch%mixt%cv(cv_mixt_ymom,ifl) = rvl
3512 ppatch%mixt%cv(cv_mixt_zmom,ifl) = rwl
3516 ppatch%mixt%cv(cv_mixt_ener,ifl) = rl*eo
3561 TYPE(t_patch),
POINTER :: ppatch
3562 TYPE(t_region
),
POINTER :: pregion
3568 INTEGER :: errorflag,ifl,c1,bcopttype,distrib,gasmodel,indcp,indgs,indmol
3569 REAL(RFREAL) :: cp,eo,
g,gc,mw,rl,rr,rul,rvl,rwl,rel,pl,pr,ul,ur,vl,vr,wl,wr
3570 REAL(RFREAL),
DIMENSION(:,:),
POINTER :: cv,dv,gv,vals
3577 global => pregion%global
3580 'RFLU_ModNSCBC.F90')
3589 indcp = pregion%mixtInput%indCp
3590 indmol = pregion%mixtInput%indMol
3592 distrib = ppatch%mixt%distrib
3594 ppatch%mixt%cvState = cv_mixt_state_cons
3596 IF (pregion%mixt%cvState /= cv_mixt_state_cons )
THEN
3597 CALL
errorstop(global,err_cv_state_invalid,__line__, &
3598 'region mixt cvState is incompatible...')
3601 DO ifl = 1,ppatch%nBFaces
3602 c1 = ppatch%bf2c(ifl)
3604 mw = pregion%mixt%gv(gv_mixt_mol,indmol*c1)
3605 cp = pregion%mixt%gv(gv_mixt_cp ,indcp *c1)
3610 rl = pregion%mixt%cv(cv_mixt_dens,c1)
3611 rul = pregion%mixt%cv(cv_mixt_xmom,c1)
3612 rvl = pregion%mixt%cv(cv_mixt_ymom,c1)
3613 rwl = pregion%mixt%cv(cv_mixt_zmom,c1)
3614 rel = pregion%mixt%cv(cv_mixt_ener,c1)
3620 pl = pregion%mixt%dv(dv_mixt_pres,c1)
3630 ppatch%mixt%cv(cv_mixt_dens,ifl) = rr
3631 ppatch%mixt%cv(cv_mixt_xmom,ifl) = rr*ur
3632 ppatch%mixt%cv(cv_mixt_ymom,ifl) = rr*vr
3633 ppatch%mixt%cv(cv_mixt_zmom,ifl) = rr*wr
3637 ppatch%mixt%cv(cv_mixt_ener,ifl) = rr*eo
subroutine, private rflu_nscbc_comprhsifveltemp(pRegion, pPatch)
subroutine, private rflu_nscbc_comprhsnswheat(pRegion, pPatch)
real(rfreal) function mixtperf_p_deogvm2(D, Eo, G, Vm2)
real(rfreal) function mixtperf_r_m(M)
subroutine, private rflu_nscbc_comprhsij(pRegion, pPatch)
subroutine, private rflu_nscbc_comprhsnswtemp(pRegion, pPatch)
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_nscbc_initsw(pRegion, pPatch)
subroutine, public rflu_nscbc_initiftotang(pRegion, pPatch)
LOGICAL function rflu_decideneedbgradface(pRegion, pPatch)
Vector_n max(const Array_n_const &v1, const Array_n_const &v2)
subroutine, private rflu_nscbc_comprhsff(pRegion, pPatch)
real(rfreal) function mixtperf_c_dgp(D, G, P)
subroutine registerfunction(global, funName, fileName)
subroutine, public rflu_nscbc_comprhs(pRegion)
real(rfreal) function mixtperf_d_prt(P, R, T)
subroutine, public rflu_nscbc_initff(pRegion, pPatch)
real(rfreal) function mixtperf_c_ghovm2(G, Ho, Vm2)
real(rfreal) function mixtperf_r_cpg(Cp, G)
subroutine, public rflu_nscbc_initifveltemp(pRegion, pPatch)
real(rfreal) function, public entropyfixhartenhyman(l, d)
*********************************************************************Illinois Open Source License ****University of Illinois NCSA **Open Source License University of Illinois All rights reserved ****Developed free of to any person **obtaining a copy of this software and associated documentation to deal with the Software without including without limitation the rights to and or **sell copies of the and to permit persons to whom the **Software is furnished to do subject to the following this list of conditions and the following disclaimers ****Redistributions in binary form must reproduce the above **copyright this list of conditions and the following **disclaimers in the documentation and or other materials **provided with the distribution ****Neither the names of the Center for Simulation of Advanced the University of nor the names of its **contributors may be used to endorse or promote products derived **from this Software without specific prior written permission ****THE SOFTWARE IS PROVIDED AS 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 v
subroutine, public rflu_computegradbfaceswrapper(pRegion, pPatch, iBegVar, iEndVar, iBegGrad, iEndGrad, var, grad)
subroutine, public rflu_convertcvcons2prim(pRegion, cvStateFuture)
subroutine, public rflu_nscbc_initnswtemp(pRegion, pPatch)
LOGICAL function, public rflu_nscbc_decidehavenscbc(pRegion)
subroutine bcondoutflowperf(bcOpt, pout, sxn, syn, szn, cpgas, mol, rho, rhou, rhov, rhow, rhoe, press, rhob, rhoub, rhovb, rhowb, rhoeb)
real(rfreal) function mixtperf_ho_cptuvw(Cp, T, U, V, W)
subroutine, private rflu_nscbc_comprhssw(pRegion, pPatch)
subroutine, public rflu_convertcvprim2cons(pRegion, cvStateFuture)
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, private rflu_nscbc_comprhsiftotang(pRegion, pPatch)
real(rfreal) function mixtperf_t_dpr(D, P, R)
subroutine, public rflu_nscbc_compsecondpatchflux(pRegion, pPatch)
subroutine bcondinflowperf(bcOptType, bcOptFixed, ptot, ttot, betah, betav, mach, sxn, syn, szn, cpgas, mm, rl, rul, rvl, rwl, rr, rur, rvr, rwr, rer, pr)
subroutine, public rflu_nscbc_comppatchflux(pRegion, pPatch)
Vector_n min(const Array_n_const &v1, const Array_n_const &v2)
subroutine rflu_printlocinfo(pRegion, locUnsorted, nLocUnsorted, locInfoMode, outputMode)
subroutine, public rflu_nscbc_initof(pRegion, pPatch)
subroutine, public rflu_bxv_convertcvcons2prim(pRegion, pPatch, cvStateFuture)
LOGICAL function rflu_decideprint(global)
real(rfreal) function mixtperf_eo_dgpuvw(D, G, P, U, V, W)
subroutine errorstop(global, errorCode, errorLine, addMessage)
subroutine, public rflu_nscbc_initij(pRegion, pPatch)
subroutine, private rflu_nscbc_comprhsof(pRegion, pPatch)
subroutine deregisterfunction(global)
subroutine, public rflu_nscbc_compfirstpatchflux(pRegion, pPatch)
real(rfreal) function mixtperf_g_cpr(Cp, R)
subroutine, public rflu_nscbc_initnswheat(pRegion, pPatch)
real(rfreal) function mixtperf_p_drt(D, R, T)
subroutine, public rflu_bxv_convertcvprim2cons(pRegion, pPatch, cvStateFuture)