Airfoil Flow Field with DeepXDE PINNs

Replace a CFD mesh with a neural network trained on physics equations.

Undergraduate Aerodynamics 5–7 weeks
Last reviewed: March 2026

Overview

Computational fluid dynamics traditionally requires generating a mesh that discretises the fluid domain into millions of cells, then iteratively solving the Navier-Stokes or Euler equations on that mesh — a process that can take hours to days for complex geometries. Physics-Informed Neural Networks offer an alternative: parameterise the flow field as a neural network, then train it to satisfy the governing PDEs and boundary conditions simultaneously, with no mesh required. For inviscid airfoil flows described by the Euler equations, PINNs can produce accurate pressure and velocity distributions in a fraction of the setup time.

DeepXDE is the leading Python library for PINNs, providing abstractions for defining PDE systems, geometric domains (including complex boundaries), boundary condition types, and training strategies. In this project you will define the 2D steady incompressible Euler system (continuity + x and y momentum in terms of stream function and vorticity), specify the NACA 0012 airfoil boundary using a parametric curve, and enforce the no-penetration condition (zero normal velocity at the airfoil surface) and far-field freestream conditions. The network is trained on a set of collocation points distributed inside and on the domain boundary.

Airfoil PINNs sit at the frontier of scientific machine learning in aerodynamics, with research groups at DLR, NASA Ames, and MIT actively publishing in this space. Completing this project demonstrates graduate-level technical ambition and produces a result directly comparable to the XFLR5 panel method baseline — enabling a concrete quantitative comparison between mesh-free learning and classical numerics.

What You'll Learn

  • Formulate the 2D steady Euler equations in stream-function/vorticity form suitable for PINN training
  • Define complex geometric domains (airfoil shape) and boundary conditions in DeepXDE
  • Train a multi-output PINN and monitor loss component balance to avoid pathological training
  • Extract lift coefficient predictions from the PINN pressure field and validate against XFLR5 or thin-airfoil theory
  • Critically compare PINN accuracy, training cost, and versatility against classical panel methods

Step-by-Step Guide

1

Formulate the governing equations

Derive the 2D steady incompressible Euler equations in stream-function (ψ) and vorticity (ω) form: the Laplacian of ψ equals −ω, and the convection of ω is zero (inviscid). This two-PDE system reduces the unknowns to ψ and ω, making it tractable for a PINN. Document the relationship between ψ and the velocity components (u = ∂ψ/∂y, v = −∂ψ/∂x) and the formula for pressure from Bernoulli.

2

Define the domain and airfoil geometry in DeepXDE

Generate NACA 0012 coordinates using the standard four-digit formula and represent them as a DeepXDE PointCloud boundary. Define the outer far-field boundary as a large circle (radius 10 chord lengths). Create the computational domain as the region inside the far-field circle but outside the airfoil. Sample 15,000 interior collocation points with higher density near the airfoil leading edge and trailing edge.

3

Specify boundary conditions and build the network

Implement three boundary condition types in DeepXDE: (1) far-field: ψ = U∞·y (freestream stream function) and ω = 0; (2) airfoil surface: ψ = constant (no-penetration). Define a fully connected network with 6 hidden layers and 128 neurons per layer outputting [ψ, ω]. Use the Swish activation function, which has smoother higher-order derivatives than tanh — beneficial for second-order PDE residuals.

4

Train with loss weighting and curriculum learning

Train first with only the boundary conditions active (zero PDE weight) for 2,000 iterations to give the network a physically meaningful initialisation. Then activate the full composite loss (PDE residual + BCs) and train for 30,000 iterations using Adam followed by L-BFGS fine-tuning. Monitor all three loss components separately; if the PDE residual dominates, increase its weight using the self-adaptive loss weighting scheme available in DeepXDE.

5

Extract flow field and compute aerodynamic coefficients

Evaluate the trained network on a dense Cartesian grid around the airfoil. Compute velocity components from ψ partial derivatives (use JAX or PyTorch autodiff via DeepXDE's backend). Compute pressure from Bernoulli and integrate pressure around the airfoil surface to get lift and drag coefficients. Compare CL vs. angle of attack against the thin-airfoil theory result (CL = 2π·α) and XFLR5 panel method predictions.

6

Quantify accuracy and write a comparative analysis

Compute the pointwise error between the PINN velocity field and a high-resolution XFLR5 panel solution or published data. Plot error maps showing where the PINN deviates most (typically the trailing edge region). Write a 5-page comparative analysis covering: PDE formulation choices, training cost vs. classical setup cost, accuracy metrics, and a balanced assessment of when PINNs are preferable to panel methods for airfoil analysis.

Go Further

  • Extend to a viscous flow by adding the vorticity transport equation with a finite Reynolds number diffusion term and compare stall prediction against Xfoil.
  • Train a single PINN across multiple angles of attack by including α as a network input, creating a continuous aerodynamic surrogate model.
  • Implement the DeepXDE hard constraint enforcement for the airfoil boundary condition (distance-function weighting) and compare convergence speed against soft constraint training.
  • Use the trained PINN as a fast evaluator inside a gradient-based airfoil shape optimisation loop, optimising camber and thickness for maximum L/D at a target CL.