Physics-Informed Neural Nets for Aerodynamics in Julia
Solve the Navier-Stokes equations with a neural network using Julia's NeuralPDE.jl
Last reviewed: March 2026Overview
Julia is the language of choice for high-performance scientific computing in academia — it combines Python-like syntax with C-like speed and a rich ecosystem of differential equations and ML libraries. NeuralPDE.jl is Julia's premier physics-informed neural network framework, built on the DifferentialEquations.jl and Flux.jl ecosystems, and it makes defining PDE-constrained learning problems remarkably concise.
In this project, you'll apply PINNs to the canonical 2D cylinder flow problem at Reynolds number 100 — the regime where the Von Kármán vortex street forms, creating periodic shedding of alternating vortices that produce oscillating lift and drag. The PINN will learn the velocity and pressure fields by minimizing the Navier-Stokes residuals throughout the domain, subject to no-slip boundary conditions on the cylinder surface and inflow/outflow conditions.
Cylinder flow is the standard benchmark for computational fluid dynamics methods — well-characterized reference data exists for validation, including Strouhal number, mean drag coefficient, and lift coefficient amplitude. If your PINN reproduces these within a few percent, you have a scientifically credible result that could support a conference publication.
What You'll Learn
- ✓ Install and navigate the Julia scientific computing ecosystem (Flux.jl, DifferentialEquations.jl, NeuralPDE.jl)
- ✓ Formulate the 2D incompressible Navier-Stokes equations as a PINN problem in NeuralPDE.jl
- ✓ Implement no-slip and inflow/outflow boundary conditions in the PINN loss function
- ✓ Train the PINN and diagnose convergence issues specific to fluid dynamics problems (pressure-velocity coupling)
- ✓ Validate against reference DNS data: Strouhal number, mean Cd, and Cl amplitude
Step-by-Step Guide
Learn Julia Fundamentals
If you're coming from Python, Julia has a learning curve — but the syntax is intuitive. Work through the Julia documentation's "Getting Started" section and install key packages: Pkg.add(["NeuralPDE", "Lux", "Optimization", "OptimizationOptimJL", "Plots"]). Julia uses just-in-time compilation, so the first run is slow — subsequent runs use the compiled cache.
Work through NeuralPDE.jl's tutorial examples for simpler PDEs (1D heat equation, 2D Poisson equation) before tackling Navier-Stokes. Understanding how NeuralPDE.jl defines PDEs symbolically using Symbolics.jl is essential.
Define the Navier-Stokes PDE System
The incompressible 2D Navier-Stokes equations are: ∂u/∂t + u·∂u/∂x + v·∂u/∂y = -∂p/∂x + ν·(∂²u/∂x² + ∂²u/∂y²) and the symmetric y-momentum equation, plus the continuity equation ∂u/∂x + ∂v/∂y = 0.
Define these symbolically in NeuralPDE.jl using @variables t x y u(..) v(..) p(..) and Differential operators. The system has 3 unknowns (u, v, p) and 3 equations. Use Re = 100 (kinematic viscosity ν = 1/100) — this is the onset of vortex shedding.
Set Up the Cylinder Domain and Boundary Conditions
Define a rectangular computational domain (length 10D, height 4D, cylinder at center left) with a circular exclusion zone at the cylinder. Boundary conditions: uniform inflow (u=1, v=0) at the left, zero-gradient outflow at the right, no-slip (u=v=0) on the cylinder surface, and symmetry on top/bottom.
The cylinder boundary in a PINN requires special treatment: sample training points on the cylinder surface using parametric coordinates, and enforce no-slip as an additional boundary loss term. The cylinder geometry makes collocation point generation non-trivial — use rejection sampling from the rectangular domain, discarding points inside the cylinder.
Architecture and Training Strategy
Use a multi-network architecture: separate small networks for (u, v) and p, each 5 layers × 50 neurons with tanh activation. Training proceeds in phases: (1) train on steady-state initialization (Re → 0) for 5,000 iterations, (2) increase Re to 100 and continue training for 20,000+ iterations, (3) fine-tune with additional collocation points near the cylinder.
Loss weighting is critical for Navier-Stokes: the continuity equation typically needs 10–100× higher weight than the momentum equations to enforce incompressibility. Tune these weights based on the relative magnitude of residuals during early training.
Extract and Visualize the Flow Field
After training, evaluate the PINN on a dense grid over the computational domain. Extract u(x,y,t), v(x,y,t), and p(x,y,t) at multiple time snapshots. Visualize with streamlines, velocity magnitude contour plots, and pressure contours using Julia's Plots.jl or export to Python for matplotlib visualization.
Plot the time history of lift and drag coefficients (integrated from the pressure field on the cylinder surface). You should see clear periodic oscillation at the Von Kármán shedding frequency. Calculate the Strouhal number St = fD/U from the frequency and compare to the reference value St ≈ 0.165.
Validate and Compare to Reference
Compute the key benchmark quantities: mean drag coefficient (reference: Cd ≈ 1.37), RMS lift coefficient (reference: Cl,rms ≈ 0.34), and Strouhal number. Plot your PINN solution against published reference DNS data (Williamson 1996, or OpenFOAM reference solutions).
If your results deviate significantly, investigate: is the training converged? Are the boundary conditions correctly implemented? Is the time domain long enough to capture the periodic state? Document your findings and the sensitivity to key hyperparameters (network size, collocation points, loss weights) in a structured report.
Career Connection
See how this project connects to real aerospace careers.
Aerospace Engineer →
PINNs for CFD are a major research investment at NASA, DARPA, and aerospace OEMs — this project directly demonstrates capability at the frontier of computational aerodynamics
Space Operations →
Physics-informed ML for fluid systems extends directly to hypersonic aerothermal prediction, spacecraft plume modeling, and liquid rocket engine combustion simulations
Astronaut →
Understanding the capabilities and limitations of PINN-based flow solvers is relevant for astronauts who will supervise AI-assisted mission design tools on long-duration missions
Aerospace Manufacturing →
PINN-based surrogates for manufacturing process fluid simulations (casting, injection molding, resin infusion in composites) are an emerging industrial application
Go Further
Extend toward research-grade PINN fluid mechanics:
- 3D extension — extend from 2D cylinder to 3D sphere flow (Re = 300) where the wake structure becomes three-dimensional and turbulent
- Inverse problem — given sparse velocity measurements (simulating PIV experimental data), use the PINN to reconstruct the full pressure field, which cannot be directly measured
- GPU acceleration — move the training to a GPU using CUDA.jl and investigate the speedup vs. CPU for varying numbers of collocation points
- Compare to FNO — train a Fourier Neural Operator on cylinder flow data and compare its accuracy and training efficiency against the physics-constrained PINN approach