# Tuning a code for accuracy

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

 August 7, 2011, 00:49 Tuning a code for accuracy #1 New Member   Felipe Hernandez Join Date: Apr 2011 Posts: 13 Rep Power: 8 Sponsored Links 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. Elements: - 20x20 grid for this test - quadratic velocity/linear pressure Matrix Solver: - biCGSTAB - 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.)

 August 9, 2011, 17:52 #2 Senior Member   cfdnewbie Join Date: Mar 2010 Posts: 557 Rep Power: 13 Hello Petrov, 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?

 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 holger_marschall OpenFOAM 242 March 7, 2013 13:30 cwang5 OpenFOAM Programming & Development 1 May 30, 2011 04:47 MechE OpenFOAM 28 May 16, 2011 11:02 Leuchte CFX 5 November 6, 2010 07:12 Zdravko Stojanovic Main CFD Forum 2 July 19, 2010 10:11