File size: 5,019 Bytes
94de5e6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
---
license: mit
size_categories:
- 100K<n<1M
task_categories:
- other
pretty_name: PreGen Navier-Stokes 2D Dataset
tags:
- physics
- fluid-dynamics
- navier-stokes
- pde
- scientific-computing
- neural-operators
- foundation-models
- difficulty-transfer
- reynolds-number
- openfoam
language:
- en
---

# PreGen Navier-Stokes 2D Dataset

[Paper](https://huggingface.co/papers/2512.00564) | [Project Page](https://naman-choudhary-ai-ml.github.io/pde-difficulty-transfer/) | [Code](https://github.com/Naman-Choudhary-AI-ML/pregenerating-pde)

## Dataset Description

This dataset accompanies the research paper **[Pre-Generating Multi-Difficulty PDE Data For Few-Shot Neural PDE Solvers](https://huggingface.co/papers/2512.00564)** (under review at ICLR 2026). It contains systematically generated 2D incompressible Navier-Stokes fluid flow simulations designed to study **difficulty transfer** in neural PDE solvers.

The key insight: by pre-generating many low and medium difficulty examples and including them with a small number of hard examples, neural PDE solvers can learn high-difficulty physics from far fewer samples.

### Dataset Summary

- **Format:** NumPy arrays (.npy files)
- **Number of Files:** 9
- **Simulations per file:** 6,400 trajectories
- **Timesteps:** 20 per trajectory
- **Spatial Resolution:** 128 × 128 grid
- **Solver:** OpenFOAM (icoFoam)
- **Domain:** 2D Incompressible Navier-Stokes equations

## Difficulty Axes

The dataset systematically varies complexity along three axes:

### 1. **Geometry Axis** (Number of Obstacles)
Simulations in flow-past-object (FPO) configuration with varying obstacle complexity:

- **Easy:** No obstacles (open channel flow)
- **Medium:** Single square obstacle
- **Hard:** 2-10 randomly placed square obstacles

**Files:**
- `Geometry_Axis/FPO_Geometry_Easy_NoObstacle.npy` (47 GB)
- `Geometry_Axis/FPO_Geometry_Medium_SingleObstacle.npy` (47 GB)
- `Geometry_Axis/FPO_Geometry_Hard_MultiObstacle.npy` (47 GB)

### 2. **Physics Axis** (Reynolds Number)
Simulations with varying flow complexity via Reynolds number:

**Multi-Obstacle Flows:**
- **Easy:** Re ∈ [100, 1000] - laminar regime
- **Medium:** Re ∈ [2000, 4000] - transitional regime
- **Hard:** Re ∈ [8000, 10000] - turbulent regime

**Files:**
- `Physics_Axis/MultiObstacle/FPO_Physics_MultiObstacle_Easy_Re100-1000.npy` (47 GB)
- `Physics_Axis/MultiObstacle/FPO_Physics_MultiObstacle_Medium_Re2000-4000.npy` (47 GB)
- `Physics_Axis/MultiObstacle/FPO_Physics_MultiObstacle_Hard_Re8000-10000.npy` (47 GB)

**No-Obstacle Flows:**
- `Physics_Axis/NoObstacle/FPO_Physics_NoObstacle_Easy_Re100-1000.npy` (47 GB)

### 3. **Combined Axis** (Geometry + Physics)
Combined variations in both geometry and Reynolds number:

- **Easy:** No obstacles + low Re ([100, 1000])
- **Medium:** Single obstacle + medium Re ([2000, 4000])
- **Hard:** Multiple obstacles + high Re ([8000, 10000])

**File:**
- `Combined_Axis/FPO_Combined_Medium_SingleObstacle_MedRe.npy` (47 GB)

### 4. **Special Configuration**
- `Special/FPO_Cylinder_Hole_Location_6284.npy` (47 GB) - Cylinder with hole at specific location

## Data Format

Each `.npy` file contains a NumPy array with shape: `(6400, 20, 128, 128, 6)`

**Dimensions:**
- **6400**: Number of simulation trajectories
- **20**: Timesteps per trajectory
- **128 × 128**: Spatial grid resolution
- **6**: Channels (features)

**Channels (in order):**
1. **u** - Horizontal velocity component (m/s)
2. **v** - Vertical velocity component (m/s)
3. **p** - Kinematic pressure (m²/s²)
4. **Re_normalized** - Normalized Reynolds number
5. **Binary mask** - Geometry encoding (1 = obstacle, 0 = fluid)
6. **SDF** - Signed distance field to nearest obstacle boundary

## Usage

```python
import numpy as np
from huggingface_hub import hf_hub_download

# Download a specific difficulty level
file_path = hf_hub_download(
    repo_id="sage-lab/PreGen-NavierStokes-2D",
    filename="Geometry_Axis/FPO_Geometry_Easy_NoObstacle.npy",
    repo_type="dataset"
)

# Load the data
data = np.load(file_path)
print(f"Data shape: {data.shape}")  # (6400, 20, 128, 128, 6)

# Extract individual trajectories
trajectory_0 = data[0]  # Shape: (20, 128, 128, 6)

# Extract velocity and pressure
u = trajectory_0[:, :, :, 0]  # Horizontal velocity
v = trajectory_0[:, :, :, 1]  # Vertical velocity
p = trajectory_0[:, :, :, 2]  # Pressure
mask = trajectory_0[:, :, :, 4]  # Binary geometry mask
sdf = trajectory_0[:, :, :, 5]  # Signed distance field
```

## Citation

If you use this dataset, please cite:

```bibtex
@article{pregen2025,
  title={Pre-Generating Multi-Difficulty PDE Data For Few-Shot Neural PDE Solvers},
  author={Choudhary, Naman and Singh, Vedant and Talwalkar, Ameet and Boffi, Nicholas Matthew and Khodak, Mikhail and Marwah, Tanya},
  journal={arXiv preprint},
  year={2025},
  url={https://huggingface.co/papers/2512.00564}
}
```

## License

MIT License

---

**Dataset Version:** 1.0
**Last Updated:** 2024
**Status:** Research dataset under peer review