riemann shock tube

27
MATLAB CODE FOR SHOCK TUBE PROBLEM- RIEMANN SOLVER BY ANAND DHARIYA AERO-520: COMPRESSIBLE FLOW PROF. BRAM VAN LEER

Upload: saravanan-shanmugam

Post on 22-Oct-2014

126 views

Category:

Documents


16 download

TRANSCRIPT

Page 1: Riemann Shock Tube

MATLAB CODE FOR SHOCK TUBE PROBLEM- RIEMANN SOLVER

BY

ANAND DHARIYA

AERO-520: COMPRESSIBLE FLOW

PROF. BRAM VAN LEER

Page 2: Riemann Shock Tube

  

  Page intentionally left blank 

Page 3: Riemann Shock Tube

AE 520 Fall 2006 Prof. van Leer

Computer Problem: Writing a Riemann Solver

Posted 10/04/06 Due 11/20/06

(a) Write a “Riemann solver,” i. e., an iterative procedure for finding thestates L∗ and R∗ from the interaction of the initial states L and R.NB: using a “canned” equation-solver is not acceptable.

(b) Compute all quantities needed to graph the solutions for u, p, ρ and eas a function of x/t.

(c) Write plotting instructions for these functions.

(d) Choose sets of initial values that will produce

• a shock and an expansion; take uL = uR = 0, as in a shock tube;

• two shocks of unequal strength;

• two expansions of unequal strength;

• cavitation between expansion waves of unequal strength.

In addition, construct initial values according to the following instruc-tions.

• Start from initial values that define a strong steady shock, withthe inflow state on the left (you may use the formulas from yourundergraduate textbook). Exchange the left and right states. Yourinitial values now form a steady expansion shock, which does notsatisfy the entropy condition and therefore must break up.

(e) Solve the Riemann problems for the above sets of initial values withyour code; plot the solutions. For cavitating flow, the initial values anda cavitation message produced by your program will suffice.

(f) Make a short write-up to go with the plots. Start your write-up withstating the goals of the project. In continuing, don’t copy the “Instruc-tions”; rather describe what’s not found in there. This includes youriterative procedure, plotting routines, an occasional formula (how doyou compute a shock position?), tables of in- and output parameters,an example of converging iterates. Explain how you arrived at the sets

1

Page 4: Riemann Shock Tube

of initial values. (NB: these values must be of your own choosing, notcopied from a book. If you wish to test your code on published cases,do that in addition to the cases you have created yourself.) Regardingthe expansion shock, explain its break-up with a (u, p) diagram.

(g) Attach the program and hand in.

–==oo00OO00oo==–

2

Page 5: Riemann Shock Tube

Abstract: The following report gives a detail explanation of the Mat LAB code written to solve 1-dimensional, inviscid flow, unsteady Euler equations for a shock tube in which 2 gases are separated by a wall. On removal of the wall a system of shock and expansion waves is generated. This constitutes a Riemann initial problem. The code explained herein is an exact solver to solve the Riemann problem and compute the pressure, density and velocity outputs. Also, it displays plots for these quantities in addition to curve for internal energy versus x/t along the shock tube.

Page 6: Riemann Shock Tube

Riemann Solver:

Our Riemann solver has 6 possible cases of initial values. Based on user selection, one of the case and hence corresponding values for density, velocity and pressure at time t=0 are selected. The 6 different cases and corresponding output values are tabulated. Once the initial values are selected, the speed of sound at given conditions is calculated. Next, the solver checks for cavitation. If

u1 + 2 a1 < u4 + 2 a4 _ _

γ – 1 γ - 1 cavitation is observed and the solver stops and prints error message. Solving the initial value problem boils down to solving the following set of equations: P* = m1 P4 + m4 P1 – m1m4 (u4 – u1) m1 + m4 u* = m1 u1 + m4 u4 – (P4 – P1) m1 + m4 m= ρpre apre sqrt {1 + γ+1 (P* - Ppre) } …….. for shock

2 γ Ppre

m= ρpre apre γ-1 1-P* / Ppre …….. for expansion

