File size: 11,115 Bytes
2ad59af
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
---
license: mit
pretty_name: PoreML V1 — pore-scale multiphase flow trajectories
size_categories:
- 100K<n<1M
task_categories:
- time-series-forecasting
tags:
- physics
- computational-fluid-dynamics
- porous-media
- multiphase-flow
- lattice-boltzmann
- scientific-machine-learning
- neural-operator
- 3d
viewer: false
---

# PoreML V1 — pore-scale multiphase flow trajectories

<table>
<tr>
<td width="50%"><img src="assets/drainage.png" alt="Drainage: invading phase entering a sphere pack"/><br/><sub><b>drainage</b> — capillary-dominated invasion of a rock; here a generated sphere pack at 256³, the front still compact</sub></td>
<td width="50%"><img src="assets/trapping.png" alt="Trapping: disconnected ganglia left behind by a flood"/><br/><sub><b>trapping</b> — a flood strands disconnected ganglia; predicting which blobs survive is the hard part</sub></td>
</tr>
<tr>
<td><img src="assets/gdl.png" alt="GDL: water in a fibrous gas-diffusion layer"/><br/><sub><b>GDL</b> — water transport through a fuel-cell gas-diffusion layer, a thin high-porosity fibrous slab</sub></td>
<td><img src="assets/underfill.png" alt="Underfill: a front sweeping past solder bumps"/><br/><sub><b>underfill</b> — capillary underfill of a flip-chip package, a coherent front sweeping past solder bumps</sub></td>
</tr>
</table>

<sub>Blue is the invading phase, grey the solid. One stored frame per campaign, at roughly 70 % of the trajectory.</sub>

**560 lattice-Boltzmann simulations of two-phase flow through porous media — 158,546 stored
3-D frames, 3.32 TB.** Four campaigns, seven geometry families, real micro-CT rock alongside
procedurally generated media, at two spatial resolutions. Every run carries the solver's own
metadata, so a trajectory can be traced back to the geometry, the capillary number and the
contact angle that produced it.

The dataset is the benchmark behind `poreml`, and it is published whole rather than as a
curated subset, so that training, held-out evaluation and transfer tests can all be drawn from
the same 560 runs.

---

## At a glance

| campaign | families | runs | frames | size | domain (D × H × W) | what it is |
|---|---|---:|---:|---:|---|---|
| **drainage** | bentheimer, buffberea, castlegate *(µCT)* · blob, poly, sphere *(generated)* | 176 | 69,473 | 1,046 GB | 128×128×161 · 256×256×289 | capillary-dominated invasion of a rock, inlet reservoir → rock → porous plate → outlet |
| **GDL** | gdl_ct, gdl_ct_20, gdl_ct_40 *(µCT)* · fiber *(generated)* | 176 | 53,654 | 1,080 GB | 128×128×77 · 256×256×141 | water transport in fuel-cell gas-diffusion layers, a thin high-porosity fibrous slab |
| **trapping** | bentheimer, buffberea, castlegate *(µCT)* · blob, poly, sphere *(generated)* | 176 | 23,040 | 390 GB | 128×128×144 · 256×256×272 | two-stage: equilibration, then a flood that strands disconnected ganglia |
| **underfill** | flipchip *(generated)* | 32 | 12,379 | 808 GB | 22–48 × 482 × 432–476 | capillary underfill of a flip-chip package, a wide thin domain around solder bumps |
| **total** | | **560** | **158,546** | **3,324 GB** | | |

Each campaign exists at a **128-class** resolution and, except underfill, a **256-class**
resolution — 16 runs per campaign, the same geometry families at twice the linear size.

---

## Download

The repository **is** the dataset directory. Clone it straight into `data/case` and the paths
line up with the benchmark's default `data.root` with nothing to move:

```bash
pip install huggingface_hub hdf5plugin h5py
hf download PoreML/PoreML_V1 --repo-type dataset --local-dir data/case
```

One campaign, or one family, is a glob away — useful, since the full set is 3.3 TB:

