Skip to main content
Log in

Optimizations for predictive–corrective particle-based fluid simulation on GPU

  • Original article
  • Published:
The Visual Computer Aims and scope Submit manuscript

Abstract

The use of particles-based simulations to produce fluid animations is nowadays a frequently used method by both the industrial and research sectors. Although there are many variations of the smoothed particle hydrodynamics (SPH) algorithm currently being used, they all have the common characteristic of being highly parallel in nature. They are therefore frequently implemented on graphics processing units (GPUs) to benefit of high computation capacities of modern GPUs. However, such optimizations require specific optimizations to make use of the full capacity of the GPU, with sometimes optimizations being contradictory to optimizations used in CPU implementations. In this paper, we explored various optimizations on a GPU implementation of a recent particle-based fluid simulation algorithm using an iterative pressure solver. In particular, we focused on CPU optimizations that have not been thoroughly studied for GPU implementations: the indexing for the neighbor’s structure, the frequency of the sorting of the fluid particles, the use of lookup tables for the kernel function computations and the use of a warm-start to improve the performance of the iterative pressure solver. We show that some of these optimizations are only effective for very specific hardware configurations and sometimes even impact the performance negatively. We also show that the warm-start reduces the computation time but introduces a cyclic instability in the simulation. We propose a solution to reduce this instability without requiring to modify the implementation of the fluid algorithm.

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
Fig. 2
Fig. 3
Fig. 4
Fig. 5

Similar content being viewed by others

