Archive for the ‘CFD’ Category
Friday, March 19th, 2010
Finally the promised screenshot

SPH with symmetry
It’s not all that impressive to look at as I’ve restricted all the particles to 2d although it does use 3d calculations. I do this to help look for any issues in the code as I find it hard to spot errors in a 3d particle rendering.
This particular screenshot has 64000 particles that have been dropped into the box in a column formation and are now starting to slosh around at the bottom.
The unusual thing with regards to a CUDA implementation is that it is using symmetry in the interactions thereby decreasing the memory/processing load. I’ve still got more work to do but its showing a lot of promise in running superfast particle interaction simulations.
I’ve aso been doing a bit of work on my second version of my raytracer. I’ve once again stepped away from KD-trees and Octrees and am using a type of BVH, ray marching system. Screenshots once I have a decent scene rendered
In other news I’m now compiling all my new C++/CUDA code in 64bit with the CUDA 3.0 beta. Although I think putting in c++ object support into CUDA was a mistake the new version does produce decent code.
Tags: CUDA, ray tracing, SPH
Posted in CFD, CUDA, Development | No Comments »
Thursday, June 25th, 2009
Or as this is a hpc/cuda/parallel processing site:
Gustafson’s Law or Amdahl’s law?
Personally I prefer Gustafson’s Law …. it seems more logical to me or is this just because I’m inherently an optimist?
I would be quite interested on hearing your views on this - so comments /forum posts most welcome.
In other news: The thermal monitor downloads have gone over 80! :) The updated version (v0.2) is ready after mucking around with subclassing a control…. I will release it soon…
Otherwise I have been extremely busy on debugging a sparse matrix solver - bugs in huge datasets can be hard to find! Even with the aid of Gold / Sivler / Bronze kernels mentioned in the last post they have been proving remarkably tricky to isolate. Rather surprising to me is the fact that the long long data type doesn’t consume a lot more processing time than a normal unsigned int - so I have been using that wherever there is a risk of exceeding 2^32.
CFD code coming soon too - although I have unwound a lot of the optimizations in order to make it easier to understand and possibly be a good foundation for your own optimizations.
Right …. back to the grindstone!
Tags: Amdahl's law, Bronze Kernel, CFD, gold kernel, GPU Thermal Monitor, Gustafson's Law, Silver Kernel, Sparse Matrix
Posted in BV2 Thermal Monitor, CFD, CUDA, Development | No Comments »
Thursday, June 4th, 2009
As at the time of writing there have been 20 downloads of the BV2 Thermal Monitor and so far not a single complaint / bug report :) I’m going to take this as a good sign and not that people are just not reporting issues. If you do have an issue please report it on the forums.
I will try to get an update with the “always on top” button and some minor bug fixes out some time this weekend.
Expect more screenshots from my Lattice Boltzmann Method - D3Q19 implementation too - although I had to roll back 3 evenings of work on it due to a myriad of introduced bugs
Naughty me for not running it against the regression data every night…. I’m thinking about releasing the source code for this too as there is not much in the way of simple D3Q19 lattice source on the web at the moment.
Tags: CFD, D3Q19, Lattice Boltzmann, Lattice Boltzmann Method, LBM, Thermal Monitor
Posted in BV2 Thermal Monitor, CFD, Uncategorized | 2 Comments »
Tuesday, May 12th, 2009
I managed to get some time last night to convert my LBM implementation to CUDA. Its far from optimal at the moment. Here is a screen shot showing the lid-driven-cavity with two obstacles, one horizontal and one vertical in the box. The visualization is from the middle plane. The obstacles are not shaded but are easily seen in the picture as an area of black. This image was taken after 16000 timeslices and some nice stable vortices have developed.

D3Q19 - lid driven cavity with obstacles
Once again the importance of making a gold kernel cannot be understated as I had quite a number of bugs in my initial CUDA implementation. I use a “multi-tap” type approach when debugging where the kernels write intermediate results to device memory as they go along. This can be easily compared to data coming from the various stages of the gold kernel and makes it much easier to identify the source of the error. Keep in mind the CUDA floats will never be the same as the CPU’s floats (CPU uses 80 bits to compute intermediate results).
Tags: CUDA, D3Q19, gold kernel, Lattice Boltzmann Method, LBM, Lid Driven Cavity
Posted in CFD, CUDA | No Comments »
Thursday, May 7th, 2009
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.

Visualization from the gold kernel
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.
Tags: CUDA, D2Q9, D3Q19, Lattice Boltzmann Method
Posted in CFD, CUDA, Development | No Comments »
Thursday, April 16th, 2009
Oil and Gas: What a fascinating industry! With all the different technologies and processes involved there is so much to learn.
Why the sudden interest you may ask? Well I may have an opportunity to work for a company involved in supplying software to the oil and gas sector in a part of the UK in which we would very much like to live and doing a job with such a wide variety of interwoven fields is rather appealing. As I have no oil industry experience I have been reading and googling as much as possible.
It seems like the software and technologies required revolve around: 3D visualization and analysis of volumetric data (seismic), construction of data based on field measurements, Geographic Information Systems, GPS, fluid / gas flow simulations in porous media or in hollow volumes, visualization of the strutures (rigs etc), drilling planning and plotting. And I’m sure there are even more things to discover.
(more…)
Tags: Oil and Gas, Seismic Data, Volumetric Data, Volumetric Rendering
Posted in CFD, CUDA, Development, cudart (ray tracing) | No Comments »
Wednesday, April 15th, 2009
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)
-
-
First try at LBM (D2Q9)
-
-
First try at LBM (D2Q9)
Tags: CFD, D2Q9, D3Q19, Lattice Boltzmann Method, LBM
Posted in CFD, Development | No Comments »