Skip to main content
Log in

Efficient odd–even multigrid for pointwise incompressible fluid simulation on GPU

  • Research
  • Published:
The Visual Computer Aims and scope Submit manuscript

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.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Fig. 1
Algorithm 1
Fig. 2
Algorithm 2
Fig. 3
Fig. 4
Fig. 5
Fig. 6
Fig. 7
Fig. 8
Fig. 9
Fig. 10
Fig. 11
Fig. 12
Fig. 13
Fig. 14
Fig. 15

Similar content being viewed by others

References

  1. 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)

  2. Zhu, Y., Bridson, R.: Animating sand as a fluid. ACM Trans. Gr. 24(3), 965–972 (2005)

    Article  Google Scholar 

  3. Jiang, C., Schroeder, C., Selle, A., Teran, J., Stomakhin, A.: The affine particle-in-cell method. ACM Trans. Gr. 34(4), 1–10 (2015)

    Google Scholar 

  4. 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)

    Article  Google Scholar 

  5. 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)

    Article  Google Scholar 

  6. Ferstl, F., Westermann, R., Dick, C.: Large-scale liquid simulation on adaptive hexahedral grids. IEEE Trans. Visual Comput. Gr. 20(10), 1405–1417 (2014)

    Article  Google Scholar 

  7. 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)

    Article  Google Scholar 

  8. 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)

  9. Chentanez N, Müller M. Real-time Eulerian water simulation using a restricted tall cell grid. In: ACM Siggraph, pp. 1–10 (2011)

  10. 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)

  11. 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)

    Article  Google Scholar 

  12. 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)

    Article  Google Scholar 

  13. 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)

  14. 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)

    Article  Google Scholar 

  15. 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)

    Article  Google Scholar 

  16. DeWolf, I.: Divergence-Free Noise. Martian Labs (2018)

    Google Scholar 

  17. Bridson, R., Houriham, J., Nordenstam, M.: Curl-noise for procedural fluid flow. ACM Trans. Gr. 26(3), 46 (2007). (es)

    Article  Google Scholar 

  18. 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)

  19. Kim, T., Thürey, N., James, D., Gross, M.: Wavelet turbulence for fluid simulation. ACM Trans. Gr. 27(3), 1–6 (2008)

    Article  Google Scholar 

  20. 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)

    Article  Google Scholar 

  21. Elcott, S., Tong, Y., Kanso, E., Schröder, P., Desbrun, M.: Stable, circulation-preserving, simplicial fluids. ACM Trans. Gr. 26(1), 4 (2007). (es)

    Article  Google Scholar 

  22. Ando, R., Thuerey, N., Wojtan, C.: A stream function solver for liquid simulations. ACM Trans. Gr. 34(4), 1–9 (2015)

    Article  Google Scholar 

  23. 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)

    Article  Google Scholar 

  24. Sato, S., Dobashi, Y., Nishita, T.: Editing fluid animation using flow interpolation. ACM Trans. Gr. 37(5), 1–12 (2018)

    Article  Google Scholar 

  25. 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)

  26. Harris, M.J.: Fast fluid dynamics simulation on the GPU. SIGGRAPH Courses 220(101145), 1198555–1198790 (2005)

    Google Scholar 

  27. 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)

  28. 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)

    Google Scholar 

  29. Wu, K., Truong, N., Yuksel, C., Hoetzlein, R.: Fast fluid simulations with sparse volumes on the GPU. Comput. Gr. Forum 37, 157–167 (2018)

    Article  Google Scholar 

  30. 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)

    Article  Google Scholar 

  31. Demidov, D.: AMGCL: an efficient, flexible, and extensible algebraic multigrid implementation. Lobachevskii J. Math. 40, 535–546 (2019)

    Article  MathSciNet  Google Scholar 

Download references

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

Authors

Corresponding authors

Correspondence to Enhua Wu or Zhi-Xin Yang.

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.

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

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

Download citation

  • Accepted:

  • Published:

  • DOI: https://doi.org/10.1007/s00371-024-03264-y

Keywords

Navigation