References

  1. Akinci, N., Ihmsen, M., Akinci, G., Solenthaler, B., Teschner, M.: Versatile Rigid-fluid Coupling for Incompressible SPH. ACM Trans. Graph. 31(4), 1–8 (2012). https://doi.org/10.1145/2185520.2185558

    Article  Google Scholar 

  2. Antuono, M., Colagrossi, A., Marrone, S., Molteni, D.: Free-surface flows solved by means of SPH schemes with numerical diffusive terms. Comp. Phys Commun. 181(3), 532–549 (2010). https://doi.org/10.1016/j.cpc.2009.11.002

    Article  MathSciNet  MATH  Google Scholar 

  3. Band, S., Gissler, C., Teschner, M.: Compressed Neighbour Lists for SPH. Comput. Graph. Forum. 39(1), 531–542 (2020)

    Article  Google Scholar 

  4. Baruffa, F., Iapichino, L., Hammer, N.J., Karakasis, V.(2017): Performance optimisation of smoothed particle hydrodynamics algorithms for multi/many-core architectures. In: 2017 International Conference on High Performance Computing & Simulation (HPCS) pp 381–388 . https://doi.org/10.1109/HPCS.2017.64ArXiv: 1612.06090

  5. Bender, J.(2017): SPlisHSPlasH is an open-source library for the physically-based simulation of fluids.: InteractiveComputerGraphics/SPlisHSPlasH . https://github.com/InteractiveComputerGraphics/SPlisHSPlasH. Publisher: Interactive Computer Graphics

  6. Bender, J., Koschier, D.(2015): Divergence-free smoothed particle hydrodynamics. In: Proceedings of the 14th ACM SIGGRAPH / Eurographics Symposium on Computer Animation - SCA ’15, pp. 147–155. ACM Press . https://doi.org/10.1145/2786784.2786796. http://dl.acm.org/citation.cfm?doid=2786784.2786796. Event-place: Los Angeles, California

  7. Bender, J., Koschier, D.: Divergence-Free SPH for incompressible and viscous fluids. IEEE Trans. Vis. Comput. Gr. 23(3), 1193–1206 (2017). https://doi.org/10.1109/TVCG.2016.2578335

    Article  Google Scholar 

  8. Bender, J., Kugelstadt, T., Weiler, M., Koschier, D.(2019): Volume Maps: an implicit boundary representation for SPH. In: Motion, Interaction and Games, MIG ’19, pp. 1–10. Association for Computing Machinery, New York, NY, USA . https://doi.org/10.1145/3359566.3360077

  9. Bilotta, G., Zago, V., Hérault, A.(2019): Design and implementation of particle systems for meshfree methods with high performance. In: S. Chickerur (ed.) High Performance Parallel Computing. IntechOpen . https://doi.org/10.5772/intechopen.81755.https://www.intechopen.com/books/high-performance-parallel-computing/design-and-implementation-of-particle-systems-for-meshfree-methods-with-high-performance

  10. Cummins, S.J., Rudman, M.: An SPH projection method. J. Comput. Phys. 152(2), 584–607 (1999)

    Article  MathSciNet  MATH  Google Scholar 

  11. Domínguez, J.M., Crespo, A.J., Gómez-Gesteira, M.: Optimization strategies for CPU and GPU implementations of a smoothed particle hydrodynamics method. Comput. Phys. Commun. 184(3), 617–627 (2013)

    Article  Google Scholar 

  12. Durand, M., Raffin, B., Faure, F.(2012): A packed memory array to keep moving particles sorted. In: 9th Workshop on Virtual Reality Interaction and Physical Simulation (VRIPHYS), pp 69–77. The Eurographics Association . https://hal.inria.fr/hal-00762593

  13. Goswami, P., Eliasson, A., Franzén, P.(2015): Implicit incompressible SPH on the GPU. In: VRIPHYS

  14. Goswami, P., Schlegel, P., Solenthaler, B., Pajarola, R.(2010): Interactive SPH simulation and rendering on the GPU. In: Proceedings of the 2010 ACM SIGGRAPH/Eurographics Symposium on Computer Animation, SCA ’10, pp. 55–64. Eurographics Association, Goslar Germany, Germany . http://dl.acm.org/citation.cfm?id=1921427.1921437

  15. Harada, T., Koshizuka, S., Kawaguchi, Y.(2007): Smoothed particle hydrodynamics on GPUs. In: Computer Graphics International, 40: 63–70. SBC Petropolis

  16. Haverkort, H.(2017): How many three-dimensional Hilbert curves are there? J. Comput. Geom. 8(1): 206-281. https://doi.org/10.20382/jocg.v8i1a10. https://jocg.org/index.php/jocg/article/view/3036

  17. Hoetzlein, R.C., Devtech, G.(2014): Fast fixed-radius nearest neighbors: Interactive million-particle fluids . Presenters: _:n2083

  18. Huang, K., Ruan, J., Zhao, Z., Li, C., Wang, C., Qin, H.: A general novel parallel framework for SPH-centric algorithms. Proceed. ACM Comput. Gr. Int. Tech. 2(1), 1–16 (2019). https://doi.org/10.1145/3321360

    Article  Google Scholar 

  19. Ihmsen, M., Akinci, N., Becker, M., Teschner, M.: A parallel SPH implementation on multi-core CPUs. Comput. Gr. Forum. 30(1), 99–112 (2011)

    Article  Google Scholar 

  20. Ihmsen, M., Cornelis, J., Solenthaler, B., Horvath, C., Teschner, M.: Implicit incompressible SPH. IEEE Trans. Vis. Comput. Gr. 20(3), 426–435 (2014)

    Article  Google Scholar 

  21. Ihmsen, M., Orthmann, J., Solenthaler, B., Kolb, A., Teschner, M.(2014): SPH Fluids in Computer Graphics. Eurographics 2014 - State of the Art Reports p. 22 pages . https://doi.org/10.2312/EGST.20141034. http://diglib.eg.org/handle/10.2312/egst.20141034.021-042. Artwork Size: 22 pages Publisher: The Eurographics Association

  22. Koschier, D., Bender, J., Solenthaler, B., Teschner, M.(2019): Smoothed particle hydrodynamics techniques for the physics based simulation of fluids and solids. Eurographics 2019 - Tutorials p. 41 pages . https://doi.org/10.2312/egt.20191035. ArXiv: 2009.06944

  23. Macklin, M., Müller, M.: Position based fluids. ACM Trans. Gr. (TOG) 32(4), 1–12 (2013)

    Article  MATH  Google Scholar 

  24. Monaghan, J.J.: Simulating free surface flows with SPH. J. Comput. Phys. 110(2), 399–406 (1994)

    Article  MATH  Google Scholar 

  25. Rustico, E., Bilotta, G., Herault, A., Del Negro, C., Gallo, G.: Advances in Multi-GPU smoothed particle hydrodynamics simulations. IEEE Trans. Parallel Distrib. Syst. 25(1), 43–52 (2014)

    Article  Google Scholar 

  26. Skilling, J.(2004): Programming the Hilbert curve. In: AIP Conference Proceedings, 707: 381–387. AIP, Jackson Hole, Wyoming (USA) . https://doi.org/10.1063/1.1751381. http://aip.scitation.org/doi/abs/10.1063/1.1751381. ISSN: 0094243X

  27. Solenthaler, B., Pajarola, R.: Predictive-corrective incompressible SPH. ACM Trans. Gr. 28(3), 1–6 (2009). https://doi.org/10.1145/1531326.1531346

    Article  Google Scholar 

  28. Verma, K., Szewc, K., Wille, R.(2017): Advanced load balancing for SPH simulations on multi-GPU architectures. In: 2017 IEEE High Performance Extreme Computing Conference (HPEC), IEEE, pp 1–7, Waltham, MA . https://doi.org/10.1109/HPEC.2017.8091093. http://ieeexplore.ieee.org/document/8091093/

  29. Weiler, M., Koschier, D., Brand, M., Bender, J.(2018): A physically consistent implicit viscosity solver for SPH fluids. In: Computer Graphics Forum, vol. 37, pp. 145–155. Wiley Online Library . Issue: 2

  30. Winchenbach, R., Akhunov, R., Kolb, A.: Semi-analytic boundary handling below particle resolution for smoothed particle hydrodynamics. ACM Trans. Gr. (TOG) 39(6), 1–17 (2020)

    Article  Google Scholar 

  31. Winchenbach, R., Kolb, A.: Multi-level memory structures for simulating and rendering smoothed particle hydrodynamics. Comput. Gr. Forum 39(6), 527–541 (2020). https://doi.org/10.1111/cgf.14090

    Article  Google Scholar 

  32. Winkler, D., Rezavand, M., Rauch, W.: Neighbour lists for smoothed particle hydrodynamics on GPUs. Comput. Phys. Commun. 225, 140–148 (2018). https://doi.org/10.1016/j.cpc.2017.12.014

    Article  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Nicolas Pronost.

Ethics declarations

Declarations

The code used for our experiments can be found in the following repository: https://gitlab.liris.cnrs.fr/npronost/sph_dynamic_window.

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.

Supplementary Information

Below is the link to the electronic supplementary material.

Supplementary material 1 (mp4 5638 KB)

Rights and permissions

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Carensac, S., Pronost, N. & Bouakaz, S. Optimizations for predictive–corrective particle-based fluid simulation on GPU. Vis Comput 39, 983–995 (2023). https://doi.org/10.1007/s00371-021-02379-w

Download citation

  • Accepted:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s00371-021-02379-w

Keywords

Navigation