Drifting Models for Surrogate Flow Modeling 1
Chris R. Jung† ; 1 Markus Dörr† ; 2 Natalie Jüngling; 2 Jennifer Niessner; 1 Adam T. Müller‡* ; 1 Nicolaj C. Stache‡ 1
2
Center for Machine Learning (ZML) Institute for Flow in Additively Manufactured Porous Structures (ISAPS) Heilbronn University of Applied Sciences, 74081 Heilbronn, Germany
arXiv:2606.07481v1 [cs.LG] 5 Jun 2026
Abstract While Computational Fluid Dynamics (CFD) provides high-fidelity flow fields for optimizing indoor environments, its computational cost limits rapid exploration. To solve this problem generative surrogates offer better distribution modeling than deterministic networks, but iterative sampling is slow. To enable high-quality, single-pass generation, we adapt the novel generative drifting framework to fluid mechanics. We introduce a conditional architecture that performs drifting in a learned VAE latent space and uses label-aware masking to align generated samples with their boundary conditions. Our label-conditioned model matches iterative diffusion in accuracy and flow consistency while running two orders of magnitude faster. Additionally, we propose a spatial-conditioning variant that establishes a promising path towards generalization to unseen geometries. Ultimately, conditional drifting serves as a highly efficient alternative to diffusion based approaches, unlocking real-time CFD surrogates where inference speed is critical. Keywords: drifting models; generative surrogate modeling; indoor flow prediction; data-driven fluid dynamics
1. Introduction Indoor air quality (IAQ) is critical for human health, since humans typically spend most of their time in indoor environments [1]. Ventilation (e.g. window ventilation or mechanical ventilation) effectively decreases the concentration of all indoor contaminants. Designing them efficiently requires an accurate understanding of complex indoor airflow patterns, which are highly sensitive to room geometry, inlet locations, and flow velocities [2, 3]. While Computational Fluid Dynamics (CFD) provides the high-fidelity flow fields necessary to optimize such environments [4], its notable computational cost precludes rapid design exploration and real-time ventilation control [5, 6]. This creates a need for data-driven surrogate models capable of delivering reliable predictions with reduced computational demands [7]. While deterministic architectures like Fourier Neural Operators (FNOs) [8] and coordinate-based networks [9] offer rapid inference, capturing environments with complex multimodal flow distributions remains challenging. Generative approaches, such as diffusion models, successfully capture this physical complexity. However, their iterative nature makes inference computationally heavy [10]. In this work, we explore the potential of adapting novel generative modeling via drifting [11] to the domain of fluid mechanics. Originally designed to evolve pushforward distributions during training to enable high-quality, one-step generation without iterative inference, we demonstrate an adapted conditional drifting architecture on 2D indoor flow modeling as a foundational proof-of-concept. Our main contributions are as follows: (1) We prove that conditional drifting models can accurately and efficiently generate flow fields in a single step. (2) We introduce essential modifications for physical conditioning, namely latent-space drifting via a learned Variational Autoencoder (VAE) and label-aware positive masking to enforce boundary conditions. (3) We develop a spatial encoding variant to explore generalization across unseen room geometries. 2. Related Work Data-Driven Surrogates for Flow Prediction. Deep learning architectures, including convolutional neural networks (e.g., U-Nets) and FNOs [9, 12], are increasingly used as surrogates of traditional CFD solvers [8, 9]. While deterministic surrogates can offer dramatic inference speedups and establish strong global flow priors, they are mostly designed to minimize standard regression losses like Mean Squared Error. Consequently, such surrogates tend to predict a smoothed expectation of the flow. This can fail to capture the complex, high-frequency, and multimodal distributions characteristic of indoor environments, where minor variations in boundary conditions or obstacles dictate drastically different, yet equally valid, flow regimes [2]. Generative Modeling for Physical Dynamics. To address this smoothing and enable uncertainty-aware predictions, generative architectures have gained traction. Diffusion model based approaches have been
†
Equal contribution, ‡ Equal senior contribution *Corresponding Author, Adam T. Müller, [email protected]
established as surrogates for aerodynamic simulations, successfully capturing complex, physically plausible flows [10]. Advanced autoregressive variants extend these capabilities to temporal predictions [13]. However, diffusion relies on an iterative denoising process. The resulting hundreds of neural function evaluations (NFE) render generation computationally heavy, contradicting the goal of rapid surrogate modeling. Flow matching approaches reduce this burden by learning continuous-time conditional flows, requiring fewer sampling steps while extending to unstructured geometries [14, 15]. Nevertheless, flow matching still relies on numerically integrating an ordinary differential equation during inference [16]. To bypass such iterative sampling, we build upon the recently introduced framework of generative modeling via drifting [11]. Originally designed for image generation and grounded in optimal transport [17], drifting evolves pushforward distributions during training. By enabling high-quality, one-step generation (NFE = 1), it provides a promising foundation for rapid fluid surrogates. 3. Method 3.1. Fundamentals of Drifting Models. A drifting model [11] is a single-pass network f : RC → RD that maps a prior sample ϵ ∼ pϵ to an output x = f (ϵ), inducing a pushforward distribution q = f# pϵ that is trained to match the data distribution p. Rather than learning an iterative noise-to-data trajectory as in diffusion or flow matching, drifting models evolve q at training time through a drifting field Vp,q (x) that prescribes, at each iteration, the direction in which a generated sample should move so that q approaches the data distribution p. The field is constructed to satisfy Vp,q (x) = 0 whenever q = p, so equilibrium coincides with distribution matching. Training thus reduces to a fixed-point update fθi+1 (ϵ) ← fθi (ϵ) + Vp,qθi (fθi (ϵ)), realised as the stop-gradient loss: 2 L = Eϵ fθ (ϵ) − stopgrad fθ (ϵ) + Vp,qθ (fθ (ϵ)) . (1) In practice Vp,q is instantiated as a kernel-based attraction–repulsion field driven by positive samples drawn from the data and negative samples from q , with the negative samples maintained in a memory bank to amortise their cost across iterations. As fθ is a single-pass network, inference is one-step (NFE=1), in contrast to the multi-step solvers required by diffusion and flow-based baselines. 3.2. Adjustments for Surrogate Modelling We adapt the original drifting model along three axes that reflect the different demands of CFD surrogate modelling compared to natural-image generation: the operating space, the conditioning interface, and the construction of the drifting field. Latent-space drifting via a learned VAE. Unlike the original work using an ImageNet-pretrained MAE, we trained a convolutional VAE on our simulation data to ensure a domain-specific feature extractor. The VAE maps 64 × 64 velocity fields to a 4 × 4 × 16 latent representation z = E(u) with encoder E . By performing drifting within this compact, semantically organized latent space and reconstructing via the decoder D, we maintain structural integrity while avoiding suboptimal pre-trained features. Conditioning. Whereas the original generator is conditioned on a single class label, each of our samples carries a condition comprising the inlet position, the outlet position, the room geometry, and a scalar inlet velocity magnitude vin ∈ R. We investigate two encoder variants that differ in how the geometric information is presented to the network: • Label-based. The label-based variant treats inlet and outlet as discrete identifiers (inlet id, outlet id) ∈ N, drawn from a fixed catalogue of room configurations and embeds each through a learned embedding table. The room geometry is implicit in the identifier. The label-based variant is restricted to the configurations enumerated in its embedding table. • Spatial. The spatial variant replaces these identifiers with a three-channel binary mask M with 3 × H × W that explicitly encodes the inlet, outlet, and obstacle locations on the simulation grid, and processes it through a small convolutional encoder that produces a fixed-dimensional vector. The spatial variant is more flexible than the label-based variant and can theoretically generalise better to arbitrary room layouts, including geometries unseen during training. In both cases vin is embedded by a small Multilayer Perceptron (MLP) and summed with the geometry embedding, where the resulting conditioning vector c drives the adapted Diffusion Transformer (DiT) backbone [18].
Label-aware positive masking. To adapt the kernelized drifting formulation [11] to our data-sparse setting, we introduced a binary compatibility mask. Unlike the original work [11], which assumes large pools of ground-truth samples per class and processes them in uniform batches, our approach allows mixed conditions within a batch. We gate the attraction kernel by matching (inlet, outlet, geometry) triples, ensuring generated samples only drift toward compatible positives. While the global repulsion term remains unchanged, this masking prevents the attraction term from averaging across incompatible flow regimes, which would otherwise force samples toward a condition-agnostic mean. 3.3. Latent Diffusion Baseline. We adopted a Latent Diffusion Model baseline [19] inspired by Liu and Thuerey’s state-of-the-art work in RANS-based surrogates [20]. Operating in the same 4×4 latent space as our drifting model, we used a lightweight DiT with a 1,000-step cosine schedule. To adapt the model for physical surrogates, we integrated heterogeneous boundary conditions and inflow parameters via cross-attention layers. Inference utilized DDIM sampling. 4. Experiments 4.1. Experimental Setup Training data comprised 2,025 two-dimensional CFD simulations using a steady-state solver executed in Simcenter STAR-CCM+ using a RANS k-ϵ turbulence model for incompressible air flow. The computational domain consisted of a square room measuring 1.5 m × 1.5 m. In each simulation, one 0.1 m wide inlet and one 0.1 m wide outlet were active, located on opposite walls. We evaluated three distinct geometric configurations: an empty room without obstacles, and two configurations containing an obstacle with a diameter of 0.25 m. This obstacle was positioned either squarely in the center of the domain or offset laterally. For each geometry, we systematically swept 15 inlet positions, 15 outlet positions, and three constant inlet velocities (0.1, 0.2, and 0.3 m/s), resulting in 675 simulations per configuration. The outlet was defined as an atmospheric pressure outlet. The domain was discretized using a polyhedral mesh, with near-wall prism layers applied around the obstacle, while all walls were treated as no-slip wall boundaries. Achieving convergence typically required 750-800 seconds of CPU time per simulation. Following convergence to a steady state, the final flow fields were averaged over the last 100 iterations to mitigate residual numerical fluctuations. Finally, these high-fidelity velocity vectors were interpolated onto a 64×64 uniform grid, with a randomly sampled 10% of the complete dataset reserved as the held-out test set. 4.2. Metrics We evaluate the predicted velocity field û = (û, v̂) against the ground truth u = (u, v) along two axes: field accuracy and flow-structure consistency. All metrics are computed per sample and reported as mean ± standard deviation over the test set. Field accuracy. Following established relative-RMSE metrics in CFD-surrogate evaluation [21], we report the range-normalised RMSE (nRMSE), in which the per-sample RMSE is normalised by the target field’s range. As a scale-free complement we report the coefficient of determination (R2 ), a standard measure of explained variance in indoor-airflow surrogates [22, 23]. To capture directional agreement independently of magnitude, we additionally report the cosine similarity between predicted and target vector fields over locations with non-negligible target velocity, which is sensitive to directional disagreement that nRMSE penalises only indirectly [23]. Flow-structure consistency. To probe whether predictions preserve the structural properties of the reference fields, we report two differential diagnostics. We monitor the vorticity as structural quantity relative to the ground truth [12, 24], to detect over- or under-smoothing of rotational structure. As a complementary diagnostic we monitor the divergence relative to the ground truth; while divergence is often used as a structural constraint in physics-informed learning [25], we employ it as a passive diagnostic against the target divergence. For both quantities we report the gap between predicted and target magnitudes and the predicted-to-target ratio as a measure of relative structural fidelity.
4.3. Results 4.3.1. Quantitative Table 1 reports the field-accuracy and flow-structure metrics for the diffusion baseline (chapter 3.3) and the two drifting variants on the held-out test set. The diffusion baseline is the strongest model overall, the label-based drifting variant trails it by a small margin, and the spatial drifting variant comes in third with significantly higher variance. Table 1 Quantitative comparison between the diffusion baseline and our drifting model with label-based and spatial conditioning. The metrics were calculated on obstacle-free test data in pixel space. Category
Metric
Diffusion (baseline)
Drifting (label)
Drifting (spatial)
Field accuracy
nRMSE (range) ↓ R2 ↑ Cos. sim. ↑
0.0592 ± 0.0204 0.8476 ± 0.1228 0.8108 ± 0.0576
0.0684 ± 0.0209 0.8019 ± 0.1152 0.7772 ± 0.0661
0.1076 ± 0.0453 0.4251 ± 0.4783 0.7846 ± 0.1122
Flow-struct. consistency
Div. gap (pred vs. target) ↓ Relative divergence ↓ Vort. gap (pred vs. target) ↓ Relative vorticity ↓
0.4503 ± 0.0849 8.0713 ± 2.1104 0.2895 ± 0.1290 1.1635 ± 0.0820
0.4224 ± 0.0842 7.5579 ± 1.6388 0.2634 ± 0.1312 1.1449 ± 0.0861
0.4680 ± 0.3316 8.2887 ± 5.4017 0.5519 ± 0.4618 1.3127 ± 0.2789
Field accuracy. The gap between diffusion and label-based drifting is moderate, supporting our central claim that a single-pass drifting generator can reach competitive accuracy. The spatial variant sacrifices a substantial amount of pixel fidelity, particularly on the nRMSE of 0.108 versus 0.059 for the label variant. Cosine similarity shows a smaller gap, indicating that all three models recover the dominant flow direction even where their magnitudes disagree. Flow-structure consistency. The label-based drifting model is competitive with the diffusion baseline. It has a smaller divergence gap (0.422 vs. 0.450) and a closer relative-vorticity ratio (1.14 vs. 1.16). The spatial variant again lags, with a vorticity gap that roughly doubles (0.552) and a relative vorticity ratio of 1.31, indicating systematic over-prediction of rotational structure. The increased standard deviations in the spatial column further suggest that the failure mode is concentrated on a subset of geometries rather than spread uniformly across the test set. Although the label-based drifting model yields stronger quantitative results in our experiments, its reliance on enumerated training configurations limits its flexibility. We view the spatial encoding as the long-term interface for this class of surrogate, as it fundamentally generalizes to unseen room geometries. We attribute the current performance gap to the foundational nature of this implementation, anticipating that future hyperparameter tuning and encoder refinements will naturally improve accuracy. Inference speed. We measured per-sample inference latency on a single NVIDIA A100, timing the full inference pipeline with CUDA events. Under this protocol, the drifting model is two orders of magnitude faster than the diffusion baseline (table 2). The low standard deviations confirm that both distributions are tight and outlier-free. The current gap reflects a comparison in a less optimised regime. However, the structural advantages of single-pass inference are clearly visible. Table 2 Per-sample inference latency on a single NVIDIA A100-SXM4 (80 GB) GPU at batch size 1, over 1000 runs after 50 warmup iterations. Model
Conditioning
NFE
Latency (ms)
Diffusion Drifting
label-based label-based
1000 1
1870.2 ± 77.1 6.74 ± 0.36
4.3.2. Qualitative In the empty-room scenario (figure 1), both the diffusion baseline and label-based drifting model successfully recover the primary flow topology, including the dominant jet and corner recirculation zones. Although being a single-pass generator, the drifting model (row 1) achieves high structural fidelity. While diffusion (row 2) shows slightly lower peak errors within the jet, the drifting model’s error distribution is comparably low across most of the domain. This confirms that drifting can match iterative
Figure 1 Comparison of predicted velocity fields for the empty-room configuration. (a) is the ground-truth flow field from CFD, (b) the predicted velocity vector fields for (1) label-based drifting model and (2) diffusion baseline, respectively. (c) illustrates the absolute velocity magnitude error compared to the CFD ground truth. Both models were conditioned on an inlet velocity of 0.20 m/s with identical inlet (blue) and outlet (yellow) positions.
Figure 2 Comparison of two pairs of velocity fields generated by the drifting model with spatial conditioning. Within each pair, the ground-truth simulation is on the left and the model prediction is on the right. Both cases utilize fixed inlet (7) and outlet (8) positions. The left pair features a left-offset obstacle with inlet velocity of 0.3 m/s, while the right pair features a centered obstacle with inlet velocity 0.1 m/s.
diffusion performance with lower computational cost while preserving essential physics. Both models exhibit peak errors at jet boundaries, likely due to spatial compression within the VAE architecture. Figure 2 illustrates the spatial-conditioning variant’s performance with obstacles. While trailing the label-based approach (see table 1), the spatial encoded model captures essential topology, including the primary jet trajectory, flow splitting, and boundary separation around the cylinder. It also reasonably approximates wake and corner recirculation locations. The primary discrepancy is in velocity scaling, where the model produces localized over-predicted speed and rotational structures. These errors directly align with the elevated relative vorticity metrics observed in the quantitative analysis. 5. Limitations Our evaluations focus on 2D steady-state flows on fixed grids to isolate generative fundamentals. However, the dataset’s sparsity limits the kernel-based drifting field’s potential. Extending to transient 3D flows and multi-state datasets will better leverage the model’s distribution-matching and NFE=1 efficiency. Performance is currently limited by the VAE’s 16× spatial compression; closing the gap to diffusion requires optimizing latent resolution and patch size. Additionally, the spatial conditioning variant’s lag likely stems from lossy geometry mask compression, suggesting a need for richer interfaces like cross-attention. Finally, drifting’s two-order-of-magnitude speed advantage is an inherent structural property, providing predictable, high-speed inference without the quality-speed trade-offs of distilled diffusion. Future benchmarks should include tuned models and direct-regression surrogates to further validate drifting’s utility in steady-state environments.
6. Conclusion By adapting a drifting model to 2D steady-state CFD, we achieved performance closely matching a 1000step diffusion baseline. Although running two orders of magnitude faster, the label-conditioned drifting variant produced an normalised RMSE of 0.068 compared to the baseline’s 0.059. While diffusion remains more accurate, the narrow gap makes single-step drifting a viable surrogate for cost-constrained applications. Our methodological contributions, latent-space drifting, spatial-scalar conditioning, and label-aware attraction masks, provide a reusable framework for scientific computing surrogates. Future work will target the spatial-conditioning gap and extend the model to transient 3D regimes to solidify drifting as a competitive generative surrogate. References [1] Carmela Concilio et al. “CFD simulation study and experimental analysis of indoor air stratification in an unventilated classroom: A case study in Spain”. In: Heliyon 10.12 (June 30, 2024). DOI: 10.1016/j.heliyon.2024.e32721. [2] Zhang Lin et al. “CFD study on effect of the air supply location on the performance of the displacement ventilation system”. In: Building and Environment 40.8 (Aug. 1, 2005), pp. 1051–1067. DOI: 10.1016/j.buildenv.2004.09.003. [3] Ihab Hasan Hatif, Azian Hariri, and Ahmad Fu’ad Idris. “CFD Analysis on Effect of Air Inlet and Outlet Location on Air Distribution and Thermal Comfort in Small Office”. In: CFD Letters 12.3 (2020), pp. 66–77. ISSN: 2180-1363. [4] Fatih Topak et al. “Collective comfort optimization in multi-occupancy environments by leveraging personal comfort models and thermal distribution patterns”. In: Building and Environment 239 (2023), p. 110401. DOI: 10.1016/j.buildenv. 2023.110401. [5] Yuexin Bian, Oliver Schmidt, and Yuanyuan Shi. “Operator learning for energy-efficient building ventilation control with computational fluid dynamics simulation of a real-world classroom”. In: Applied Energy 404 (Feb. 1, 2026), p. 127035. ISSN: 0306-2619. DOI: 10.1016/j.apenergy.2025.127035. [6] Adrian Tobisch et al. “Reducing indoor particle exposure using mobile air purifiers—Experimental and numerical analysis”. In: AIP Advances 11.12 (Dec. 9, 2021), p. 125114. ISSN: 2158-3226. DOI: 10.1063/5.0064805. [7] Rui Mao et al. “Rapid CFD Prediction Based on Machine Learning Surrogate Model in Built Environment: A Review”. In: Fluids 10.8 (Aug. 2025), p. 193. ISSN: 2311-5521. DOI: 10.3390/fluids10080193. [8] Tanya Marwah et al. “Deep Equilibrium Based Neural Operators for Steady-State PDEs”. In: Advances in Neural Information Processing Systems 36 (Dec. 15, 2023), pp. 15716–15737. [9] Adam T. Müller et al. “Reducing Experimental Testing in Space Propulsion Film Cooling Analyses by Pixelwise Generative Image Interpolation”. In: EUCASS (2025). DOI: 10.13009/EUCASS2025-285. [10] Dongyu Luo et al. “DiffFluid: Plain Diffusion Models are Effective Predictors of Flow Dynamics”. In: arXiv arXiv:2409.13665 (Sept. 20, 2024). DOI: 10.48550/arXiv.2409.13665. arXiv: 2409.13665[cs.LG]. [11] Mingyang Deng et al. “Generative Modeling via Drifting”. In: arXiv arXiv:2602.04770 (Feb. 6, 2026). DOI: 10.48550/ arXiv.2602.04770. arXiv: 2602.04770[cs]. [12] Zongyi Li et al. “Fourier Neural Operator for Parametric Partial Differential Equations”. In: arXiv (2020). [13] Georg Kohl, Li-Wei Chen, and Nils Thuerey. “Benchmarking autoregressive conditional diffusion models for turbulent flow simulation”. In: Neural Networks 199 (July 1, 2026), p. 108641. DOI: 10.1016/j.neunet.2026.108641. [14] Giacomo Baldan et al. “Physics vs Distributions: Pareto Optimal Flow Matching with Physics Constraints”. In: The Fourteenth International Conference on Learning Representations (Oct. 8, 2025). [15] David Ramos et al. “FluidFlow: a flow-matching generative model for fluid dynamics surrogates on unstructured meshes”. arXiv.org. In: arXiv (Mar. 30, 2026). [16] Yaron Lipman et al. “Flow Matching for Generative Modeling”. arXiv.org. In: arXiv (Oct. 6, 2022). [17] Ping He et al. “Sinkhorn-Drifting Generative Models”. arXiv.org. In: arXiv (Mar. 12, 2026). [18] William Peebles and Saining Xie. “Scalable Diffusion Models with Transformers”. In: 2023 ICCV. Paris, France: IEEE, Oct. 1, 2023, pp. 4172–4182. DOI: 10.1109/ICCV51070.2023.00387. [19] Robin Rombach et al. “High-Resolution Image Synthesis with Latent Diffusion Models”. In: arXiv e-prints, arXiv:2112.10752 (Dec. 2021), arXiv:2112.10752. DOI: 10.48550/arXiv.2112.10752. arXiv: 2112.10752 [cs.CV]. [20] Qiang Liu and Nils Thuerey. “Uncertainty-aware Surrogate Models for Airfoil Flow Simulations with Denoising Diffusion Probabilistic Models”. In: arXiv (Dec. 2023). DOI: 10.48550/arXiv.2312.05320. [21] Reza Behrou et al. “Physics-informed multi-fidelity surrogate modeling of fluid flow in porous media”. In: APL Machine Learning 3.3 (Sept. 8, 2025), p. 036116. ISSN: 2770-9019. DOI: 10.1063/5.0279064. [22] Ibrahim Reda et al. “Rapid indoor airflow prediction using a hybrid residual learning regression model”. In: Energy and Buildings 352 (Feb. 1, 2026), p. 116827. ISSN: 0378-7788. DOI: 10.1016/j.enbuild.2025.116827. [23] Wentao Wang et al. “Condition monitoring of axial piston pumps based on machine learning-driven real-time CFD simulation”. In: Engineering Applications of Computational Fluid Mechanics 19.1 (Dec. 31, 2025), p. 2474676. ISSN: 1994-2060. DOI : 10.1080/19942060.2025.2474676. [24] Dmitrii Kochkov et al. “Machine learning–accelerated computational fluid dynamics”. In: Proceedings of the National Academy of Sciences 118.21 (May 25, 2021), e2101784118. DOI: 10.1073/pnas.2101784118. [25] Arvind T. Mohan et al. “Embedding Hard Physical Constraints in Convolutional Neural Networks for 3D Turbulence”. In: ICLR 2020 Workshop on Integration of Deep Neural Models and Differential Equations. Feb. 26, 2020.