http://www.nd.edu/~gtryggva/cfd-course/! Solving the Euler Equations! Grétar Tryggvason! Spring 0! The Euler equations for D flow:! where! Define! Ideal Gas:! ρ ρu ρu + ρu + p = 0 t x ( / ) ρe ρu E + p ρ E = e + u / h = e + p / ρ; H = h + u / = E + p / ρ; p = ρt; e = e( T ); c v = de /dt h = h( T); c p = dh /dt = c p c v ; γ = c p /c v ; p = ( γ )ρe The Euler equations for D flow:! or! where! ρ ρu ρu + ρu + p = 0 t x ( / ) ρe ρu E + p ρ t f + x F = 0 ρ ρu f = ρu ; F = ρu + p ρe ρu(e + p / ρ) Predictor step! Variables! f j +/ Predictor-corrector method: imiting the variables! Find:! Final step! n +/ f j = f n j Δt h F n n j +/ F j / n +/ = f j + Ψ n +/ f n +/ ( j f j ) n +/ f j +/ = f j + Ψ n +/ f n +/ j + f j F j +/ n +/ = F ( f ) n +/, f n +/ ( j +/ j +/ ) n f + j = f n j Δt h F n +/ n +/ ( j +/ F j / ) 5! 6! The Euler equations can be solved using the flux limited high order methods described earlier by finding the fluxes using solutions to the iemann problem! F j +/ n +/ = F ( f ) n +/, f n +/ ( j +/ j +/ ) In principle we can solve this problem, the iemann problem, exactly by assuming constant states and then integrate the fluxes over the time step. In the last lecture we did so for the case when the fluids are initially at rest.! Although the iemann problem can be solved for the general case when the fluids are not stationary, the solution is expensive (involving solving a nonlinear equation for the pressure ratio across the shock) and the only information that we need from the solution is the flux across the cell boundary.! Therefore, usually we use approximate iemann solvers. Different approximations are possible but generally the result is a complex process. Here we will only outline it briefly!
7! 8! The oe approximate iemann solver was one of the first method to compute the fluxes in a simpler way.! It is based on approximating the Euler equation by a linear equation! f t + A f x = 0 whose fluxes can be found analytically. The linearization is done in such a way that the correct wave speed is preserved. The jump in the solution across a shock can be written in terms of the eigenvectors:! 3 f f = α p p p= oe introduced the following matrix A! A = 0 0 γ 3 u ( 3 γ )u γ γ u 3 uh H ( γ )u γ u where the average variables are defined by! u = ρ u + ρ u ; H = ρ H + ρ H ρ + ρ ρ + ρ 9! The fluxes are given by! 3 F i+/ = F + F λ p α p where the eigenvalues are the same as for the original! and the scaled eigenvectors are given by! = u c H u c ; = p= u u p λ = u c ; λ = c ; λ 3 = u + c ; ; = u + c H + u c ; α α α 3 0! The alphas are given by! = u 4c + ( γ ) u c c + ( γ ) u c γ u γ c u 4c ( γ ) u c c ( γ ) u c Δρ j+/ = ρ j+/ ρ j+/ ; Δρu j+/ = ρu j+/ γ c u ( γ ) u c c ρu j+/ γ c Where the jumps across the cell boundary are:! and (again)! u = ρ u + ρ u ; H = ρ H + ρ H ; c = γ ρ + ρ ρ + ρ H u Δρ j+/ Δρu j+/ ΔρE j+/ ; ΔρE j+/ = ρe j+/ ρe j+/! The fluxes are given by! F i+/ F i+/ 3 F i+/ = ρu ( + ( ρu) j+/ j+/ ) λ α λ α λ α 3 3 ( j+/ ) = ( γ ) ( ρe) j+/ ( γ 3) ( ρu) ( ρ) j+/ j+/ + ( γ ) ( ρe) j+/ = ρu ρu γ 3 ( ρ) j+/ λ α ( u c ) λ α u λ α ( u + c ) 3 3 H ( + ( ρu) j+/ j+/ H ) λ α ( h u c ) λ α u λ α ( h + u c ) 3 3! rd order unge-kutta! f () = f n + Δt f n f () = f () + Δt f () f n+ = f n + f () 3 rd order unge-kutta! f () = f n + Δt f n f () = 3 4 f n + 4 f () + () Δt f 4 f n+ = 3 f n + 3 f () + () Δt( f ) 3 Time Integration! 4 rd order unge-kutta! f (0) = f n f () = f (0) + 4 Δt f n f () = f (0) + () Δt( f ) 3 f (3) = f (0) + () Δt f f n+ = f (0) + Δt f ()
3! 4! esults from:! PINCIPES OF COMPUTATIONA! FUID DYNAMICS by P. Wesseling,! Delft University of Technology,! The Netherlands! 48 gridpoints! Matlab codes available at the website! http://ta.twi.tudelft.nl/users/wesselin/cfdbook.html! 5! 6! 48 gridpoints! The oe approximate iemann solver generally gives well behaved results but it does allow for expansion shocks in some cases. This can be corrected by the so-called entropy fix (see Wesseling)! 7! 8! The TVD property gives monotonic behavior for D scalar conservation laws but generally not for nonlinear systems or multidimensional flows. However, generally it is found that schemes that satisfy the TVD property when applied to D scalar equation do well for systems. When used for multidimensional flows by splitting, they are also generally found to be well behaved.! Several variants of similar methods have been proposed.! One of the better known is the AUSM (Advection Upstream Splitting Method) family of methods, originally due to iou and Steffen (993), where the fluxes are split into convective and a pressure part. The method and its derivatives have been used widely for many aerospace and other applications, including multiphase flows.!
The Euler Equations in twodimensions! For the Euler equations:! ρ ρu ρv ρu + ρu + p + ρuv = 0 t ρv x ρuv y ρv + p ρe ρu(e + p /ρ) ρv(e + p/ρ) where! E = e + (u + v ) /; p = (γ )ρe In vector form! f t + F x + G y = 0 Two-dimensional problems are almost always solved by splitting where we apply one-dimensional methods to each direction in sequence! Flux vector splitting! F ± = ± ρ 4c u ± c ( γ )u ± c γ v v [ + ( γ )u ± c ] ( γ ) f t + F + x + F x + G + y + G y = 0 G ± = ± ρ 4c v ± c u ( γ )v ± c γ u [ + ( γ )v ± c ] ( γ ) esults from a review paper:! P. Woodward and P. Colella:! Computational domain! Shock! h=/30 h The Numerical Simulation of two- Dimensional Fluid Flow with Strong Shocks.! J. Comput. Phys. 54 (984), 5-73.! Given inflow! 3! wall!! Outflow! h=/60 h=/0 0 Godunovʼs method! MacCormacʼs method!
6! h=/30 h=/60 h Higher Order and more recent methods! h=/0 0 MUSC! PPM! 7! 8! Beyond linear: econstruction of higher order approximations for the function in each cell (ENO and WENO).! The critical step in the methods discussed so far is the construction of a linear slope in each cell and the limitation of this slope to prevent oscillations. For higher order methods, a higher order profile needs to be constructed! Constructing an interpolation polynomial from the cell averages: For anything higher than second order (linear) the problem is that the average value in the cell is not equal to the value at the center.! To get around this we look at the primitive function:! x v( ξ) V x The lower bound is arbitrary and can be replaced! dξ j- j- j j+ j+ j-3/ j-/ j+/ j+3/ 9! 30! Since this is the integral over the cells, the discrete version is exact at the cell boundaries! i x j+/ = v( ξ) V x i+/ dξ = f i Δx j= x j / j- j- j j+ j+ j-3/ j-/ j+/ j+3/ i j= V ( x i 3/ ); V ( x i / ); V ( x i+/ ); V ( x i+3/ ); A polynomial interpolating the edge values is given by P(x) and we denote its derivative by p(x) Then it can be shown that! x j+/ p(x) = P'(x) p ξ dξ = P' ξ dξ = P(x j+/ ) P(x j / ) x j / x j+/ x j / x j+/ = V (x j+/ ) V (x j / ) = v ξ dξ = f i Δx x j / That is, the integral of p(x) over the cell is equal to the cell average f i
3! 3! Thus, p(x) gives the correct average value in each cell and the integrated value gives the exact values of the primitive function at the cell boundaries.! We need to write down a polynomial P(x) that interpolates the values of the primitive function of the cell boundaries and then differentiate this polynomial to get p(x), which lets us compute the variables at the cell boundary! j- j- j j+ j+ j-3/ j-/ j+/ j+3/ The interpolation polynomial is often taken to be the agrangian Polynomial! k P(x) = V (x i r + m / ) m=0 k l =0 l m x x i r +l / x i r / x i r +l / Where r determines where we start and k is the order! 33! Example: Second order ENO! j- j- j j+ j+ j-3/ j-/ j+/ j+3/ The question is now which point we select. We start by interpolating over one cell (linear). To add one point we can add either the point to the left or the right. In ENO we select the points based on the minimum absolute value of the divided differences of the function values!. Construct left and right slopes by connecting the average values in adjacent cells!. Select the downstream flux by using the smaller slope! Δf + j = f j + f j Δf j-! j! j+! j = f j f j f j +/ = U>0! f j f j f j + amin Δf + ( j, Δf j ), if u j + u j + f j amin Δf + ( j +, Δf j + ), if u + u j j + f j / f j +/ > 0 < 0 f j+ f t + u f x = 0 f * j = f n j Δt h u n j f j n+ = f j n Δt h Second order ENO scheme for the linear advection equation! f n n ( j +/ f j / ) f n j +/ f n * * * ( ( j / ) + u j ( f j +/ f j / )) u n j f j +/ = = amin a,b a, a < b b, b a f j + amin Δf + ( j,δf j ), if u + u j j + f j amin Δf + ( j +,Δf j + ), if u + u j j + > 0 < 0 Second order ENO scheme for the linear advection equation! f t + u f x = 0 Blue: nd order ENO! ed: st Upwind! Δf j + = f j + f j Δf j = f j f j
37! 38! j- j- j j+ j+ j-3/ j-/ j+/ j+3/ In the WENO (weighted essentially non-oscillating) scheme we use all the points but weigh the contribution of each according to a smoothness criteria. High-order WENO represents the current state-of-the-art in computing of flows with sharp interfaces! Increasingly we see methods developed for the inviscid Euler equation with shocks being used for the advection part of the Navier-Stokes solvers.! For a recent reference on WENO see, for example:! C-W Shu. High Order Weighted Essential Nonoscillatory Schemes for Convection Dominated Problems. SIAM eview, Vol. 5 (009), 8-6.! 39! 40! CIP-gradient augmentation! Other Approaches! The CIP (Constrained Interpolation Polynomial)! Method (Yabe)! In addition to advecting the marker function f, its derivative is advected by fitting a third order polynomial through the function and its derivatives.! Start with! Introduce! In D, the advection of the derivative is given by! f and g given! Therefore, the derivative is translated with velocity u, just as the function. In D splitting is used to separate translation and deformation! New f and g! 4! CIP-gradient augmentation! The CIP method results in very accurate advection and for a sharp interface it greatly reduces overshoots, but does not eliminate them completely! Enormous progress has been made in solution techniques for hyperbolic systems with shocks in the last twenty years. Advanced methods are now able to resolve complex shocks within a grid space or two, even in multidimensional situations for a large range of governing parameters and physical complexity.! Here, we have only examined relatively elementary aspects of methods for hyperbolic systems, but this short introduction should have taught you methods to solve such systems and introduced you to literature.!
43! A few words about the project:! I asked you to select your own parameters. In doing so keep in mind that while Nature usually presents us with problems that have multiphysics problems with a large range of scales and extreme values of the physical properties, in CFD we prefer single physics, small range of scales and O() values for the physical properties. In the project you are simply showing that the code works and looking at trends. Using Matlab you are limited to modest resolution and run-time so you should select you parameters commensurate with the resolution you are using!!