Showing posts with label D2Q9. Show all posts
Showing posts with label D2Q9. Show all posts

Thursday, 7 May 2009

D3Q19 Lattice

After playing with a D2Q9 lattice mentioned in a previous post I felt I'd learned enough to progress to the wonderful 3D world :) The arrival of my Tesla has also given me more processing power to move into three dimensions.

So far, in order to get data I can compare the CUDA kernels against, I have come up with a cpu gold kernel. For the first test have constructed a Box with 5 sides and constantly moving flow in the top layer of the box. I am only simulating incompressible at the moment.

I have made a very simple OpenGL viewer that can either show me the entire box or a plane through it. The direction of the velocity vectors is indicated both by their colour and direction of line while the magnitude of the velocity is indicated by the length of the line (thats why some spill over the edges of the box). The below image shows a section through the middle of the box.

[caption id="attachment_763" align="aligncenter" width="292" caption="Visualization from the gold kernel"]Visualization from the gold kernel[/caption]

The next step is to construct the CUDA kernels and compare their outputs. I'm hoping for a massive increase in lattice update speed whilst maintaining numerical stability. The gold kernel uses doubles for reference purposes.

Wednesday, 15 April 2009

Playing with the Lattice Boltzmann Method

I've been learning more and more about the LBM (Lattice Boltzmann Method) recently and decided to implement a very basic 2D one last night. More to educate myself than for anything useful.

I decided on the D2Q9 Lattice as it should give nice results in 2D while being less complex to implement then the D3Q19 (3D) one.

My colour mapping isnt great and for some reason the simulation isnt responding as expected to different Reynolds Numbers. My initial conditions and boundary conditions need work too. For what its worth here are two screenshots of the velocity field in a pipe with 2 Cylinders projected through it. (Lighter colours indicate higher velocity)

[gallery]