Sailfish Reference Manual

Release:0.1
Date:November 08, 2009

Sailfish is a free computational fluid dynamics solver employing the Lattice Boltzmann method and optimized for modern commodity high-performance computational systems, especially Graphics Processing Units.

To illustrate how easy it is to create simulations using the Sailfish package, here is a simple example code to simulate fluid flow in a lid-driven cavity:

import lbm
import geo

class LBMGeoLDC(geo.LBMGeo2D):
    max_v = 0.1

    def _define_nodes(self):
        for i in range(0, self.lat_w):
            self.set_geo((i, 0), self.NODE_WALL)
            self.set_geo((i, self.lat_h-1), self.NODE_VELOCITY, (self.max_v, 0.0))
        for i in range(0, self.lat_h):
            self.set_geo((0, i), self.NODE_WALL)
            self.set_geo((self.lat_w-1, i), self.NODE_WALL)

    def init_dist(self, dist):
        self.velocity_to_dist((0,0), (0.0, 0.0), dist)
        self.fill_dist((0,0), dist)

        for i in range(0, self.lat_w):
            self.velocity_to_dist((i, self.lat_h-1), (self.max_v, 0.0), dist)

class LDCSim(lbm.LBMSim):
    pass

sim = LDCSim(LBMGeoLDC)
sim.run()

Want to see Sailfish in action? Check out our video on YouTube, or better yet, get the code and see for yourself by running the provided examples.

Indices and tables

Table Of Contents

Next topic

Motivation and Design Principles

This Page