# 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

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

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

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

## Grid refinement study with ADflow¶

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

Coarsen the L0 grid \(n-1\) times using

`cgns_utils coarsen`

.Use

`solveCL`

or`solveTrimCL`

in ADflow to obtain \(C_D\) for a given \(C_L\).Compute the Richardson extrapolation using the L0 and L1 grids.

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: