hp://www.nd.ed/~gryggva/cfd-corse/ The Eler Eqaions The Eler Eqaions The Eler eqaions for D flow: + + p = x E E + p where Define E = e + / H = h + /; h = e + p/ Gréar Tryggvason Spring 3 Ideal Gas: 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 Eler Eqaions The Eler Eqaions The Eler eqaions for D flow: where + + p = x E E + p E = e + / Ideal Gas: p = T; h = h( T ); c p = dh / dt; h e = T = h / T e / T = c p c v ; = c p / c v ; and we define H = h + /; h = e + p/ e = e( T ); c v = de /dt Pressre and energy are relaed by p = ( h e) = ( h / e )e = ( )e Speed of sond c = p = T = p s p = ( ) c = p / The Eler Eqaions + + p = x E E + p p = ( )e c = p / Expanding he derivaive and rearranging he eqaions + / p c x = + A or x = p The Characerisics for he Eler Eqaions are fond by finding he eigenvales for A T de(a T λi) = Find de(a T λi) = or: The Eler Eqaions or (( ) c ) = ( λ) λ ( λ) = λ = (( λ) c ) = λ = ±c λ = ± c λ de λ c = / λ Therefore λ = c; λ = + c; λ 3 = Exac Solion: The ankine-hgonio condiions For a hyperbolic sysem + F x = The speed of a disconiniy (shock) is fond by moving o a frame where a shock moving wih speed s is saionary s x + F x = Inegraing across he shock yields [ ] = [ F] s f
Exac Solion: For he Eler eqaions: + + p = x E E + p The ankine-hgonio condiions are: s( L ) = (( ) L ( ) ) s( ( ) L ( ) ) = (( + p) + p L ( ) ) s( ( E ) L E ) = (( (E + p/) ) L (E + p/) ) ( ) ( ) The Shock-Tbe Problem Exac Solion The shock be problem L,, L,, Densiy L 5 3 Pressre Expansion Fan Conac Shock Expansion Fan Conac Shock L L Exac Solion: 3 L given:, L, L,,, α = + Exac Solion: 3 L given:, L, L,,, c L = L c = Consider he case > : Shock separaes and Conac disconiniy separaes and 3 Expansion fan separaes 3 and L The ankine-hgonio condiions give a nonlinear P = p relaion for he pressre jmp across he shock P = p L ( ) ( c / c L )(P ) ( + ( + ) ( P ) ) which can be solved by ieraion /( )
Exac Solion: Exac Solion: The speed of he shock and velociy behind he shock are fond sing H condiions: + ( +)P s shock = + c / 3 L x shock = x + s shock The speed of he conac is s conac = 3 = = L + c L P p x conac = x + s conac The lef hand side of he fan moves wih speed s fl = c L x fl = x + s fl The righ hand side of he fan moves wih speed s f = c 3 x f = x + s f P = p Lef niform sae given:, L, L, c L = L 3 L In he expansion fan () + (s x) = c L α = L + s x + + (s x) p = p c L α Behind he conac (3) p 3 = p 3 = P = p 3 = L P p / Exac Solion: Exac Solion: 3 L α = + P = p The velociy relaive o he speed of sond defines he flow regime Behind he conac (3) p 3 = p 3 = 3 = L P p / Behind he shock () = + αp α + P p = P = L + c L P p igh niform sae given:,, c = c = p The Mach nmber is defined as he raio of he local velociy over he speed of sond Ma = c Ma < sbsonic Ma > spersonic Tes case: Shockbe problem of G.A. Sod, JCP 7:, 97 = 5 ; L =.; L = = ; =.5; = final =.5 x =.5 Sbsonic case Exac Solion:.... x 3 5 velociy 3 5 3.... =.5 Velociy Pressre Densiy Mach nmber 3 5 Mach Nmber.... 3 5 5 3 5 5 velociy Exac Solion: x pressre 3 5.9..7..5..3.. Mach nmber 3 5 3 5 3 5
Exac Solion: Tes case: Pressre Shockbe problem of G.A. Sod, JCP 7:, 97 = 5 ; L =.; L = = ; =.; = final =.5 x =.5 Spersonic case Velociy Mach Nmber Densiy Solve sing second order Lax-Wendroff L-W wih arificial viscosiy For he flid-dynamic sysem of eqaions (Eler eqaions): + + p = x E E + p where E = e + / ; Add he arificial viscosiy o HS: = αh x x x p = ( ) e * f j + L-W wih arificial viscosiy Solions of he D Eler eqaion sing Lax-Wendroff ( ).5 Δ n n ( F j ) =.5 f n n j + f j + ( ) n f + j = f n j Δ h F * * j + F j F' = F αh h F j + Wih an arificial viscosiy erm added o he correcor sep x x Lax Fredrich Leap Frog j- j j+ Tes case: L-W wih arificial viscosiy L-W wih arificial viscosiy Effec of α Shockbe problem of G.A. Sod, JCP 7:, 97 = 5 ; L =.; L = = ; =.5; = Final ime:.5.... nx=; α =.5.... nx=; α =.5 α =. α =.5 α =.5 x pressre α =.5 α =. α =.5 α =.5............
nx=; nx=; nx=5; ime=.5 x pressre.... L-W wih arificial viscosiy Effec of resolion α =.5........ Oline of L-W program L-W wih arificial viscosiy for isep=: for i=:nx,p(i)=..; end for i=:nx- %predicion sep rh(i)=.. rh(i)=.. reh(i)=.. end for i=:nx,ph(i)=..; end for i=:nx- %correcion sep r(i)=.. r(i)=.. re(i)=.. end for i=:nx,(i)=r(i)/r(i);end for i=:nx- %arificial viscosiy r(i)=.. re(i)=.. end ime=ime+d,isep end L-W wih arificial viscosiy nx=9; arvisc=.5; hold off %gg=.;p_lef=;p_righ=;r_lef=;r_righ=.; gg=.;p_lef=;p_righ=;r_lef=;r_righ=.5; xl=.;h=xl/(nx-);ime=; r=zeros(,nx);r=zeros(,nx);re=zeros(,nx);p=zeros(,nx); rh=zeros(,nx);rh=zeros(,nx);reh=zeros(,nx);ph=zeros(,nx); for i=:nx,r(i)=r_righ;r(i)=.;re(i)=p_righ/(gg-);end for i=:nx/; r(i)=r_lef; re(i)=p_lef/(gg-); end rh=r;rh=r;reh=re;ph=p; d=.5*h/sqr(.*max([7+p_righ/r_righ,7+p_lef/r_lef]) ) for isep=: for i=:nx,p(i)=(gg-)*(re(i)-.5*(r(i)*r(i)/r(i)));end for i=:nx- %predicion sep rh(i)=.5*(r(i)+r(i+))-(.5*d/h)*(r(i+)-r(i)); rh(i)=.5*(r(i)+r(i+))-(.5*d/h)*((r(i+)^/r(i+))+p(i+)-(r(i)^/r(i))-p(i)); reh(i)=.5*(re(i)+re(i+))-... (.5*d/h)*((rE(i+)*r(i+)/r(i+))+(r(i+)*p(i+)/r(i+))... -(re(i)* r(i) /r(i))- (r(i) *p(i) /r(i))); end for i=:nx,ph(i)=(gg-)*(reh(i)-.5*(rh(i)*rh(i)/rh(i)));end for i=:nx- %correcion sep r(i)=r(i)-(d/h)*(rh(i)-rh(i-)); r(i)=r(i)-(d/h)*((rh(i)^/rh(i))-(rh(i-)^/rh(i-))+ph(i)-ph(i-)); re(i)=re(i)-(d/h)*((reh(i)*rh(i)/rh(i))-(reh(i-)*rh(i-)/rh(i-))+... (rh(i)*ph(i)/rh(i))-(rh(i-)*ph(i-)/rh(i-))); end for i=:nx,(i)=r(i)/r(i);end for i=:nx- %arificial viscosiy r(i)=r(i)+arvisc*(.5*d/h)*( (r(i)+r(i+))*((i+)-(i))*abs((i+)-(i))... -(r(i)+r(i-))*((i)-(i-))*abs((i)-(i-)) ); re(i)=re(i)+arvisc*(.5*d/h)*... ( ((i+)+(i))*(r(i)+r(i+))*((i+)-(i))*abs((i+)-(i))... -((i)+(i-))*(r(i)+r(i-))*((i)-(i-))*abs((i)-(i-)) ); end ime=ime+d,isep plo(p,'b','linewidh',),ile('pressre'); pase if(ime >.5)break,end end Solve sing firs order pwinding wih flx spliing For conservaion law Define F = F + + F So ha + F + x + F x = Flx Spliing + F x = Which can be wrien as + [ A] x = ; where [ A] = F [ λ] = [ λ + ] + [ λ ] Are he posiive and negaive eigenvales of A Flx Spliing For nonlinear eqaion he spliing is no niqe, differen marices can have he same eigenvales
Firs order pwind Here we solve he one-dimensional Eler eqaion sing he van Leer vecor flx spliing Van Leer F + = ( + c) c ( ) + c ( ) + c ( ) F = ( c) c ( ) c c ( ) ( ) van Leer vecor flx spliing + p = (E + p c ) Firs order pwind ( + c) For example, he mass flx: c ( + c) ( c) c ( ) + c ( ) + c ( ) ( c) c ( ) = c = c + c + c + c c ( ) c c ( ) ( ) c = For D flow he flxes are F ± = ± ( ± c) c Firs order pwind ( ) ± c [ c ± ( )] ( ) = ± c (M ±) c M ± c ± M For D flow he flxes are F ± = ± ( ± c) c v Firs order pwind ( ) ± c v [ ] + ( ) ± c ( ) ; G ± = ± (v ± c) c ( )v ± c + [( )v ± c] ( ) + F+ x + F x + G+ y + G y = Seger-Warming F + = Firs order pwind Several oher spliing schemes are possible, sch as: ( ) + c ( ) + ( + c) ( ) 3 + ( + c)3 + 3 ( + c)c ( ) F = ( c) c ( c) + 3 c F + = ( + c) c Firs order pwind ewrie he flx erms in erms of Mach nmber: ( ) + c ( ) + c ( ) = c c + c + c c + c = c (M +) c + M c + M
+ F + x + F - x = Firs order pwind + c E x ( M + c ) + M + x c ( M c ) + M = c + M c M + F+ x + F- x = Solve by f n+ j = f n j Δ h F + + j F j- Where Firs order pwind ( ) n Δ ( ) n - - h F j + F j F + = c ( M + c ) + M ; F = c ( M c ) + M c + M c M Firs order pwind for isep=:maxsep for i=:nx,c(i)=sqr( gg*(gg-)*(re(i)-.5*(r(i)^/r(i)))/r(i) );end for i=:nx,(i)=r(i)/r(i);end; for i=:nx,m(i)=(i)/c(i);end for i=:nx- %pwind rn(i)=r(i)-(d/h)*(... (.5*r(i)*c(i)*(m(i)+)^) - (.5*r(i-)*c(i-)*(m(i-)+)^)+... (-.5*r(i+)*c(i+)*(m(i+)-)^) - (-.5*r(i)*c(i)*(m(i)-)^) ); rn(i)=r(i)-(d/h)*(... (.5*r(i)*c(i) *(m(i)+)^) *(( +.5*(gg-)*m(i)) **c(i) /gg) -... (.5*r(i-)*c(i-)*(m(i-)+)^)*(( +.5*(gg-)*m(i-))**c(i-)/gg) +... (-.5*r(i+)*c(i+)*(m(i+)-)^)*((-+.5*(gg-)*m(i+))**c(i+)/gg) -... (-.5*r(i)*c(i) *(m(i)-)^) *((-+.5*(gg-)*m(i)) **c(i) /gg) ); ren(i)=re(i)-(d/h)*(... (.5*r(i)*c(i) *(m(i)+)^) *((+.5*(gg-)*m(i))^ **c(i)^ /(gg^-)) -... (.5*r(i-)*c(i-)*(m(i-)+)^)*((+.5*(gg-)*m(i-))^**c(i-)^/(gg^-)) +... (-.5*r(i+)*c(i+)*(m(i+)-)^)*((-.5*(gg-)*m(i+))^**c(i+)^/(gg^-)) -... (-.5*r(i)*c(i) *(m(i)-)^) *((-.5*(gg-)*m(i))^ **c(i)^ /(gg^-)) ); end Firs order pwind Effec of resolion Shockbe problem of G.A. = 5 ; L =.; L = Sod, JCP 7:, 97 = ; =.5; = x Pressre nx=; maxsep=3 nx=5; maxsep= Final ime:.5 Densiy... nx=; maxsep=3 nx=; maxsep=. nx=5; maxsep= nx=5; maxsep=5 Smmary Nmerical solions of he onedimensional Eler eqaions Upwind/flx spliing Lax-Wendroff/arificial viscosiy