Presentation is loading. Please wait.

Presentation is loading. Please wait.

Lecture 3 & 4 : Newtonian Numerical Hydrodynamics Contents 1. The Euler equation 2. Properties of the Euler equation 3. Shock tube problem 4. The Roe scheme.

Similar presentations


Presentation on theme: "Lecture 3 & 4 : Newtonian Numerical Hydrodynamics Contents 1. The Euler equation 2. Properties of the Euler equation 3. Shock tube problem 4. The Roe scheme."— Presentation transcript:

1 Lecture 3 & 4 : Newtonian Numerical Hydrodynamics Contents 1. The Euler equation 2. Properties of the Euler equation 3. Shock tube problem 4. The Roe scheme 5. Exercise 1

2 The Euler equation Continuity equation Momentum conservation Energy conservation where ρ is density, v i is velocity, p is pressure, and e is total energy 2

3 The Euler equation Continuity equation Change of the density in a volume V per unit time Mass inflow through a surface S V dS n Applying the Gauss’s theorem to the right hand side, Then, S 3

4 Momentum conservation The Euler equation Change of the momentum (x-dir.) in V per unit time Momentum inflow through S Momentum change by pressure on S Applying the Gauss’s theorem to the right hand side, Then, Momentum conservation for x-dir. 4

5 The Euler equation Energy conservation Change of the energy in V per unit time Energy inflow through S Work done by pressure on S per unit time Applying the Gauss’s theorem to the right hand side, Then, 5

6 6 unknowns (ρ, v i, p, e) and 5 equations ⇒ Close the system by specifying an equation of state E.g., Ideal gas : p = (γ-1) ρ e int where e = ρ (1/2 v 2 + e int + etc. ) γ : Adiabatic index Note : p, ρ, and e int should satisfy the 1 st -law of thermodynamics de int = - p d(1/ρ) for an adiabatic flow Main topic of this lecture = how to solve the Euler equation numerically Direct discretization gives you wrong answer because shock may appear (Lecture I & II) The Euler equation 6

7 Vector expression Consider one dimensional case ; v 1 ⇒ v Conserved variables 7

8 Properties of the Euler equation 1. Flux Jacobian matrix Let’s linearize the Euler eq. locally, A is flux Jacobian matrix where we assume the ideal gas and H = (e + p)/ρ is enthalpy. Jacobian matrix contains the information of the characteristics. Note that F = AQ 8

9 Properties of the Euler equation 2. Characteristics Let’s diagonalize the Euler eq. Eigen value eq. ; det( A - λ I ) = 0, I is unit matrix ⇒ Solution (Characteristic speed) 9

10 Properties of the Euler equation 2. Characteristics Another derivation of the characteristic speed. Let’s consider the non-conservative form of the basic equation, Eigenvalue equation det ( M – λ I ) = 0 gives you the same eigenvalue, Primitive variable 10

11 Properties of the Euler equation 2. Characteristics Left eigenvector (l i ∙ M = λ i l i, i = 1,2,3) The basic equations cast into If you consider a trajectory such that the above eq. cast into The trajectory on t-x plane = characteristics λ i = characteristic speed Simple wave = wave propagating with λ i 11

12 Properties of Euler equation 2. Characteristics With the left eigenmatrix (for the primitive variable w) the flux Jacobian matrix(for w) casts into and 12

13 Properties of Euler equation 2. Characteristics Let’s consider the transformation between Q and w, and go back to the locally linearized Euler eq., 13

14 Properties of Euler equation 2. Characteristics Then, the right eigenmatrix is R = P R p This matrix and Λ will be utilized in Roe scheme (see later section). 14

15 x Left stateRight state ρ, P 0 t = 0 t > 0 x ? Properties of the Euler equation 3. Riemann invariants Key words to solve the Riemann problem 1.Characteristics (Sec. 2) 2.Riemann invariants 15

16 Properties of the Euler equation 3. Riemann invariants along Let’s define φ i (x,t) such that it parameterizes the charactristics. t x φ 1 = const. φ 2 = const. φ 3 = const. along the characteristics Recall 16

