Computing and Visualization in Science

, Volume 13, Issue 7, pp 341–353 | Cite as

Simulation and visualization of the Saint-Venant system using GPUs

  • André R. BrodtkorbEmail author
  • Trond R. Hagen
  • Knut-Andreas Lie
  • Jostein R. Natvig
Open Access
Regular Article


We consider three high-resolution schemes for computing shallow-water waves as described by the Saint-Venant system and discuss how to develop highly efficient implementations using graphical processing units (GPUs). The schemes are well-balanced for lake-at-rest problems, handle dry states, and support linear friction models. The first two schemes handle dry states by switching variables in the reconstruction step, so that bilinear reconstructions are computed using physical variables for small water depths and conserved variables elsewhere. In the third scheme, reconstructed slopes are modified in cells containing dry zones to ensure non-negative values at integration points. We discuss how single and double-precision arithmetics affect accuracy and efficiency, scalability and resource utilization for our implementations, and demonstrate that all three schemes map very well to current GPU hardware. We have also implemented direct and close-to-photo-realistic visualization of simulation results on the GPU, giving visual simulations with interactive speeds for reasonably-sized grids.


GPU Shallow water Saint-Venant Conservation laws Visualization Finite volume High-resolution scheme 



The authors gratefully acknowledge financial support from the Research Council of Norway under grants number 180023/S10 and 186947/I30 and the Center of Mathematics for Applications, University of Oslo. The authors also thank NVIDA for their continued support.

Open Access

