CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > General Forums > Main CFD Forum

verifying second order

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 20, 2009, 14:56
Default verifying second order
  #1
New Member
 
vahid
Join Date: Nov 2009
Posts: 6
Rep Power: 16
vahidmech is on a distinguished road
hi
I have written a code for wave equation with RK2.
now I want to know how I can be sure that my code is second order?
the error must be smaller than what?
vahidmech is offline   Reply With Quote

Old   November 20, 2009, 16:34
Default
  #2
jed
Member
 
Jed Brown
Join Date: Mar 2009
Posts: 56
Rep Power: 19
jed is on a distinguished road
Which wave equation? In any case, you choose a smooth solution (\cos is good) and compare your code's results at successively finer resolution (refine in both space and time). Now plot \log(\text{error}) versus \log(\Delta x), the resulting slope is the order of accuracy of your method. If you don't have an exact solution available, you can manufacture one by introducing a distributed source term that makes something simple a solution, or (generally a worse option) compute a reference solution at very high resolution (preferably with a proven code).
jed is offline   Reply With Quote

Old   November 23, 2009, 16:51
Default code order
  #3
Senior Member
 
CFDtoy
Join Date: Mar 2009
Location: United States
Posts: 145
Blog Entries: 2
Rep Power: 17
CFDtoy is on a distinguished road
Hi there,
Do richardson extrapolation test for grid convergence! 3 sets of results at time steps or spatial step h, h/2 ,h 4 is needed (basically 3 grids). works for structured mesh straight up ! Unstructured meshes are tricky. Since yours is a simple RK based integration procedure method..this works very well.

/CFDtoy

Quote:
Originally Posted by vahidmech View Post
hi
I have written a code for wave equation with RK2.
now I want to know how I can be sure that my code is second order?
the error must be smaller than what?
CFDtoy is offline   Reply With Quote

Reply


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 Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
IS calc. with 2nd order discret. always necessary? Azman FLUENT 2 March 14, 2013 04:28
1st order vs 2nd order ken FLUENT 8 March 14, 2013 03:43
Unstable flow simpleFoam 2nd order Valle OpenFOAM 0 August 26, 2009 08:12
CFL condition for higher order schemes Shyam Main CFD Forum 2 February 14, 2008 14:24
SECOND ORDER DON'T CONVERGE, WHY?????????? naus FLUENT 10 March 13, 2006 07:21


All times are GMT -4. The time now is 05:16.