c ***************************************************************** c SPLITTING IN THE X-DIRECTION c ***************************************************************** SUBROUTINE CHARX IMPLICIT REAL*8 (A-H,O-Z),INTEGER*4 (I-N) COMMON/CELL/ ROCELL(2001,2001),UCELL(2001,2001),VCELL(2001,2001), & ETCELL(2001,2001),EICELL(2001,2001) COMMON/GXN/UXN(2001,2001),VXN(2001,2001),ROXN(2001,2001) & ,PXN(2001,2001) COMMON/GX/UX(2001,2001),VX(2001,2001),ROX(2001,2001),PX(2001,2001) COMMON/GY/UY(2001,2001),VY(2001,2001),ROY(2001,2001),PY(2001,2001) COMMON/XY/X(2001),Y(2001) COMMON/D1X/PN(2001),UN(2001),RON(2001),VN(2001) COMMON/EPS/EPS1,EPS2 COMMON/BAL/NX,NY,CFL,EPS,GAM,DT COMMON/FON/ROFONL,EIFONL,PFONL,UFONL,VFONL & ,ROFONR,EIFONR,PFONR,UFONR,VFONR c ***************************************************************** DO 1 J=1,NY-1 HY=Y(J+1)-Y(J) I=1 UR=UX(I+1,J) UL=UX(I,J) VR=VX(I+1,J) VL=VX(I,J) PR=PX(I+1,J) PL=PX(I,J) ROR=ROX(I+1,J) ROL=ROX(I,J) EIR=PR/(ROR*(GAM-1)) EIL=PL/(ROL*(GAM-1)) c ------------------------------------------------ UT=UY(I,J+1) UB=UY(I,J) VT=VY(I,J+1) VB=VY(I,J) PT=PY(I,J+1) PB=PY(I,J) ROT=ROY(I,J+1) ROB=ROY(I,J) EIT=PT/(ROT*(GAM-1)) EIB=PB/(ROB*(GAM-1)) c ------------------------------------------------ ROC=ROCELL(I,J) UC=UCELL(I,J) VC=VCELL(I,J) ETC=ETCELL(I,J) EIC=EICELL(I,J) PC=(GAM-1)*ROC*EIC SOUND=DSQRT(GAM*PC/ROC) SAR=PC/ROC**GAM AR=2*DSQRT(GAM)/(GAM-1)*SAR**(1/(2*GAM)) CC=PC**((GAM-1)/(2*GAM)) CL=PL**((GAM-1)/(2*GAM)) CR=PR**((GAM-1)/(2*GAM)) c ------------------------------------------------- c PRIMARY VAR, AY AY11=VC AY12=0 AY13=ROC AY14=0 AY21=0 AY22=AY11 AY23=0 AY24=0 AY31=0 AY32=0 AY33=AY11 AY34=1/AY13 AY41=0 AY42=0 AY43=GAM*PC AY44=AY11 DFIDY1=(ROT-ROB)/HY DFIDY2=(UT-UB)/HY DFIDY3=(VT-VB)/HY DFIDY4=(PT-PB)/HY FX1=-(AY11*DFIDY1+AY12*DFIDY2+AY13*DFIDY3+AY14*DFIDY4) FX2=-(AY21*DFIDY1+AY22*DFIDY2+AY23*DFIDY3+AY24*DFIDY4) FX3=-(AY31*DFIDY1+AY32*DFIDY2+AY33*DFIDY3+AY34*DFIDY4) FX4=-(AY41*DFIDY1+AY42*DFIDY2+AY43*DFIDY3+AY44*DFIDY4) c CHAR VAR, OMEGAX G=2./DSQRT(GAM*ROC) OX11=0 OX12=1 OX13=0 OX14=G/(2*DSQRT(PC)) OX21=0 OX22=1 OX23=0 OX24=-OX14 OX31=0 OX32=0 OX33=1 OX34=0 OX41=-GAM/ROC OX42=0 OX43=0 OX44=1/PC GX1=(OX11*FX1+OX12*FX2+OX13*FX3+OX14*FX4) GX2=(OX21*FX1+OX22*FX2+OX23*FX3+OX24*FX4) GX3=(OX31*FX1+OX32*FX2+OX33*FX3+OX34*FX4) GX4=(OX41*FX1+OX42*FX2+OX43*FX3+OX44*FX4) RR=UR+AR*CR RL=UL+AR*CL RC=UC+AR*CC QR=UR-AR*CR QL=UL-AR*CL QC=UC-AR*CC SR=DLOG(PR/ROR**GAM) SL=DLOG(PL/ROL**GAM) SC=DLOG(PC/ROC**GAM) RMAX=MAX(RR,RL,RC)+DT*GX1 RMIN=MIN(RR,RL,RC)+DT*GX1 QMAX=MAX(QR,QL,QC)+DT*GX2 QMIN=MIN(QR,QL,QC)+DT*GX2 VMAX=MAX(VR,VL,VC)+DT*GX3 VMIN=MIN(VR,VL,VC)+DT*GX3 SMAX=MAX(SR,SL,SC)+DT*GX4 SMIN=MIN(SR,SL,SC)+DT*GX4 c ***************************************************************** RMAX=RMAX+EPS2*DABS(RMAX) RMIN=RMIN-EPS2*DABS(RMIN) QMAX=QMAX+EPS2*DABS(QMAX) QMIN=QMIN-EPS2*DABS(QMIN) VMAX=VMAX+EPS2*DABS(VMAX) VMIN=VMIN-EPS2*DABS(VMIN) SMAX=SMAX+EPS2*DABS(SMAX) SMIN=SMIN-EPS2*DABS(SMIN) c ***************************************************************** RLN=2*RC-RR QLN=2*QC-QR SLN=2*SC-SR VLN=2*VC-VR c ------------------------------------------ IF(RLN.GT.RMAX) RLN=RMAX IF(RLN.LT.RMIN) RLN=RMIN IF(QLN.GT.QMAX) QLN=QMAX IF(QLN.LT.QMIN) QLN=QMIN IF(VLN.GT.VMAX) VLN=VMAX IF(VLN.LT.VMIN) VLN=VMIN IF(SLN.GT.SMAX) SLN=SMAX IF(SLN.LT.SMIN) SLN=SMIN RRN=2*RC-RL QRN=2*QC-QL SRN=2*SC-SL VRN=2*VC-VL IF(RRN.GT.RMAX) RRN=RMAX IF(RRN.LT.RMIN) RRN=RMIN IF(QRN.GT.QMAX) QRN=QMAX IF(QRN.LT.QMIN) QRN=QMIN IF(VRN.GT.VMAX) VRN=VMAX IF(VRN.LT.VMIN) VRN=VMIN IF(SRN.GT.SMAX) SRN=SMAX IF(SRN.LT.SMIN) SRN=SMIN ! RRNL=RRN ! QRNL=QRN ! VRNL=VRN ! SRNL=SRN ! GL=G AL=AR SOUNDL=SOUND UCL=UC DO 2 I=1,NX-1 c ------------------------------------------- UR=UX(I+1,J) UL=UX(I,J) VR=VX(I+1,J) VL=VX(I,J) PR=PX(I+1,J) PL=PX(I,J) ROR=ROX(I+1,J) ROL=ROX(I,J) EIR=PR/(ROR*(GAM-1)) EIL=PL/(ROL*(GAM-1)) c ------------------------------------------------ UT=UY(I,J+1) UB=UY(I,J) VT=VY(I,J+1) VB=VY(I,J) PT=PY(I,J+1) PB=PY(I,J) ROT=ROY(I,J+1) ROB=ROY(I,J) EIT=PT/(ROT*(GAM-1)) EIB=PB/(ROB*(GAM-1)) c ------------------------------------------------ ROC=ROCELL(I,J) UC=UCELL(I,J) VC=VCELL(I,J) ETC=ETCELL(I,J) EIC=EICELL(I,J) PC=(GAM-1)*ROC*EIC SOUND=DSQRT(GAM*PC/ROC) SAR=PC/ROC**GAM AR=2*DSQRT(GAM)/(GAM-1)*SAR**(1/(2*GAM)) CC=PC**((GAM-1)/(2*GAM)) CL=PL**((GAM-1)/(2*GAM)) CR=PR**((GAM-1)/(2*GAM)) c ------------------------------------------------- HX=X(I+1)-X(I) c ------------------------------------------------- c PRIMARY VAR, AY AY11=VC AY12=0 AY13=ROC AY14=0 AY21=0 AY22=AY11 AY23=0 AY24=0 AY31=0 AY32=0 AY33=AY11 AY34=1/AY13 AY41=0 AY42=0 AY43=GAM*PC AY44=AY11 DFIDY1=(ROT-ROB)/HY DFIDY2=(UT-UB)/HY DFIDY3=(VT-VB)/HY DFIDY4=(PT-PB)/HY FX1=-(AY11*DFIDY1+AY12*DFIDY2+AY13*DFIDY3+AY14*DFIDY4) FX2=-(AY21*DFIDY1+AY22*DFIDY2+AY23*DFIDY3+AY24*DFIDY4) FX3=-(AY31*DFIDY1+AY32*DFIDY2+AY33*DFIDY3+AY34*DFIDY4) FX4=-(AY41*DFIDY1+AY42*DFIDY2+AY43*DFIDY3+AY44*DFIDY4) c CHAR VAR, OMEGAX G=2./DSQRT(GAM*ROC) OX11=0 OX12=1 OX13=0 OX14=G/(2*DSQRT(PC)) OX21=0 OX22=1 OX23=0 OX24=-OX14 OX31=0 OX32=0 OX33=1 OX34=0 OX41=-GAM/ROC OX42=0 OX43=0 OX44=1/PC GX1=(OX11*FX1+OX12*FX2+OX13*FX3+OX14*FX4) GX2=(OX21*FX1+OX22*FX2+OX23*FX3+OX24*FX4) GX3=(OX31*FX1+OX32*FX2+OX33*FX3+OX34*FX4) GX4=(OX41*FX1+OX42*FX2+OX43*FX3+OX44*FX4) RR=UR+AR*CR RL=UL+AR*CL RC=UC+AR*CC QR=UR-AR*CR QL=UL-AR*CL QC=UC-AR*CC SR=DLOG(PR/ROR**GAM) SL=DLOG(PL/ROL**GAM) SC=DLOG(PC/ROC**GAM) RMAX=MAX(RR,RL,RC)+DT*GX1 RMIN=MIN(RR,RL,RC)+DT*GX1 QMAX=MAX(QR,QL,QC)+DT*GX2 QMIN=MIN(QR,QL,QC)+DT*GX2 VMAX=MAX(VR,VL,VC)+DT*GX3 VMIN=MIN(VR,VL,VC)+DT*GX3 SMAX=MAX(SR,SL,SC)+DT*GX4 SMIN=MIN(SR,SL,SC)+DT*GX4 c ***************************************************************** RMAX=RMAX+EPS2*DABS(RMAX) RMIN=RMIN-EPS2*DABS(RMIN) QMAX=QMAX+EPS2*DABS(QMAX) QMIN=QMIN-EPS2*DABS(QMIN) VMAX=VMAX+EPS2*DABS(VMAX) VMIN=VMIN-EPS2*DABS(VMIN) SMAX=SMAX+EPS2*DABS(SMAX) SMIN=SMIN-EPS2*DABS(SMIN) c ***************************************************************** RLN=2*RC-RR QLN=2*QC-QR SLN=2*SC-SR VLN=2*VC-VR c ------------------------------------------ IF(RLN.GT.RMAX) RLN=RMAX IF(RLN.LT.RMIN) RLN=RMIN IF(QLN.GT.QMAX) QLN=QMAX IF(QLN.LT.QMIN) QLN=QMIN IF(VLN.GT.VMAX) VLN=VMAX IF(VLN.LT.VMIN) VLN=VMIN IF(SLN.GT.SMAX) SLN=SMAX IF(SLN.LT.SMIN) SLN=SMIN c CHAR DIRECTIONS UCH=UC+UCL !-UL SCH=SOUND+SOUNDL !-DSQRT(GAM*PL/ROL) CHAR3=UCH CHAR4=UCH CHAR1=UCH+SCH CHAR2=UCH-SCH c UPDATE PRIMARY VAR IF(CHAR1.GT.0.AND.CHAR2.LE.0.AND.CHAR3.GT.0) THEN PN(I)=((RRN-QLN)/(AR+AL))**(2*GAM/(GAM-1)) UN(I)=(AR*RRN+AL*QLN)/(AR+AL) RON(I)=(PN(I)/DEXP(SRN))**(1/GAM) VN(I)=VRN GOTO 20 ENDIF IF(CHAR1.GT.0.AND.CHAR2.LE.0.AND.CHAR3.LE.0) THEN PN(I)=((RRN-QLN)/(AR+AL))**(2*GAM/(GAM-1)) UN(I)=(AR*RRN+AL*QLN)/(AR+AL) RON(I)=(PN(I)/DEXP(SLN))**(1/GAM) VN(I)=VLN GOTO 20 ENDIF IF(CHAR1.GT.0.AND.CHAR2.GT.0.AND.CHAR3.GT.0) THEN PN(I)=((RRN-QRN)/(AL+AL))**(2*GAM/(GAM-1)) UN(I)=(AL*RRN+AL*QRN)/(AL+AL) RON(I)=(PN(I)/DEXP(SRN))**(1/GAM) VN(I)=VRN GOTO 20 ENDIF IF(CHAR1.LE.0.AND.CHAR2.LE.0.AND.CHAR3.LE.0) THEN PN(I)=((RLN-QLN)/(AR+AR))**(2*GAM/(GAM-1)) UN(I)=(AR*RLN+AR*QLN)/(AR+AR) RON(I)=(PN(I)/DEXP(SLN))**(1/GAM) VN(I)=VLN GOTO 20 ENDIF 20 CONTINUE RRN=2*RC-RL QRN=2*QC-QL SRN=2*SC-SL VRN=2*VC-VL IF(RRN.GT.RMAX) RRN=RMAX IF(RRN.LT.RMIN) RRN=RMIN IF(QRN.GT.QMAX) QRN=QMAX IF(QRN.LT.QMIN) QRN=QMIN IF(VRN.GT.VMAX) VRN=VMAX IF(VRN.LT.VMIN) VRN=VMIN IF(SRN.GT.SMAX) SRN=SMAX IF(SRN.LT.SMIN) SRN=SMIN AL=AR SOUNDL=SOUND UCL=UC 2 CONTINUE DO 3 I=1,NX-1 PXN(I,J)=PN(I) UXN(I,J)=UN(I) ROXN(I,J)=RON(I) IF(ROXN(I,J).LT.EPS) ROXN(I,J)=EPS VXN(I,J)=VN(I) PN(I)=0 UN(I)=0 RON(I)=0 VN(I)=0 3 CONTINUE ! ----------------------------------------------------------------- 1 CONTINUE RETURN END