Tuning a code for accuracy
I've been trying to test my code against the taylor-green vortex, and I am having problems getting an accurate solution. What is happening is that in the first few time iterations, the velocities wiggle around, and then settle down. After that, the decay in the magnitude of the velocity/pressure seems decent.
According to http://www.mech.eng.unimelb.edu.au/p...2/Niclasen.pdf, I could be getting errors on the order of E-4 after 1000 iterations with a time step of E-5. Instead, I find errors on the order of E-2 after only a few iterations. Furthermore, reducing the time step does not always improve the accuracy.
I'll list some of the specs of my program, and if you see something that could be causing the problem, that would help a lot.
- 20x20 grid for this test
- quadratic velocity/linear pressure
- Gauss-Siedel preconditioner
epsilon for solution error: E-25
Time Iteration (this is where the problem probably lies!)
- discrete pressure correction method, as described in http://ta.twi.tudelft.nl/users/vuik/.../fem_notes.pdf, page 76
The problem is not serious enough to completely disqualify my code, as it produces the correct results qualitatively. (It can produce a karman street, calculated drag coefficients are in the right order of magnitude, pressure drops occur where you'd expect them, high viscosity in a pipe gives parabolic profile, etc.)
I've done many TG-computations, but only with an explicit time scheme. I guess for such an unsteady problem, the scheme of choice would be explicit instead of implicit, so I can't really help you here. If you have verified your spatial discretization before, I'd guess your implicit solver has problems with the unsteadiness of the flow....
do you have any means of switching to an explicit time integrator?
|All times are GMT -4. The time now is 14:05.|