Grid generation is a crucial step in Computational Fluid Dynamics. It involves discretizing the computational domain into smaller elements or cells, which form the foundation for numerical simulations. The choice of grid type and generation technique directly impacts solution accuracy and computational efficiency.
Grid types for CFD
The grid type you choose determines how the computational domain gets divided into cells. This decision depends on geometry complexity, flow physics, the numerical scheme you're using, and available computational resources.
Structured vs unstructured grids
Structured grids have a regular connectivity pattern where each cell is identified by a unique set of indices (i, j, k). This regularity allows for efficient memory storage and faster computation, making them well-suited for simple geometries with aligned boundaries.
Unstructured grids have irregular connectivity, with cells connected through a list of neighbors rather than an index system. They offer much more flexibility for meshing complex geometries, but they require more memory and computational overhead because the solver has to explicitly store connectivity information.
Cartesian grids
Cartesian grids are structured grids with cells aligned along the coordinate axes (x, y, z). They're the simplest and most efficient grid type for rectangular or box-shaped domains.
For geometries that don't fit neatly into a box, Cartesian grids can be combined with immersed boundary methods, where the geometry is represented within the Cartesian mesh rather than conforming to it. Adaptive Cartesian grids allow local refinement in regions of interest (near shocks, vortices) while keeping the simplicity of the Cartesian structure everywhere else.
Body-fitted grids
Body-fitted grids conform to the shape of the geometry, with grid lines following the contours of the boundary. This enables accurate representation of the surface and straightforward application of boundary conditions.
- Can be structured (curvilinear) or unstructured (triangular, tetrahedral) depending on the generation technique
- Structured body-fitted grids, often called multi-block grids, are widely used in aerospace applications for airfoils, wings, and nacelles
- The trade-off is that generating body-fitted grids for complex shapes takes more effort than using Cartesian approaches
Overset grids
Overset grids (also called Chimera grids) use multiple overlapping grids to handle complex geometries or moving boundaries. Each component of the geometry is meshed independently, and the grids overlap with interpolation at the interfaces.
This approach is particularly useful when components move relative to each other, such as rotor-stator interaction or store separation from an aircraft. The main challenge is the overset assembly process: hole cutting (blanking cells inside solid bodies), interpolation between overlapping grids, and maintaining conservation at grid interfaces all require careful treatment.
Hybrid grids
Hybrid grids combine different grid types within a single domain to leverage their respective strengths. A common example: structured body-fitted cells near the wall for boundary layer resolution, transitioning to unstructured cells in the far-field for geometric flexibility.
This strategy enables efficient meshing of complex geometries while maintaining grid quality where it matters most. The interfaces between different grid types need special treatment to ensure solution continuity and conservation.
Grid generation techniques
Grid generation techniques range from simple algebraic formulas to PDE-based methods. The right choice depends on the grid type, geometry complexity, mesh quality requirements, and how much automation you need.
Algebraic methods
Algebraic methods generate grids by evaluating algebraic equations that define the grid point distribution. Transfinite interpolation (TFI) is the most common algebraic method for structured grids. It blends boundary point distributions to fill in the interior points.
These methods are computationally cheap and easy to implement, but they have limitations. They typically require user input for boundary point distribution and interior point control, and they offer no direct control over quality metrics like orthogonality and smoothness.
Elliptic methods
Elliptic methods generate grids by solving elliptic partial differential equations that govern grid point distribution. The Poisson equation is the most commonly used PDE for this purpose.
- Produce smooth grids with good orthogonality and low skewness
- Computationally expensive because the PDEs must be solved iteratively
- Require specification of boundary conditions and source terms to control grid clustering and spacing
The source terms in the Poisson equation act as controls: by tuning them, you can attract grid lines toward boundaries or concentrate points in regions where you need higher resolution.
Hyperbolic methods
Hyperbolic methods generate grids by marching the solution of hyperbolic PDEs outward from the boundaries toward the interior. They produce grids with good orthogonality and smoothness in the marching direction, making them well-suited for generating boundary layer grids with high aspect ratios.
These methods are computationally efficient and can handle sharp corners and geometric discontinuities. The main caveat is that grid topology and intersecting surfaces require careful treatment to avoid grid crossings or negative cell volumes.
Unstructured grid generation
Unstructured grids use elements with irregular connectivity, typically triangles in 2D or tetrahedra in 3D. Two dominant techniques:
- Delaunay triangulation constructs a mesh by maximizing the minimum angle of all triangles, which tends to produce well-shaped elements. Points are inserted and the mesh is locally reconnected to maintain the Delaunay criterion.
- Advancing front method starts from the boundary and generates elements progressively toward the interior, building the mesh layer by layer.
Both approaches offer flexibility for complex geometries and local refinement, at the cost of higher memory usage and computational overhead compared to structured methods.
Adaptive grid refinement
Adaptive grid refinement modifies grid resolution locally based on solution features or error estimates, so you concentrate computational resources where they're needed most.
- H-refinement subdivides existing cells into smaller ones in regions of interest (near shocks, vortices, separation zones)
- P-refinement increases the polynomial order of the solution approximation within cells, improving accuracy without changing the mesh
Both approaches require error estimation techniques and refinement criteria to guide the adaptation. The combination of h- and p-refinement is sometimes called hp-refinement.
Grid quality metrics
Grid quality metrics quantify the geometric and topological properties of a mesh. Poor grid quality leads to numerical errors, convergence problems, and potentially unphysical solutions. You should always check these metrics before running a simulation.

