Overview This project implements a 2D fluid simulation from scratch using Smoothed Particle Hydrodynamics (SPH). It models a dynamic wave collapse within a constrained tank, treating the water as a weakly compressible fluid via the stiff Tait equation of state.
To overcome the traditional O(N^2) computational bottleneck of SPH, the simulator utilizes a Linked-Cell spatial hashing algorithm, reducing neighbor search complexity to O(N). Furthermore, the solver ensures mathematical stability using a Predictor-Corrector second-order integration scheme.
g++ -fopenmp -O3 sph_openmp.cpp -o sph_openmp.out
./sph_openmp.out
mpicxx -O3 sph_mpi.cpp -o sph_mpi.out
mpirun -np 4 ./sph_mpi.out
nvcc -O3 sph_cuda.cu -o sph_cuda.out
./sph_cuda.out