Organizations: Academy of Mathematics and Systems Science, Chinese Academy of Sciences · Microsoft Research Asia · Renmin University of China · Institute of Zoology, Chinese Academy of Sciences
Partial differential equation (PDE) simulation holds extensive significance in scientific research. Currently, the integration of deep neural networks to learn solution operators of PDEs has introduced great potential. In this paper, we present UniFluids, a conditional flow-matching framework that harnesses the scalability of diffusion Transformer to unify learning of solution operators across diverse PDEs with varying dimensionality and physical variables. Unlike the autoregressive PDE foundation models, UniFluids adopts flow-matching to achieve parallel sequence generation, making it the first such approach for unified operator learning. Specifically, the introduction of a unified four-dimensional spatiotemporal representation for the heterogeneous PDE datasets enables joint training and conditional encoding. Furthermore, we find the effective dimension of the PDE dataset is much lower than its patch dimension. We thus employ x-prediction in the flow-matching operator learning, which is verified to significantly improve prediction accuracy. We conduct a large-scale evaluation of UniFluids on several PDE datasets covering spatial dimensions 1D, 2D and 3D. Experimental results show that UniFluids achieves strong prediction accuracy and demonstrates good scalability and cross-scenario generalization capability. The code will be released later.
Figures & tables
Figure 1: Overall architecture. (a) Unified 4D representation: heterogeneous 1D/2D/3D PDE trajectories with different variable sets are aligned to a canonical 4D grid (t,h,w,d) with zero-padding on degenerate axes and a channel mask for missing variables, then space–time patchified into tokens paired with explicit 4D coordinates, enabling 4D RoPE. (b) Unified condition encoder: a Transformer encodes the observed history into ctok (dense condition) and a aggregated cg (compact condition) via temporal/spatial aggregation. (c) Conditional flow-matching operator: starting from noisy future-window tokens, the operator stacks 4D-RoPE self-attention and cross-attention to ctok , with AdaLN modulated by (t,cg,dim_type) , to predict the clean solution.
Dim- d
V
Target
PR ↓
EV90 ↓
EV90/ d↓
1D
48
x
1.14
1
0.0208
1D
48
ϵ
47.60
43
0.8958
1D
48
v
1.75
19
0.3958
2D
512
x
1.29
2
0.0039
2D
512
ϵ
471.99
428
0.8359
2D
512
v
18.05
276
0.5391
Table 1: Effective-dimension diagnostics for PDE patch vectors. V denotes the size of the patch vector.
Figure 2: Eigen-spectra of covariance for PDE patch vectors (log-scale), comparing targets x , ϵ , and v across 1D/2D/3D. Patchified PDE states concentrate variance in a small number of components (fast spectral decay), whereas ϵ (and partially v ) spans a much larger effective dimension, making ϵ / v prediction increasingly ill-conditioned as patch dimension grows.
Methods
1D
2D CFD
2D
3D
CFD
Adv.
Bur.
M=1
M=0.1
All
SWE
Incom.
CFD (TURB.)
Baselines – Task-specific models
PINNs
–
0.8130
0.9450
–
–
–
0.0170
–
–
U-Net
2.6700
0.7760
0.3201
–
–
–
0.0830
1.1200
0.7989
FNO
1.4100
0.0091
0.0174
–
–
–
0.0044
0.2574
0.3052
Baselines – Unified pre-training
Table 2: Comparison of the relative L2 -error on the PDEBench subsets used in this work (lower is better). “–” indicates that the result is not reported by the corresponding baseline under the same setting. For the 2D CFD datasets, the parameters (η,ζ)=(0.1,0.1) . The improvement is calculated by the best results of UniFluids and best results of the unified pre-training baselines.
Figure 3: Scaling behavior of validation loss. Validation loss (log scale) across training epochs for UniFluids models of increasing scale (S/M/L/XL). Larger models consistently achieve lower validation loss, and the log-scale axis highlights the widening performance gap as training progresses.
Figure 4: Validation loss versus epoch on CFD fine-tuning (S model), comparing training from scratch (w/o pretrain) and fine-tuning from the foundation checkpoint (w/ pretrain) across 1D/2D/3D.
Method
1D
2D
3D
Adv.
Bur.
CFD
CFD (All)
SWE .
Incom.
CFD (turb.)
x-pred
0.0052
0.0253
0.0267
0.0561
0.0099
0.0553
0.6749
v-pred
0.0706
0.0243
0.0635
0.8197
0.0334
0.5258
0.5545
Table 3: Prediction-target ablation (S model). nRMSE ↓ on representative PDEBench subsets; “2D CFD (All)” averages the four CFD regimes in our suite. ϵ -pred is omitted because training becomes numerically unstable (loss blows up to NaN/Inf under our unified pipeline), so no valid nRMSE can be obtained.
Method
1D CFD
2D CFD
3D CFD
w/o pretrain
0.0269
0.0063
0.5954
w/ pretrain
0.0245
0.0049
0.5456
Reduction (%)
8.9%
22.2%
8.4%
Table 4: In-domain CFD adaptation (S model). nRMSE ↓ . The 2D result is reported on the subset (M,η,ζ)=(1,10−1,10−1) .
Methods
2D-Shock
2D-KH
2D-TOV
FNO
0.7484
1.0891
0.5946
U-Net
1.6667
0.1677
0.4217
MPP-L
0.3243
1.3261
0.3025
UniFluids-XL
0.2160
0.3113
0.2159
Table 5: Zero-shot performance on unseen cases (without fine-tuning). nRMSE ↓ (lower is better).
Appendix figures & tables7 assets
Supplementary material from the paper’s appendix.
Appendix
Subset
Dim
physical variables
N
(T,Ns)
Target Ns
1D_Advection
1D
(Vx)
80000
(201,1024)
1024
1D_Burgers
1D
(Vx)
120000
(201,1024)
1024
1D_CFD (CNS)
1D
(Vx,ρ,p)
50000
(101,1024)
1024
2D_CFD (CNS)
2D
(Vx,Vy,ρ,p)
40000
(21,5122)
1282
diff_react_2d
2D
(u,v)
1000
(101,1282)
1282
swe_pdb
2D
(h)
1000
(101,1282)
1282
Appendix
Table 6: PDEBench subsets used in this work (variables and resolutions). N / T / Ns denote #trajectories, #timesteps, and spatial grid resolution in the PDEBench release; Target Ns is our unified resolution.
Model
d
Le
he
Lj
hj
Params (M)
Encoder/Flow-Matching Operator (M)
S
256
4
4
7
4
22.77
6.11 / 16.66
M
384
6
6
10
6
60.49
15.51 / 44.98
L
512
8
8
14
8
135.31
32.29 / 103.01
XL
1024
8
8
14
8
512.28
119.64 / 392.65
Appendix
Table 7: Model scaling configurations used in this work.
Target resolution
nRMSE ↓
128
0.01077
256
0.01063
512
0.01082
768
0.01099
1024
0.01033
Appendix
Table 8: Multi-resolution evaluation on 1D Burgers (nRMSE ↓ , 110 test samples).
Model
1 step
5 steps
40 steps
UniFluids-S
0.03617 ± 0.00023
0.16240 ± 0.00060
1.26670 ± 0.00355
UniFluids-M
0.05475 ± 0.00594
0.23163 ± 0.01024
1.80871 ± 0.01983
UniFluids-XL
0.06911 ± 0.00062
0.31227 ± 0.00126
2.45982 ± 0.03195
Appendix
Table 9: Inference time (seconds) for one-shot generation of 10 frames on 1D_Advection . Mean ± std over 10 runs.
Figure 5: Prediction results on 1D PDEBench subsets. From left to right: 1D Advection, 1D Burgers, and 1D CFD (compressible Navier–Stokes). Each panel shows rollouts for time steps T+1 to T+6 ; the top row is ground truth and the bottom row is our prediction.
Figure 6: Prediction results on 2D PDEBench subsets. Top row: ground truth; bottom row: our prediction; shown for time steps T+1 to T+6 . We visualize (top-left) 2D CFD (compressible Navier–Stokes), (top-right) reaction–diffusion, (bottom-left) shallow-water equation, and (bottom-right) 2D incompressible Navier–Stokes (with particle tracer).
Figure 7: Prediction results on the 3D CFD subset (compressible Navier–Stokes). We display rollouts for time steps T+1 to T+6 ; the top row shows ground truth and the bottom row shows our prediction.