# Looking for good Test Cases for Code Validation

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

 August 28, 2013, 15:33 Looking for good Test Cases for Code Validation #1 New Member   Megan Join Date: Jan 2013 Location: North Carolina Posts: 5 Rep Power: 4 Hello all, and thanks in advance for any help you can offer. I have just finished up writing a pretty basic 2-D Euler solver and I think I have worked out the obvious bugs. But I would like to run some validation tests and plan to add on some DG methods and maybe upgrade eventually to NS. So what I need help with is-- What kind of validation tests are good to run? Currently I have ran a cylinder, NACA0012 airfoil, and a channel with a bump. The pressure, velocities etc all look fairly good, visually they are what I would expect and I am thinking about adding in a section to calculate the coefficient of pressure on the surfaces to just verify the actual numbers. What else can I throw at my code? What other things should I be looking for? I really want to put this through the ringer before I add in more complicated parts so please anything that would really test it would be awesome! Thanks again!

 August 28, 2013, 15:44 #2 Senior Member   cfdnewbie Join Date: Mar 2010 Posts: 551 Rep Power: 11 Hello Megan, before starting with some "real world" test cases, the most important way to test your code is by the method of manufactured solution. You will find a lot of information about this on google. In brief, you choose any given (smooth) solution to your equation, plug it in, compute the residual and use that as a source term. By doing that, you can test you formal order of accuracy of your code for both space and time and ensure the correct order of convergence. Inspection by eye is not sufficient, since you can never tell the the difference between a 3rd and 4th order solution without actually computing the errors. This is especially important if you want to add DG functionality. Hope this helps! Cheers

 August 28, 2013, 15:56 #3 Member   Join Date: Jul 2013 Posts: 45 Rep Power: 3 In the case your code is transient and compressible, an easy case to setup is the Sod Shock Tube. It is a 1D case, but it is a good practice to run it in 2D or 3D. There are exact solution for the case, which makes validation very easy. If you code does not handle transient or compressible flow, then you'll need to go with something else. Injecting an analytic solution to verify your residuals is a very good suggestion in order to validate what you did. Congrats for the home-code!

 August 28, 2013, 18:21 #4 New Member   Megan Join Date: Jan 2013 Location: North Carolina Posts: 5 Rep Power: 4 Great! Thank you both for the suggestions I will look into them. So as far as the method of manufactured solution, how difficult is it to either find or write a code to generate the source terms needed for verification? If I understand correctly from briefly reading about it you are essentially adding in source terms which you expect to also see in the error at the end of the solve? As far as order of accuracy I guess I'm not sure how that has to do with validation of the code? Currently the cylinder grid I've evaluated has 4 levels of refinement and using the L2Norm I can back out the order of accuracy, but I don't see how that tells me if the algorithm I've coded is correct? What am I missing in this? Thanks! I have run a similar 1-D code through the various shock problems for validation but I had not thought to try it on the 2-D code... how does one 'two-dimensionalize' the sod shock tube problem? Thanks again for all the help, I'm a little new at this so I appreciate it a ton! Megan

August 28, 2013, 21:17
#5
Member

Join Date: Jul 2013
Posts: 45
Rep Power: 3
Quote:
 Originally Posted by Spacegirl1923 how does one 'two-dimensionalize' the sod shock tube problem?
You setup a rectangle, and initialize the domain to have a pressure discontinuity at the normal section in the middle. The easiest boundaries in my opinion is to setup symmetry plane at every boundaries, and to stop the time marching before the shock reflexion occurs on the tube extremities.

An other way is to set pressure inlet on the side of high pressure, and pressure outlet on the side of low pressure. Therefore you can simulate longer than the reach of the shock to the boundary, but once the shock has passed, you will only have a growing velocity toward infinity (Poiseuille flow without viscosity)

Last edited by Alex C.; August 29, 2013 at 08:58.

 Tags code testing, euler equations, validations

 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 dogan OpenFOAM Verification & Validation 4 June 26, 2013 05:38 cth_yao CFX 0 February 17, 2012 01:52 PRAVEEN CHANDRASHEKAR Main CFD Forum 7 February 8, 2011 12:25 Jonas Larsson CFD-Wiki 3 March 14, 2008 06:02 Apurva Shukla Main CFD Forum 7 August 12, 1999 13:10

All times are GMT -4. The time now is 00:33.