```bash
# just the 128-class GDL runs (~476 GB)
hf download PoreML/PoreML_V1 --repo-type dataset --local-dir data/case \
  --include "GDL/runs/*/128x128x64/*"

# a single run (~3.2 GB)
hf download PoreML/PoreML_V1 --repo-type dataset --local-dir data/case \
  --include "drainage/runs/blob/128/drain_blob128_0000_128_M1_th140_b99/*"
```

```python
from huggingface_hub import snapshot_download
snapshot_download("PoreML/PoreML_V1", repo_type="dataset", local_dir="data/case",
                  allow_patterns=["trapping/runs/sphere/128/*"])
```

> **`hdf5plugin` is not optional.** Every trajectory is Zstandard-compressed (HDF5 filter
> id 32015). `import hdf5plugin` before `h5py.File(...)` or HDF5 reports the filter as
> unavailable and the read fails. For `h5ls` / `h5dump`, point `HDF5_PLUGIN_PATH` at
> `hdf5plugin`'s plugin directory.

---

## Layout

Every run is one directory, at `<campaign>/runs/<family>/<size>/<run_id>/`. `<size>` is the
*geometry's* shape (`128`, `128x128x64`, `256`, `256x256x128`, `26x482x476`); the simulated
domain is longer along the flow axis, see below.

**drainage and GDL** — one stage, one trajectory:

```
<run_id>.h5                 the trajectory — zstd-3 HDF5
<run_id>.xdmf               ParaView index over the .h5 (relative paths)
run_meta.json               solver, geometry, environment, progress, protocol (`extra`)
metrics.csv                 the solver's own per-block scalars (saturation, front position, pressures)
report.md                   the solver's one-page run summary
<run_id>.conversion.json    how this copy was produced: encoding, sizes and checksums
```

**trapping** — two stages, and note there is *no* plain `run_meta.json`. The stored trajectory
is the second (flood) stage; the equilibration that preceded it is described but not stored:

```
flood_<run_id>.h5           the flood trajectory — the only .h5 in the directory
flood_<run_id>.xdmf
run_meta_flood.json         the flood stage: its `status` / `finish_type` describe the .h5
run_meta_stab.json          the preceding equilibration stage (no trajectory kept)
metrics_flood.csv           per-block scalars, one file per stage
metrics_stab.csv
flood_report.md
stab_report.md
<run_id>.conversion.json
```

**underfill** — the HDF5 carries a `uf_` prefix, and the geometry is generated, so its
parameters travel with it:

```
uf_<run_id>.h5
uf_<run_id>.xdmf
run_meta.json
metrics.csv
report.md
<run_id>_geometry.json      the generated flip-chip geometry's parameters
<run_id>.npy                the solid mask as bool — identical to `/rock` in the .h5, kept for convenience
<run_id>.conversion.json
```

A reader should glob for the single `*.h5` in a run directory rather than assume the file is
named after the run, and should fall back to `run_meta_flood.json` where `run_meta.json` is
absent.

### Reading one frame

```python
import glob, json
import h5py, hdf5plugin  # noqa: F401 — registers the Zstandard filter
import numpy as np

run = "data/case/drainage/runs/blob/128/drain_blob128_0000_128_M1_th140_b99"
meta = json.load(open(f"{run}/run_meta.json"))
lo, hi = meta["extra"]["regions"]["rock"]          # score the rock, not the buffers
M, theta = meta["extra"]["M"], meta["solver"]["theta"]

with h5py.File(glob.glob(f"{run}/*.h5")[0], "r") as f:
    solid = f["rock"][..., lo:hi].astype(bool)     # 1 = solid
    steps = sorted(f["steps"])
    phi = f[f"steps/{steps[len(steps) // 2]}/phi"][..., lo:hi]

pore = ~solid
phi = np.where(pore, phi, -1.0)                    # phi is NaN inside solid
saturation = (phi[pore] > 0).mean()                # non-wetting fraction of the pore space

print(f"{len(steps)} frames | M={M} theta={theta} | rock {solid.shape} "
      f"porosity={pore.mean():.3f} | S_nw={saturation:.3f}")
# 380 frames | M=1.0 theta=140.0 | rock (128, 128, 128) porosity=0.283 | S_nw=0.305
```

### Inside a trajectory

```
/rock                     (D, H, W)    uint8     1 = solid
/steps/<step:09d>/phi     (D, H, W)    float32   phase field; > 0 non-wetting, < 0 wetting, NaN in solid
/steps/<step:09d>/p       (D, H, W)    float32   pressure
/steps/<step:09d>/u       (D, H, W, 3) float32   velocity
```

Root attributes carry `fields` (`phi,p,u`), `dtype`, `shape`, the run conditions — `M` (viscosity
ratio), `ca` (capillary number), `theta` (contact angle, degrees), `sigma`, `nu0`, `chi`,
`cs2` = 1/3, `u_in` — and `run_meta`, a JSON snapshot of the metadata taken while the run was
writing. Frames are stored every 5,000 lattice steps in drainage, GDL and the trapping flood,
and every 1,000 in underfill and the trapping equilibration stage (`extra.block`).

Three things bite readers who treat the arrays naively:

1. **`phi` is `NaN` inside the solid**, not zero. Fill it before it reaches a model or a loss
   (`poreml` uses −1.0) and mask it out of any metric.
2. **The domain is longer than the rock along the last axis.** `extra.regions` in the metadata
   gives the half-open spans: drainage has `inbuf`, `rock`, `plate`, `outbuf`
   (e.g. `{"inbuf": [0,7], "rock": [7,135], "plate": [135,155], "outbuf": [155,161]}`), GDL and
   trapping have `inbuf`, `rock`, `outbuf`, and underfill records no regions because it has no
   buffers. Saturation computed over the whole domain will not agree with the solver's own
   `metrics.csv`: the inlet buffer is always fully invaded and the plate is a boundary device,
   so score the `rock` span.
3. **The last spatial axis is the flow axis**, inlet at index 0, outlet at −1.

`rho` and `umag` are **not** stored. Both were exact functions of what is here — `rho` = `p` / `cs2`
and `umag` = ‖`u`‖ — and together cost 32 % of the bytes, so they were dropped in a 2026-09-13
repack. Recompute them if you need them.

---

## Physics and sampling

Colour-gradient lattice Boltzmann, D3Q19, immiscible two-phase, β = 0.99. Each campaign sweeps
a grid of viscosity ratio `M` against contact angle `theta`:

| campaign | `M` | `theta` | `ca` |
|---|---|---|---|
| drainage | 0.05, 0.1, 0.2, 1 | 120°, 130°, 140°, 150° | 1 × 10⁻⁵ |
| GDL | 1, 5, 10, 20 | 120°, 130°, 140°, 150° | 1 × 10⁻⁵ |
| trapping | 0.05, 0.1, 0.2, 1 | 120°, 130°, 140°, 150° | not recorded |
| underfill | 5, 10, 20, 30 | 30°, 40°, 50° | not recorded |

Contact angles above 90° make the invading phase non-wetting (drainage); the underfill
campaign is the wetting-invasion case. The capillary number is held fixed and low in the two
campaigns that record it, so those runs are capillary-dominated. `M` and `theta` are the only
two conditions the benchmark conditions its models on — trapping and underfill record no `ca`,
so it is the one parameter that cannot span every campaign.

Runs stop on their own terms and record why in `status` / `finish_type` — breakthrough,
pore-volume cap, immobilisation of the invading phase, or a filled package. Trajectory length
therefore varies a great deal (17 to 1,266 stored frames), which is why any aggregate over
this dataset should average **per run first, then over runs**; otherwise the long runs
dominate.

---

## Citation

```bibtex
@misc{poreml_v1,
  title  = {PoreML V1: pore-scale multiphase flow trajectories for machine-learning benchmarks},
  author = {PoreML},
  year   = {2026},
  howpublished = {\url{https://huggingface.co/datasets/PoreML/PoreML_V1}}
}
```

Released under the MIT licence.