Jump to content
  • Advertisement
Sign in to follow this  
Icebraker

Divergence in Navier-Stokes equation / Fluid simulation

This topic is 3540 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi everybody, I'm currently writing a fluid simulator based on the Navier-Stokes equations for computer graphics an have one question concerning the divergence term div u = 0. Does this term relate to every single cell or to the whole volume? In my opinion either one is confusing: 1) If it relates to the whole volume this would mean that there cannot be any "inflow" cells which represent inflowing water in the domain. However, these cells are mentioned in some papers. 2) If it relates to every cell this would mean that the water cannot flow because as soon as it enters a previously empty cell the inflow in that cell is greater than the outflow. Obviously I have misunderstood something and I would greatly appreciate it if somebody could shed some light on this issue. Thanks, Icebraker

Share this post


Link to post
Share on other sites
Advertisement
If you are talking about surface fluid entering an empty region of space, that is another issue altogether. In that case, boundary conditions and velocity extension handles velocities for "new" cells. Have a look in bridsons book where this is discussed.

Share this post


Link to post
Share on other sites
Hi,

thanks for the answer. So if I understood you correctly then the div=0 needs to be fulfilled for every cell, and in the case when fluids extend to the AIR-regions then the velocities of the AIR-cells have to be set such that div u = 0. Is this correct?

Share this post


Link to post
Share on other sites
Yes, in short, that is what you do.

But I'm not entirely sure if the velocity extrapolation step itself conserves incompressibility or not. I seem to remember that this was ambigious and I couldn't really figure out how to combine this condition with the boundary conditions at the surface cells. I'm thinking about taking up this project again so perhaps I'll figure it out. I kind of gave up around this point....

The easiest way out seemed to be to extrapolate out as a constant and then just ignore the divergence that arises in the new air cells and just take care of it next time you run the solver with those cells included.








Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!