59 CHARACTER(CHRLEN) :: &
60 RCSIdentString =
'$RCSfile: RFLU_ModHLLCFlux.F90,v $ $Revision: 1.10 $'
101 TYPE(t_region
),
POINTER :: pregion
113 global => pregion%global
116 'RFLU_ModHLLCFlux.F90')
122 SELECT CASE ( pregion%mixtInput%gasModel )
128 CASE ( gas_model_tcperf )
129 SELECT CASE ( pregion%mixtInput%spaceOrder )
130 CASE ( discr_order_1 )
132 CASE ( discr_order_2 )
135 CALL
errorstop(global,err_reached_default,__line__)
142 CASE ( gas_model_mixt_tcperf )
143 SELECT CASE ( pregion%mixtInput%spaceOrder )
144 CASE ( discr_order_1 )
146 CASE ( discr_order_2 )
149 CALL
errorstop(global,err_reached_default,__line__)
156 CASE ( gas_model_mixt_gasliq )
157 SELECT CASE ( pregion%mixtInput%spaceOrder )
158 CASE ( discr_order_1 )
160 CASE ( discr_order_2 )
163 CALL
errorstop(global,err_reached_default,__line__)
171 CALL
errorstop(global,err_reached_default,__line__)
224 TYPE(t_region
),
POINTER :: pregion
230 INTEGER :: c1,c2,ifg,indgs,indmf,indsd,ipatch
231 INTEGER,
DIMENSION(:,:),
POINTER :: f2c
232 REAL(RFREAL) :: bgh2,blh2,bp,bt,bvh2,cml,cmr,cms,cvg,cvl,cvv,cgh2,clh2, &
233 cvh2,cvm,el,er,fs,irl,irr,nm,nx,ny,nz,ph,pl,po,pr,ps,ql, &
234 qr,qs,res,rgh,rgl,rgr,rh,rl,rlh,ro,rr,
rs,rus,rvh,rvl,rvr, &
235 rvs,rws,rygh,rygl,rygr,ryvh,ryvl,ryvr,rg,rv,sl,sm,sr, &
236 term,th,tl,to,tr,ul,ur,us,vfgh,vfgl,vfgr,vflh,vfvh,vfvl, &
237 vfvr,vl,vr,vs,vms,wl,wr,ws,wt1,wt2
238 REAL(RFREAL) :: flx(5)
239 REAL(RFREAL),
DIMENSION(:),
POINTER :: pmf
240 REAL(RFREAL),
DIMENSION(:,:),
POINTER :: pcvmixt,pcvspec,pdvmixt,prhs,psd
242 TYPE(t_grid),
POINTER :: pgrid
243 TYPE(t_patch),
POINTER :: ppatch
249 global => pregion%global
252 'RFLU_ModHLLCFlux.F90')
258 pgrid => pregion%grid
262 indmf = pregion%mixtInput%indMfMixt
263 indsd = pregion%mixtInput%indSd
265 pcvmixt => pregion%mixt%cv
266 pdvmixt => pregion%mixt%dv
267 pcvspec => pregion%spec%cv
269 pmf => pregion%mixt%mfMixt
270 prhs => pregion%mixt%rhs
271 psd => pregion%mixt%sd
273 IF ( pregion%spec%cvState /= cv_mixt_state_cons )
THEN
274 CALL
errorstop(global,err_cv_state_invalid,__line__)
277 IF ( pregion%mixtInput%gasModel /= gas_model_mixt_gasliq )
THEN
278 CALL
errorstop(global,err_gasmodel_invalid,__line__)
285 ro = global%refDensityLiq
286 po = global%refPressLiq
287 to = global%refTempLiq
288 bp = global%refBetaPLiq
289 bt = global%refBetaTLiq
290 cvl = global%refCvLiq
292 rg =
mixtperf_r_m(pregion%specInput%specType(1)%pMaterial%molw)
295 rv =
mixtperf_r_m(pregion%specInput%specType(2)%pMaterial%molw)
302 DO ifg = 1,pgrid%nFaces
303 c1 = pgrid%f2c(1,ifg)
304 c2 = pgrid%f2c(2,ifg)
310 nx = pgrid%fn(xcoord,ifg)
311 ny = pgrid%fn(ycoord,ifg)
312 nz = pgrid%fn(zcoord,ifg)
313 nm = pgrid%fn(xyzmag,ifg)
315 fs = pgrid%gs(indgs*ifg)
325 rl = pcvmixt(cv_mixt_dens,c1)
328 ul = pcvmixt(cv_mixt_xmom,c1)*irl
329 vl = pcvmixt(cv_mixt_ymom,c1)*irl
330 wl = pcvmixt(cv_mixt_zmom,c1)*irl
331 el = pcvmixt(cv_mixt_ener,c1)*irl
332 pl = pdvmixt(dv_mixt_pres,c1)
333 tl = pdvmixt(dv_mixt_temp,c1)
334 cml = pdvmixt(dv_mixt_soun,c1)
345 ql = ul*nx + vl*ny + wl*nz - fs
351 rr = pcvmixt(cv_mixt_dens,c2)
354 ur = pcvmixt(cv_mixt_xmom,c2)*irr
355 vr = pcvmixt(cv_mixt_ymom,c2)*irr
356 wr = pcvmixt(cv_mixt_zmom,c2)*irr
357 er = pcvmixt(cv_mixt_ener,c2)*irr
358 pr = pdvmixt(dv_mixt_pres,c2)
359 tr = pdvmixt(dv_mixt_temp,c2)
360 cmr = pdvmixt(dv_mixt_soun,c2)
371 qr = ur*nx + vr*ny + wr*nz - fs
378 wt2 = 1.0_rfreal/(1.0_rfreal + wt1)
384 us = wt2*(ul + wt1*ur)
385 vs = wt2*(vl + wt1*vr)
386 ws = wt2*(wl + wt1*wr)
387 qs = wt2*(ql + wt1*qr)
389 vms = us*us + vs*vs + ws*ws
392 ph = wt2*(pl + wt1*pr)
393 th = wt2*(tl + wt1*tr)
394 rygh = wt2*(rygl + wt1*rygr)
395 ryvh = wt2*(ryvl + wt1*ryvr)
404 IF ( vfgh > 1.0_rfreal)
THEN
407 ELSE IF ( vfgh < 0.0_rfreal)
THEN
409 ELSE IF ( vfvh > 1.0_rfreal)
THEN
412 ELSE IF ( vfvh < 0.0_rfreal)
THEN
416 vflh = 1.0_rfreal - vfvh - vfgh
418 IF ( vflh > 1.0_rfreal )
THEN
420 ELSE IF ( vflh < 0.0_rfreal)
THEN
432 cvm = (rlh*vflh*cvl + rvh*vfvh*cvv + rgh*vfgh*cvg)/rh
434 cms =
mixtgasliq_c(cvm,rh,ph,rlh,rvh,rgh,vflh,vfvh,vfgh,clh2,cvh2,cgh2, &
437 sl =
min(ql-cml,qs-cms)
438 sr =
max(qr+cmr,qs+cms)
444 IF ( sl > 0.0_rfreal )
THEN
446 flx(2) = (ql* rl*ul + pl*nx )*nm
447 flx(3) = (ql* rl*vl + pl*ny )*nm
448 flx(4) = (ql* rl*wl + pl*nz )*nm
449 flx(5) = (ql*(rl*el + pl) + pl*fs)*nm
450 ELSE IF ( sr < 0.0_rfreal )
THEN
452 flx(2) = (qr* rr*ur + pr*nx )*nm
453 flx(3) = (qr* rr*vr + pr*ny )*nm
454 flx(4) = (qr* rr*wr + pr*nz )*nm
455 flx(5) = (qr*(rr*er + pr) + pr*fs)*nm
457 sm = (rr*qr*(sr-qr) - rl*ql*(sl-ql) - pr + pl)/(rr*(sr-qr) - rl*(sl-ql))
458 ps = pl + rl*(ql-sl)*(ql-sm)
460 IF ( sm > 0.0_rfreal )
THEN
461 term = 1.0_rfreal/(sl-sm)
464 rus =
term*((sl-ql)*rl*ul + (ps - pl )*nx)
465 rvs =
term*((sl-ql)*rl*vl + (ps - pl )*ny)
466 rws =
term*((sl-ql)*rl*wl + (ps - pl )*nz)
467 res =
term*((sl-ql)*rl*el + (ps*sm - pl*ql) )
469 term = 1.0_rfreal/(sr-sm)
472 rus =
term*((sr-qr)*rr*ur + (ps - pr )*nx)
473 rvs =
term*((sr-qr)*rr*vr + (ps - pr )*ny)
474 rws =
term*((sr-qr)*rr*wr + (ps - pr )*nz)
475 res =
term*((sr-qr)*rr*er + (ps*sm - pr*qr) )
479 flx(2) = (sm* rus + ps*nx )*nm
480 flx(3) = (sm* rvs + ps*ny )*nm
481 flx(4) = (sm* rws + ps*nz )*nm
482 flx(5) = (sm*(res + ps) + ps*fs)*nm
489 pmf(indmf*ifg) = flx(1)
495 prhs(cv_mixt_dens,c1) = prhs(cv_mixt_dens,c1) + flx(1)
496 prhs(cv_mixt_xmom,c1) = prhs(cv_mixt_xmom,c1) + flx(2)
497 prhs(cv_mixt_ymom,c1) = prhs(cv_mixt_ymom,c1) + flx(3)
498 prhs(cv_mixt_zmom,c1) = prhs(cv_mixt_zmom,c1) + flx(4)
499 prhs(cv_mixt_ener,c1) = prhs(cv_mixt_ener,c1) + flx(5)
501 prhs(cv_mixt_dens,c2) = prhs(cv_mixt_dens,c2) - flx(1)
502 prhs(cv_mixt_xmom,c2) = prhs(cv_mixt_xmom,c2) - flx(2)
503 prhs(cv_mixt_ymom,c2) = prhs(cv_mixt_ymom,c2) - flx(3)
504 prhs(cv_mixt_zmom,c2) = prhs(cv_mixt_zmom,c2) - flx(4)
505 prhs(cv_mixt_ener,c2) = prhs(cv_mixt_ener,c2) - flx(5)
511 psd(sd_xmom,c1*indsd) = psd(sd_xmom,c1*indsd) + us*pmf(indmf*ifg)
512 psd(sd_ymom,c1*indsd) = psd(sd_ymom,c1*indsd) + vs*pmf(indmf*ifg)
513 psd(sd_zmom,c1*indsd) = psd(sd_zmom,c1*indsd) + ws*pmf(indmf*ifg)
515 psd(sd_xmom,c2*indsd) = psd(sd_xmom,c2*indsd) - us*pmf(indmf*ifg)
516 psd(sd_ymom,c2*indsd) = psd(sd_ymom,c2*indsd) - vs*pmf(indmf*ifg)
517 psd(sd_zmom,c2*indsd) = psd(sd_zmom,c2*indsd) - ws*pmf(indmf*ifg)
524 DO ipatch = 1,pregion%grid%nPatches
525 ppatch => pregion%patches(ipatch)
584 TYPE(t_region
),
POINTER :: pregion
590 INTEGER :: c1,c2,ifg,indcp,indgs,indmf,indmol,indsd,ipatch
591 REAL(RFREAL) :: al,ar,as,cpl,cpr,el,er,fs,gcl,gcr,gl,gr,gs,hl,hr,hs,irl, &
592 irr,mml,mmr,nm,nx,ny,nz,ql,qr,qs,pl,pr,ps,rl,rr,res,
rs, &
593 rus,rvs,rws,sl,sm,sr,
term,ul,ur,us,vl,vml,vmr,vms,vr,vs, &
595 REAL(RFREAL) :: flx(5)
596 REAL(RFREAL),
DIMENSION(:),
POINTER :: pmf
597 REAL(RFREAL),
DIMENSION(:,:),
POINTER :: pcv,pdv,pgv,prhs,psd
599 TYPE(t_grid),
POINTER :: pgrid
600 TYPE(t_patch),
POINTER :: ppatch
604 REAL(RFREAL) :: cps,gcs,mms,y1,y2,ys
605 REAL(RFREAL),
DIMENSION(:,:),
POINTER :: pcvspec
613 global => pregion%global
616 'RFLU_ModHLLCFlux.F90')
619 CALL fprofiler_begins(
"RFLU::HLLC_ComputeFlux1_MTCP")
626 pgrid => pregion%grid
630 indcp = pregion%mixtInput%indCp
631 indmf = pregion%mixtInput%indMfMixt
632 indmol = pregion%mixtInput%indMol
633 indsd = pregion%mixtInput%indSd
635 pcv => pregion%mixt%cv
636 pdv => pregion%mixt%dv
637 pgv => pregion%mixt%gv
639 pmf => pregion%mixt%mfMixt
640 prhs => pregion%mixt%rhs
641 psd => pregion%mixt%sd
644 pcvspec => pregion%spec%cv
647 IF ( pregion%spec%cvState /= cv_mixt_state_cons )
THEN
648 CALL
errorstop(global,err_cv_state_invalid,__line__)
651 IF ( pregion%mixtInput%gasModel /= gas_model_mixt_tcperf )
THEN
652 CALL
errorstop(global,err_gasmodel_invalid,__line__)
655 IF ( (indcp /= 1) .OR. (indmol /= 1) )
THEN
656 CALL
errorstop(global,err_reached_default,__line__)
663 DO ifg = 1,pgrid%nFaces
664 c1 = pgrid%f2c(1,ifg)
665 c2 = pgrid%f2c(2,ifg)
671 nx = pgrid%fn(xcoord,ifg)
672 ny = pgrid%fn(ycoord,ifg)
673 nz = pgrid%fn(zcoord,ifg)
674 nm = pgrid%fn(xyzmag,ifg)
676 fs = pgrid%gs(indgs*ifg)
686 rl = pcv(cv_mixt_dens,c1)
689 mml = pgv(gv_mixt_mol,c1)
690 cpl = pgv(gv_mixt_cp ,c1)
695 ul = pcv(cv_mixt_xmom,c1)*irl
696 vl = pcv(cv_mixt_ymom,c1)*irl
697 wl = pcv(cv_mixt_zmom,c1)*irl
698 pl = pdv(dv_mixt_pres,c1)
699 al = pdv(dv_mixt_soun,c1)
703 vml = ul*ul + vl*vl + wl*wl
704 ql = ul*nx + vl*ny + wl*nz - fs
711 rr = pcv(cv_mixt_dens,c2)
714 mmr = pgv(gv_mixt_mol,c2)
715 cpr = pgv(gv_mixt_cp ,c2)
720 ur = pcv(cv_mixt_xmom,c2)*irr
721 vr = pcv(cv_mixt_ymom,c2)*irr
722 wr = pcv(cv_mixt_zmom,c2)*irr
723 pr = pdv(dv_mixt_pres,c2)
724 ar = pdv(dv_mixt_soun,c2)
728 vmr = ur*ur + vr*vr + wr*wr
729 qr = ur*nx + vr*ny + wr*nz - fs
737 wt2 = 1.0_rfreal/(1.0_rfreal + wt1)
746 us = wt2*(ul + wt1*ur)
747 vs = wt2*(vl + wt1*vr)
748 ws = wt2*(wl + wt1*wr)
749 qs = wt2*(ql + wt1*qr)
750 hs = wt2*(hl + wt1*hr)
756 DO ispec = 1,pregion%specInput%nSpecies
757 pspectype => pregion%specInput%specType(ispec)
759 y1 = irl*pcvspec(ispec,c1)
760 y2 = irr*pcvspec(ispec,c2)
762 ys = wt2*(y1 + wt1*y2)
764 mms = mms + ys/pspectype%pMaterial%molw
765 cps = cps + ys*pspectype%pMaterial%spht
773 vms = us*us + vs*vs + ws*ws
775 sl =
min(ql-al,qs-as)
776 sr =
max(qr+ar,qs+as)
782 IF ( sl > 0.0_rfreal )
THEN
784 flx(2) = (ql* rl*ul + pl*nx )*nm
785 flx(3) = (ql* rl*vl + pl*ny )*nm
786 flx(4) = (ql* rl*wl + pl*nz )*nm
787 flx(5) = (ql*(rl*el + pl) + pl*fs)*nm
788 ELSE IF ( sr < 0.0_rfreal )
THEN
790 flx(2) = (qr* rr*ur + pr*nx )*nm
791 flx(3) = (qr* rr*vr + pr*ny )*nm
792 flx(4) = (qr* rr*wr + pr*nz )*nm
793 flx(5) = (qr*(rr*er + pr) + pr*fs)*nm
795 sm = (rr*qr*(sr-qr) - rl*ql*(sl-ql) - pr + pl)/(rr*(sr-qr) - rl*(sl-ql))
796 ps = pl + rl*(ql-sl)*(ql-sm)
798 IF ( sm > 0.0_rfreal )
THEN
799 term = 1.0_rfreal/(sl-sm)
802 rus =
term*((sl-ql)*rl*ul + (ps - pl )*nx)
803 rvs =
term*((sl-ql)*rl*vl + (ps - pl )*ny)
804 rws =
term*((sl-ql)*rl*wl + (ps - pl )*nz)
805 res =
term*((sl-ql)*rl*el + (ps*sm - pl*ql) )
807 term = 1.0_rfreal/(sr-sm)
810 rus =
term*((sr-qr)*rr*ur + (ps - pr )*nx)
811 rvs =
term*((sr-qr)*rr*vr + (ps - pr )*ny)
812 rws =
term*((sr-qr)*rr*wr + (ps - pr )*nz)
813 res =
term*((sr-qr)*rr*er + (ps*sm - pr*qr) )
817 flx(2) = (sm* rus + ps*nx )*nm
818 flx(3) = (sm* rvs + ps*ny )*nm
819 flx(4) = (sm* rws + ps*nz )*nm
820 flx(5) = (sm*(res + ps) - ps*fs)*nm
827 pmf(indmf*ifg) = flx(1)
833 prhs(cv_mixt_dens,c1) = prhs(cv_mixt_dens,c1) + flx(1)
834 prhs(cv_mixt_xmom,c1) = prhs(cv_mixt_xmom,c1) + flx(2)
835 prhs(cv_mixt_ymom,c1) = prhs(cv_mixt_ymom,c1) + flx(3)
836 prhs(cv_mixt_zmom,c1) = prhs(cv_mixt_zmom,c1) + flx(4)
837 prhs(cv_mixt_ener,c1) = prhs(cv_mixt_ener,c1) + flx(5)
839 prhs(cv_mixt_dens,c2) = prhs(cv_mixt_dens,c2) - flx(1)
840 prhs(cv_mixt_xmom,c2) = prhs(cv_mixt_xmom,c2) - flx(2)
841 prhs(cv_mixt_ymom,c2) = prhs(cv_mixt_ymom,c2) - flx(3)
842 prhs(cv_mixt_zmom,c2) = prhs(cv_mixt_zmom,c2) - flx(4)
843 prhs(cv_mixt_ener,c2) = prhs(cv_mixt_ener,c2) - flx(5)
849 psd(sd_xmom,c1*indsd) = psd(sd_xmom,c1*indsd) + us*pmf(indmf*ifg)
850 psd(sd_ymom,c1*indsd) = psd(sd_ymom,c1*indsd) + vs*pmf(indmf*ifg)
851 psd(sd_zmom,c1*indsd) = psd(sd_zmom,c1*indsd) + ws*pmf(indmf*ifg)
853 psd(sd_xmom,c2*indsd) = psd(sd_xmom,c2*indsd) - us*pmf(indmf*ifg)
854 psd(sd_ymom,c2*indsd) = psd(sd_ymom,c2*indsd) - vs*pmf(indmf*ifg)
855 psd(sd_zmom,c2*indsd) = psd(sd_zmom,c2*indsd) - ws*pmf(indmf*ifg)
862 DO ipatch = 1,pregion%grid%nPatches
863 ppatch => pregion%patches(ipatch)
873 CALL fprofiler_ends(
"RFLU::HLLC_ComputeFlux1_MTCP")
920 TYPE(t_region
),
POINTER :: pregion
926 INTEGER :: c1,c2,ifg,indgs,indmf,indsd,ipatch
927 INTEGER,
DIMENSION(:,:),
POINTER :: f2c
928 REAL(RFREAL) :: al,ar,as,el,er,fs,
g,hl,hr,hs,irl,irr,nm,nx,ny,nz,ql,qr, &
929 qs,pl,pr,ps,rl,rr,res,
rs,rus,rvs,rws,sl,sm,sr,
term,ul,ur, &
930 us,vl,vml,vmr,vms,vr,vs,wl,wr,ws,wt1,wt2
931 REAL(RFREAL) :: flx(5)
932 REAL(RFREAL),
DIMENSION(:),
POINTER :: pmf
933 REAL(RFREAL),
DIMENSION(:,:),
POINTER :: pcv,pdv,prhs,psd
935 TYPE(t_grid),
POINTER :: pgrid
936 TYPE(t_patch),
POINTER :: ppatch
942 global => pregion%global
945 'RFLU_ModHLLCFlux.F90')
948 CALL fprofiler_begins(
"RFLU::HLLC_ComputeFlux1_TCP")
955 pgrid => pregion%grid
959 indmf = pregion%mixtInput%indMfMixt
960 indsd = pregion%mixtInput%indSd
962 pcv => pregion%mixt%cv
963 pdv => pregion%mixt%dv
965 pmf => pregion%mixt%mfMixt
966 prhs => pregion%mixt%rhs
967 psd => pregion%mixt%sd
969 IF ( pregion%mixtInput%gasModel /= gas_model_tcperf )
THEN
970 CALL
errorstop(global,err_gasmodel_invalid,__line__)
979 DO ifg = 1,pgrid%nFaces
980 c1 = pgrid%f2c(1,ifg)
981 c2 = pgrid%f2c(2,ifg)
987 nx = pgrid%fn(xcoord,ifg)
988 ny = pgrid%fn(ycoord,ifg)
989 nz = pgrid%fn(zcoord,ifg)
990 nm = pgrid%fn(xyzmag,ifg)
992 fs = pgrid%gs(indgs*ifg)
1002 rl = pcv(cv_mixt_dens,c1)
1005 ul = pcv(cv_mixt_xmom,c1)*irl
1006 vl = pcv(cv_mixt_ymom,c1)*irl
1007 wl = pcv(cv_mixt_zmom,c1)*irl
1008 el = pcv(cv_mixt_ener,c1)*irl
1009 pl = pdv(dv_mixt_pres,c1)
1010 al = pdv(dv_mixt_soun,c1)
1012 vml = ul*ul + vl*vl + wl*wl
1013 ql = ul*nx + vl*ny + wl*nz - fs
1020 rr = pcv(cv_mixt_dens,c2)
1023 ur = pcv(cv_mixt_xmom,c2)*irr
1024 vr = pcv(cv_mixt_ymom,c2)*irr
1025 wr = pcv(cv_mixt_zmom,c2)*irr
1026 er = pcv(cv_mixt_ener,c2)*irr
1027 pr = pdv(dv_mixt_pres,c2)
1028 ar = pdv(dv_mixt_soun,c2)
1030 vmr = ur*ur + vr*vr + wr*wr
1031 qr = ur*nx + vr*ny + wr*nz - fs
1039 wt2 = 1.0_rfreal/(1.0_rfreal + wt1)
1045 us = wt2*(ul + wt1*ur)
1046 vs = wt2*(vl + wt1*vr)
1047 ws = wt2*(wl + wt1*wr)
1048 qs = wt2*(ql + wt1*qr)
1049 hs = wt2*(hl + wt1*hr)
1051 vms = us*us + vs*vs + ws*ws
1053 sl =
min(ql-al,qs-as)
1054 sr =
max(qr+ar,qs+as)
1060 IF ( sl > 0.0_rfreal )
THEN
1062 flx(2) = (ql* rl*ul + pl*nx )*nm
1063 flx(3) = (ql* rl*vl + pl*ny )*nm
1064 flx(4) = (ql* rl*wl + pl*nz )*nm
1065 flx(5) = (ql*(rl*el + pl) + pl*fs)*nm
1066 ELSE IF ( sr < 0.0_rfreal )
THEN
1068 flx(2) = (qr* rr*ur + pr*nx )*nm
1069 flx(3) = (qr* rr*vr + pr*ny )*nm
1070 flx(4) = (qr* rr*wr + pr*nz )*nm
1071 flx(5) = (qr*(rr*er + pr) + pr*fs)*nm
1073 sm = (rr*qr*(sr-qr) - rl*ql*(sl-ql) - pr + pl)/(rr*(sr-qr) - rl*(sl-ql))
1074 ps = pl + rl*(ql-sl)*(ql-sm)
1076 IF ( sm > 0.0_rfreal )
THEN
1077 term = 1.0_rfreal/(sl-sm)
1080 rus =
term*((sl-ql)*rl*ul + (ps - pl )*nx)
1081 rvs =
term*((sl-ql)*rl*vl + (ps - pl )*ny)
1082 rws =
term*((sl-ql)*rl*wl + (ps - pl )*nz)
1083 res =
term*((sl-ql)*rl*el + (ps*sm - pl*ql) )
1085 term = 1.0_rfreal/(sr-sm)
1088 rus =
term*((sr-qr)*rr*ur + (ps - pr )*nx)
1089 rvs =
term*((sr-qr)*rr*vr + (ps - pr )*ny)
1090 rws =
term*((sr-qr)*rr*wr + (ps - pr )*nz)
1091 res =
term*((sr-qr)*rr*er + (ps*sm - pr*qr) )
1095 flx(2) = (sm* rus + ps*nx )*nm
1096 flx(3) = (sm* rvs + ps*ny )*nm
1097 flx(4) = (sm* rws + ps*nz )*nm
1098 flx(5) = (sm*(res + ps) - ps*fs)*nm
1105 pmf(indmf*ifg) = flx(1)
1111 prhs(cv_mixt_dens,c1) = prhs(cv_mixt_dens,c1) + flx(1)
1112 prhs(cv_mixt_xmom,c1) = prhs(cv_mixt_xmom,c1) + flx(2)
1113 prhs(cv_mixt_ymom,c1) = prhs(cv_mixt_ymom,c1) + flx(3)
1114 prhs(cv_mixt_zmom,c1) = prhs(cv_mixt_zmom,c1) + flx(4)
1115 prhs(cv_mixt_ener,c1) = prhs(cv_mixt_ener,c1) + flx(5)
1117 prhs(cv_mixt_dens,c2) = prhs(cv_mixt_dens,c2) - flx(1)
1118 prhs(cv_mixt_xmom,c2) = prhs(cv_mixt_xmom,c2) - flx(2)
1119 prhs(cv_mixt_ymom,c2) = prhs(cv_mixt_ymom,c2) - flx(3)
1120 prhs(cv_mixt_zmom,c2) = prhs(cv_mixt_zmom,c2) - flx(4)
1121 prhs(cv_mixt_ener,c2) = prhs(cv_mixt_ener,c2) - flx(5)
1127 psd(sd_xmom,c1*indsd) = psd(sd_xmom,c1*indsd) + us*pmf(indmf*ifg)
1128 psd(sd_ymom,c1*indsd) = psd(sd_ymom,c1*indsd) + vs*pmf(indmf*ifg)
1129 psd(sd_zmom,c1*indsd) = psd(sd_zmom,c1*indsd) + ws*pmf(indmf*ifg)
1131 psd(sd_xmom,c2*indsd) = psd(sd_xmom,c2*indsd) - us*pmf(indmf*ifg)
1132 psd(sd_ymom,c2*indsd) = psd(sd_ymom,c2*indsd) - vs*pmf(indmf*ifg)
1133 psd(sd_zmom,c2*indsd) = psd(sd_zmom,c2*indsd) - ws*pmf(indmf*ifg)
1140 DO ipatch = 1,pregion%grid%nPatches
1141 ppatch => pregion%patches(ipatch)
1151 CALL fprofiler_ends(
"RFLU::HLLC_ComputeFlux1_TCP")
1205 TYPE(t_region
),
POINTER :: pregion
1211 INTEGER :: c1,c2,ifg,indgs,indmf,indsd,ipatch
1212 REAL(RFREAL) :: bgh2,bgl2,bgr2,blh2,bll2,blr2,bp,bt,bvh2,bvl2,bvr2,cml, &
1213 cmr,cms,cvg,cvl,cvm,cvv,cgh2,cgl2,cgr2,clh2,cll2,clr2, &
1214 cvh2,cvl2,cvr2,
dx,
dy,
dz,el,er,fs,irl,irr,nm,nx,ny,nz,ph, &
1215 pl,po,pr,ps,ql,qr,qs,rel,rer,res,rgh,rgl,rgr,rh,rl,rlh, &
1216 rll,rlr,ro,rr,
rs,rus,rvh,rvl,rvr,rvs,rws,rygl,rygr,ryll, &
1217 rylr,ryvl,ryvr,rg,rv,sl,sm,sr,
term,th,tl,to,tr,ul,ur,us, &
1218 vfgh,vfgl,vfgr,vflh,vfll,vflr,vfvh,vfvl,vfvr,vl,vr,vs,vl2, &
1219 vms,vr2,wl,wr,ws,wt1,wt2,xc,yc,zc,ygl,ygr,yll,ylr,yvl,yvr
1220 REAL(RFREAL) :: flx(5)
1221 REAL(RFREAL),
DIMENSION(:),
POINTER :: pmf
1222 REAL(RFREAL),
DIMENSION(:,:),
POINTER :: pcvmixt,pcvspec,pdvmixt,prhs,psd
1223 REAL(RFREAL),
DIMENSION(:,:,:),
POINTER :: pgradmixt,pgradspec
1225 TYPE(t_grid),
POINTER :: pgrid
1226 TYPE(t_patch),
POINTER :: ppatch
1232 global => pregion%global
1235 'RFLU_ModHLLCFlux.F90')
1241 pgrid => pregion%grid
1245 indmf = pregion%mixtInput%indMfMixt
1246 indsd = pregion%mixtInput%indSd
1248 pcvmixt => pregion%mixt%cv
1249 pdvmixt => pregion%mixt%dv
1250 pcvspec => pregion%spec%cv
1252 pgradmixt => pregion%mixt%gradCell
1253 pgradspec => pregion%spec%gradCell
1255 pmf => pregion%mixt%mfMixt
1256 prhs => pregion%mixt%rhs
1257 psd => pregion%mixt%sd
1259 IF ( pregion%spec%cvState /= cv_mixt_state_cons )
THEN
1260 CALL
errorstop(global,err_cv_state_invalid,__line__)
1263 IF ( pregion%mixtInput%gasModel /= gas_model_mixt_gasliq )
THEN
1264 CALL
errorstop(global,err_gasmodel_invalid,__line__)
1271 ro = global%refDensityLiq
1272 po = global%refPressLiq
1273 to = global%refTempLiq
1274 bp = global%refBetaPLiq
1275 bt = global%refBetaTLiq
1276 cvl = global%refCvLiq
1278 rg =
mixtperf_r_m(pregion%specInput%specType(1)%pMaterial%molw)
1279 cvg =
mixtperf_cv_cpr(pregion%specInput%specType(1)%pMaterial%spht,rg)
1281 rv =
mixtperf_r_m(pregion%specInput%specType(2)%pMaterial%molw)
1282 cvv =
mixtperf_cv_cpr(pregion%specInput%specType(2)%pMaterial%spht,rv)
1288 DO ifg = 1,pgrid%nFaces
1289 c1 = pgrid%f2c(1,ifg)
1290 c2 = pgrid%f2c(2,ifg)
1296 nx = pgrid%fn(xcoord,ifg)
1297 ny = pgrid%fn(ycoord,ifg)
1298 nz = pgrid%fn(zcoord,ifg)
1299 nm = pgrid%fn(xyzmag,ifg)
1301 xc = pgrid%fc(xcoord,ifg)
1302 yc = pgrid%fc(ycoord,ifg)
1303 zc = pgrid%fc(zcoord,ifg)
1305 fs = pgrid%gs(indgs*ifg)
1315 rl = pcvmixt(cv_mixt_dens,c1)
1318 ul = pcvmixt(cv_mixt_xmom,c1)*irl
1319 vl = pcvmixt(cv_mixt_ymom,c1)*irl
1320 wl = pcvmixt(cv_mixt_zmom,c1)*irl
1321 tl = pdvmixt(dv_mixt_temp,c1)
1323 ygl = pcvspec(1,c1)*irl
1324 yvl = pcvspec(2,c1)*irl
1326 dx = xc - pgrid%cofg(xcoord,c1)
1327 dy = yc - pgrid%cofg(ycoord,c1)
1328 dz = zc - pgrid%cofg(zcoord,c1)
1330 rl = rl + pgradmixt(xcoord,grc_mixt_dens,c1)*
dx &
1331 + pgradmixt(ycoord,grc_mixt_dens,c1)*
dy &
1332 + pgradmixt(zcoord,grc_mixt_dens,c1)*
dz
1333 ul = ul + pgradmixt(xcoord,grc_mixt_xvel,c1)*
dx &
1334 + pgradmixt(ycoord,grc_mixt_xvel,c1)*
dy &
1335 + pgradmixt(zcoord,grc_mixt_xvel,c1)*
dz
1336 vl = vl + pgradmixt(xcoord,grc_mixt_yvel,c1)*
dx &
1337 + pgradmixt(ycoord,grc_mixt_yvel,c1)*
dy &
1338 + pgradmixt(zcoord,grc_mixt_yvel,c1)*
dz
1339 wl = wl + pgradmixt(xcoord,grc_mixt_zvel,c1)*
dx &
1340 + pgradmixt(ycoord,grc_mixt_zvel,c1)*
dy &
1341 + pgradmixt(zcoord,grc_mixt_zvel,c1)*
dz
1342 tl = tl + pgradmixt(xcoord,grc_mixt_temp,c1)*
dx &
1343 + pgradmixt(ycoord,grc_mixt_temp,c1)*
dy &
1344 + pgradmixt(zcoord,grc_mixt_temp,c1)*
dz
1346 ygl = ygl + pgradspec(xcoord,1,c1)*
dx &
1347 + pgradspec(ycoord,1,c1)*
dy &
1348 + pgradspec(zcoord,1,c1)*
dz
1349 yvl = yvl + pgradspec(xcoord,2,c1)*
dx &
1350 + pgradspec(ycoord,2,c1)*
dy &
1351 + pgradspec(zcoord,2,c1)*
dz
1353 IF ( ygl > 1.0_rfreal )
THEN
1356 ELSE IF ( ygl < 0.0_rfreal )
THEN
1358 ELSE IF ( yvl > 1.0_rfreal )
THEN
1361 ELSE IF ( yvl < 0.0_rfreal )
THEN
1365 yll = 1.0_rfreal - ygl - yvl
1367 IF ( yll > 1.0_rfreal)
THEN
1369 ELSE IF ( yll < 0.0_rfreal)
THEN
1373 vl2 = ul*ul + vl*vl + wl*wl
1374 ql = ul*nx + vl*ny + wl*nz - fs
1384 pl =
mixtgasliq_p(ryll,ryvl,rygl,cll2,cvl2,cgl2,rl,ro,po,to,bp,bt,tl)
1394 cvm = (ryll*cvl + ryvl*cvv + rygl*cvg)/rl
1395 rel = rl*cvm*tl + 0.5*rl*vl2
1402 cml =
mixtgasliq_c(cvm,rl,pl,rll,rvl,rgl,vfll,vfvl,vfgl,cll2,cvl2,cgl2, &
1409 rr = pcvmixt(cv_mixt_dens,c2)
1412 ur = pcvmixt(cv_mixt_xmom,c2)*irr
1413 vr = pcvmixt(cv_mixt_ymom,c2)*irr
1414 wr = pcvmixt(cv_mixt_zmom,c2)*irr
1415 tr = pdvmixt(dv_mixt_temp,c2)
1417 ygr = pcvspec(1,c2)*irr
1418 yvr = pcvspec(2,c2)*irr
1420 dx = xc - pgrid%cofg(xcoord,c2)
1421 dy = yc - pgrid%cofg(ycoord,c2)
1422 dz = zc - pgrid%cofg(zcoord,c2)
1424 rr = rr + pgradmixt(xcoord,grc_mixt_dens,c2)*
dx &
1425 + pgradmixt(ycoord,grc_mixt_dens,c2)*
dy &
1426 + pgradmixt(zcoord,grc_mixt_dens,c2)*
dz
1427 ur = ur + pgradmixt(xcoord,grc_mixt_xvel,c2)*
dx &
1428 + pgradmixt(ycoord,grc_mixt_xvel,c2)*
dy &
1429 + pgradmixt(zcoord,grc_mixt_xvel,c2)*
dz
1430 vr = vr + pgradmixt(xcoord,grc_mixt_yvel,c2)*
dx &
1431 + pgradmixt(ycoord,grc_mixt_yvel,c2)*
dy &
1432 + pgradmixt(zcoord,grc_mixt_yvel,c2)*
dz
1433 wr = wr + pgradmixt(xcoord,grc_mixt_zvel,c2)*
dx &
1434 + pgradmixt(ycoord,grc_mixt_zvel,c2)*
dy &
1435 + pgradmixt(zcoord,grc_mixt_zvel,c2)*
dz
1436 tr = tr + pgradmixt(xcoord,grc_mixt_temp,c2)*
dx &
1437 + pgradmixt(ycoord,grc_mixt_temp,c2)*
dy &
1438 + pgradmixt(zcoord,grc_mixt_temp,c2)*
dz
1440 ygr = ygr + pgradspec(xcoord,1,c2)*
dx &
1441 + pgradspec(ycoord,1,c2)*
dy &
1442 + pgradspec(zcoord,1,c2)*
dz
1443 yvr = yvr + pgradspec(xcoord,2,c2)*
dx &
1444 + pgradspec(ycoord,2,c2)*
dy &
1445 + pgradspec(zcoord,2,c2)*
dz
1447 IF ( ygr > 1.0_rfreal )
THEN
1450 ELSE IF ( ygr < 0.0_rfreal )
THEN
1452 ELSE IF ( yvr > 1.0_rfreal )
THEN
1455 ELSE IF ( yvr < 0.0_rfreal )
THEN
1459 ylr = 1.0_rfreal - ygr - yvr
1461 IF ( ylr > 1.0_rfreal )
THEN
1463 ELSE IF ( ylr < 0.0_rfreal )
THEN
1467 vr2 = ur*ur + vr*vr + wr*wr
1468 qr = ur*nx + vr*ny + wr*nz - fs
1478 pr =
mixtgasliq_p(rylr,ryvr,rygr,clr2,cvr2,cgr2,rr,ro,po,to,bp,bt,tr)
1488 cvm = (rylr*cvl + ryvr*cvv + rygr*cvg)/rr
1489 rer = rr*cvm*tr + 0.5*rr*vr2
1496 cmr =
mixtgasliq_c(cvm,rr,pr,rlr,rvr,rgr,vflr,vfvr,vfgr,clr2,cvr2,cgr2, &
1504 wt2 = 1.0_rfreal/(1.0_rfreal + wt1)
1510 us = wt2*(ul + wt1*ur)
1511 vs = wt2*(vl + wt1*vr)
1512 ws = wt2*(wl + wt1*wr)
1513 qs = wt2*(ql + wt1*qr)
1515 vms = us*us + vs*vs + ws*ws
1518 ph = wt2*(pl + wt1*pr)
1519 th = wt2*(tl + wt1*tr)
1521 vfgh = wt2*(vfgl + wt1*vfgr)
1522 vfvh = wt2*(vfvl + wt1*vfvr)
1524 IF ( vfgh > 1.0_rfreal )
THEN
1527 ELSE IF ( vfgh < 0.0_rfreal )
THEN
1529 ELSE IF ( vfvh > 1.0_rfreal )
THEN
1532 ELSE IF ( vfvh < 0.0_rfreal )
THEN
1536 vflh = 1.0_rfreal - vfvh - vfgh
1538 IF ( vflh > 1.0_rfreal )
THEN
1540 ELSE IF ( vflh < 0.0_rfreal )
THEN
1556 cvm = (rlh*vflh*cvl + rvh*vfvh*cvv + rgh*vfgh*cvg)/rh
1558 cms =
mixtgasliq_c(cvm,rh,ph,rlh,rvh,rgh,vflh,vfvh,vfgh,clh2,cvh2,cgh2, &
1561 sl =
min(ql-cml,qs-cms)
1562 sr =
max(qr+cmr,qs+cms)
1568 IF ( sl > 0.0_rfreal )
THEN
1570 flx(2) = (ql* rl*ul + pl*nx )*nm
1571 flx(3) = (ql* rl*vl + pl*ny )*nm
1572 flx(4) = (ql* rl*wl + pl*nz )*nm
1573 flx(5) = (ql*(rl*el + pl) + pl*fs)*nm
1574 ELSE IF ( sr < 0.0_rfreal )
THEN
1576 flx(2) = (qr* rr*ur + pr*nx )*nm
1577 flx(3) = (qr* rr*vr + pr*ny )*nm
1578 flx(4) = (qr* rr*wr + pr*nz )*nm
1579 flx(5) = (qr*(rr*er + pr) + pr*fs)*nm
1581 sm = (rr*qr*(sr-qr) - rl*ql*(sl-ql) - pr + pl)/(rr*(sr-qr) - rl*(sl-ql))
1582 ps = pl + rl*(ql-sl)*(ql-sm)
1584 IF ( sm > 0.0_rfreal )
THEN
1585 term = 1.0_rfreal/(sl-sm)
1588 rus =
term*((sl-ql)*rl*ul + (ps - pl )*nx)
1589 rvs =
term*((sl-ql)*rl*vl + (ps - pl )*ny)
1590 rws =
term*((sl-ql)*rl*wl + (ps - pl )*nz)
1591 res =
term*((sl-ql)*rl*el + (ps*sm - pl*ql) )
1593 term = 1.0_rfreal/(sr-sm)
1596 rus =
term*((sr-qr)*rr*ur + (ps - pr )*nx)
1597 rvs =
term*((sr-qr)*rr*vr + (ps - pr )*ny)
1598 rws =
term*((sr-qr)*rr*wr + (ps - pr )*nz)
1599 res =
term*((sr-qr)*rr*er + (ps*sm - pr*qr) )
1603 flx(2) = (sm* rus + ps*nx )*nm
1604 flx(3) = (sm* rvs + ps*ny )*nm
1605 flx(4) = (sm* rws + ps*nz )*nm
1606 flx(5) = (sm*(res + ps) - ps*fs)*nm
1613 pmf(indmf*ifg) = flx(1)
1619 prhs(cv_mixt_dens,c1) = prhs(cv_mixt_dens,c1) + flx(1)
1620 prhs(cv_mixt_xmom,c1) = prhs(cv_mixt_xmom,c1) + flx(2)
1621 prhs(cv_mixt_ymom,c1) = prhs(cv_mixt_ymom,c1) + flx(3)
1622 prhs(cv_mixt_zmom,c1) = prhs(cv_mixt_zmom,c1) + flx(4)
1623 prhs(cv_mixt_ener,c1) = prhs(cv_mixt_ener,c1) + flx(5)
1625 prhs(cv_mixt_dens,c2) = prhs(cv_mixt_dens,c2) - flx(1)
1626 prhs(cv_mixt_xmom,c2) = prhs(cv_mixt_xmom,c2) - flx(2)
1627 prhs(cv_mixt_ymom,c2) = prhs(cv_mixt_ymom,c2) - flx(3)
1628 prhs(cv_mixt_zmom,c2) = prhs(cv_mixt_zmom,c2) - flx(4)
1629 prhs(cv_mixt_ener,c2) = prhs(cv_mixt_ener,c2) - flx(5)
1635 psd(sd_xmom,c1*indsd) = psd(sd_xmom,c1*indsd) + us*pmf(indmf*ifg)
1636 psd(sd_ymom,c1*indsd) = psd(sd_ymom,c1*indsd) + vs*pmf(indmf*ifg)
1637 psd(sd_zmom,c1*indsd) = psd(sd_zmom,c1*indsd) + ws*pmf(indmf*ifg)
1639 psd(sd_xmom,c2*indsd) = psd(sd_xmom,c2*indsd) - us*pmf(indmf*ifg)
1640 psd(sd_ymom,c2*indsd) = psd(sd_ymom,c2*indsd) - vs*pmf(indmf*ifg)
1641 psd(sd_zmom,c2*indsd) = psd(sd_zmom,c2*indsd) - ws*pmf(indmf*ifg)
1648 DO ipatch = 1,pregion%grid%nPatches
1649 ppatch => pregion%patches(ipatch)
1651 SELECT CASE ( ppatch%spaceOrder )
1657 CALL
errorstop(global,err_reached_default,__line__)
1716 TYPE(t_region
),
POINTER :: pregion
1722 INTEGER :: c1,c2,ifg,indcp,indgs,indmf,indmol,indsd,ipatch
1723 REAL(RFREAL) :: al,ar,as,dx1,dx2,dy1,dy2,dz1,dz2,el,er,fs,gcl,gcr,gl,gr,gs, &
1724 hl,hr,hs,irl,irr,nm,nx,ny,nz,ql,qr,qs,pl,pr,ps,rl,rr,res, &
1725 rs,rus,rvs,rws,sl,sm,sr,
term,ul,ur,us,vl,vml,vmr,vms,vr,vs, &
1726 wl,wr,ws,wt1,wt2,xc,yc,zc
1727 REAL(RFREAL) :: flx(5)
1728 REAL(RFREAL),
DIMENSION(:),
POINTER :: pmf
1729 REAL(RFREAL),
DIMENSION(:,:),
POINTER :: pcv,pdv,pgv,prhs,psd
1730 REAL(RFREAL),
DIMENSION(:,:,:),
POINTER :: pgc
1732 TYPE(t_grid),
POINTER :: pgrid
1733 TYPE(t_patch),
POINTER :: ppatch
1737 REAL(RFREAL) :: cpl,cpr,cps,gcs,mml,mmr,mms,y1,y2,ys
1738 REAL(RFREAL),
DIMENSION(:,:),
POINTER :: pcvspec
1739 REAL(RFREAL),
DIMENSION(:,:,:),
POINTER :: pgcspec
1747 global => pregion%global
1750 'RFLU_ModHLLCFlux.F90')
1753 CALL fprofiler_begins(
"RFLU::HLLC_ComputeFlux2_MTCP")
1760 pgrid => pregion%grid
1764 indcp = pregion%mixtInput%indCp
1765 indmf = pregion%mixtInput%indMfMixt
1766 indmol = pregion%mixtInput%indMol
1767 indsd = pregion%mixtInput%indSd
1769 pcv => pregion%mixt%cv
1770 pdv => pregion%mixt%dv
1771 pgv => pregion%mixt%gv
1773 pgc => pregion%mixt%gradCell
1774 pmf => pregion%mixt%mfMixt
1775 prhs => pregion%mixt%rhs
1776 psd => pregion%mixt%sd
1779 pcvspec => pregion%spec%cv
1780 pgcspec => pregion%spec%gradCell
1783 IF ( pregion%spec%cvState /= cv_mixt_state_cons )
THEN
1784 CALL
errorstop(global,err_cv_state_invalid,__line__)
1787 IF ( pregion%mixtInput%gasModel /= gas_model_mixt_tcperf )
THEN
1788 CALL
errorstop(global,err_gasmodel_invalid,__line__)
1791 IF ( (indcp /= 1) .OR. (indmol /= 1) )
THEN
1792 CALL
errorstop(global,err_reached_default,__line__)
1799 DO ifg = 1,pgrid%nFaces
1800 c1 = pgrid%f2c(1,ifg)
1801 c2 = pgrid%f2c(2,ifg)
1807 nx = pgrid%fn(xcoord,ifg)
1808 ny = pgrid%fn(ycoord,ifg)
1809 nz = pgrid%fn(zcoord,ifg)
1810 nm = pgrid%fn(xyzmag,ifg)
1812 xc = pgrid%fc(xcoord,ifg)
1813 yc = pgrid%fc(ycoord,ifg)
1814 zc = pgrid%fc(zcoord,ifg)
1816 fs = pgrid%gs(indgs*ifg)
1826 rl = pcv(cv_mixt_dens,c1)
1829 dx1 = xc - pgrid%cofg(xcoord,c1)
1830 dy1 = yc - pgrid%cofg(ycoord,c1)
1831 dz1 = zc - pgrid%cofg(zcoord,c1)
1837 DO ispec = 1,pregion%specInput%nSpecies
1838 pspectype => pregion%specInput%specType(ispec)
1840 y1 = irl*pcvspec(ispec,c1) + pgcspec(xcoord,ispec,c1)*dx1 &
1841 + pgcspec(ycoord,ispec,c1)*dy1 &
1842 + pgcspec(zcoord,ispec,c1)*dz1
1844 mml = mml + y1/pspectype%pMaterial%molw
1845 cpl = cpl + y1*pspectype%pMaterial%spht
1848 mml = 1.0_rfreal/mml
1853 ul = pcv(cv_mixt_xmom,c1)*irl
1854 vl = pcv(cv_mixt_ymom,c1)*irl
1855 wl = pcv(cv_mixt_zmom,c1)*irl
1856 pl = pdv(dv_mixt_pres,c1)
1858 rl = rl + pgc(xcoord,grc_mixt_dens,c1)*dx1 &
1859 + pgc(ycoord,grc_mixt_dens,c1)*dy1 &
1860 + pgc(zcoord,grc_mixt_dens,c1)*dz1
1861 ul = ul + pgc(xcoord,grc_mixt_xvel,c1)*dx1 &
1862 + pgc(ycoord,grc_mixt_xvel,c1)*dy1 &
1863 + pgc(zcoord,grc_mixt_xvel,c1)*dz1
1864 vl = vl + pgc(xcoord,grc_mixt_yvel,c1)*dx1 &
1865 + pgc(ycoord,grc_mixt_yvel,c1)*dy1 &
1866 + pgc(zcoord,grc_mixt_yvel,c1)*dz1
1867 wl = wl + pgc(xcoord,grc_mixt_zvel,c1)*dx1 &
1868 + pgc(ycoord,grc_mixt_zvel,c1)*dy1 &
1869 + pgc(zcoord,grc_mixt_zvel,c1)*dz1
1870 pl = pl + pgc(xcoord,grc_mixt_pres,c1)*dx1 &
1871 + pgc(ycoord,grc_mixt_pres,c1)*dy1 &
1872 + pgc(zcoord,grc_mixt_pres,c1)*dz1
1877 vml = ul*ul + vl*vl + wl*wl
1878 ql = ul*nx + vl*ny + wl*nz - fs
1885 rr = pcv(cv_mixt_dens,c2)
1888 dx2 = xc - pgrid%cofg(xcoord,c2)
1889 dy2 = yc - pgrid%cofg(ycoord,c2)
1890 dz2 = zc - pgrid%cofg(zcoord,c2)
1896 DO ispec = 1,pregion%specInput%nSpecies
1897 pspectype => pregion%specInput%specType(ispec)
1899 y2 = irr*pcvspec(ispec,c2) + pgcspec(xcoord,ispec,c2)*dx2 &
1900 + pgcspec(ycoord,ispec,c2)*dy2 &
1901 + pgcspec(zcoord,ispec,c2)*dz2
1903 mmr = mmr + y2/pspectype%pMaterial%molw
1904 cpr = cpr + y2*pspectype%pMaterial%spht
1907 mmr = 1.0_rfreal/mmr
1912 ur = pcv(cv_mixt_xmom,c2)*irr
1913 vr = pcv(cv_mixt_ymom,c2)*irr
1914 wr = pcv(cv_mixt_zmom,c2)*irr
1915 pr = pdv(dv_mixt_pres,c2)
1917 rr = rr + pgc(xcoord,grc_mixt_dens,c2)*dx2 &
1918 + pgc(ycoord,grc_mixt_dens,c2)*dy2 &
1919 + pgc(zcoord,grc_mixt_dens,c2)*dz2
1920 ur = ur + pgc(xcoord,grc_mixt_xvel,c2)*dx2 &
1921 + pgc(ycoord,grc_mixt_xvel,c2)*dy2 &
1922 + pgc(zcoord,grc_mixt_xvel,c2)*dz2
1923 vr = vr + pgc(xcoord,grc_mixt_yvel,c2)*dx2 &
1924 + pgc(ycoord,grc_mixt_yvel,c2)*dy2 &
1925 + pgc(zcoord,grc_mixt_yvel,c2)*dz2
1926 wr = wr + pgc(xcoord,grc_mixt_zvel,c2)*dx2 &
1927 + pgc(ycoord,grc_mixt_zvel,c2)*dy2 &
1928 + pgc(zcoord,grc_mixt_zvel,c2)*dz2
1929 pr = pr + pgc(xcoord,grc_mixt_pres,c2)*dx2 &
1930 + pgc(ycoord,grc_mixt_pres,c2)*dy2 &
1931 + pgc(zcoord,grc_mixt_pres,c2)*dz2
1936 vmr = ur*ur + vr*vr + wr*wr
1937 qr = ur*nx + vr*ny + wr*nz - fs
1945 wt2 = 1.0_rfreal/(1.0_rfreal + wt1)
1954 us = wt2*(ul + wt1*ur)
1955 vs = wt2*(vl + wt1*vr)
1956 ws = wt2*(wl + wt1*wr)
1957 qs = wt2*(ql + wt1*qr)
1958 hs = wt2*(hl + wt1*hr)
1964 DO ispec = 1,pregion%specInput%nSpecies
1965 pspectype => pregion%specInput%specType(ispec)
1967 y1 = irl*pcvspec(ispec,c1) + pgcspec(xcoord,ispec,c1)*dx1 &
1968 + pgcspec(ycoord,ispec,c1)*dy1 &
1969 + pgcspec(zcoord,ispec,c1)*dz1
1971 y2 = irr*pcvspec(ispec,c2) + pgcspec(xcoord,ispec,c2)*dx2 &
1972 + pgcspec(ycoord,ispec,c2)*dy2 &
1973 + pgcspec(zcoord,ispec,c2)*dz2
1975 ys = wt2*(y1 + wt1*y2)
1977 mms = mms + ys/pspectype%pMaterial%molw
1978 cps = cps + ys*pspectype%pMaterial%spht
1981 mms = 1.0_rfreal/mms
1986 vms = us*us + vs*vs + ws*ws
1988 sl =
min(ql-al,qs-as)
1989 sr =
max(qr+ar,qs+as)
1995 IF ( sl > 0.0_rfreal )
THEN
1997 flx(2) = (ql* rl*ul + pl*nx )*nm
1998 flx(3) = (ql* rl*vl + pl*ny )*nm
1999 flx(4) = (ql* rl*wl + pl*nz )*nm
2000 flx(5) = (ql*(rl*el + pl) + pl*fs)*nm
2001 ELSE IF ( sr < 0.0_rfreal )
THEN
2003 flx(2) = (qr* rr*ur + pr*nx )*nm
2004 flx(3) = (qr* rr*vr + pr*ny )*nm
2005 flx(4) = (qr* rr*wr + pr*nz )*nm
2006 flx(5) = (qr*(rr*er + pr) + pr*fs)*nm
2008 sm = (rr*qr*(sr-qr) - rl*ql*(sl-ql) - pr + pl)/(rr*(sr-qr) - rl*(sl-ql))
2009 ps = pl + rl*(ql-sl)*(ql-sm)
2011 IF ( sm > 0.0_rfreal )
THEN
2012 term = 1.0_rfreal/(sl-sm)
2015 rus =
term*((sl-ql)*rl*ul + (ps - pl )*nx)
2016 rvs =
term*((sl-ql)*rl*vl + (ps - pl )*ny)
2017 rws =
term*((sl-ql)*rl*wl + (ps - pl )*nz)
2018 res =
term*((sl-ql)*rl*el + (ps*sm - pl*ql) )
2020 term = 1.0_rfreal/(sr-sm)
2023 rus =
term*((sr-qr)*rr*ur + (ps - pr )*nx)
2024 rvs =
term*((sr-qr)*rr*vr + (ps - pr )*ny)
2025 rws =
term*((sr-qr)*rr*wr + (ps - pr )*nz)
2026 res =
term*((sr-qr)*rr*er + (ps*sm - pr*qr) )
2030 flx(2) = (sm* rus + ps*nx )*nm
2031 flx(3) = (sm* rvs + ps*ny )*nm
2032 flx(4) = (sm* rws + ps*nz )*nm
2033 flx(5) = (sm*(res + ps) - ps*fs)*nm
2040 pmf(indmf*ifg) = flx(1)
2046 prhs(cv_mixt_dens,c1) = prhs(cv_mixt_dens,c1) + flx(1)
2047 prhs(cv_mixt_xmom,c1) = prhs(cv_mixt_xmom,c1) + flx(2)
2048 prhs(cv_mixt_ymom,c1) = prhs(cv_mixt_ymom,c1) + flx(3)
2049 prhs(cv_mixt_zmom,c1) = prhs(cv_mixt_zmom,c1) + flx(4)
2050 prhs(cv_mixt_ener,c1) = prhs(cv_mixt_ener,c1) + flx(5)
2052 prhs(cv_mixt_dens,c2) = prhs(cv_mixt_dens,c2) - flx(1)
2053 prhs(cv_mixt_xmom,c2) = prhs(cv_mixt_xmom,c2) - flx(2)
2054 prhs(cv_mixt_ymom,c2) = prhs(cv_mixt_ymom,c2) - flx(3)
2055 prhs(cv_mixt_zmom,c2) = prhs(cv_mixt_zmom,c2) - flx(4)
2056 prhs(cv_mixt_ener,c2) = prhs(cv_mixt_ener,c2) - flx(5)
2062 psd(sd_xmom,c1*indsd) = psd(sd_xmom,c1*indsd) + us*pmf(indmf*ifg)
2063 psd(sd_ymom,c1*indsd) = psd(sd_ymom,c1*indsd) + vs*pmf(indmf*ifg)
2064 psd(sd_zmom,c1*indsd) = psd(sd_zmom,c1*indsd) + ws*pmf(indmf*ifg)
2066 psd(sd_xmom,c2*indsd) = psd(sd_xmom,c2*indsd) - us*pmf(indmf*ifg)
2067 psd(sd_ymom,c2*indsd) = psd(sd_ymom,c2*indsd) - vs*pmf(indmf*ifg)
2068 psd(sd_zmom,c2*indsd) = psd(sd_zmom,c2*indsd) - ws*pmf(indmf*ifg)
2075 DO ipatch = 1,pregion%grid%nPatches
2076 ppatch => pregion%patches(ipatch)
2078 SELECT CASE ( ppatch%spaceOrder )
2084 CALL
errorstop(global,err_reached_default,__line__)
2093 CALL fprofiler_ends(
"RFLU::HLLC_ComputeFlux2_MTCP")
2143 TYPE(t_region
),
POINTER :: pregion
2149 INTEGER :: c1,c2,ifg,indgs,indmf,indsd,ipatch
2150 REAL(RFREAL) :: al,ar,as,cp,
dx,
dy,
dz,el,er,fs,
g,hl,hr,hs,irl,irr,nm, &
2151 nx,ny,nz,ql,qr,qs,pl,pr,ps,rl,rr,res,
rs,rus,rvs,rws, &
2152 sl,sm,sr,
term,ul,ur,us,vl,vml,vmr,vms,vr,vs,wl,wr,ws, &
2154 REAL(RFREAL) :: flx(5)
2155 REAL(RFREAL),
DIMENSION(:),
POINTER :: pmf
2156 REAL(RFREAL),
DIMENSION(:,:),
POINTER :: pcv,pdv,prhs,psd
2157 REAL(RFREAL),
DIMENSION(:,:,:),
POINTER :: pgc
2159 TYPE(t_grid),
POINTER :: pgrid
2160 TYPE(t_patch),
POINTER :: ppatch
2166 global => pregion%global
2169 'RFLU_ModHLLCFlux.F90')
2172 CALL fprofiler_begins(
"RFLU::HLLC_ComputeFlux2_TCP")
2179 pgrid => pregion%grid
2183 indmf = pregion%mixtInput%indMfMixt
2184 indsd = pregion%mixtInput%indSd
2186 pcv => pregion%mixt%cv
2187 pdv => pregion%mixt%dv
2189 pgc => pregion%mixt%gradCell
2190 pmf => pregion%mixt%mfMixt
2191 prhs => pregion%mixt%rhs
2192 psd => pregion%mixt%sd
2194 IF ( pregion%mixtInput%gasModel /= gas_model_tcperf )
THEN
2195 CALL
errorstop(global,err_gasmodel_invalid,__line__)
2205 DO ifg = 1,pgrid%nFaces
2206 c1 = pgrid%f2c(1,ifg)
2207 c2 = pgrid%f2c(2,ifg)
2213 nx = pgrid%fn(xcoord,ifg)
2214 ny = pgrid%fn(ycoord,ifg)
2215 nz = pgrid%fn(zcoord,ifg)
2216 nm = pgrid%fn(xyzmag,ifg)
2218 xc = pgrid%fc(xcoord,ifg)
2219 yc = pgrid%fc(ycoord,ifg)
2220 zc = pgrid%fc(zcoord,ifg)
2222 fs = pgrid%gs(indgs*ifg)
2232 rl = pcv(cv_mixt_dens,c1)
2235 ul = pcv(cv_mixt_xmom,c1)*irl
2236 vl = pcv(cv_mixt_ymom,c1)*irl
2237 wl = pcv(cv_mixt_zmom,c1)*irl
2238 pl = pdv(dv_mixt_pres,c1)
2240 dx = xc - pgrid%cofg(xcoord,c1)
2241 dy = yc - pgrid%cofg(ycoord,c1)
2242 dz = zc - pgrid%cofg(zcoord,c1)
2244 rl = rl + pgc(xcoord,grc_mixt_dens,c1)*
dx &
2245 + pgc(ycoord,grc_mixt_dens,c1)*
dy &
2246 + pgc(zcoord,grc_mixt_dens,c1)*
dz
2247 ul = ul + pgc(xcoord,grc_mixt_xvel,c1)*
dx &
2248 + pgc(ycoord,grc_mixt_xvel,c1)*
dy &
2249 + pgc(zcoord,grc_mixt_xvel,c1)*
dz
2250 vl = vl + pgc(xcoord,grc_mixt_yvel,c1)*
dx &
2251 + pgc(ycoord,grc_mixt_yvel,c1)*
dy &
2252 + pgc(zcoord,grc_mixt_yvel,c1)*
dz
2253 wl = wl + pgc(xcoord,grc_mixt_zvel,c1)*
dx &
2254 + pgc(ycoord,grc_mixt_zvel,c1)*
dy &
2255 + pgc(zcoord,grc_mixt_zvel,c1)*
dz
2256 pl = pl + pgc(xcoord,grc_mixt_pres,c1)*
dx &
2257 + pgc(ycoord,grc_mixt_pres,c1)*
dy &
2258 + pgc(zcoord,grc_mixt_pres,c1)*
dz
2263 vml = ul*ul + vl*vl + wl*wl
2264 ql = ul*nx + vl*ny + wl*nz - fs
2271 rr = pcv(cv_mixt_dens,c2)
2274 ur = pcv(cv_mixt_xmom,c2)*irr
2275 vr = pcv(cv_mixt_ymom,c2)*irr
2276 wr = pcv(cv_mixt_zmom,c2)*irr
2277 pr = pdv(dv_mixt_pres,c2)
2279 dx = xc - pgrid%cofg(xcoord,c2)
2280 dy = yc - pgrid%cofg(ycoord,c2)
2281 dz = zc - pgrid%cofg(zcoord,c2)
2283 rr = rr + pgc(xcoord,grc_mixt_dens,c2)*
dx &
2284 + pgc(ycoord,grc_mixt_dens,c2)*
dy &
2285 + pgc(zcoord,grc_mixt_dens,c2)*
dz
2286 ur = ur + pgc(xcoord,grc_mixt_xvel,c2)*
dx &
2287 + pgc(ycoord,grc_mixt_xvel,c2)*
dy &
2288 + pgc(zcoord,grc_mixt_xvel,c2)*
dz
2289 vr = vr + pgc(xcoord,grc_mixt_yvel,c2)*
dx &
2290 + pgc(ycoord,grc_mixt_yvel,c2)*
dy &
2291 + pgc(zcoord,grc_mixt_yvel,c2)*
dz
2292 wr = wr + pgc(xcoord,grc_mixt_zvel,c2)*
dx &
2293 + pgc(ycoord,grc_mixt_zvel,c2)*
dy &
2294 + pgc(zcoord,grc_mixt_zvel,c2)*
dz
2295 pr = pr + pgc(xcoord,grc_mixt_pres,c2)*
dx &
2296 + pgc(ycoord,grc_mixt_pres,c2)*
dy &
2297 + pgc(zcoord,grc_mixt_pres,c2)*
dz
2302 vmr = ur*ur + vr*vr + wr*wr
2303 qr = ur*nx + vr*ny + wr*nz - fs
2311 wt2 = 1.0_rfreal/(1.0_rfreal + wt1)
2317 us = wt2*(ul + wt1*ur)
2318 vs = wt2*(vl + wt1*vr)
2319 ws = wt2*(wl + wt1*wr)
2320 qs = wt2*(ql + wt1*qr)
2321 hs = wt2*(hl + wt1*hr)
2323 vms = us*us + vs*vs + ws*ws
2325 sl =
min(ql-al,qs-as)
2326 sr =
max(qr+ar,qs+as)
2332 IF ( sl > 0.0_rfreal )
THEN
2334 flx(2) = (ql* rl*ul + pl*nx )*nm
2335 flx(3) = (ql* rl*vl + pl*ny )*nm
2336 flx(4) = (ql* rl*wl + pl*nz )*nm
2337 flx(5) = (ql*(rl*el + pl) + pl*fs)*nm
2338 ELSE IF ( sr < 0.0_rfreal )
THEN
2340 flx(2) = (qr* rr*ur + pr*nx )*nm
2341 flx(3) = (qr* rr*vr + pr*ny )*nm
2342 flx(4) = (qr* rr*wr + pr*nz )*nm
2343 flx(5) = (qr*(rr*er + pr) + pr*fs)*nm
2345 sm = (rr*qr*(sr-qr) - rl*ql*(sl-ql) - pr + pl)/(rr*(sr-qr) - rl*(sl-ql))
2346 ps = pl + rl*(ql-sl)*(ql-sm)
2348 IF ( sm > 0.0_rfreal )
THEN
2349 term = 1.0_rfreal/(sl-sm)
2352 rus =
term*((sl-ql)*rl*ul + (ps - pl )*nx)
2353 rvs =
term*((sl-ql)*rl*vl + (ps - pl )*ny)
2354 rws =
term*((sl-ql)*rl*wl + (ps - pl )*nz)
2355 res =
term*((sl-ql)*rl*el + (ps*sm - pl*ql) )
2357 term = 1.0_rfreal/(sr-sm)
2360 rus =
term*((sr-qr)*rr*ur + (ps - pr )*nx)
2361 rvs =
term*((sr-qr)*rr*vr + (ps - pr )*ny)
2362 rws =
term*((sr-qr)*rr*wr + (ps - pr )*nz)
2363 res =
term*((sr-qr)*rr*er + (ps*sm - pr*qr) )
2367 flx(2) = (sm* rus + ps*nx )*nm
2368 flx(3) = (sm* rvs + ps*ny )*nm
2369 flx(4) = (sm* rws + ps*nz )*nm
2370 flx(5) = (sm*(res + ps) - ps*fs)*nm
2377 pmf(indmf*ifg) = flx(1)
2383 prhs(cv_mixt_dens,c1) = prhs(cv_mixt_dens,c1) + flx(1)
2384 prhs(cv_mixt_xmom,c1) = prhs(cv_mixt_xmom,c1) + flx(2)
2385 prhs(cv_mixt_ymom,c1) = prhs(cv_mixt_ymom,c1) + flx(3)
2386 prhs(cv_mixt_zmom,c1) = prhs(cv_mixt_zmom,c1) + flx(4)
2387 prhs(cv_mixt_ener,c1) = prhs(cv_mixt_ener,c1) + flx(5)
2389 prhs(cv_mixt_dens,c2) = prhs(cv_mixt_dens,c2) - flx(1)
2390 prhs(cv_mixt_xmom,c2) = prhs(cv_mixt_xmom,c2) - flx(2)
2391 prhs(cv_mixt_ymom,c2) = prhs(cv_mixt_ymom,c2) - flx(3)
2392 prhs(cv_mixt_zmom,c2) = prhs(cv_mixt_zmom,c2) - flx(4)
2393 prhs(cv_mixt_ener,c2) = prhs(cv_mixt_ener,c2) - flx(5)
2399 psd(sd_xmom,c1*indsd) = psd(sd_xmom,c1*indsd) + us*pmf(indmf*ifg)
2400 psd(sd_ymom,c1*indsd) = psd(sd_ymom,c1*indsd) + vs*pmf(indmf*ifg)
2401 psd(sd_zmom,c1*indsd) = psd(sd_zmom,c1*indsd) + ws*pmf(indmf*ifg)
2403 psd(sd_xmom,c2*indsd) = psd(sd_xmom,c2*indsd) - us*pmf(indmf*ifg)
2404 psd(sd_ymom,c2*indsd) = psd(sd_ymom,c2*indsd) - vs*pmf(indmf*ifg)
2405 psd(sd_zmom,c2*indsd) = psd(sd_zmom,c2*indsd) - ws*pmf(indmf*ifg)
2412 DO ipatch = 1,pregion%grid%nPatches
2413 ppatch => pregion%patches(ipatch)
2415 SELECT CASE ( ppatch%spaceOrder )
2421 CALL
errorstop(global,err_reached_default,__line__)
2430 CALL fprofiler_ends(
"RFLU::HLLC_ComputeFlux2_TCP")
subroutine rflu_centralsecondpatch(pRegion, pPatch)
real(rfreal) function mixtperf_r_m(M)
subroutine rs(nm, n, a, w, matz, z, fv1, fv2, ierr)
Vector_n max(const Array_n_const &v1, const Array_n_const &v2)
real(rfreal) function mixtperf_c_dgp(D, G, P)
subroutine registerfunction(global, funName, fileName)
real(rfreal) function mixtperf_d_prt(P, R, T)
subroutine, public rflu_hllc_computeflux(pRegion)
real(rfreal) function mixtperf_c_ghovm2(G, Ho, Vm2)
real(rfreal) function mixtperf_r_cpg(Cp, G)
real(rfreal) function mixtgasliq_p(DYl, DYv, DYg, Cl2, Cv2, Cg2, D, Dz, Po, To, Bp, Bt, T)
subroutine rflu_centralsecondpatch_gl(pRegion, pPatch)
subroutine rflu_hllc_computeflux1_mtcp(pRegion)
subroutine rflu_centralfirstpatch_gl(pRegion, pPatch)
real(rfreal) function mixtperf_c2_grt(G, R, T)
subroutine rflu_hllc_computeflux1_tcp(pRegion)
real(rfreal) function mixtliq_c2_bp(Bp)
subroutine rflu_hllc_computeflux2_tcp(pRegion)
subroutine rflu_hllc_computeflux2_mtcp(pRegion)
Vector_n min(const Array_n_const &v1, const Array_n_const &v2)
real(rfreal) function mixtliq_d_dobpppobttto(Dz, Bp, Bt, P, Po, T, To)
real(rfreal) function mixtgasliq_c(Cvm, D, P, Dl, Dv, Dg, VFl, VFv, VFg, Cl2, Cv2, Cg2, Bl2, Bv2, Bg2)
real(rfreal) function mixtperf_eo_dgpuvw(D, G, P, U, V, W)
subroutine rflu_centralfirstpatch(pRegion, pPatch)
subroutine errorstop(global, errorCode, errorLine, addMessage)
subroutine rflu_hllc_computeflux2_gl(pRegion)
subroutine deregisterfunction(global)
real(rfreal) function mixtperf_g_cpr(Cp, R)
real(rfreal) function mixtperf_cv_cpr(Cp, R)
subroutine rflu_hllc_computeflux1_gl(pRegion)