It may be a very simple question, if you have the answer please share.
Provided a series (say for t0..tn
) of the matrices (2D
arrays) of velocities in X
and Y
directions (UX,UY)
by means of application of Lattice Boltzmann method (LBM) on the simulation of fluid flow in 2D, the question is how to make an animation of fluid flow.
We should be able to use velocities to find positions of (??) by applying: Position = Velocity x Time
. Any ideas of what could be (??).
We think that we could have a same size of velocity matrix of particles for time t0
and find the next position matrix as mentioned above, so to move particles accordingly.
- Please share your knowledge!
- Is the chosen approach correct?
- Any other methods etc etc.
- For this problem tips in Python are more than welcome!
- Pseudo-codes could be of more help!
To simplify the question the following is the velocity map at time tn
, trying to have a fluid flow map based on that, How?
If the initial distribution of your particles is fairly regular (a grid, or uniformly random), you'll find that after a while all the particles tend to cluster together, leaving entire areas of your fluid empty and thus invisible.
I found that a good method is to have short-lived particles (on the order of seconds). When a particle dies, it is respawned in a random position. Also, because each particle traces only a short path, the accuracy of the integration method used doesn't matter so much: a midpoint method or even forward Euler does the job just fine.