If CFD were a house, the mesh would be its foundation. You can have the best solver, the most accurate turbulence model, and perfect boundary conditions, but if your mesh is poor, your results will be unreliable. Mesh generation is where simulation success or failure often begins.

What is a Mesh?

A mesh divides your computational domain into small, discrete elements. Instead of solving fluid equations continuously (which is mathematically intractable), we solve them at specific points and interpolate between them.

The mesh defines:

  • Where calculations happen (cell centers or vertices)
  • How information flows between regions
  • The resolution of features you can capture
  • The computational cost of your simulation

Mesh Types

There are several fundamental mesh types, each with trade-offs:

Structured meshes: Regular, grid-like arrangements where each cell has the same number of neighbors. These are highly efficient computationally but difficult to fit to complex geometries.

Unstructured meshes: Irregular arrangements of triangles (2D) or tetrahedra (3D) that can conform to any geometry. More flexible but more computationally expensive.

Hybrid meshes: Combine structured regions (typically in boundary layers) with unstructured regions elsewhere. Often the best compromise for external aerodynamics.

Polyhedral meshes: Use cells with many faces. Can provide accuracy benefits with fewer cells than tetrahedral meshes.

Key Quality Metrics

Not all meshes are created equal. Several metrics indicate mesh quality:

Aspect ratio: The ratio of longest to shortest cell dimension. High aspect ratios (>100) can cause numerical problems, though they're acceptable in boundary layers aligned with the flow.

Skewness: How much cells deviate from ideal shapes (equilateral triangles, regular hexahedra). High skewness degrades accuracy and can cause convergence problems.

Orthogonality: How perpendicular cell faces are to the line connecting cell centers. Non-orthogonality requires correction terms that add cost and can reduce accuracy.

Smoothness: How gradually cell sizes change. Rapid transitions create interpolation errors.

Most meshing tools report these metrics. Learn to interpret them for your solver.

The Boundary Layer Challenge

For viscous flows, resolving the boundary layer is critical. This thin region near walls contains steep velocity and temperature gradients that drive drag and heat transfer predictions.

Key requirements:

y+ considerations: The dimensionless wall distance of your first cell determines which turbulence modeling approach you can use:

  • y+ < 1: Resolves the viscous sublayer (required for low-Re models)
  • 30 < y+ < 300: Uses wall functions (faster but less accurate)

Growth ratio: Cells should grow gradually away from the wall. Typical growth ratios are 1.1-1.3.

Number of layers: Enough layers to capture the boundary layer profile, typically 15-30 for resolved approaches.

Getting the boundary layer mesh right often determines whether your simulation predicts the right drag and separation behavior.

Common Pitfalls

Years of experience have taught us what goes wrong:

Insufficient resolution: The most common error. If you can't resolve a feature, you can't simulate it correctly. When in doubt, refine.

Poor quality in critical regions: A few bad cells near a leading edge or in a wake can corrupt an entire simulation. Focus quality efforts where physics demand it.

Ignoring mesh independence: Results should not change significantly when you refine the mesh. Always run a mesh independence study.

Over-meshing everywhere: More cells aren't always better. They increase cost without improving accuracy in regions where gradients are low. Be strategic.

Trusting automatic meshers blindly: Automatic meshing is a starting point, not a final product. Always inspect the result.

Mesh Independence Studies

Before trusting any CFD result, verify that your mesh is adequate through a refinement study:

  1. Run your simulation on a baseline mesh
  2. Refine the mesh (typically 1.5-2x cells in each direction)
  3. Run again and compare key quantities
  4. Repeat until results stop changing significantly (typically <2% change)

Document your mesh independence. It's fundamental to credible CFD.

Adaptive Mesh Refinement

Modern solvers often support adaptive mesh refinement (AMR), automatically adding resolution where needed based on solution gradients or error estimates.

AMR can be powerful for:

  • Shock capturing
  • Wake resolution
  • Moving features (vortices, separation bubbles)

However, AMR adds complexity and cost. For steady problems with known features, a well-designed static mesh is often more efficient.

Practical Workflow

A sensible meshing workflow:

  1. Start coarse: Get your simulation running on a coarse mesh first
  2. Identify critical regions: Where are gradients high? Where does physics happen?
  3. Refine strategically: Add resolution where it matters
  4. Check quality: Fix problem cells before running
  5. Verify independence: Prove your mesh is adequate
  6. Document everything: Future you will thank present you

Tools of the Trade

Common meshing tools include:

  • Gmsh: Open-source, scriptable, good for research
  • ANSYS Meshing: Integrated with Fluent, good automation
  • Pointwise: High-quality structured and hybrid meshes
  • snappyHexMesh: OpenFOAM's built-in mesher
  • cfMesh: Automatic hex-dominant meshing for OpenFOAM

The best tool depends on your geometry, solver, and workflow preferences. Learn at least one well.


Struggling with mesh quality? We offer meshing services and can help establish best practices for your applications. Contact us to discuss.