Skip to content

sidd707/AeroPINN

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AeroPINN

AeroPINN Logo

Leveraging Physics-Informed Neural Networks (PINNs) to simulate airflow patterns around arbitrary airfoil geometries in real-time — replacing expensive CFD solvers with fast, physics-constrained deep learning.

Python TensorFlow Streamlit License


Problem

Traditional Computational Fluid Dynamics (CFD) simulations require mesh generation, boundary condition setup, and significant compute time for each airfoil design iteration. For engineers iterating over hundreds of designs, this becomes a bottleneck — both in time and cost.

Cost comparison — Wind Tunnel vs AeroPINN

AeroPINN solves this by training a neural network that embeds the governing physics (Navier-Stokes equations) directly into the loss function, enabling real-time predictions of pressure and velocity fields around any NACA airfoil geometry.

What is an Airfoil?

An airfoil is a streamlined shape designed to produce lift and minimize drag as air flows around it. The NACA 4-digit naming convention encodes the geometry:

Airfoil anatomy — chord, camber, thickness
Airfoil geometry — leading edge, trailing edge, camber line, and thickness distribution

What are PINNs?

A standard neural network learns purely from data. A Physics-Informed Neural Network adds a second objective — the network must also satisfy the underlying physical laws.

PINN = Deep Learning + Physics Knowledge
PINNs combine deep learning with physics knowledge

The loss function has two components:

Total Loss = Data Loss + Physics Loss

Data Loss    →  |predicted - CFD ground truth|
Physics Loss →  Residuals of Navier-Stokes equations
                (Continuity: du/dx + dv/dy = 0)

The network takes spatial coordinates (x, y) as input and predicts flow variables (u, v, p) — velocity components and pressure. Automatic differentiation computes spatial derivatives to enforce physical consistency.

Why Physics Matters — PINN vs Standard NN

The difference is striking. Without physics constraints, a neural network overfits to noise. With PINN, the model learns the true underlying trajectory:

Without PINN — overfits noise With PINN — follows physics
Left: Standard NN overfits noisy data | Right: PINN recovers the true trajectory

Architecture

PINN Workflow

The pipeline follows:

  1. Data Collection — CFD simulation results for 6 NACA airfoils (OpenFOAM)
  2. Preprocessing — Coordinate extraction, normalization, missing data handling
  3. Loss Construction — Data loss + Navier-Stokes residuals + boundary conditions
  4. Training — Adam optimizer, 1000 epochs, combined loss minimization
  5. Deployment — Streamlit web app for real-time inference

Dataset

CFD simulation data for 6 NACA airfoil profiles, each with ~1M data points:

Airfoil Type Data Points Fields
NACA 0012 Symmetric 999,000 p, U:0, U:1, U:2, x, y, z
NACA 0015 Symmetric 999,000 p, U:0, U:1, U:2, x, y, z
NACA 0021 Symmetric 999,000 p, U:0, U:1, U:2, x, y, z
NACA 2412 Cambered 999,000 p, U:0, U:1, U:2, x, y, z
NACA 2415 Cambered 999,000 p, U:0, U:1, U:2, x, y, z
NACA 4412 High Camber 999,000 p, U:0, U:1, U:2, x, y, z

Total: ~6M data points across symmetric and cambered airfoil families.

CFD Visualizations (Pressure & Velocity Fields)

NACA 0012
NACA 0012 — Pressure field (left) | Velocity magnitude (right)

NACA 2412
NACA 2412 — Cambered airfoil showing asymmetric flow distribution

NACA 4412
NACA 4412 — Higher camber producing stronger pressure differential

Results

Model Comparison

Four approaches were benchmarked on the same airfoil data. PINN achieves the lowest MSE by leveraging physics constraints:

Model predictions vs true values
Predicted vs true values — PINN (MSE: 0.000091) closely follows the perfect prediction line

Model MSE
Linear Regression 0.093992
Basic Neural Network 0.000985
Random Forest 0.000414
PINN 0.000091

Training Convergence

Training loss — without physics Training loss — with physics
Left: Without physics loss (smooth but higher plateau) | Right: With physics loss (converges lower)

Streamlit App

An interactive web interface for uploading airfoil data, running automated EDA, training models, and visualizing flow fields:

  • Upload — Load CSV/Excel airfoil simulation data
  • Profiling — Automated exploratory data analysis with dataset statistics
  • Unpinned Data — Raw data exploration and preprocessing
  • Piped Data — PINN-powered flow field predictions with streamline and contour visualizations

Demo video: Google Drive

Project Structure

AeroPINN/
├── Streamlit.py                          # Main Streamlit application
├── Dataset/
│   ├── 0012.csv, 0015.csv, 0021.csv      # Symmetric airfoils (NACA 00xx)
│   ├── 2412.csv, 2415.csv                # Cambered airfoils (NACA 24xx)
│   ├── 4412.csv                          # High-camber airfoil (NACA 4412)
│   └── *.png                             # CFD visualization snapshots
├── notebooks/
│   ├── comparining_model.ipynb           # Model training & comparison
│   └── preprocessing-missing-data.ipynb  # Data cleaning & imputation
├── src/
│   └── airfoil-cfd-model.ipynb           # Core PINN model development
├── asset/                                # Banner, workflow diagram, demo video
├── docs/                                 # Presentation slides
└── LICENSE

Tech Stack

  • Deep Learning — TensorFlow / Keras (PINN architecture)
  • Data Processing — NumPy, Pandas, scikit-learn
  • Visualization — Matplotlib, Seaborn, SciPy (griddata interpolation)
  • App — Streamlit, ydata-profiling, PyCaret
  • CFD Data — OpenFOAM simulation exports

Getting Started

git clone https://github.com/sidd707/AeroPINN.git
cd AeroPINN
pip install -r requirements.txt
streamlit run Streamlit.py

Team

License

This project is licensed under the MIT License.

About

Real-time airflow simulation around airfoils using Physics-Informed Neural Networks (PINNs) with a Streamlit interface.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors