This repository contains Physics-Informed Neural Networks (PINNs) for two incompressible Navier-Stokes benchmarks:
- Steady 2D Kovasznay flow
- Unsteady 2D cylinder wake flow
The models learn velocity and pressure fields by minimizing boundary supervision loss and PDE residual loss.
Best run metrics captured from logged training summaries:
- Boundary MSE:
1.20e-09 - Physics MSE:
2.24e-07 - Final weighted objective:
-15.63 - RAR + L-BFGS run: Boundary MSE
1.14e-09, Physics MSE2.81e-07
Interpretation:
- The PINN converges to very low boundary and physics residual errors.
- Adaptive weighting and second-stage optimization (L-BFGS) are critical to reach the final regime.
- Residual-based adaptive refinement (RAR) stabilizes physics loss as collocation density increases in hard regions.
Representative logged run metrics:
- Boundary MSE:
3.67e-06 - Physics MSE:
1.45e-05 - Final weighted objective:
-9.53
Interpretation:
- The unsteady wake problem is more challenging than Kovasznay; residuals remain higher, which is expected.
- The pipeline supports additional RAR passes to improve wake-region fidelity.
For velocity
Cylinder flow extends this with the transient term
PDE-Solver/
├── README.md
├── requirements.txt
├── pinn_kovasznay.pth
├── pinn_cylinder.pth
├── kovasznay_flow/
│ ├── dataset.py
│ ├── evaluate.py
│ ├── kovasznay.py
│ ├── loss.py
│ ├── network.py
│ ├── refine.py
│ ├── train.py
│ └── results/
└── cylinder_flow/
├── dataset.py
├── evaluate.py
├── loss.py
├── network.py
├── refine.py
├── train.py
└── results/
pip install -r requirements.txtRun all commands from the repository root.
python kovasznay_flow/train.py
python kovasznay_flow/refine.py
python kovasznay_flow/evaluate.pypython cylinder_flow/train.py
python cylinder_flow/refine.py
python cylinder_flow/evaluate.py- Scripts automatically use GPU if CUDA is available; otherwise they run on CPU.
- Existing plots in
*/results/reflect prior training runs and can be overwritten by new experiments. - Weights & Biases logging is enabled in training/refinement scripts.
This project is distributed under the terms in LICENSE.

