FluidFlow: a flow-matching generative model for fluid dynamics surrogates on unstructured meshes
Authors: David Ramos, Lucas Lacasa, Fermín Gutiérrez, Eusebio Valero, Gonzalo Rubio
Organizations: ETSIAE-UPM-School of Aeronautics, Universidad Politécnica de Madrid, Plaza Cardenal Cisneros 3, E-28040 Madrid, Spain · Institute for Cross-Disciplinary Physics and Complex Systems (IFISC, CSIC-UIB), 07122 Palma de Mallorca (Spain) · Center for Computational Simulation, Universidad Politécnica de Madrid, Campus de Montegancedo, Boadilla del Monte, 28660 Madrid, Spain
Computational fluid dynamics (CFD) provides high-fidelity simulations of fluid flows but remains computationally expensive for many-query applications. In recent years deep learning (DL) has been used to construct data-driven fluid-dynamic surrogate models. In this work we consider a different learning paradigm and embrace generative modelling as a framework for constructing scalable fluid-dynamics surrogate models. We introduce FluidFlow, a generative model based on conditional flow-matching, a recent alternative to diffusion models that learns deterministic transport maps between noise and data distributions. FluidFlow is specifically designed to operate directly on CFD data defined on both structured and unstructured meshes alike, without the needs to perform any mesh interpolation pre-processing and preserving geometric fidelity. We assess the capabilities of FluidFlow using two different core neural network architectures, a U-Net and diffusion transformer (DiT), and condition their learning on physically meaningful parameters. The methodology is validated on two benchmark problems of increasing complexity: prediction of pressure coefficients along an airfoil boundary across different operating conditions, and prediction of pressure and friction coefficients over a full three-dimensional aircraft geometry discretized on a large unstructured mesh. In both cases, FluidFlow outperform strong multilayer perceptron baselines, achieving significantly lower error metrics and improved generalisation across operating conditions. Notably, the transformer-based architecture enables scalable learning on large unstructured datasets while maintaining high predictive accuracy. These results demonstrate that flow-matching generative models provide an effective and flexible framework for surrogate modelling in fluid dynamics, with potential for realistic engineering and scientific applications.
Figures & tables
Figure 1: U-Net architecture and its main components.
Figure 2: One-dimensional patchification used in the diffusion transformer.
Model
mse
rmse
mae
mre (%)
ae_95
ae_99
R2
Relative L2
Vanilla MLP
0.00129
0.03598
0.01763
16.85219
0.05716
0.14176
0.99730
0.04911
FluidFlow (U-Net)
0.00009
0.00961
0.00240
4.48810
0.00761
0.03175
0.99981
0.01325
FluidFlow (DiT)
0.00009
0.00953
0.00249
3.43723
0.00764
0.03246
0.99981
0.01314
Table 1: Generalisation performance comparison for the airfoil task.
Figure 3: Scatter plots of the true vs predicted pressure coefficient, for all locations and operating conditions in the airfoil’s test set. Color codes the magnitude of the residuals.
Figure 4: Examples of predicted and reference airfoil pressure distributions for different operating conditions.
s
mse
rmse
mae
mre (%)
ae_95
ae_99
R2
Relative L2
1.0
0.000110
0.0105
0.00289
3.520
0.00920
0.0360
0.99977
0.0145
1.5
0.000092
0.0096
0.00252
3.089
0.00766
0.0339
0.99980
0.0132
2.0
0.000091
0.0095
0.00249
3.043
0.00764
0.0325
0.99981
0.0131
2.5
0.000094
0.0097
0.00254
3.118
0.00793
0.0321
0.99980
0.0134
3.0
0.000100
0.0100
0.00261
3.205
0.00824
0.0319
0.99979
0.0138
4.0
0.000113
0.0106
0.00278
3.393
0.00900
0.0306
0.99976
0.0146
Table 2: DiT-based flow-matching model performance metrics across different CFG guidance scales s , for the airfoil case, showing minor dependence on s .
Model
R2
RCp2
RCf,x2
RCf,y2
RCf,z2
MLP [ 34 ]
0.956
0.972
0.944
0.951
0.957
FluidFlow (DiT)
0.965
0.974
0.959
0.960
0.965
Table 3: Comparison of the performance of FluidFlow with the baseline MLP model [ 34 ] for the 3D aircraft task.
MSE
RMSE
MAE
MRE
ae_95
ae_99
R2
Relative L2
0.0013
0.0358
0.0065
23.4211%
0.0271
0.1229
0.9659
0.1835
Table 4: Additional performance metrics for FluidFlow on the 3D aircraft case in the ONERA CRM WBPN dataset (full 3D geometry).
Figure 5: Comparison between (ground true) CFD pressure/friction coefficient fields (top panels) and the prediction generated by the DiT flow-matching model (bottom panels) for one particular operating condition with parameters pi=1×105,M∞=0.3 and AoA=−6\textordmasculine .
Appendix figures & tables5 assets
Supplementary material from the paper’s appendix.
Appendix
Parameter
Value
Optimizer
Adam
Loss function
Mean Squared Error (MSE)
Activation function
ELU
Weight initialization
Xavier uniform
Initial learning rate
1.47×10−3
Learning rate scheduler
Step scheduler (step size = 1 epoch)
Appendix
Table 5: Summary of the MLP architecture, training configuration, and optimized hyperparameters.
Parameter
Value
Blocks dim
[128, 256, 512]
Num. attention heads
8
Attention hidden dim
512
pdrop
0.2
Total parameters
43.2M
Training steps
200000
Appendix
Table 6: Neural network and training hyperparameters of the U-Net architecture on the airfoil case.
Parameter
Value
Num. blocks
6
Num. heads
4
Hidden dim
128
Patch size
1
MLP ratio
2.5
pdrop
0.2
Appendix
Table 7: Neural network and training hyperparameters of the Diffusion Transformer architecture on the airfoil case.
Parameter
Value
Num. blocks
12
Num. heads
8
Hidden dim
256
Patch size
1
MLP ratio
4
pdrop
0.2
Appendix
Table 8: Neural network and training hyperparameters of the Diffusion Transformer architecture on the 3D aircraft case.
Figure 6: Strong scaling speed-up of the DiT model for the aircraft dataset as a function of the number of GPUs.
Center for Machine Learning (ZML) 2Institute for Flow in Additively Manufactured Porous Structures (ISAPS) Heilbronn University of Applied Sciences, 74081 Heilbronn, Germany
AI for Image-Guided Diagnosis and Therapy, Technical University of Munich · Munich Center for Machine Learning (MCML) · AI in Healthcare and Medicine, Technical University of Munich +1