Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Lattice Boltzman Method

LBM simulation built in python using JAX and numpy.

Requirements

This code was developed with Python 3.10.X, tested on Windows and WSL.

Install required libraries:

pip install -r requirements.txt

If you're running on Linux and wish to use the GPU, install JAX with all the cuda helpers:

pip install -U "jax[cuda12]"

Settings.py options

Switch between rendering a plot vs recording renders to disk:

  • RECORD = False for rendering the simulation
  • RECORD = True for saving simulation to disk

Switch between the NumPy and JAX implementations:

  • USE_LIBRARY = NP for NumPy
  • USE_LIBRARY = JAX for JAX

Switch between using gpu and cpu:

  • USE_DEVICE = cpu for CPU
  • USE_DEVICE = cuda for GPU via cuda

Note that JAX currently only offers GPU support on Linux, so it is not possible to use the GPU if you are running on windows. NumPy on the otherhand, does not support GPU support on any platform.

LBM ran on GPU vs CPU

On GPU:

On CPU:

About

LBM simulation written in python implemented on numpy and jax.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages