Complete implementations of deep learning methods for solving Partial Differential Equations (PDEs), including tutorials, training code, and real-world applications.
Neural networks that encode physical laws directly into the loss function
Core Idea: Construct physics-constrained loss using automatic differentiation:
Loss = MSE(Boundary) + MSE(Initial) + MSE(PDE Residual)
- Advantages: Low data requirements, handles complex boundaries, suitable for inverse problems
- Location:
PINNs/ - Tutorials: 8 Jupyter notebooks (English & Chinese), from basics to advanced
- Applications: Poisson, Heat, Navier-Stokes, Vlasov-Poisson systems
Neural networks learning mappings between infinite-dimensional function spaces
Core Idea: Branch-Trunk architecture for learning operators G: u → G(u):
DeepONet(u)(y) = Σᵢ bᵢ(u) · tᵢ(y)
Branch network bᵢ: Encodes input function u
Trunk network tᵢ: Encodes output location y
- Advantages: Train once, fast inference (milliseconds), efficient for multi-query
- Location:
DeepONet/ - Tutorials: Pure PyTorch implementation tutorial
- Applications: Heat equation, Burgers, Darcy flow, VP systems
Neural operators solving PDEs in frequency domain
Core Idea: Convolution in Fourier space for global information propagation:
v(x) = σ(W·u(x) + (K*u)(x))
where K*u computed in frequency domain: F⁻¹(R · F(u))
- Advantages: Resolution-invariant, excellent for periodic problems, high-resolution solving
- Location:
FNO/ - Applications: Navier-Stokes, turbulence modeling, Darcy flow
Neural networks using tensor decomposition for high-dimensional PDEs
Core Idea: Decompose high-dimensional functions into products of low-dimensional functions:
u(x₁,...,xₐ) ≈ Σᵢ αᵢ · ∏ₖ φₖ⁽ⁱ⁾(xₖ)
- Advantages: Linear parameter growth (vs exponential), suitable for high-dimensional problems
- Location:
TNN/ - Tutorials: Complete Jupyter tutorial and 5D examples
- Applications: 5D Poisson equation, high-dimensional PDE solving
Sequence models using attention mechanisms for PDE solving
Core Idea: Capture long-range dependencies in spatial/temporal domains via self-attention
- Advantages: Long-range dependency capture, flexible architecture design
- Location:
Transformer/ - Applications: Time-series prediction, multi-physics coupling
AI4CFD/
├── PINNs/ # Physics-Informed Neural Networks
│ ├── tutorial/ # 8 tutorials (English & Chinese)
│ ├── vp_system/ # Vlasov-Poisson system implementation
│ └── README.md
├── DeepONet/ # Deep Operator Networks
│ ├── tutorial/ # PyTorch implementation tutorial
│ ├── vp_system/ # VP operator learning
│ └── README.md
├── FNO/ # Fourier Neural Operators
│ └── README.md
├── TNN/ # Tensor Neural Networks
│ ├── tutorial/ # Complete tutorial
│ ├── train/dim5/ # 5D PDE solving example
│ └── README.md
├── Transformer/ # Transformer-based methods
│ └── README.md
├── VP_system/ # Vlasov-Poisson applications
│ └── TwoStreamInstability/ # Two-stream instability
└── utils/ # Shared utility functions
git clone https://github.com/Michael-Jackson666/AI4CFD.git
cd AI4CFD
pip install -r requirements.txtPINNs Tutorial (Recommended for Beginners):
cd PINNs/tutorial
jupyter notebook tutorial_eng.ipynb # English tutorial
# or
jupyter notebook tutorial_chinese.ipynb # Chinese tutorialTNN 5D Example:
cd TNN/train/dim5
python ex_5_1_dim5.pyDeepONet Tutorial:
cd DeepONet/tutorial
jupyter notebook operator_learning_torch.ipynb| Method | Training Data | Single Solve Speed | Parameter Query | Best For |
|---|---|---|---|---|
| PINNs | Low (physics-informed) | Seconds | Re-train needed | Complex boundaries, inverse problems, data scarcity |
| DeepONet | High (needs solutions) | Milliseconds | One forward pass | Multi-query, real-time prediction |
| FNO | High (needs solutions) | Milliseconds | One forward pass | Periodic problems, turbulence, high-resolution |
| TNN | Medium | Seconds | Re-train needed | High-dimensional problems (5D+) |
| Transformer | High (needs solutions) | Milliseconds | One forward pass | Time-series, long-range dependencies |
- Fluid Dynamics: Navier-Stokes equations, turbulence modeling, shape optimization
- Heat Transfer: Heat equation, convection-diffusion, multi-physics coupling
- Plasma Physics: Vlasov-Poisson systems, two-stream instability
- General PDEs: Poisson equation, Burgers equation, Darcy flow
- Python >= 3.8
- PyTorch >= 1.10
- NumPy, SciPy, Matplotlib
- Jupyter (optional, for tutorials)
Each method has detailed README documentation:
PINNs/README.md: Complete PINNs guide and tutorial indexDeepONet/README.md: Operator learning detailed explanationTNN/README.md: Tensor neural network theory and implementationTNN/train/dim5/README.md: 5D PDE solving example guide
This project is licensed under the MIT License - see the LICENSE file for details.
⭐ Star this repository if you find it helpful! ⭐