2 γ 1-(P* / Ppre)(γ-1)/2 γ If no cavitation is observed, the solver calculates the lower and upper limit for the iterative root finder. The lower limit is given by linear theory and it is given by m1=ρ1a1 and m4=ρ4a4. From m1 and m4, P*

low is calculated. The upper limit is found by assuming double expansion. After comparing the initial values with pressure obtained from linear theory, the solver determines whether a shock or an expansion wave is formed, so that m1 and m4 are calculated accordingly. The pressure, P* denoted as P23 is calculated

Page 7: Riemann Shock Tube

from the given equations and is compared with the upper boundary. In case of deviation the upper pressure limit is re-calculated using the following equation for tangent-secant root finder method: P*

n = P*n-1 – f( P*

n-1) ( P*n-1 - P*

n-2) f( P*

n-1) - f( P*n-2)

where ‘f’ is function in P* whose root is to be found out. The root-finder continues to iterate and successively improve the value of P*

(i.e. P23) until f(P*) ≈ 0.000001 or 450000 iterations, whichever first. Once convergence is achieved, the velocity u* and other intermediate flow parameters viz. ρ1, ρ4, a1, a4, the shock and expansion speeds are calculated and displayed. Next, the parameter x/t is varied and corresponding values of velocity, density, pressure and energy are calculated. Arrays are constructed to store these values and they are plotted against x/t. The plots for the 5 cases are attached herewith.

TABLE FOR VARIOUS CASES

SR. NO. CASE P1 P4 u1 u4 ρ1 ρ4 P* u* ρ2 ρ3

1 Sod's Problem 1 0.1 0 0 1 0.125 0.30313 0.927453 0.426319 0.265574

2 Left expansion and right strong shock 1000 0.1 0 0 3 2 406.90239 13.020508 1.578286 11.99828

3 Right expansion and left shock 7 10 0 0 1 1 8.48087 -0.435229 1.146676 0.888968

4 Double shock 450 45 20 -6 6 6 1701.5942 8.933681 14.530506 31.206924

5 Double expansion 40 40 -2 2 1 2.5 24.89761 0.450296 0.712733 1.781833

6 Cavitation 0.4 0.4 -20 20 1 1 NO SOLUTION POSSIBLE

Page 8: Riemann Shock Tube

% % Riemann solver for solving shock-tube problem % by Anand Dhariya as part of Computer project for Aero 520: Compressible % flow course % Date: 22/11/2006 % % Note: % 6 possible cases of formation of shock waves and expansion fan have been % considered including the case of cavitation. The cavitation check is % incorporated in the code. It further prevents plotting for mathematically % possible but physically unlikely case of expansion shocks. % clear; clc; close all; % Ratio of specific heats for air gamma = 1.4; % Problem definition: Conditions at time t=0 % Case 1 : Sod's Problem ch=0; while(ch==0) fprintf ('Choose one of the following cases :- \n'); fprintf ('\n \t Case 1: Sods problem \n'); fprintf ('\t Case 2: Left running expansion and right running "STRONG" shock \n'); fprintf ('\t Case 3: Left running shock and right running expansion \n'); fprintf ('\t Case 4: Double shock \n'); fprintf ('\t Case 5: Double expansion \n'); fprintf ('\t Case 6: Cavitation \n'); cas=input ('\nEnter a case no. <1-6>: '); if cas==1 % Case 1:Left Expansion & right Shock fprintf('Case 1:Sods problem \n'); rho1=1; rho4=0.125; u1=0; u4=0; p1=1; p4=0.1; fprintf ('P1 = %f \n',p1); fprintf ('P4 = %f \n',p4); fprintf ('U1 = %f \n',u1); fprintf ('U4 = %f \n',u4); fprintf ('rho1 = %f \n',rho1); fprintf ('rho4 = %f \n',rho4); ch=1; elseif cas==2 % Case 2:Strong Expansion & Shock

Page 9: Riemann Shock Tube

fprintf('Case 2:Strong Expansion & Shock \n'); rho1=3; rho4=2; u1=0; u4=0; p1=1000; p4=0.01; fprintf ('P1 = %f \n',p1); fprintf ('P4 = %f \n',p4); fprintf ('U1 = %f \n',u1); fprintf ('U4 = %f \n',u4); fprintf ('rho1 = %f \n',rho1); fprintf ('rho4 = %f \n',rho4); ch=1; elseif cas==3 % Case 3:Shock & Expansion fprintf ); ('Case 3:Shock & Expansion \n' rho1=1; rho4=1; u1=0; u4=0; p1=7; p4=10; fprintf ('P1 = %f \n',p1); fprintf ('P4 = %f \n',p4); fprintf ('U1 = %f \n',u1); fprintf ('U4 = %f \n',u4); fprintf ('rho1 = %f \n',rho1); fprintf ('rho4 = %f \n',rho4); ch=1; elseif cas==4 % Case 4:Double Shock fprintf('Case 4:Double Shock \n'); rho1=6; rho4=6; u1=20; u4=-6; p1=450; p4=45; fprintf ('P1 = %f \n',p1); fprintf ('P4 = %f \n',p4); fprintf ('U1 = %f \n',u1); fprintf ('U4 = %f \n',u4); fprintf ('rho1 = %f \n',rho1); fprintf ('rho4 = %f \n',rho4); ch=1; elseif cas==5 % Case 5:Double Expansion fprintf('Case 5:Double Expansion \n'); rho1=1; rho4=2.5; u1=-2; u4=2; p1=40; p4=40; fprintf ('P1 = %f \n',p1); fprintf ('P4 = %f \n',p4);

Page 10: Riemann Shock Tube

fprintf ('U1 = %f \n',u1); fprintf ('U4 = %f \n',u4); fprintf ('rho1 = %f \n',rho1); fprintf ('rho4 = %f \n',rho4); ch=1; elseif cas==6 % Case 6:Cavitation fprintf ); ('Case 6:Cavitation \n' rho1=1; rho4=1; u1=-20 ; u4=20; p1=0.40; p4=0.40; fprintf ('P1 = %f \n',p1); fprintf ('P4 = %f \n',p4); fprintf ('U1 = %f \n',u1); fprintf ('U4 = %f \n',u4); fprintf ('rho1 = %f \n',rho1); fprintf ('rho4 = %f \n',rho4); ch=1; else fprintf ('Please enter an appropriate choice \n'); end % for case selection if-else loop end % for case selection while loop % Calculation of flow parameters at initial condition a1=sqrt(gamma*p1/rho1); a4=sqrt(gamma*p4/rho4); M1=u1/a1; M4=u4/a4; if u1<0 && u4>0 && (u1+(2/(gamma-1))*a1)<=(u4-(2/(gamma-1))*a4) %chk for cavitation fprintf('\n Cavitation is observed in this case of double expansion. No solution possible \n'); break; else % Secant Method for getting pressure P* p23up=(((gamma-1)/2*(u1-u4)+a1+a4)/((a1*(p1)^((2*gamma)/(gamma-1)))+(a4*(p4)^((2*gamma)/(gamma-1)))))^((2*gamma)/(gamma-1)); % upper limit p23down=(rho1*a1*p4+rho4*a4*p1-(rho1*a1*rho4*a4*(u4-u1)))/(rho1*a1+rho4*a4); %lower limit by linear theory s=0; if p23down>=p1 s=1; end ss=0; if p23down>=p4 ss=1; end if s==1 m1=rho1*a1*sqrt(1+((gamma+1)*(p23up-p1)/(2*gamma*p1))); m1d=rho1*a1*sqrt(1+((gamma+1)*(p23down-p1)/(2*gamma*p1)));

Page 11: Riemann Shock Tube

else m1=rho1*a1*(gamma-1)/(2*gamma)*(1-p23up/p1)/(1-(p23up/p1)^((gamma-1)/(2*gamma))); m1d=rho1*a1*(gamma-1)/(2*gamma)*(1-p23down/p1)/(1-(p23down/p1)^((gamma-1)/(2*gamma))); end if ss==1 m4=rho4*a4*sqrt(1+((gamma+1)*(p23up-p4)/(2*gamma*p4))); m4d=rho4*a4*sqrt(1+((gamma+1)*(p23down-p4)/(2*gamma*p4))); else m4=rho4*a4*(gamma-1)/(2*gamma)*(1-p23up/p4)/(1-(p23up/p4)^((gamma-1)/(2*gamma))); m4d=rho4*a4*(gamma-1)/(2*gamma)*(1-p23down/p4)/(1-(p23down/p4)^((gamma-1)/(2*gamma))); end p23=(m1*p4+m4*p1-m1*m4*(u4-u1))/(m1+m4); f=p23up-p23; p23d=(m1d*p4+m4d*p1-m1d*m4d*(u4-u1))/(m1d+m4d); ff=p23d-p23; j=0; % iteration procedure starts from here while abs(f)>0.000001 p23up=p23up-(f*(p23up-p23d)/(f-ff)); if s==1 m1=rho1*a1*sqrt(1+((gamma+1)*(p23up-p1)/(2*gamma*p1))); m1d=rho1*a1*sqrt(1+((gamma+1)*(p23down-p1)/(2*gamma*p1))); else m1=rho1*a1*(gamma-1)/(2*gamma)*(1-p23up/p1)/(1-(p23up/p1)^((gamma-1)/(2*gamma))); m1d=rho1*a1*(gamma-1)/(2*gamma)*(1-p23down/p1)/(1-(p23down/p1)^((gamma-1)/(2*gamma))); end if ss==1 m4=rho4*a4*sqrt(1+((gamma+1)*(p23up-p4)/(2*gamma*p4))); m4d=rho4*a4*sqrt(1+((gamma+1)*(p23down-p4)/(2*gamma*p4))); else m4=rho4*a4*(gamma-1)/(2*gamma)*(1-p23up/p4)/(1-(p23up/p4)^((gamma-1)/(2*gamma))); m4d=rho4*a4*(gamma-1)/(2*gamma)*(1-p23down/p4)/(1-(p23down/p4)^((gamma-1)/(2*gamma))); end p23=(m1*p4+m4*p1-m1*m4*(u4-u1))/(m1+m4); f=p23up-p23; p23d=(m1d*p4+m4d*p1-m1d*m4d*(u4-u1))/(m1d+m4d); ff=p23d-p23; j=j+1; if j>450000; fprintf ('No convergance \n'); break; end end % for while loop of secant method

Page 12: Riemann Shock Tube

% Root finder ends %Calculation of flow parameters depending whether shock or an %expansion is observed u23=(m1*u1+m4*u4-(p4-p1))/(m1+m4); if s==1 rho2=rho1*(1+(((gamma+1)/(gamma-1))*p23/p1))/(((gamma+1)/(gamma-1))+p23/p1); if u23>u1 fprintf('Expansion shock-not physically possible \n'); return; end else rho2=rho1*(p23/p1)^(1/gamma); end if ss==1 rho3=rho4*(1+(((gamma+1)/(gamma-1))*p23/p4))/(((gamma+1)/(gamma-1))+p23/p4); if u23<u4 fprintf('Expansion shock-not physically possible \n'); return; end else rho3=rho4*(p23/p4)^(1/gamma); end a2=sqrt(gamma*p23/rho2); a3=sqrt(gamma*p23/rho3); end % for cavitation test % Print calculated flow quantities fprintf ('\n Solution of Riemann problem :- \n'); fprintf ('P* = %f \n',p23); fprintf ('U* = %f \n',u23); fprintf ('rho2 = %f \n',rho2); fprintf ('rho3 = %f \n',rho3); % Variable initialization cs12=0; cs34=0; expc121=0; expc122=0; expc341=0; expc342=0; % Calculation of shock/expansion speeds if s==1 cs12l=a1*sqrt(1+(gamma+1)/(2*gamma)*(p23-p1)/p1); cs12=u1-abs(cs12l); else expc121=u1-a1; expc122=u23-a2; end

Page 13: Riemann Shock Tube

if ss==1 cs34r=a4*sqrt(1+(gamma+1)/(2*gamma)*(p23-p4)/p4); cs34=u4+abs(cs34r); else expc341=u4+a4; expc342=u23+a3; end %Array construction maxxt=max([cs12 cs34 expc121 expc122 expc341 expc342]); minxt=min([cs12 cs34 expc121 expc122 expc341 expc342]); offsetxt=0.1*(maxxt-minxt); if s==1 xt(1)=cs12-offsetxt; incr=abs(offsetxt)/1500; for i=1:1500 xt(i+1)=xt(i)+incr; u(i)=u1; rho(i)=rho1; p(i)=p1; e(i)=p(i)/(gamma-1)/rho(i); end xt(1500)=cs12; incr=abs(u23-cs12)/1500; for i=1501:3000 xt(i+1)=xt(i)+incr; u(i)=u23; rho(i)=rho2; p(i)=p23; e(i)=p(i)/(gamma-1)/rho(i); end xt(3000)=u23; else xt(1)=expc121-offsetxt; incr=abs(offsetxt)/1000; for i=1:1000 xt(i+1)=xt(i)+incr; u(i)=u1; rho(i)=rho1; p(i)=p1; e(i)=p(i)/(gamma-1)/rho(i); end xt(1000)=expc121; incr=abs(expc122-expc121)/1000; for i=1001:2000 xt(i+1)=xt(i)+incr; if expc122>=0 u(i)=2/(gamma+1)*(xt(i)-a1)+(gamma-1)/(gamma+1)*u1; a=((gamma-1)/(gamma+1)*(xt(i)-u1))+(2/(gamma+1)*a1); else u(i)=2/(gamma+1)*(xt(i)+a1)+(gamma-1)/(gamma+1)*u1; a=(-(gamma-1)/(gamma+1)*(xt(i)-u1))+(2/(gamma+1)*a1); end

Page 14: Riemann Shock Tube

rho(i)=rho1*(a/a1)^(2/(gamma-1)); p(i)=p1*(a/a1)^(2*gamma/(gamma-1)); e(i)=p(i)/(gamma-1)/rho(i); end xt(2000)=expc122; incr=abs(expc122-u23)/1000; for i=2001:3000 xt(i+1)=xt(i)+incr; u(i)=u23; rho(i)=rho2; p(i)=p23; e(i)=p(i)/(gamma-1)/rho(i); end xt(3000)=u23; end if ss==1 incr=abs(u23-cs34)/1500; for i=3001:4500 xt(i)=xt(i-1)+incr; u(i)=u23; rho(i)=rho3; p(i)=p23; e(i)=p(i)/(gamma-1)/rho(i); end xt(4500)=cs34; incr=abs(offsetxt)/1500; for i=4501:6000 xt(i)=xt(i-1)+incr; u(i)=u4; rho(i)=rho4; p(i)=p4; e(i)=p(i)/(gamma-1)/rho(i); end else incr=abs(expc342-u23)/1000; for i=3001:4000 xt(i)=xt(i-1)+incr; u(i)=u23; rho(i)=rho3; p(i)=p23; e(i)=p(i)/(gamma-1)/rho(i); end xt(4000)=expc342; incr=abs(expc342-expc341)/1000; for i=4001:5000 xt(i)=xt(i-1)+incr; if expc341>=0 u(i)=2/(gamma+1)*(xt(i)-a4)+(gamma-1)/(gamma+1)*u4; a=((gamma-1)/(gamma+1)*(xt(i)-u4))+(2/(gamma+1)*a4); else u(i)=2/(gamma+1)*(xt(i)+a4)+(gamma-1)/(gamma+1)*u4; a=(-(gamma-1)/(gamma+1)*(xt(i)-u4))+(2/(gamma+1)*a4);

Page 15: Riemann Shock Tube

end rho(i)=rho4*(a/a4)^(2/(gamma-1)); p(i)=p4*(a/a4)^(2*gamma/(gamma-1)); e(i)=p(i)/(gamma-1)/rho(i); end xt(5000)=expc341; incr=abs(offsetxt)/1000; for i=5001:6000 xt(i)=xt(i-1)+incr; u(i)=u4; rho(i)=rho4; p(i)=p4; e(i)=p(i)/(gamma-1)/rho(i); nd e end % Plotting instructions subplot (2,2,1) plot(xt,u); title('Plot of U v/s x/t'); xlabel ('x/t'); ylabel ('u'); axis tight; subplot (2,2,2) plot(xt,rho); title('Plot of Density v/s x/t'); xlabel ('x/t'); ylabel ('rho'); axis tight; subplot (2,2,3) plot(xt,p); title('Plot of Pressure v/s x/t'); xlabel ('x/t'); ylabel ('P'); axis tight; subplot (2,2,4) plot(xt,e); title('Plot of Internal Energy v/s x/t'); xlabel ('x/t'); ylabel ('E'); axis tight; % ---------END OF CODE----------- %

Page 16: Riemann Shock Tube

Flowchart for Riemann Solver:

SELECT CASE & fix ρ IS CAVITATION PRESENT ? IS ERROR < 0.000001

1, ρ , u4 1, u , P , P4 1 4

CALC a , a , M1 4 1, M4

PRINT ERROR MESSAGE YES

STOPNO

CALC. UPPER AND LOWER PRESSURE LIMIT FOR SECANT

METHOD

ENTER ITERATIVE ROOT FINDER

ITERATE

NO

YESCALC. U

END

23, ρ2, ρ , a3 2, a3 & SHOCK/EXPANSION SPEEDS

BUILD ARRAY FOR U, ρ, P & E. PLOT THEM AGAINST

VARYING x/t

Page 17: Riemann Shock Tube

Choose one of the following cases :- Case 1: Sods problem Case 2: Left running expansion and right running "STRONG" shock Case 3: Left running shock and right running expansion Case 4: Double shock Case 5: Double expansion Case 6: Cavitation Enter a case no. <1-6>: 1 Case 1:Sods problem P1 = 1.000000 P4 = 0.100000 U1 = 0.000000 U4 = 0.000000 rho1 = 1.000000 rho4 = 0.125000 Solution of Riemann problem :- P* = 0.303130 U* = 0.927453 rho2 = 0.426319 rho3 = 0.265574 >>

Page 18: Riemann Shock Tube

−1 −0.5 0 0.5 1 1.5 20

0.2

0.4

0.6

0.8

Plot of U v/s x/t

x/t

u

−1 −0.5 0 0.5 1 1.5 2

0.2

0.4

0.6

0.8

1Plot of Density v/s x/t

x/t

rho

−1 −0.5 0 0.5 1 1.5 2

0.2

0.4

0.6

0.8

1Plot of Pressure v/s x/t

x/t

P

−1 −0.5 0 0.5 1 1.5 21.8

2

2.2

2.4

2.6

2.8

Plot of Internal Energy v/s x/t

x/t

E

Page 19: Riemann Shock Tube

Choose one of the following cases :- Case 1: Sods problem Case 2: Left running expansion and right running "STRONG" shock Case 3: Left running shock and right running expansion Case 4: Double shock Case 5: Double expansion Case 6: Cavitation Enter a case no. <1-6>: 1 Case 1:Sods problem P1 = 1.000000 P4 = 0.100000 U1 = 0.000000 U4 = 0.000000 rho1 = 1.000000 rho4 = 0.125000 Solution of Riemann problem :- P* = 0.303130 U* = 0.927453 rho2 = 0.426319 rho3 = 0.265574 >>

Page 20: Riemann Shock Tube

−20 −10 0 100

2

4

6

8

10

12

Plot of U v/s x/t

x/t

u

−20 −10 0 102

4

6

8

10

Plot of Density v/s x/t

x/t

rho

−20 −10 0 10

200

400

600

800

1000Plot of Pressure v/s x/t

x/t

P

−20 −10 0 10

100

200

300

400

500

600

700

800

Plot of Internal Energy v/s x/t

x/t

E

Page 21: Riemann Shock Tube

Choose one of the following cases :- Case 1: Sods problem Case 2: Left running expansion and right running "STRONG" shock Case 3: Left running shock and right running expansion Case 4: Double shock Case 5: Double expansion Case 6: Cavitation Enter a case no. <1-6>: 3 Case 3:Shock & Expansion P1 = 7.000000 P4 = 10.000000 U1 = 0.000000 U4 = 0.000000 rho1 = 1.000000 rho4 = 1.000000 Solution of Riemann problem :- P* = 8.480870 U* = -0.435229 rho2 = 1.146676 rho3 = 0.888968 >>

Page 22: Riemann Shock Tube

−4 −2 0 2 4

−0.4

−0.3

−0.2

−0.1

0Plot of U v/s x/t

x/t

u

−4 −2 0 2 4

0.9

0.95

1

1.05

1.1

Plot of Density v/s x/t

x/t

rho

−4 −2 0 2 47

7.5

8

8.5

9

9.5

10Plot of Pressure v/s x/t

x/t

P

−4 −2 0 2 4

18

19

20

21

22

23

24

25Plot of Internal Energy v/s x/t

x/t

E

Page 23: Riemann Shock Tube

Choose one of the following cases :- Case 1: Sods problem Case 2: Left running expansion and right running "STRONG" shock Case 3: Left running shock and right running expansion Case 4: Double shock Case 5: Double expansion Case 6: Cavitation Enter a case no. <1-6>: 4 Case 4:Double Shock P1 = 450.000000 P4 = 45.000000 U1 = 20.000000 U4 = -6.000000 rho1 = 6.000000 rho4 = 6.000000 Solution of Riemann problem :- P* = 1701.594168 U* = 8.933681 rho2 = 14.530506 rho3 = 31.206924 >>

Page 24: Riemann Shock Tube

0 2 4 6 8 10 12−5

0

5

10

15

20Plot of U v/s x/t

x/t

u

0 2 4 6 8 10 12

10

15

20

25

30

Plot of Density v/s x/t

x/t

rho

0 2 4 6 8 10 12

200

400

600

800

1000

1200

1400

1600

Plot of Pressure v/s x/t

x/t

P

0 2 4 6 8 10 12

50

100

150

200

250

Plot of Internal Energy v/s x/t

x/t

E

Page 25: Riemann Shock Tube

Choose one of the following cases :- Case 1: Sods problem Case 2: Left running expansion and right running "STRONG" shock Case 3: Left running shock and right running expansion Case 4: Double shock Case 5: Double expansion Case 6: Cavitation Enter a case no. <1-6>: 5 Case 5:Double Expansion P1 = 40.000000 P4 = 40.000000 U1 = -2.000000 U4 = 2.000000 rho1 = 1.000000 rho4 = 2.500000 Solution of Riemann problem :- P* = 24.897610 U* = 0.450296 rho2 = 0.712733 rho3 = 1.781833 >>

Page 26: Riemann Shock Tube

−10 −5 0 5−2

−1.5

−1

−0.5

0

0.5

1

1.5

2Plot of U v/s x/t

x/t

u

−10 −5 0 5

0.8

1

1.2

1.4

1.6

1.8

2

2.2

2.4

Plot of Density v/s x/t

x/t

rho

−10 −5 0 525

30

35

40Plot of Pressure v/s x/t

x/t

P

−10 −5 0 5

40

50

60

70

80

90

100Plot of Internal Energy v/s x/t

x/t

E

Page 27: Riemann Shock Tube

Choose one of the following cases :- Case 1: Sods problem Case 2: Left running expansion and right running "STRONG" shock Case 3: Left running shock and right running expansion Case 4: Double shock Case 5: Double expansion Case 6: Cavitation Enter a case no. <1-6>: 6 Case 6:Cavitation P1 = 0.400000 P4 = 0.400000 U1 = -20.000000 U4 = 20.000000 rho1 = 1.000000 rho4 = 1.000000 Cavitation is observed in this case of double expansion. No solution possible >>