|
[Sponsors] |
November 20, 2009, 15:56 |
verifying second order
|
#1 |
New Member
vahid
Join Date: Nov 2009
Posts: 6
Rep Power: 16 |
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? |
|
November 20, 2009, 17:34 |
|
#2 |
Member
Jed Brown
Join Date: Mar 2009
Posts: 56
Rep Power: 19 |
Which wave equation? In any case, you choose a smooth solution ( is good) and compare your code's results at successively finer resolution (refine in both space and time). Now plot versus , 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).
|
|
November 23, 2009, 17:51 |
code order
|
#3 |
Senior Member
|
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 |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
IS calc. with 2nd order discret. always necessary? | Azman | FLUENT | 2 | March 14, 2013 05:28 |
1st order vs 2nd order | ken | FLUENT | 8 | March 14, 2013 04:43 |
Unstable flow simpleFoam 2nd order | Valle | OpenFOAM | 0 | August 26, 2009 09:12 |
CFL condition for higher order schemes | Shyam | Main CFD Forum | 2 | February 14, 2008 15:24 |
SECOND ORDER DON'T CONVERGE, WHY?????????? | naus | FLUENT | 10 | March 13, 2006 08:21 |