# Grid Refinement Study¶

## Theory¶

Computational physics models generally use discretized physical domains (grids) to transform physical laws into systems of equations that can be solved by numerical methods. The discretization of a physical domain introduces discretization error, which can be reduced in two ways:

• h-refinement: Increasing the resolution of the grid.

• p-refinement: Increasing the order of the numerical approximation at each cell.

In a grid refinement study, we demonstrate that iterative h-refinement converges to the exact solution. For a given grid/mesh, the grid spacing is

$h = N^{-1/d}$

where $$N$$ is the number of cells and $$d$$ is the dimension of the domain. For two grids, the grid refinement ratio is

$r = \frac{h_{coarse}}{h_{fine}}$

Generally, we use a grid refinement ratio of 2. The convention is to name the grids with an L (for level) followed by an integer beginning at 0 for the finest grid (i.e. L0 for the finest, L1 for the next, etc).

If the grids are sufficiently fine, the error is roughly proportional to $$h^p$$, where $$p$$ is the order of the solution method. Grids that follow this relationship are in what is termed the “region of asymptotic convergence”. Although for a second-order finite volume solver, the theoretical order of convergence is $$p=2$$, the achieved rate of convergence ($$\hat{p}$$) may vary. The achieved rate of convergence for a given h-refinement study can be computed as

$\hat{p} = ln\left(\frac{f_{L2}-f_{L1}}{f_{L1}-f_{L0}}\right) / ln(r)$

using the finest three grids. When plotting the results of the grid convergence study, we generally plot the results of the grid convergence using $$h^p$$ on the x-axis.

The Richardson extrapolation is an estimation of the solution for a grid with a grid spacing on the order of zero. It is computed using the solutions from the L0 and L1 grids with the equation

$f_{h=0} = f_{L0} + \frac{f_{L0}-f_{L1}}{r^{\hat{p}} - 1}$

## Grid refinement study with ADflow¶

1. Generate fine grid (L0) with $$N=2^n m + 1$$ nodes along each edge.

2. Coarsen the L0 grid $$n-1$$ times using cgns_utils coarsen.

3. Use solveCL or solveTrimCL in ADflow to obtain $$C_D$$ for a given $$C_L$$.

4. Compute the Richardson extrapolation using the L0 and L1 grids.

5. Plot $$h^p$$ vs $$C_D$$. For ADflow, use $$p=2$$ to indicate a second-order method.

An example of grid convergence plot for a family of RAE 2822 Airfoil meshes is illustrated below: Figure 1: Grid convergence plot for RAE 2822 Transonic Airfoil.