Orthogonality
Orthogonality measures how close grid lines or cell faces are to being perpendicular to each other. The ideal is 90 degrees at every intersection.
Non-orthogonal grids introduce errors in the computation of fluxes and gradients, especially near boundaries where accuracy matters most. You can improve orthogonality through grid smoothing techniques or by using higher-order discretization schemes that are less sensitive to non-orthogonality.
Aspect ratio
Aspect ratio is the ratio of the longest to the shortest edge length of a cell. For isotropic cells, the ideal aspect ratio is close to 1.
- High aspect ratio cells (>100) are common and necessary in boundary layer grids to resolve steep wall-normal gradients without using excessive cells in the wall-parallel direction
- Extremely high aspect ratios can lead to ill-conditioned matrices and convergence issues, so there's a practical upper limit
Skewness
Skewness measures how much a cell deviates from its ideal shape (equilateral triangle, square, or regular hexahedron). High skewness introduces numerical errors and degrades solution accuracy.
Skewed cells are especially problematic near boundaries and in regions of high gradients. You can reduce skewness through grid smoothing, local refinement, or modifying the grid topology.
Smoothness
Smoothness measures how gradually cell size and shape change between adjacent cells. Smooth grids have gentle transitions without abrupt jumps in cell size.
Non-smooth grids can cause unphysical oscillations in the solution and reduce the effective order of accuracy of the discretization scheme. Grading functions that control cell size variation (geometric or hyperbolic tangent distributions) help maintain smoothness.
Cell volume ratio
Cell volume ratio is the ratio of volumes between adjacent cells. The ideal ratio is close to 1 for consistent resolution and numerical stability.
- Large cell volume ratios (>10) can introduce significant numerical errors
- This metric is especially important in regions of rapid grid size variation, such as near-wall regions or where adaptive refinement transitions to coarser cells
- Grading functions and limits on the refinement ratio help keep cell volume ratios within acceptable bounds
Boundary layer grid resolution
Proper boundary layer resolution is critical for predicting skin friction, heat transfer, and flow separation. The steep gradients in velocity and temperature near solid walls demand carefully sized and distributed cells.
Wall spacing requirements
Wall spacing is the distance from the wall to the first grid point, typically expressed in dimensionless wall units . This parameter is defined as:
where is the wall distance, is the friction velocity, and is the kinematic viscosity.
Different turbulence models have specific requirements:
- Low-Reynolds-number models (k-ω, SST): require to resolve the viscous sublayer directly
- High-Reynolds-number models (k-ε with wall functions, Spalart-Allmaras with wall functions): can use , where wall functions bridge the near-wall region
Stretching ratios
The stretching ratio is the ratio of spacing between successive grid points in the wall-normal direction. It controls how quickly cells grow as you move away from the wall.
- Ideal stretching ratio is between 1.1 and 1.2 for smooth grid size variation
- Stretching ratios above 1.5 can introduce numerical errors and degrade accuracy
- Hyperbolic tangent or geometric progression functions are commonly used to distribute points in the boundary layer, giving tight spacing near the wall with gradual growth outward
Number of layers
The number of grid layers within the boundary layer determines how well you resolve velocity and temperature profiles.
- Typical boundary layer grids use 20-50 layers, with the highest concentration near the wall and gradual stretching toward the freestream
- The required number depends on the Reynolds number, geometry complexity, and turbulence model
- Grid independence studies should always be performed to confirm that the chosen number of layers is sufficient for your specific problem
Prism vs hexahedral cells
Both prism and hexahedral cells are used for boundary layer meshing, but they serve different contexts.
- Prism cells have a triangular cross-section and extend from the wall outward. They pair naturally with unstructured surface meshes and can conform to complex geometries.
- Hexahedral cells have a quadrilateral cross-section and are used with structured or block-structured grids. They generally offer better numerical accuracy and faster convergence than prism cells.
The choice often comes down to the surface mesh: if your surface is triangulated (unstructured), prisms are the natural boundary layer element. If your surface is quadrilateral (structured), hexahedra are the better fit.
Grid independence studies
Grid independence studies assess how sensitive your CFD solution is to grid resolution. The goal is to find the minimum resolution at which the solution no longer changes significantly with further refinement.
Systematic grid refinement
Systematic grid refinement creates a series of grids with progressively increasing resolution:
- Start with a coarse grid and compute the solution
- Refine the grid (typically doubling the number of cells in each direction, giving a 2x, 4x, 8x sequence)
- Compute the solution on each refined grid
- Compare key quantities (drag, lift, pressure distributions) across all grids
Refinement should cover all regions of the domain, including boundary layers, wakes, and regions of high gradients. If you only refine one region, you can't be confident that other regions aren't contributing errors.

