Hello,First, thanks for your reply, I really checked the source code too much for bugs but I really can’t find. I have 3 weeks (16 hour per day) until now working to find what’s wrong with the simulation, and I really can’t find, I’m really so exauhsted. So, in brief I’ll describe to you what’s is going on:
The code written until now is works perfect if I removed the Collision step, which means I just propagate the PDFs and DETECT the collisions with WALLS or any of these things, and then immediately draw what is going on (I mean without tending to the equiblibruim function). I test this part too much it works perfectly, So I don’t think there is a bug here.
For the collide part, I tested it HUNDRED of times and I think if there is a bug so the bug on my understanding not the implementation, So I’ll tell you what I do briefly (I’ll use names from pseudo code done in page 9 chapter 2 in document titled “A single-phase free-surface Lattice Boltzmann Method”):
1- On every lattice site I sum the PDFs and assign it to a density variable.
2- On every lattice site I get Ux, Uy, Uz:
For all i from 0 to 18[indent]uX += f[i]*eX[i]uY += f[i]*eY[i]
uZ += f[i]*eZ[i]
- Then I divide these values by the density:uX/=densityuY/=density
uZ/=density
- There are really a lot of models to add the force like gravity to the simulation:I used the one you also suggested in your document by adding the force to the uX, uY, uZ , which I put a constant like (0,-0.1,0):uY+=-0.1
Then I computer the U vecto like this: u = uXuX+uYuY+uZ*uZ Then for all the 19 direction I do this:
[ul][ol]
[li]Compute a variable I call uV like : uV = uXeX[l]+uYeY[l]+uZeZ[l]
[/li][li]The compute feq = w[l](density-(3/2.0)u+3uV+(9/2.0)uVuV), Please notice this feq is different than what in document, document state that feq = w[l]density(1-(3/2.0)u+3uV+(9/2.0)uVuV)!
[/li]
[li]Then I computer the new PDF like this:
[/li]relaxationTime*feq+(1-relaxationTime)*f[l]
[li]END
[/li]
[/ul]
[li]For displaying I just draw particles at every lattice site (When the lattice site density is more than 0 ) using OpenGL.
[/li][/ol]Is there any thing wrong![/indent]Thanks,
Mustafa ELBanna