• 中国计算机学会会刊
  • 中国科技核心期刊
  • 中文核心期刊

Computer Engineering & Science

Previous Articles     Next Articles

Fluid modeling and simulation using
CUDA-based weakly compressible SPH

DUAN Xingfeng1,2,REN Hongxiang1,SHEN Helong1   

  1. (1.Key Laboratory of Marine Dynamic Simulation & Control for Ministry of Communications,
    Dalian Maritime University,Dalian 116026;
    2.College of Navigation,Jimei University,Xiamen 361021,China)
  • Received:2017-04-11 Revised:2017-05-26 Online:2018-08-25 Published:2018-08-25

Abstract:

In order to realize the realtime and realistic simulation of smallscale fluid scenes, the Weakly Compressible SPH (WCSPH) method is used to model fluids and a hybrid CPUGPU framework is proposed for fluid calculation. Aiming at the problem that the neighbor particle search algorithm affects the computational efficiency of the fluid, we propose a 3D spatial grid partition algorithm and parallel counting sort algorithm to increase speed for searching neighbour particles. Lastly, we propose a parallel Marching Cubes algorithm based on CUDA to triangulate the isosurface of fluids, and use cube map technology to represent the effect of reflection and refraction, thus achieving fluid surface shading. The experiments show that the proposed fluid modeling and simulation method can realize the realtime calculation and rendering of smallscale fluid scenes and draw the dynamic effects of water flow, overturning and the wood swaying in the water. When the number of particles reaches 1 048 576, the parallel method based on GPU achieves the speedup of 60.7 in comparison to the sequential method based on CPU.
 

Key words: smoothed particle hydrodynamics(SPH), Boundary handling, neighbour search, marching cubes, CUDA