Smaller time step results in less accuracy!!
Hi guys,
I'm writing a code in Fortran that solves a 2D TaylorGreen vortex problem. I'm implementing RK3 with central differences discretization in space and periodic boundary conditions everywhere. I plot the results and they look good. I also compare the results against the analytical solution and they seem close enough. But there are two issues: 1 The order of accuracy in space is 2.4!!!! (Theoretically it is be 2, so in reality it should be less.) 2Smaller time steps result in less accuracy. To check my code, I ran a Liddriven cavity problem and all looks fine. I'm comparing streamlines against those in published journal articles. Does anyone have any idea what might be wrong? My first thoughts went to boundary and initial conditions but I've checked them both and they seem to be fine. 
Quote:
first, could you give these details? 1) what about the formulation you use, is it a projection method? 2) how do you perform the accuracy analysis, do you take dt/h constant (and in the stability region) and check for the error in some norm? what about the chosen norm? 3) Are you performing the the test on the analytical Taylor solution as in http://www.sciencedirect.com/science...21999185901482 ? 4) when you say that for smaller dt the solution is less accurate, do you see a deviation in the slope of the error convergence? Did you take h fixed? 
Yes I use a projection method, Runge Kutta 3rd order. Fully explicit.
Domain size is: 0 < x,y < 2*pi Uniform grid 32x32 dt is constant. I run the case for dt = 0.001 and 0.0001 sec Flow time is 2sec. As for the error analysis, I subtract the analytical and numerical values od say xvelocity and consider the largest error. I don't normalize. The analytical solutions are provided by the professor whose homework assignment this is, so I'm fairly sure they are correct: u = e^(2*t) * cos(x) * sin (y) v = e^(2*t) * sin(x) * cos(y) 
Quote:
Ok, follow these steps: 1) fix a uniform 128 x 128 grid 2) compute the maximum error for dt=0.1, 0.05, 0.01, 0.05, 0.001 3) plot the error versus the dt in a double logarithmic scale. 4) repeat the same procedure but now fixing a uniform 628 x 628 grid, you should see that the error slope is more extended than before. That depends on the local truncation error fixed by the spatial mesh measure. 5) Finally, perform the error analysis on a 32, 64, 128, 256, 628 mesh but by taking constant dt/h 
If I may add something: it would be really nice, to post all these pictures here in the forum!

Quote:

Thank you for the direction!
I found this: http://onlinelibrary.wiley.com/doi/1...d.520/abstract Any more? 
Quote:
http://onlinelibrary.wiley.com/doi/1...d.598/abstract 
So I was able to fix the problem and now the spatial accuracy is second order. the temporal accuracy however is practically constant. It's zero order.

How do you determine the temporal order? The usual way to do it is to choose the spatial discretization so fine that the spatial error is essentially zero, and then check the time order.

Quote:

All times are GMT 4. The time now is 01:18. 