# How do I know which outer grid shape is best for CFD?

I’m looking into running a CFD simulation on an aerofoil in transonic flow (M=0.8) but am unsure about what external grid shape to choose for my computational domain?

I read into 3 main types:
C-grid
Elliptical
Circular

How do you choose a grid? How does it affect the simulation and why would this even have an impact on the simulation please?

These grid topologies refer to structured meshes. Unstructured meshes are a different technology with different pros/cons, I won't discuss them here.

A mesh must have adequate resolution to resolve all the flow features of interest using the numerical methods of the chosen tool.

Low quality cells can adversely impact a solution. For structured meshes, this usually means highly non-orthogonal (or skew) meshes. It can also have to do with how quickly the mesh resolution changes in a given direction.

2D Structured meshes can be represented by a matrix of points. X(I,J) and Y(I,J). You can easily move from one point to the next by indexing in the I or J direction -- i.e. move from XY(I,J) to XY(I+1,J). If I starts at 1 and runs to N, then those values of indices are valid I[1,N] no matter the J. Likewise, if J[1,M], those values are always valid. I.e. there are no holes in IJ space, no gaps, etc.

This means that the mesh has NxM points in it. If you increase the number of points in I, those points exist for all J. This means that if you need to add points in one region to resolve the flow, you might end up with extra points somewhere else that you don't need.

A very simple topology is the O-grid, you might think of it as a circle grid.

In the O-grid, the I=1 line is the airfoil and the I=N line is the outer boundary. The J=1 and J=M lines are coincident, and usually are chosen to start at the trailing edge of the airfoil and travel downstream from there.

Another simple topology is the H-grid. It can also be thought of as two grids together -- a top grid and a bottom grid.

In an H-grid, the I=1 line is the bottom boundary, the I=N is the top. The airfoil surface is found along I=N/2, with that line being duplicated or split somehow to represent both the top and bottom surfaces.

The left boundary is J=1 and the right boundary is J=M.

A third common topology is the C-grid.

Here, the I=1 line is both the airfoil and also the split line starting from the trailing edge and extending downstream. The I=N line is the top, left, and bottom of the outer boundary. The J=1 line is the top half of the vertical boundary and the J=M line is the bottom half of the vertical boundary.

If you are doing a viscous solution, then you typically need a lot of resolution in the boundary layer. The O and C grids here depict this situation.

With a C grid, when you have a dense boundary layer, you also automatically get a dense wake downstream of the airfoil. This can be a benefit if you are interested in resolving the wake downstream.

If you imagine using a H grid and resolving a dense boundary layer, you would also end up with a region of very fine cells extending in front of the airfoil. Those cells are not needed and the solution would not be very efficient.

However, if you use an O-grid for this solution, you will get a good solution near the airfoil, but if you are interested in the wake downstream of the airfoil, your solution will quickly degrade as the cells get very coarse downstream of the trailing edge.

Another common issue is the trailing edge itself. The airfoil you are considering might have a sharp TE or a blunt TE. A sharp TE can be very difficult to resolve with high quality cells with an O-grid or H-grid. However, a C-grid is very amenable to a sharp TE.

However, a blunt TE is very difficult for a C-grid if you can't insert an additional grid to emanate from the TE itself.

Usually a mesh is described as either algebraic or elliptical. An algebraic grid uses simple algebraic equations to place the points. Basically, any point can be calculated directly. An elliptical grid generator sets up an elliptical partial differential equation to arrange the points. In this way, the all the boundaries influence the exact placement of all the points. this is more complex and computationally expensive, but it can produce a very smooth and high quality mesh.

All of these images were pulled from a PDF of Numerical Grid Generation. This book used to be available freely online from a site at Mississippi State University, but I can't find a link to it anymore.

• Hi Rob, thanks for the answer. I still feel confused though about the external grid shape- the above answers are really good, but focus on the internal bit too much please? Oct 27 at 12:34
• As long as the outer grid shape is 'far enough' away, then it doesn't really matter. If you are doing a supersonic simulation, then nothing in front of the Mach cone emanating from the forward most point of the geometry will matter. If you are doing a subsonic simulation, then you need mesh in all directions. For 2D simulations, you probably want the boundary 5-30 chord lengths away -- depending on the fidelity you're after and the computational expense you can spare. You can run a study of changing the far field distance to see how it changes your solution. Oct 27 at 16:07