A fast fluid simulator using smoothed-particle hydrodynamics