We are developing new solver for OpenFOAM and we need to prove actual order of our numerical scheme by simple primer. How we can do that? We would like to check spatial order and separate influence of the time discretization scheme.
There may be other ways to do this, but when one uses a fixed rectangular grid and obtains a steady solution then I generally repeat the computation another twice. If the typical grid-spacing with the first computation was h, then the second and third are h/2 and h/4. If for example, J is the value of a variable say at the centre of the domain, then one has three such values: J(h), J(h/2) and J(h/4).
The ratio [J(h)-J(h/2)]/[J(h/2)-J(h/4)] should then have a value which is close to 2^alpha, where alpha is the order of the method. This is derived by assuming that J(h)=J(exact)+Ah^\alpha+..., then J(h/2)=J(exact)+A(h/2)^alpha, etc.
The above works nicely if it is a regular grid and interval-halving has taken place. Upwinding (different discretizations depending on the direction of the flow) will render this procedure invalid. Allowing OpenFOAM to choose its own meshing will not necessarily be equivalent to the above interval-halving, and the ratio test may not be so good then either.
An alternative might be to compare solutions with an exact solution for a test problem, and to see how the differences change as the step size decreases.
When doing convergence tests in time dependent cases, time and space discretization steps must be reduced by the same amount. The order resulting from the standard order estimation procedure described in the previous answer will end up being the smaller between space and time discretization orders. However, analyzing separately the space and time discretization error is not in general an easy task. One possible way of doing that, if you are using a method of lines time discretization (i.e., discretize first in space and then use an ODE solver in time for the resulting ODE system) is to compare the solution provided by your method and that provided by the same space discretization and a much more accurate time discretization. The difference between the two provides a (very coarse!) estimate of the time discretization error.
I am also involved in the analysis of convection/diffusion/time integration schemes for CFD. In my opinion, there is only one way to analyse scheme accuracy: by comparison with an analytical solution. By the way, such comparison can be performed when an analytical solution is known, or using manufactured solution. For the latest case, the idea is to define the set of equation to solve, to introduce the solution you are looking for in the equations. By doing so, the PDE equation F(x,t) = 0 leads to F(MS(x,t)) = RHS where MS(x,t) is the manufactured solution and RHS is the right hand side designed such that MS is the solution.
If you are interested in only capturing the order of accuracy of your spatial scheme, I should recommend you the use of the test case for the High Order Workshop. See http://how4.cenaero.be for the 4th meeting and https://www.grc.nasa.gov/hiocfd/ for the 3rd meeting.
As you’ll see on the HOW websites, accuracy is computed using a set of refined meshes and the shape of the error gives you the order of accuracy, as this is done using Taylor expansion of functions.
I concur with Dr. Rees and Puigt. First choice is to model a problem that have an exact solution, ex. laminar Poiseuille flow, looking for the order of convergence. Second choice is the use of a manufactured solution. A third choice is to model an actual experiment but now looking relatively at the difference between predictions and measurements as the mesh is refined.
The first two choices are in the domain of verification. The third choice falls in the domain of validation.
For any discretization error analysis and to find grid independent solutions I use the GCI or Grid Convergence Index. The GCI was developed by Patrick J Roache. To the best of my knowledge, Dr. Roache pioneered the systematic verification and validation of numerical solvers and models. I recommend highly his book "Verification and Validation in Computational Science and Engineering"