Use smoke density to simulate water
I'm a newbie in this field, so I try to implement water simulation for practice. Currently, I've implemented Jos Stam's paper, "Stable Fluids", to simulate smoke motion in three dimension. The smoke looks good, so my next step is to add a surface tracking method to simulate water surface.
I extend the smoke-simulation program by adding level-set method to track the surface. Initially, the center of the Euler grid stores the distance to the water surface. The negative distance means that the grid point is under the water surface, while the positive distance means that the grid point is above the water surface. Intuitively, the zero value means that the grid point is just at the surface.
The surface evolution equation is as follows,
d(phi) ------ = -u dot grad(phi), dt
where phi is the signed distance defined in each grid point, and u is the velocity computed from the smoke simulation. After I got the newest phi value, I constructed the surface by tracking the zero value.
However, I found that the surface didn't reset to the original position when you removed the force applied on it, just like a rubber without elasticity.
I thought the problem occurs because I didn't specify the gravity force. But after I applied the gravity force on each grid under the water surface, the surface gradually dropped down during the simulation process.
Thank you for reading this long explanation. I'd appreciated your any support. Thank you very much :D
|All times are GMT -4. The time now is 04:35.|