I'm new to this forum, but I thought this might be the right place to ask for advice. I'm trying to create a realistic, physically correct (looking) smoke effect in 2D. For more than a week now, I've been experimenting with different approaches in the fluid dynamics field.
I successfully implemented an Eulerian fixed-grid algorithm (based on this and this article) and it works as expected.
(The cells are not smoothed for debugging purposes).
However I just can't figure out how to implement boundary conditions for rigid bodies in the simulation. Being able to simulate realistic airflow around a ball and turbulences behind a moving object is why I started working on this in the first place. I spent hours googling and reading through countless articles and papers, but all of them just say that you have to account for boundary conditions when setting up the velocity equations or apply a poststep fix, but they never go into details.
I'm also starting to think that a grid based method is not the best for simulating airflow around arbitrary placed and shaped objects, because you would have to use a very high resolution grid to get rid of artifacts. Correct me if I'm wrong.
I also investigated vortex based methods, where you use an array of vortex particles (vortons) to represent the airflow. The vortons aren't fixed, because they are affected by the velocity field they create. So they move around and change their angular velocities. It's a bit more complicated then a fixed velocity grid method, but the real problems only arise once I want to add rigid bodies to the simulation.
Let's say I just calculated the velocity field for the current frame from all the vortons in my simulation and it turns out to be a very simple one:
Now I want to account for the orange ball in this flow. Wether the ball is stationary and the air is moving past it, or the ball is moving to the left in a non-moving field doesn't really matter. In some articles they suggest adding auxiliary vortons somewhere along the surface of the body to redirect the airflow and satisfy the boundary conditions. But I couldn't yet figure out where and what kind of vortons have to be added.
In the above case we could determine the ambient air velocity V[sub]A[/sub] at a point P on the ball surface and place a vorton alongside a line normal to the airflow. Then we specify a vorticity (angular velocity) of the vorton, so that the velocity it creates equals V[sub]V [/sub]= -V[sub]A[/sub] at P. This way all velocity at P is canceled and the boundary conditions are satisfied at P. The problem is, that there are two possible ways to place the vorton (to the right or to the left of the airflow vector). Placing the vorton on the other side also means we have to reverse it's vorticity. How to we find out where to place the vorton? We could use the angle between the normal vector at P and the airflow to separate the vortons into clockwise and counter-clockwise vortons. This would result in something like this (blue: clockwise vorton, red: counter-clockwise vorton):
This looks like to could work, but I'm not sure. What do you think? The air infront of the ball is pushed away, and it sucks in some air behind it. However in the case of a rectangle it won't work:
Using the surface normals to categorize the vortons into CW and CCW ones will result in a row of vortons all turning in the same direction. Instinctively I would categorize them like this:
This looks more like what one would expect (although I'm really not sure), but how could this be implemented? One could use the distance from the edges, but that sounds more like a hack then something stable.
Or maybe I'm completely on the wrong track and there is a better way to do all of this? Any hint, advice or useful link would be very appreciated. Thanks for reading.