# Exact solution - Euler equations

 Register Blogs Members List Search Today's Posts Mark Forums Read

 May 2, 2013, 14:07 Exact solution - Euler equations #1 New Member   Jakub Join Date: May 2013 Location: Czech Republic Posts: 16 Rep Power: 6 Sponsored Links I work on numerical solution of Euler equations in 1D. I implemented some numerical schemes and now I need compare their accuracy due to the exact solution. But I don't know how to compute it. For Burger's equation I compute exact solution with method of characteristics, but I don't know how to implement it for Euler equations or whether it is possible. Can anyone get me some tip how to compute exact solution of Euler equations? Many thanks. Jakub

May 2, 2013, 14:17
#2
Senior Member

Filippo Maria Denaro
Join Date: Jul 2010
Posts: 3,415
Rep Power: 39
Quote:
 Originally Posted by jakubstary I work on numerical solution of Euler equations in 1D. I implemented some numerical schemes and now I need compare their accuracy due to the exact solution. But I don't know how to compute it. For Burger's equation I compute exact solution with method of characteristics, but I don't know how to implement it for Euler equations or whether it is possible. Can anyone get me some tip how to compute exact solution of Euler equations? Many thanks. Jakub
you can find many references for the Sod problem ...

 May 3, 2013, 00:29 #3 New Member   Ravindra Shende Join Date: Feb 2011 Location: Pune, India Posts: 8 Rep Power: 8 Check out this paper: ANALYTICAL SOLUTIONS FOR THE UNSTEADY COMPRESSIBLE FLOW EQUATIONS SERVING AS TEST CASES FOR THE VERIFICATION OF NUMERICAL SCHEMES - Tsangaris and Pappou Also look in the text 'Computational Gasdynamics' by Culbert Laney.

 May 3, 2013, 02:55 #4 New Member   Join Date: Mar 2012 Posts: 8 Rep Power: 7 Check the book on Riemann solvers by Toro, there you'll find many shock tube problems together with the behavior of many different discretizations. A good starting point may also be: http://www-troja.fjfi.cvut.cz/~liska...re8/index.html Moreover, you could setup sound waves in the linear regime. Going to two or three dimensions, simulating flow instabilities (e.g. shear, convection, rayleigh-taylor) and comparing the growth rates to the theoretical estimates can give much insight into a numerical discretization. Besides that, computing (stationary) vortices are also a good code validation.

 May 3, 2013, 10:00 Solved #5 New Member   Jakub Join Date: May 2013 Location: Czech Republic Posts: 16 Rep Power: 6 Thanks all. It was very helpful for me. I have one more question about solving Euler equations. Please can you get me a good tip again? I use Euler method, Runge-Kutta 2nd order method and RK 4th order method for time discretization. I think that RK4 method should be the best and RK2 method better than Euler, but in every cases I get the best accuracy with Euler and worst with RK4. Don't you have any idea where would be a mistake in my implementation? Thanks. Jakub

 May 3, 2013, 14:49 #6 Senior Member   cfdnewbie Join Date: Mar 2010 Posts: 557 Rep Power: 13 Did you test your implementation of RK2 and 4 for a system of ODEs? It sounds to me like there must be a bug in your implementation?

May 4, 2013, 14:40
#7
New Member

Jakub
Join Date: May 2013
Location: Czech Republic
Posts: 16
Rep Power: 6
I implemented Euler and RK2 on ODEs, but I get same bad results. In first few times RK2 is better than Euler, but after some time not. I enclosed figure with my results. In figure is Euler, RK2, Matlab ode 23 and exact solution. I must have bug in implementation or bug is in book (Finite Volume Method for Hyperbolic Problems - LeVeque - equations (10.18)) which I use.

Here is my code of RK2:
Code:
```function dy = rigid(t,y)
dy = 3*exp(-4*t)-2*y;
end

for i=1:length(t)-1
k1=rigid(t(i),rk2(i)); %derivate
ystar1(i)=rk2(i)+h*k1; %y*
k2=rigid(t(i),ystar1(i)); %derivate
ystar2(i)=ystar1(i)+h*k2; %y**
rk2(i+1)=0.5*(rk2(i)+ystar2(i)); %result = 1/2*(y + y**)
end```
Many thanks!
Jakub
Attached Images
 figure.jpg (24.9 KB, 9 views)

 May 6, 2013, 06:47 #8 New Member   Jakub Join Date: May 2013 Location: Czech Republic Posts: 16 Rep Power: 6 Please, has anybody any idea for my problem with Runge Kutta? Thanks. Jakub

 May 6, 2013, 08:02 #9 New Member   Join Date: Mar 2012 Posts: 8 Rep Power: 7 I guess the second evaluation of 'rigid' should not be at time t(i). The algorithm in LeVeque is defined for problems without an explicit time dependence. You should look up the butcher tableau for this time marching scheme to find out the correct time for the second evaluation. I guess, it's just t(i) + h but look it up in order to be certain!

May 6, 2013, 18:14
#10
New Member

Jakub
Join Date: May 2013
Location: Czech Republic
Posts: 16
Rep Power: 6
Quote:
 Originally Posted by Fabian82 I guess the second evaluation of 'rigid' should not be at time t(i). The algorithm in LeVeque is defined for problems without an explicit time dependence. You should look up the butcher tableau for this time marching scheme to find out the correct time for the second evaluation. I guess, it's just t(i) + h but look it up in order to be certain!
Yes, t(i) + h was the problem. Thanks Fabian82 .

So if I apply now Runge Kutta 2nd order method on Euler equations or on other system of hyperbolic partial differential equations I get this:
U* = U(n) + dt*G(U(n)) - first step
U** = U* + dt*G(U*(n+1)) - second step
and result is:
U(n+1) = 1/2*(U(n) + U**).
But how can I compute U** when I don't know U*(n+1) in the second step?

Many thanks to all. Jakub.

 Tags euler equations, exact solutution

 Thread Tools Display Modes Linear Mode

 Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts BB code is On Smilies are On [IMG] code is On HTML code is OffTrackbacks are On Pingbacks are On Refbacks are On Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post Centurion2011 FLUENT 44 June 20, 2017 09:57 RameshK Main CFD Forum 3 May 30, 2012 10:41 Kyounghwa Main CFD Forum 5 January 23, 2012 10:36 bipulsaha FLUENT 1 July 6, 2011 07:51 technophobe Main CFD Forum 5 April 28, 2009 15:11