Abstract
Fluid simulation is a well-established research field in computer graphics that aims to generate realistic and visually appealing simulations of fluids, including water, smoke, and fire. Divergence is identified as a crucial factor in achieving realistic fluid behavior. This article presents a GPU optimization of the pointwise incompressible fluid simulation technique, which uses pointwise incompressible velocity interpolation to ensure divergence at arbitrary points, rather than grid cells. Pointwise incompressible velocity interpolation at arbitrary points is the curl of velocity potential. The velocity potential can be obtained from the divergence-free velocities by solving a Poisson equation. To enhance the computational efficiency of the simulation, an odd–even geometric multigrid method is introduced to solve Poisson’s equation on non-power-of-2 resolution grids. Additionally, to recover the potential on grid cells, a warp-level method is proposed via divergence-free velocities on grid cells. The proposed warp-level potential recovery method offers GPU optimization and enhanced efficiency, in contrast to the sweeping method that only provides CPU optimization for potential recovery. Furthermore, a locally enhanced method is proposed to recover the detailed velocity potential within small domains through the use of the odd–even multigrid. The experiments show that the odd–even multigrid outperforms Weber’s multigrid by an average speedup factor of 4.32 across various grid sizes. On the other hand, the warp-level potential recovery method demonstrates notable speedups ranging from approximately 2–6 times for 2D grids and about 1.35–2.64 times for 3D grids when compared to the parallel sweeping method on GPU. The results of these contributions demonstrate remarkable improvements in the efficiency and performance of fluid simulations in computer graphics, harnessing the computational capabilities of modern GPUs to achieve visually appealing and realistic fluid behaviors.
Similar content being viewed by others
References
Stam, J.: Stable fluids. In: In Proceedings of the 26th Annual Conference on Computer Graphics and Interactive Techniques (SIGGRAPH ’99). ACM Press/Addison-Wesley Publishing Co., New York (1999)
Zhu, Y., Bridson, R.: Animating sand as a fluid. ACM Trans. Gr. 24(3), 965–972 (2005)
Jiang, C., Schroeder, C., Selle, A., Teran, J., Stomakhin, A.: The affine particle-in-cell method. ACM Trans. Gr. 34(4), 1–10 (2015)
Chang, J., Partono, R., Azevedo, V.C., Batty, C.: Curl-flow: boundary-respecting pointwise incompressible velocity interpolation for grid-based fluids. ACM Trans. Gr. 41(6), 1–21 (2022)
Bolz, J., Farmer, I., Grinspun, E., Schröder, P.: Sparse matrix solvers on the GPU: conjugate gradients and multigrid. ACM Trans. Gr. 22(3), 917–924 (2003)
Ferstl, F., Westermann, R., Dick, C.: Large-scale liquid simulation on adaptive hexahedral grids. IEEE Trans. Visual Comput. Gr. 20(10), 1405–1417 (2014)
Shao, H., Huang, L., Michels, D.L.: A fast unsmoothed aggregation algebraic multigrid framework for the large-scale simulation of incompressible flow. ACM Trans. Gr. 41(4), 1–18 (2022)
McAdams, A., Sifakis, E., Teran, J.: A parallel multigrid poisson solver for fluids simulation on large grids. In: Symposium on Computer Animation, vol. 65, p. 74 (2010)
Chentanez N, Müller M. Real-time Eulerian water simulation using a restricted tall cell grid. In: ACM Siggraph, pp. 1–10 (2011)
Chentanez, N., Müller, M.: A multigrid fluid pressure solver handling separating solid boundary conditions. In: Proceedings of the 2011 ACM SIGGRAPH/Eurographics Symposium on Computer Animation, pp. 83–90 (2011)
Setaluri, R., Aanjaneya, M., Bauer, S., Sifakis, E.: SPGrid: a sparse paged grid structure applied to adaptive smoke simulation. ACM Trans. Gr. 33(6), 1–12 (2014)
Aanjaneya, M., Gao, M., Liu, H., Batty, C., Sifakis, E.: Power diagrams and sparse paged grids for high resolution adaptive liquids. ACM Trans. Gr. 36(4), 1–12 (2017)
Dick, C., Rogowsky, M., Westermann, R.: Solving the fluid pressure Poisson equation using multigrid-evaluation and improvements. IEEE Trans. Visual Comput. Gr. 22(11), 2480–2492 (2015)
Weber, D., Mueller-Roemer, J., Stork, A., Fellner, D.: A cut-cell geometric multigrid Poisson solver for fluid simulation. Comput. Gr. Forum 34, 481–491 (2015)
Aanjaneya, M., Han, C., Goldade, R., Batty, C.: An efficient geometric multigrid solver for viscous liquids. Proc. ACM Comput. Gr. Interact. Tech. 2(2), 1–21 (2019)
DeWolf, I.: Divergence-Free Noise. Martian Labs (2018)
Bridson, R., Houriham, J., Nordenstam, M.: Curl-noise for procedural fluid flow. ACM Trans. Gr. 26(3), 46 (2007). (es)
Schechter, H., Bridson, R.: Evolving sub-grid turbulence for smoke animation. In: Proceedings of the 2008 ACM SIGGRAPH/Eurographics Symposium on Computer Animation, pp. 1–7 (2008)
Kim, T., Thürey, N., James, D., Gross, M.: Wavelet turbulence for fluid simulation. ACM Trans. Gr. 27(3), 1–6 (2008)
Ding, X., Batty, C.: Differentiable curl-noise: boundary-respecting procedural incompressible flows without discontinuities. Proc. ACM Comput. Gr. Interact. Tech. 6(1), 1–16 (2023)
Elcott, S., Tong, Y., Kanso, E., Schröder, P., Desbrun, M.: Stable, circulation-preserving, simplicial fluids. ACM Trans. Gr. 26(1), 4 (2007). (es)
Ando, R., Thuerey, N., Wojtan, C.: A stream function solver for liquid simulations. ACM Trans. Gr. 34(4), 1–9 (2015)
Sato, S., Dobashi, Y., Yue, Y., Iwasaki, K., Nishita, T.: Incompressibility-preserving deformation for fluid flows using vector potentials. Vis. Comput. 31, 959–965 (2015)
Sato, S., Dobashi, Y., Nishita, T.: Editing fluid animation using flow interpolation. ACM Trans. Gr. 37(5), 1–12 (2018)
Biswas, A., Strelitz, R., Woodring, J., Chen, C.M., Shen, H.W.: A scalable streamline generation algorithm via flux-based isocontour extraction. In: EGPGV@ EuroVis, pp. 69–78 (2016)
Harris, M.J.: Fast fluid dynamics simulation on the GPU. SIGGRAPH Courses 220(101145), 1198555–1198790 (2005)
Molemaker, J., Cohen, J.M., Patel, S., Noh, J., et al.: Low viscosity flow simulations for animation. In: Symposium on Computer Animation, vol. 9, p. 18 (2008)
Chen, Z., Kim, B., Ito, D., Wang, H.: Wetbrush: GPU-based 3D painting simulation at the bristle level. ACM Trans. Gr. 34(6), 1–11 (2015)
Wu, K., Truong, N., Yuksel, C., Hoetzlein, R.: Fast fluid simulations with sparse volumes on the GPU. Comput. Gr. Forum 37, 157–167 (2018)
Raateland, W., Hädrich, T., Herrera, J.A.A., Banuti, D.T., Pałubicki, W., Pirk, S., et al.: Dcgrid: an adaptive grid structure for memory-constrained fluid simulation on the GPU. Proc. ACM Comput. Gr. Interact. Tech. 5(1), 1–14 (2022)
Demidov, D.: AMGCL: an efficient, flexible, and extensible algebraic multigrid implementation. Lobachevskii J. Math. 40, 535–546 (2019)
Acknowledgements
This work was funded in part by the Science and Technology Development Fund, Macau SAR (Grant no. 0075/2023/AMJ, 0003/2023/RIB1, 001/2024/SKL), in part by NSFC (62332015, 62072449), in part by the Guangdong Science and Technology Department (Grant no. 2020B1515130001), in part by the Zhuhai Science and Technology Innovation Bureau (Grant no. ZH2220004002524), in part by the International Science and Technology project of Guangzhou Development District (Grant no. 2022GH09), in part by Zhuhai UM Research Institute (Grant no. HF-011-2021), in part by the University of Macau (Grant No.: MYRG2022-00059-FST, MYRG-GRG2023-00237-FST-UMDF), and in part by the Fund of China University of Petroleum (Grant No. 21CX06042A).
Author information
Authors and Affiliations
Corresponding authors
Ethics declarations
Conflict of interest
The authors declare that they have no conflict of interest.
Additional information
Publisher's Note
Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
Rights and permissions
Springer Nature or its licensor (e.g. a society or other partner) holds exclusive rights to this article under a publishing agreement with the author(s) or other rightsholder(s); author self-archiving of the accepted manuscript version of this article is solely governed by the terms of such publishing agreement and applicable law.
About this article
Cite this article
Lyu, L., Cao, W., Ren, X. et al. Efficient odd–even multigrid for pointwise incompressible fluid simulation on GPU. Vis Comput (2024). https://doi.org/10.1007/s00371-024-03264-y
Accepted:
Published:
DOI: https://doi.org/10.1007/s00371-024-03264-y