其仿真过程的核心算法参考了 Robert Bridson 的 Fluid Simulation for Computer Graphics。它使用 Navier-Stokes 方程的数值解来预测 Qt 的 OpenGL 小部件中显示的每一帧中粒子的密度和速度分布。有两种分辨率可供用户选择:64 × 64 和 128 × 128。用户还可以在 7 种颜色的密度和速度之间切换显示模式。
Its core algorithm of the simulation process refers to Robert Bridson's Fluid Simulation for Computer Graphics. It uses the numerical solution of Navier-Stokes equations to predict the density and velocity distribution of particles in each frame displayed in the OpenGL widget of Qt. There are two resolution options for users: 64 × 64 and 128 × 128. Users can also change display mode between density and velocity in 7 colors.
密度场 (Density field) | 速度场 (Velocity field) |
git clone https://github.com/MuGeminorum/FluidS.git
cd FluidS
此部分内容请统一参考此博文
Please refer to this blog post for this section.