Richardson extrapolation
Richardson extrapolation estimates what the solution would be on an infinitely fine grid, using solutions from two or more grids of different resolution. It assumes the solution error decreases with a constant order of convergence as the grid is refined.
With solutions on at least three systematically refined grids, you can compute both the estimated grid-independent solution and the observed order of convergence. If the observed order matches the expected order of your numerical scheme (e.g., second-order), that's a good sign your grids are in the asymptotic convergence range.
Grid convergence index (GCI)
The Grid Convergence Index (GCI) is a standardized measure of grid-related uncertainty, built on Richardson extrapolation. It provides a confidence interval for the grid-independent solution.
- Expressed as a percentage of the solution value
- A GCI below ~1% indicates the solution is effectively grid-independent
- Should be computed for all key quantities of interest (drag, lift, pressure, temperature)
GCI gives you a consistent, reportable way to quantify grid convergence. It's widely recommended in the CFD community (notably by Roache) as the standard method for reporting grid sensitivity.
Best practices in grid generation
Domain size considerations
The computational domain must be large enough to capture all relevant flow features and minimize the influence of boundary conditions on the solution.
- Typical domain sizes range from 10-100 characteristic lengths (chord length, diameter) in each direction, depending on the flow problem
- Farfield boundaries should be placed far enough to avoid wave reflections or artificial flow acceleration
- Inflow and outflow boundaries should be oriented perpendicular to the flow direction to minimize numerical errors
For external aerodynamics, a common starting point is placing farfield boundaries at least 20 chord lengths away from the body in all directions, then verifying through sensitivity studies.
Geometry simplification strategies
Geometry simplification reduces the complexity of the computational model while preserving essential flow features.
- Remove small features (bolts, nuts, small gaps) that have minimal impact on the flow but significantly complicate grid generation
- Combine multiple components into a single volume to simplify grid topology and reduce cell count
- Always validate the simplified geometry against the original to confirm the simplification doesn't alter the flow physics or quantities of interest
Symmetry and periodicity
Symmetry and periodicity reduce the computational domain and grid size, sometimes dramatically.
- Symmetry planes let you model half or quarter of the geometry, assuming symmetric flow conditions (e.g., a wing at zero sideslip)
- Periodic boundaries model a single passage of repeating patterns (turbomachinery blade rows, heat exchanger tubes)
Grid lines should be aligned with symmetry or periodic planes to avoid numerical errors. And remember: symmetry boundary conditions enforce symmetric flow, so they're not appropriate when you expect asymmetric phenomena (e.g., vortex shedding).
Handling complex geometries
Complex geometries with intricate details, sharp corners, and small gaps pose the biggest grid generation challenges.
- Unstructured grids (triangular, tetrahedral) are often the most practical choice for conforming to complex shapes
- Hybrid grids (prism layers near walls, tetrahedral cores) combine geometric flexibility with boundary layer accuracy
- Grid generation for complex geometries typically requires iterative refinement and quality checks
- Adaptive refinement can capture critical flow features without manually specifying resolution everywhere
Grid clustering in critical regions
Grid clustering concentrates cells in regions of high gradients to capture steep changes in flow variables.
- Boundary layers: tight wall-normal spacing to resolve velocity and temperature profiles
- Wakes: refined cells downstream of bodies to capture momentum deficit and turbulent structures
- Shocks: clustered cells across discontinuities to minimize numerical smearing
Clustering should be applied carefully to avoid excessive cell counts. Adaptive grid refinement automates this process by clustering cells based on solution features or error estimates during the simulation.
Grid preprocessing and postprocessing
Grid partitioning for parallel computing
Grid partitioning divides the mesh into subdomains for parallel processing, with each subdomain assigned to a different processor.
- Partitioning algorithms (recursive bisection, space-filling curves, graph-based methods) aim to balance the computational load across processors while minimizing communication between subdomains
- Good partitioning is crucial for scalable parallel performance
- The partitioning should account for grid topology, cell weights (if cells have varying computational cost), and communication patterns
Grid coarsening and refinement
Coarsening reduces grid resolution by merging or removing cells in regions of low interest, cutting computational cost and memory requirements. Algorithms like edge collapse and vertex removal aim to preserve geometry and grid quality while reducing cell count.
Refinement increases resolution by subdividing cells in regions of high interest. Algorithms like element splitting and node insertion add cells while maintaining quality and smooth transitions between refined and unrefined regions.
Both operations are central to adaptive mesh strategies, where the grid evolves during the simulation to track important flow features.
Solution interpolation between grids
Solution interpolation transfers solution data from one grid to another. This is needed when using adaptive refinement, overset grids, or grid morphing techniques.
- Linear interpolation is the simplest approach but can introduce diffusion errors
- Higher-order interpolation (quadratic, cubic) preserves solution accuracy better but requires more neighboring cell data
- Conservation of key quantities (mass, momentum, energy) during interpolation is important, especially for transient simulations or when transferring data between significantly different grids