17 Properties of the Euler equation 3. Riemann invariants Let’s consider a simple wave w i which belongs to λ i, along the characteristics Therefore, w i is a constant along the characteristics and w i = w i (φ i ). The Euler equation cast into the right eigen-vector for M 17

18 Properties of the Euler equation 3. Riemann invariants If you fix the proportionality factor to be unity, dw i - r i dφ i = 0. This equation gives you how w i changes if you across the characteristics. Note that dφ i is normal to the characteristics. If you integrate it, the quantity ∫ (dw i - r i dφ i )= const. is conserved when you across the characteristics. It is called generalized Riemann invariant. 18

19 Properties of Euler equation 3. Riemann invariants We know there are three characteristic speeds λ 1, λ 2, and λ 3. Let’s consider the (generalized) Riemann invariants for each case. case (i) : λ 1 case (ii) : λ 2 19

20 Properties of the Euler equation 3. Riemann invariants case (iii) : λ 3 Riemann invariants are important quantities to solve the Riemann problem. 20

21 Properties of the Euler equation 4. Jump condition and Rankine-Hugoniot relation Jump condition v sh = shock velocity x state 1 state 2 v sh If you consider a comoving system with shock, v sh = 0. Then, [F] = 0; (a) (b) (c) (cf. Lecture I & II ) 21

22 Properties of Euler equation 4. Jump condition and Rankine-Hugoniot relation With (a) and (b), With (c) and ideal gas EOS, (d) (e) By equating (d) with (e), we arrive Rankine-Hugoniot relation (f) 22

23 Properties of Euler equation 4. Jump condition and Rankine-Hugoniot relation From (b), (g) With this eq. and Rankine-Hugoniot relation, (h) This equation gives you the ratio of the pressure of shocked and unshocked region, once you specify the Mach number of the upstream. Similarly, from (a) and (h) (i) 23

24 Shock tube x Left stateRight stateρ, P 0 t = 0 t > 0 x Sod’s problem (γ=1.4) Initial condition ? What is a physical state at t = 0.14154 ? 24

25 Shock wave ρ Contact discontinuity Rarefaction wave L 2 3 R Shock tube Right state x Left stateρ, P t = 0 (ρ 2, v 2, p 2 ), (ρ 3, v 3, p 3 ) at t = 0.14154 ? Sod’s problem (γ=1.4) Initial condition 25

26 Shock tube With the initial condition of the Sod’s problem, (λ 1 = v – c s ) Left < (λ 1 = v – c s ) Right t x LeftRight (λ 1 ) Left (λ 1 ) Right Rarefaction wave (-direction) (λ 3 = v + c s ) Left > (λ 3 = v + c s ) Right LeftRight (λ 3 ) Left (λ 3 ) Right t x Shock wave (+direction) λ 2 = v ⇒ Contact discontinuity (between the rarefaction wave and shock wave) Note dp = 0 and dv = 0 across contact discontinuity (recall Riemann invariant) 26

27 From (h), and use (1). From the jump-condition, Shock tube Shock wave ρ Contact discontinuity Rarefaction wave L 2 3R Region 3 and R v sh : shock wave velocity Mach number in R : M R = v sh /c s,R (1) Mach number in 3 : M 3 =(v sh -v 3) /c s,3 (2) (3) (4) (5) 27

28 Shock tube From Eq. (i), Then, (6) (7) With (3), (4), and (7), we get (8) Expansion wave region (region 2) Because expansion wave is a simple wave, the Riemann invariants are (9) (10) 28

29 Shock tube Contact interface If you consider the jump-condition in a comoving frame with the contact interface, At contact interface, fluid with different density should not be mixed, Then, (11) (12) (13) (14) With (8), (10), (13), and (14), Non-linear equation for p 3 29

30 Shock tube Once we get p 3, Eq. (4) ⇒ v sh (Shock wave velocity) Then, shock wave position is x shock = x shock,ini + v sh t Eq. (8) ⇒ v 3. Then, Eq. (5) ⇒ ρ 3 Eqs. (13) and (14) ⇒ v 2, ν and p 2. Contact discontinuity position is x cd = x cd,ini + νt Eq. (9) ⇒ ρ 2 = ρ L (p 2 /p L ) 1/γ In rarefaction wave region, and characteristic velocity of rarefaction wave, (15) (16) Then, (17) (18) 30

31 Shock tube Density and pressure can be casted (19) (20) Rarefaction wave head (back-end) is λ L = v L – c s,L (λ 2 = v 2 – c s,2 ). So, rarefaction wave exist between λ L < λ rare < λ 2 Position of rarefaction wave is x rare = x rare,ini + λ rare t Expansion wave for Sod’s problem 31

32 Roe scheme To solve the Euler equation numerically, we should evaluate the numerical flux as (Lecture I and II) we should evaluate Roe scheme = a scheme to evaluate A Property U (i) F(Q R ) – F(Q L ) = A(Q R,Q L ) (Q R -Q L ) (ii) A(Q R,Q L ) has real eigen values and linear independent eigen vectors (iii) For Q R, Q L ⇒ Q, A ⇒ Flux Jacobian Matrix (Q) We will construct A to satisfy the property U. 32

33 Roe scheme If you define Roe average as, A is given as See appendix to derive this expression in details. 33

34 Roe scheme With this matrix, the numerical flux of the Roe scheme where Why does this numerical flux work ? Again, let’s start from the locally linearized Euler eq., Three scalar equations for (R -1 Q) 34

35 Roe scheme Recall the numerical flux for the scalar equation (Lecture I and II), Roe averaged variables Procedure 1.Calculate Q R and Q L at x = x j+1/2 (MUSCL) 2.Calculate Roe average Q ave from Q R and Q L 3.Calculate the eigen-matrix R, R -1 and Λ for Q ave 4.Calculate F(Q R ) and F(Q L ) 5.Calculate numerical flux at x = x j+1/2 Note that F = AQ = RΛR -1 Q 35

36 Roe scheme Procedure 1.Calculate Q R and Q L at x = x j+1/2 (MUSCL) Which quantity should we use ? (Q=(ρ, ρv, e) or w=(ρ, v, p) ? ) Recall Answer : (R -1 Q) MUSCL κ= 1/3 ⇒ quadratic scheme, κ=-1 ⇒ linear scheme 1 ≤ b ≤ (3-κ)/(1-κ) 36

37 37 2 nd accuracy in time 2nd order in time (n->n+1) ∙step 1 Q * j = Q n j – Δt/2Δx ( F n j+1/2 – F n j-1/2 ) where F n j+1/2 and F n j-1/2 should be evaluated by the Roe scheme with the 1 st order accuracy (Q L j+1/2 =Q j-1, Q R j+1/2 = Q j ). ∙step 2 Q n+1 j = Q n j – Δt/Δx ( F n+1/2 j+1/2 – F n+1/2 j-1/2 ) where F n+1/2 j+1/2 – F n+1/2 j-1/2 should be evaluated by the Roe scheme with MUSCL reconstruction, Von Neumann analysis ⇒ 0 < |λ| max Δt / Δx < 1 - κ

38 38 Rarefaction correction Because the Roe method is the approximate Riemann solver, you need the offset for the rarefaction wave, |λ i | mod = |λ i l + ½ ((λ i ) R -(λ i ) L ) if (λ i ) L < 0 < (λ i ) R = |λ i l otherwise You should use it to evaluate the matrix Λ.

39 Exercise 1.Solve the Sod’s problem and obtain the analytic solution (see p29 and p30) 2.Construct numerical code for one dimensional shock-tube problem (the Roe scheme) 3.Compare numerical and analytical solution 39

40 Appendix. A for Roe scheme Let’s consider a homogeneous expression which express Q and F. Parameter vector W With W, Q and F are expressed as 40

41 For arbitrary p R,L & q R,L, where With this relation, Matrix B Appendix. A for Roe scheme 41

42 Similarly, Matrix C Because Property U(i) requires matrix A such that ΔF = A(Q R,Q L ) ΔQ, Note that you can easily show Property U(ii) and (iii). Appendix. A for Roe scheme 42


Download ppt "Lecture 3 & 4 : Newtonian Numerical Hydrodynamics Contents 1. The Euler equation 2. Properties of the Euler equation 3. Shock tube problem 4. The Roe scheme."

Similar presentations


Ads by Google