Stephan Helou has created a toolkit for Lattice Boltzmann methods (LBM). His code makes it simple to set up 2D and 3D CFD simulations which evaluate the interactions of fluid and rigid bodies. All kernels are fully parameterized and support multiple types of boundaries (periodic boundary conditions, no-slip, free-slip, Zou He). Obstacles may be primitive geometric bodies (cubes, cylinders, spheres) or arbitrary shapes, including any concave shapes and freeform surfaces. The kernels have been thoroughly validated.

The toolkit relies on LibGeoDecomp for its runtime management and parallelization.

The first real world application built with LibGeoDecomp is a materials science code. It simulates crystal growth in cooling molten metal alloys. The simulation model itself is maintained by Klemens Reuther and Markus Pitzing, Department of Metallic Materials, FSU Jena, Germany. This video is a visualization of the 490 GB of output produced by the first operational version.

In this run we simulated a mixture of aluminum with 2.0% copper on a 425x425x425 grid. The copper makes up 2 percent of the mass, which corresponds to 1.73% of the atoms. Each cell represents a cube with an edge length of 0.5μm. After approximately 19000 time steps the dendrite reached the boundaries of the simulation space. We used periodic boundary conditions, as for all of our dendrite simulations, which allows the dendrite to take up a large part of the simulation space without rendering the simulation physically inaccurate.

The video is also available for download.

We build this mock-up of a gas chromatography simulation to illustrate the applicability of the library to simulations which rely topologies other than regular grids. The video shows how a gas with two substances in solution is pumped through a column filled with activated carbon (indicated by the spherical shapes). The two diagrams on the right show the relative fraction of each substance in the solution. The activated carbon reduces the flow speed, which is why pressure is build up on the bottom of the column, while a vacuum forms at the top. The carbon also absorbs the second substance to a certain degree, which is why it arrives at the top later than the first substance.

For this simulation we placed the cells randomly on the 2D plane and used a Voronoi diagram do determine their shapes. Tiles of these cells were embedded into container cells. The container did act as an adapter for LibGeoDecomp, to which the model appeared to be a regular stencil code.

The standard code every computer scientist writes as his first stencil code. A hot cube is placed into a cold volume. Its heat spreads as time progresses. Cold regions are rendered transparent, while the temperature of hot regions is indicated by their color. It is actually an application of the 3D Jacobi method, but with a twist: we're not using fixed boundary values, but a toroidal topology (i.e. periodic boundary conditions). This way heat is not lost on the edges, but fed back into the system on the opposite face.
Conway's Game of Life, perhaps the iconic cellular automaton. Its implementation takes only a couple of lines of code, and yet it may take full advantage of the library's whole feature set. In this setup a glider moves from the bottom left to the upper right while a diehard pattern evolves in the lower right corner.
last modified: Sun Nov 29 14:08:42 2015 +0100