Generative modeling of granular flow on inclined planes using conditional flow matching
Authors: Xuyang Li, Rui Li, Teng Man, Yimin Lu
Organizations: School of Construction, University of North Carolina at Charlotte, Charlotte, NC 28223, USA · Department of Civil, Environmental, and Construction Engineering, Texas Tech University, Lubbock, TX 79409, USA · College of Civil Engineering, Zhejiang University of Technology, Hangzhou, Zhejiang 310023, China
Granular flows govern many natural and industrial processes, yet their interior kinematics and mechanics remain largely unobservable, as experiments access only boundaries or free surfaces. Conventional numerical simulations are computationally expensive for fast inverse reconstruction, and deterministic models tend to collapse to over-smoothed mean predictions in ill-posed settings. This study, to the best of the authors' knowledge, presents the first conditional flow matching (CFM) framework for granular-flow reconstruction from sparse boundary observations. Trained on high-fidelity particle-resolved discrete element simulations, the generative model is guided at inference by a differentiable forward operator and a novel sparsity-aware gradient guidance mechanism. This mechanism avoids the gradient dilution inherent to standard mean-squared-error approaches, preserves the absolute physical scale of observation errors, enforces measurement consistency without hyperparameter tuning, and prevents unphysical velocity predictions in non-material regions. A physics decoder maps the reconstructed velocity fields to stress states and energy fluctuation quantities, including mean stress, deviatoric stress, and granular temperature. The framework accurately recovers interior flow fields from full observation to only 16% of the informative window, and it remains effective under strongly diluted spatial resolution with only 11% of data. It also outperforms a deterministic CNN baseline in the most ill-posed reconstruction regime and provides spatially resolved uncertainty estimates through ensemble generation. These results demonstrate that conditional generative modeling offers a practical route for non-invasive inference of hidden bulk mechanics in granular media, and it suggests potential applicability for inverse problems in particulate and multiphase systems.
Figures & tables
Figure 1: Numerical modeling and dataset construction. (a) Schematic view of the discrete element method (DEM) model showing the geometry, particle size, coordinate system, and representative surfaces of interest, from the observational boundary (Slice 0) to the other boundary plane (Slice 3). (b) Representative DEM results, showing runout velocity \delimiter69640972\mathchar29048 profile after packing, during the flow, and after flow stops. (c) Demonstration of the grid-averaging scheme that transfers particle-scale information into grid cells , with a grid size of 4 mm. (d) Demonstrative grid-averaged results at \mathchar29044\mathchar12349\mathchar28720\mathchar314\mathchar28723 s used for conditional flow matching, including runout velocity \delimiter69640972\mathchar29048 , granular temperature \mathchar29012 , mean stress \mathchar29040 , and deviatoric stress \mathchar29041 .
Figure 2: Overview of the proposed framework. The architecture integrates (a) a continuous-time probabilistic flow matching backbone as a kinematic prior \mathchar29030 , (b) a differentiable neural forward operator \mathchar29031 with a gradient guidance mechanism for conditional flow matching to infer internal particle dynamics from partial boundary observations, and (c) a physics decoder \mathchar29000 to infer key physical properties from the reconstructed kinematic fields.
Figure 3: Validation of the generative kinematic prior. (a) Empirical cumulative distribution functions (eCDFs) of the three velocity components ( \delimiter69640972\mathchar29048 , \delimiter69640972\mathchar29049 , and \delimiter69640972\mathchar29050 ). (b) Cumulative probability distributions of spatial velocity gradients, including shear strain rates ( \mathchar28941˙\mathchar29048\mathchar24891\mathchar28941˙\mathchar29050 ) and volumetric divergence ( \mathchar626\mathchar8705\delimiter69640972 ). The unguided generative samples show a strong overall match with the DEM ground truth, demonstrating that the model successfully captures both the underlying kinematic distribution and spatial-physical constraints.
Figure 4: Reconstruction of internal velocity fields from full boundary observations at \mathchar29044\mathchar12349\mathchar28720\mathchar314\mathchar28725\mathchar28726 s. The top and bottom rows display the streamwise ( \delimiter69640972\mathchar29048 ) and vertical ( \delimiter69640972\mathchar29050 ) velocity components, respectively. From left to right, the columns present the boundary observation (Slice 0) used as the conditioning input, the DEM ground truth at the deepest internal plane (Slice 3), the corresponding CFM reconstruction, and the absolute error field.
Figure 5: Reconstruction of internal streamwise velocity fields ( \delimiter69640972\mathchar29048 ) from partial boundary observations at \mathchar29044\mathchar12349\mathchar28720\mathchar314\mathchar28725\mathchar28726 s. (a) The masked input boundary observation region, indicated by a pink bounding box. (b) Visualization of the observation window on the boundary (Slice 0) and prediction Slices 1-3. (c) Slice-by-slice comparison across three internal depths (rows: Slices 1, 2, and 3 from top to bottom). The columns display the DEM ground truth with green boxes showing the projection of the boundary observation window, the CFM reconstruction, and the absolute error, respectively. (d) Vertical profiles of velocity ( \delimiter69640972\mathchar29048 ) and shear strain rate ( \mathchar28941˙\mathchar29048 ) at \mathchar29048\mathchar12349\mathchar28720\mathchar314\mathchar28720 m and \mathchar29048\mathchar12349\mathchar28720\mathchar314\mathchar28721 m across two flow stages ( \mathchar29044\mathchar12349\mathchar28720\mathchar314\mathchar28723\mathchar28726 and \mathchar28720\mathchar314\mathchar28727\mathchar28726 s) along \mathchar29050 direction. The plots compare the ground truth and the CFM prediction at two different internal depths (Slice 1 and Slice 3).
Figure 6: End-to-end inference of physical fields from partial boundary observations at \mathchar29044\mathchar12349\mathchar28720\mathchar314\mathchar28725\mathchar28726 s for Slice 3 . (a) Spatial distributions of pressure \mathchar29040 , shear stress \mathchar29041 , and granular temperature \mathchar29012 at the deepest unobservable plane. The columns display the DEM ground truth, the chained CFM prediction, and the absolute spatial error, respectively. (b) Depth-wise profiles of \mathchar29040 , \mathchar29041 , and the effective friction coefficient ( \mathchar28950\mathchar12349\mathchar29041\delimiter68408078\mathchar29040 ) at \mathchar29048\mathchar12349\mathchar28720\mathchar314\mathchar28720 m, comparing the raw data and linear fits between the ground truth and CFM predictions.
Figure 7: Comparison of the reconstructed streamwise velocity ( \delimiter69640972\mathchar29048 ) between the generative CFM framework and the deterministic CNN baseline at the deepest interior plane (Slice 3) for \mathchar29044\mathchar12349\mathchar28720\mathchar314\mathchar28725\mathchar28726 s. The columns display the DEM ground truth, CFM and CNN predictions, and their respective absolute error maps. (a) Results under full boundary observation. (b) Results under severe partial observation.
Figure 8: Uncertainty analysis of the internal flow reconstruction under partial observation at \mathchar29044\mathchar12349\mathchar28720\mathchar314\mathchar28725\mathchar28726 s. (a) Slice-by-slice spatial evaluation across three internal depths, displaying the CFM ensemble mean, absolute error, and pixel-wise standard deviation. (b) 1D velocity propagation profile along the thickness ( \mathchar29049 ) direction extracted at a sample boundary location (marked by the cross ‘ \mathchar8706 ’). The plot compares the depth-wise ground truth velocity (black dashed line) against the CFM ensemble mean (red line) and the full distribution spread of all 25 raw generative ensembles (gray lines).
Figure 9: Ablation study comparing the proposed sparsity-aware guidance (top row) and two baselines: normalized guidance (middle row) and MSE guidance (bottom row) . The columns display the reconstructed velocity field, a zoom-in view of the empty region, and the global absolute error map without background masking. The normalized baseline introduces severe non-physical numerical noise in empty and zero-velocity pixels and corrupts the active flow profile, while the MSE baseline suffers from severe gradient dilution . In contrast , the proposed method accurately maintains sharp material boundaries and absolute zero values in those spaces.
Figure 10: Sensitivity analysis of the reconstruction fidelity under varying observation constraints (evaluated on Slice 3 at \mathchar29044\mathchar12349\mathchar28720\mathchar314\mathchar28721\mathchar28726\mathchar24891\mathchar28720\mathchar314\mathchar28725\mathchar28726\mathchar24891 and \mathchar28720\mathchar314\mathchar28727\mathchar28726 s ). Left: Robustness against restricted spatial coverage, where the horizontal axis represents the varying coverage ratio \mathchar28954 . Representative input conditions at \mathchar28954\mathchar12349\mathchar28720\mathchar314\mathchar28728 and \mathchar28954\mathchar12349\mathchar28720\mathchar314\mathchar28724 are visualized as insets. Right: Robustness against diluted spatial resolution, where the horizontal axis denotes the spatial subsampling stride \mathchar29035 , with insets illustrating the sparse inputs at \mathchar29035\mathchar12349\mathchar28723 and \mathchar29035\mathchar12349\mathchar28727 . In both plots, solid lines with varying color shades represent the active RMSE at different flow stages , and the corresponding dashed lines represent the spatial Pearson correlation \mathchar29042 (right vertical axis).
Appendix figures & tables3 assets
Supplementary material from the paper’s appendix.
Appendix
Figure 11: Velocity field reconstruction under partial boundary observations at additional time steps. (a) Reconstructed slices at \mathchar29044\mathchar12349\mathchar28720\mathchar314\mathchar28721\mathchar28726 s. (b) Reconstructed slices at \mathchar29044\mathchar12349\mathchar28720\mathchar314\mathchar28723\mathchar28726 s. Both panels compare the DEM ground truth, the generative prediction, and the absolute spatial error across three distinct internal depths.
Figure 12: Sensitivity analysis of the reconstruction fidelity evaluated on Slice 2 across three different macroscopic flow stages ( \mathchar29044\mathchar12349\mathchar28720\mathchar314\mathchar28721\mathchar28726\mathchar24891\mathchar28720\mathchar314\mathchar28725\mathchar28726\mathchar24891 and \mathchar28720\mathchar314\mathchar28727\mathchar28726 s). The relative degradation patterns remain consistent with the deepest slice.
Figure 13: Sensitivity analysis of the reconstruction fidelity evaluated on Slice 1 across three different macroscopic flow stages ( \mathchar29044\mathchar12349\mathchar28720\mathchar314\mathchar28721\mathchar28726\mathchar24891\mathchar28720\mathchar314\mathchar28725\mathchar28726\mathchar24891 and \mathchar28720\mathchar314\mathchar28727\mathchar28726 s). This slice is closest to the observation boundary, yielding the lowest absolute reconstruction errors while maintaining the same robustness threshold.
Reconstructing PDE-governed fields from sparse and irregular measurements is challenging due to their ill-posed nature. Deterministic surrogates are trained on dense fields that struggle with limited measurements and uncertainty quantification. Generative models, by learning distributions over spatiotemporal fields, can better handle sparsity and uncertainty. However, existing generative approaches enforce data consistency and PDE constraints simultaneously via sampling-time gradient guidance, resulting in slow and unstable inference. To this end, we propose PerFlow, a Physics-embedded rectified Flow for efficient sparse reconstruction and uncertainty quantification of spatiotemporal dynamics. PerFlow decouples observation conditioning from physics enforcement, performing guidance-free conditioning by feeding observations into rectified-flow dynamics while embedding hard physics via a constraint-preserving projection (e.g., incompressibility or conservation). Theoretically, we establish invariance guarantees to ensure that trajectories remain on the physics-consistent manifold throughout sampling. Experiments on various PDE systems demonstrate competitive reconstruction accuracy with sound physics consistency, while enabling efficient conditional sampling (e.g., 50 steps) and up to 320x faster inference than 2000-step guided diffusion baselines.
Hao Zhou, Rui Zhang, Han Wan +1
Gaoling School of Artificial Intelligence, Renmin University of China
Reconstructing PDE solutions from sparse observations is a core challenge in scientific computing. We present FM4PDE, a flow-matching generative framework that learns the joint distribution of PDE coefficients (or initial states) and solutions (or final states), enabling both forward simulation and inverse recovery with limited paired data. At inference, sampling is guided by a composite loss that enforces agreement with sparse measurements and reduces the PDE residual; we support deterministic, stochastic, and hybrid samplers. We provide error guarantees for these guided procedures. For the deterministic optimizer, a coercivity condition ensures trajectory boundedness and a phase-wise contraction yields logarithmic complexity in the target accuracy. For the stochastic sampler, we introduce adaptive guidance and assume dissipativity of the velocity field to obtain uniform moment bounds independent of the noise-floor parameter. This leads to polynomial-time error bounds, and a matching lower bound shows constant guidance induces an unavoidable positive bias, motivating adaptivity. A hybrid deterministic-stochastic analysis is also provided. Experiments on static and time-dependent benchmark PDEs demonstrate competitive accuracy and faster inference than diffusion-based generative models.
Xifeng Zhang, Jin Zhao
School of Mathematical Science Capital Normal University Beijing, 100048, China · Academy for Multidisciplinary Studies Capital Normal University2026 Beijing, 100048, China
This study presents a conditional flow matching framework for solving physics-constrained Bayesian inverse problems. In this setting, samples from the joint distribution of inferred variables and measurements are assumed available, while explicit evaluation of the prior and likelihood densities is not required. We derive a simple and self-contained formulation of both the unconditional and conditional flow matching algorithms, tailored specifically to inverse problems. In the conditional setting, a neural network is trained to learn the velocity field of a probability flow ordinary differential equation that transports samples from a chosen source distribution directly to the posterior distribution conditioned on observed measurements. This black-box formulation accommodates nonlinear, high-dimensional, and potentially non-differentiable forward models without restrictive assumptions on the noise model. We further analyze the behavior of the learned velocity field in the regime of finite training data. Under mild architectural assumptions, we show that overtraining can induce degenerate behavior in the generated conditional distributions, including variance collapse and a phenomenon termed selective memorization, wherein generated samples concentrate around training data points associated with similar observations. A simplified theoretical analysis explains this behavior, and numerical experiments confirm it in practice. We demonstrate that standard early-stopping criteria based on monitoring test loss effectively mitigate such degeneracy. The proposed method is evaluated on several physics-based inverse problems. We investigate the impact of different choices of source distributions, including Gaussian and data-informed priors. Across these examples, conditional flow matching accurately captures complex, multimodal posterior distributions while maintaining computational efficiency.
Agnimitra Dasgupta, Ali Fardisi, Mehrnegar Aminy +4
Department of Aerospace & Mechanical Engineering, University of Southern California, Los Angeles, 90089, California, USA · Optimization and Uncertainty Quantification, Sandia National Laboratories, Albuquerque, 87123, New Mexico, USA