Skip to content
A lattice Boltzmann code for complex fluids
C Makefile C++ Shell Fortran Python Other
Branch: master
Clone or download
Latest commit 25905b5 Aug 14, 2019
Type Name Latest commit message Commit time
Failed to load latest commit information.
config Move to single compiler variable Jul 27, 2019
mpi_s Prevent warnings with -DNDEBUG Aug 14, 2019
src Clear compiler warnings Aug 14, 2019
target Correct typo Jul 9, 2019
tests Update list of targets Aug 14, 2019
util Add run time warning Aug 14, 2019
.gitignore Added Jul 18, 2018
.lgtm.yml Update extraction Aug 14, 2019
.travis.yml Update travis config and yml Jul 8, 2019 Merge patch-0.8.16 Jul 11, 2019 Minor update to test description Aug 14, 2019
Makefile Added top level Makefile Nov 16, 2018 Updated make procedure Nov 16, 2018 Additional information on build etc Aug 14, 2019
version.h Update to version 0.9.0 Jul 28, 2019


A lattice Boltzmann code for complex fluids

Build Status CII Best Practices

Ludwig is a parallel code for the simulation of complex fluids, which include mixtures, colloidal suspensions, gels, and liquid crystals. It takes its name from Ludwig Boltzmann, as it uses a lattice Boltzmann method as a basis for numerical solution of the Navier Stokes equations for hydrodynamics. It typically combines hydrodynamics with a coarse-grained order parameter (or order parameters) to represent the "complex" part in a free energy picture.

The code is written in standard ANSI C, and uses the Message Passing Interface for distributed memory parallelism. Threaded parallelism is also available via a lightweight abstraction layer ("Target Data Parallel" or "TargetDP") which currently supports either OpenMP or CUDA (NVIDIA GPUs) from a single source.


Copy a config file from the config directory to the top level directory and make any changes required. E.g.,

$ cp config/
$ make serial
$ make
$ make test

Note that the tests expect standard C assertions to be active; for production runs, one should add the standard preprocessor option -DNDEBUG to the compiler options in the file.

If a parallel build is wanted omit the serial step, for example,

$ cp config/
$ make
$ make test

Full details of the build process are available at

Background and Tutorial

Background documentation on the LB model and various free energy choices is available in the docs directory.

$ cd docs
$ make

will produce a pdf version of the LaTeX source.

A short tutorial, which includes some examples in which the results are visualised, is also provided:

$ cd docs/tutorial
$ make

to produce a pdf of the tutorial instructions.


If you would like to contribute, please consider a pull request. See for further details of testing and development.


For bug reports, problems, and other issues, please open a new issue.

You can’t perform that action at this time.