This article is distributed under the terms of the Creative Commons Attribution Noncommercial License which permits any noncommercial use, distribution, and reproduction in any medium, provided the original author(s) and source are credited.


  1. 1.
    Brandvik, T., Pullan, G.: Acceleration of a two-dimensional Euler flow solver using commodity graphics hardware. IMechE Proc C: J. Mech. Eng. Sci. (2007). doi: 10.1243/09544062JMES813FT
  2. 2.
    Brandvik, T., Pullan, G.: Acceleration of a 3D Euler solver using commodity graphics hardware. In: 46th AIAA Aerospace Sciences Meeting and Exhibit, AIAA 2008-607 (2008)Google Scholar
  3. 3.
    Brodtkorb, A., Dyken, C., Hagen, T., Hjelmervik, J., Storaasli, O.: State-of-the-art in heterogeneous computing. Sci. Program. 18(1) (2010)Google Scholar
  4. 4.
    Brodtkorb, A.R., Sætra, M.L., Altinakar, M.: Efficient shallow water simulations on GPUs: implementation, visualization, verification, and validation. In preparation (2010)Google Scholar
  5. 5.
    de la Asunción, M., Mantas, J.M., Castro, M.J.: Simulation of one-layer shallow water systems on multicore and CUDA architectures. J. Supercomput. (2010)Google Scholar
  6. 6.
    Hagen T., Henriksen M., Hjelmervik J., Lie K.A.: How to solve systems of conservation laws numerically using the graphics processor as a high-performance computational engine. In: Hasle, G., Lie, K.A., Quak, E. (eds) Geometrical Modeling, Numerical Simulation, and Optimization: Industrial Mathematics at SINTEF, pp. 211–264. Springer, New York (2007)CrossRefGoogle Scholar
  7. 7.
    Hagen T., Hjelmervik J., Lie K.A., Natvig J., Henriksen M.: Visual simulation of shallow-water waves. Simul. Model. Pract. Theory 13(8), 716–726 (2005)CrossRefGoogle Scholar
  8. 8.
    Hagen, T.R., Lie, K.A., Natvig, J.R.: Solving the Euler equations on graphics processing units. In: Proceedings of the 6th International Conference on Computational Science—ICCS 2006, Lect. Notes Comp. Sci., vol. 3994, pp. 220–227. Springer, Berlin/Heidelberg (2006)Google Scholar
  9. 9.
    Harten A.: High resolution schemes for hyperbolic conservation laws. J. Comput. Phys. 49(3), 357–393 (1983)MathSciNetCrossRefzbMATHGoogle Scholar
  10. 10.
    Klöckner A., Warburton T., Bridge J., Hesthaven J.: Nodal discontinuous Galerkin methods on graphics processors. J. Comput. Phys. 228(21), 7863–7882 (2009). doi: 10.1016/ MathSciNetCrossRefzbMATHGoogle Scholar
  11. 11.
    Kurganov A., Levy D.: Central-upwind schemes for the Saint-Venant system. Math. Model. Numer. Anal. 36, 397–425 (2002)MathSciNetCrossRefzbMATHGoogle Scholar
  12. 12.
    Kurganov A., Noelle S., Petrova G.: Semidiscrete central-upwind schemes for hyperbolic conservation laws and Hamilton–Jacobi equations. SIAM J. Sci. Comput. 23(3), 707–740 (2001) (electronic)MathSciNetCrossRefzbMATHGoogle Scholar
  13. 13.
    Kurganov A., Petrova G.: A second-order well-balanced positivity preserving central-upwind scheme for the Saint- Venant system. Commun. Math. Sci. 5, 133–160 (2007)MathSciNetzbMATHGoogle Scholar
  14. 14.
    Larsen, E., McAllister, D.: Fast matrix multiplies using graphics hardware. In: Supercomputing, pp. 55–55. ACM, New York, NY, USA (2001).
  15. 15.
    Lastra M., Mantas J.M., na C.U., Castro M.J., Garca-Rodrguez J.A.: Simulation of shallow-water systems using graphics processing units. Math. Comput. Simul. 80(3), 598–618 (2009). doi: 10.1016/j.matcom.2009.09.012 CrossRefzbMATHGoogle Scholar
  16. 16.
    Liang, W.Y., Hsieh, T.J., Satria, M., Chang, Y.L., Fang, J.P., Chen, C.C., Han, C.C.: A GPU-based simulation of tsunami propagation and inundation. In: Algorithms and Architectures for Parallel Processing, Lecture Notes in Computer Science, vol. 5574, pp. 593–603. Springer Verlag, Berlin/Heidelberg (2009). doi: 10.1007/978-3-642-03095-6_56
  17. 17.
    Natvig J.R., Sebastian N., Pankratz N., Puppo G.: Well-balanced finite volume schemes of arbitrary order of accuracy for shallow water flows. J. Comput. Phys. 13(2), 474–499 (2006)Google Scholar
  18. 18.
    NVIDIA: NVIDIA CUDA reference manual 2.3 (2009)Google Scholar
  19. 19.
    OpenGL ARB, Shreiner, D., Woo, M., Neider, J., Davis, T.: OpenGL Programming Guide: The Official Guide to Learning OpenGL, 6th edn. Addison-Wesley (2007)Google Scholar
  20. 20.
    Owens J., Houston M., Luebke D., Green S., Stone J., Phillips J.: GPU computing. Proc. IEEE 96(5), 879–899 (2008). doi: 10.1109/JPROC.2008.917757 CrossRefGoogle Scholar
  21. 21.
    Pankratz N., Natvig J.R., Gjevik B., Noelle S.: High-order well-balanced finite-volume schemes for barotropic flows. Development and numerical comparisons. Ocean Model. 18(1), 53–79 (2007)CrossRefGoogle Scholar
  22. 22.
    Phillips, E.H., Zhang, Y., Davis, R.L., Owens, J.D.: Rapid aerodynamic performance prediction on a cluster of graphics processing units. In: Proceedings of the 47th AIAA Aerospace Sciences Meeting, AIAA 2009-565 (2009)Google Scholar
  23. 23.
    Shu, C.W.: Essentially non-oscillatory and weighted essentially non-oscillatory schemes for hyperbolic conservation laws. In: Advanced Numerical Approximation of Nonlinear Hyperbolic Equations (Cetraro, 1997), Lecture Notes in Mathematics, vol. 1697, pp. 325–432. Springer, Berlin (1998)Google Scholar
  24. 24.
    Singh, J., Altinakar, M., Ding, Y.: 2D numerical model for shallow transient free surface flows over natural terrain. In: Proceedings of the International Conference on Hydroscience and Engineering (2010)Google Scholar
  25. 25.
    Sweby P.K.: High resolution schemes using flux limiters for hyperbolic conservation laws. SIAM J. Numer. Anal. 21(5), 995–1011 (1984)MathSciNetCrossRefzbMATHGoogle Scholar
  26. 26.
    Wang, P., Abel, T., Kaehler, R.: Adaptive mesh fluid simulations on GPU. New Astron (2009). doi: 10.1016/j.newast.2009.10.002

Copyright information

© The Author(s) 2011

Authors and Affiliations

  • André R. Brodtkorb
    • 1
    Email author
  • Trond R. Hagen
    • 1
  • Knut-Andreas Lie
    • 1
  • Jostein R. Natvig
    • 1
  1. 1.Dept. Appl. Math.SINTEF ICTOsloNorway

Personalised recommendations