CFD Analysis of an Airfoil with OpenFOAM
Simulate fluid flow over a wing and validate against published data
Last reviewed: March 2026Overview
Computational Fluid Dynamics (CFD) is one of the most important tools in aerospace engineering. Instead of building expensive wind tunnel models, engineers simulate airflow computationally — predicting lift, drag, and pressure distributions before anything is built.
OpenFOAM is the industry-standard open-source CFD toolkit. It's used by NASA, ESA, Boeing, and hundreds of research labs worldwide. In this project, you'll set up a complete simulation of flow over a NACA 0012 airfoil, generate results, and validate them against published wind tunnel data from NASA.
This project teaches you the full CFD workflow: geometry → mesh → boundary conditions → solve → post-process → validate. It's the exact pipeline used in professional aerodynamic analysis.
What You'll Learn
- ✓ Install and configure OpenFOAM for aerodynamic simulations
- ✓ Create a structured mesh around an airfoil using blockMesh or snappyHexMesh
- ✓ Set up boundary conditions for incompressible external flow
- ✓ Run a RANS simulation with turbulence modeling (k-omega SST)
- ✓ Post-process results and validate against published experimental data
- ✓ Understand mesh independence and solution convergence
Step-by-Step Guide
Install OpenFOAM
Install OpenFOAM v2312+ on Linux (native or WSL). The ESI version is recommended for students. Also install ParaView for visualization and Python with matplotlib for data plotting.
Run one of the built-in tutorials (e.g., pitzDaily) to confirm your installation works.
Define the Airfoil Geometry
Generate NACA 0012 coordinates using a Python script or online generator. Create a 2D computational domain: the airfoil at the center, with the domain extending ~20 chord lengths in each direction to minimize boundary effects.
For your first run, use a C-grid topology — this is the standard mesh topology for airfoil simulations, with the mesh wrapping around the leading edge.
Generate the Mesh
Use blockMesh for a structured mesh or snappyHexMesh for an unstructured approach. Key considerations:
- Wall-normal spacing: y+ ≈ 1 for wall-resolved RANS (first cell height ~1e-5 chord lengths)
- Growth ratio: 1.1–1.2 from the wall outward
- Total cells: 50,000–200,000 for 2D
Check mesh quality with checkMesh. Fix any negative volumes or high non-orthogonality before proceeding.
Set Up the Simulation
Configure boundary conditions in the 0/ directory: freestream velocity, pressure, and turbulence quantities (k, omega). Use the simpleFoam solver (steady-state, incompressible) with the k-omega SST turbulence model.
Set Reynolds number to 3 million (NASA validation data is available at this Re). This means adjusting either velocity or viscosity to match.
Run at Multiple Angles of Attack
Run simulations at angles of attack from 0° to 12° in 2° increments. For each run, monitor residuals and force coefficients to confirm convergence. CL and CD should stabilize to within 0.1% over the last 100 iterations.
Automate this with a bash script that modifies the inflow direction and runs each case sequentially.
Post-Process and Visualize
Use ParaView to visualize pressure contours, velocity fields, and streamlines around the airfoil. Export CL and CD values at each angle of attack.
Use Python to plot your computed CL vs. alpha curve alongside the NASA experimental data (Ladson 1988 or Gregory & O'Reilly 1970). How closely do your results match?
Perform a Mesh Convergence Study
Run the same case (e.g., alpha = 4°) on three different mesh densities: coarse, medium, and fine. Plot CL and CD vs. cell count to demonstrate mesh independence — showing that your results don't change significantly with further refinement.
This is a required step in any credible CFD study. Without it, reviewers and supervisors won't trust your results.
Career Connection
See how this project connects to real aerospace careers.
Aerospace Engineer →
CFD is a daily tool for aerodynamicists — OpenFOAM experience is highly valued because it shows you understand the physics, not just the GUI
Drone & UAV Ops →
UAV design relies heavily on CFD for performance prediction at low Reynolds numbers where experimental data is sparse
Aerospace Manufacturing →
Manufacturing defects (surface roughness, gaps, steps) affect aerodynamics — CFD quantifies these effects
Space Operations →
Atmospheric re-entry vehicles require extensive CFD analysis for thermal protection system design
Go Further
Extend your CFD capabilities:
- Try a 3D wing — extend to a finite-span wing and compare with XFLR5 results
- Add transition modeling — use the gamma-ReTheta model to predict laminar-to-turbulent transition
- Simulate high angle of attack — use URANS (unsteady) to capture vortex shedding near stall
- Compare with XFLR5 — run the same airfoil in XFLR5 and compare the panel method results with your CFD results