Programming CUDA-Based GPUs to Simulate Two-Layer Shallow Water Flows

  • Marc de la Asunción
  • José M. Mantas
  • Manuel J. Castro
Part of the Lecture Notes in Computer Science book series (LNCS, volume 6272)


The two-layer shallow water system is used as the numerical model to simulate several phenomena related to geophysical flows such as the steady exchange of two different water flows, as occurs in the Strait of Gibraltar, or the tsunamis generated by underwater landslides. The numerical solution of this model for realistic domains imposes great demands of computing power and modern Graphics Processing Units (GPUs) have demonstrated to be a powerful accelerator for this kind of computationally intensive simulations. This work describes an accelerated implementation of a first order well-balanced finite volume scheme for 2D two-layer shallow water systems using GPUs supporting the CUDA (Compute Unified Device Architecture) programming model and double precision arithmetic. This implementation uses the CUDA framewok to exploit efficiently the potential fine-grain data parallelism of the numerical algorithm. Two versions of the GPU solver are implemented and studied: one using both single and double precision, and another using only double precision. Numerical experiments show the efficiency of this CUDA solver on several GPUs and a comparison with an efficient multicore CPU implementation of the solver is also reported.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    Abgrall, R., Karni, S.: Two-layer shallow water system: A relaxation approach. SIAM J. Sci. Comput. 31(3), 1603–1627 (2009)MathSciNetCrossRefzbMATHGoogle Scholar
  2. 2.
    de la Asunción, M., Mantas, J.M., Castro, M.: Simulation of one-layer shallow water systems on multicore and CUDA architectures. The Journal of Supercomputing (2010),
  3. 3.
    Audusse, E., Bristeau, M.O.: Finite-volume solvers for a multilayer Saint-Venant system. Int. J. Appl. Math. Comput. Sci. 17(3), 311–320 (2007)MathSciNetCrossRefzbMATHGoogle Scholar
  4. 4.
    Castro, M.J., García-Rodríguez, J.A., González-Vida, J.M., Parés, C.: A parallel 2D finite volume scheme for solving systems of balance laws with nonconservative products: Application to shallow flows. Comput. Meth. Appl. Mech. Eng. 195, 2788–2815 (2006)MathSciNetCrossRefzbMATHGoogle Scholar
  5. 5.
    Castro, M.J., García-Rodríguez, J.A., González-Vida, J.M., Parés, C.: Solving shallow-water systems in 2D domains using finite volume methods and multimedia SSE instructions. J. Comput. Appl. Math. 221(1), 16–32 (2008)MathSciNetCrossRefzbMATHGoogle Scholar
  6. 6.
    Castro, M.J., García-Rodríguez, J.A., González-Vida, J.M., Macías, J., Parés, C.: Improved FVM for two-layer shallow-water models: Application to the strait of gibraltar. Adv. Eng. Softw. 38(6), 386–398 (2007)CrossRefzbMATHGoogle Scholar
  7. 7.
    Chapman, B., Jost, G., van der Pas, R.: Using OpenMP: Portable Shared Memory Parallel Programming. The MIT Press, Cambridge (2007)Google Scholar
  8. 8.
  9. 9.
    Hagen, T.R., Hjelmervik, J.M., Lie, K.A., Natvig, J.R., Henriksen, M.O.: Visual simulation of shallow-water waves. Simulation Modelling Practice and Theory 13(8), 716–726 (2005)CrossRefGoogle Scholar
  10. 10.
    Lastra, M., Mantas, J.M., Ureña, C., Castro, M.J., García-Rodríguez, J.A.: Simulation of shallow-water systems using graphics processing units. Math. Comput. Simul. 80(3), 598–618 (2009)MathSciNetCrossRefzbMATHGoogle Scholar
  11. 11.
  12. 12.
    NVIDIA: NVIDIA CUDA Programming Guide 3.0 (2010),
  13. 13.
    Ostapenko, V.V.: Numerical simulation of wave flows caused by a shoreside landslide. J. Appl. Mech. Tech. Phys. 40, 647–654 (1999)CrossRefzbMATHGoogle Scholar
  14. 14.
    Owens, J.D., Houston, M., Luebke, D., Green, S., Stone, J.E., Phillips, J.C.: GPU computing. Proceedings of the IEEE 96(5), 879–899 (2008)CrossRefGoogle Scholar
  15. 15.
    Rumpf, M., Strzodka, R.: Graphics Processor Units: New prospects for parallel computing. Lecture Notes in Comput. Science and Engineering 51, 89–134 (2006)CrossRefzbMATHGoogle Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2010

Authors and Affiliations

  • Marc de la Asunción
    • 1
  • José M. Mantas
    • 1
  • Manuel J. Castro
    • 2
  1. 1.Dpto. Lenguajes y Sistemas InformáticosUniversidad de GranadaSpain
  2. 2.Dpto. Análisis MatemáticoUniversidad de MálagaSpain

Personalised recommendations