Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (
Help us improve Python packaging - Donate today!

A general purpose Smoothed Particle Hydrodynamics framework

Project Description

PySPH: a Python-based SPH framework

PySPH is an open source framework for Smoothed Particle Hydrodynamics (SPH) simulations. It is implemented in Python and the performance critical parts are implemented in Cython.

PySPH allows users to write their high-level code in pure Python. This Python code is automatically converted to high-performance Cython which is compiled and executed. PySPH can also be configured to work seamlessly with OpenMP and MPI.

The latest documentation for PySPH is available at

Here are videos of some example problems solved using PySPH.


  • Flexibility to define arbitrary SPH equations operating on particles in pure Python.
  • Define your own multi-step integrators in pure Python.
  • High-performance: our performance is comparable to hand-written solvers implemented in FORTRAN.
  • Seamless multi-core support with OpenMP.
  • Seamless parallel support using Zoltan.

SPH formulations

PySPH ships with a variety of standard SPH formulations along with basic examples. Some of the formulations available are:


Up-to-date details on how to install PySPH on Linux/OS X and Windows are available from here.

If you wish to see a working build/test script please see our shippable.yml. Or you could see the build script hosted at or for Windows platforms see the appveyor.yml.

Running the examples

You can verify the installation by exploring some examples. A fairly quick running example (taking about 5-10 minutes) would be the following:

$ cd examples
$ python

The solution can be viewed live by running:

$ pysph_viewer

This requires that Mayavi be installed. The saved output data can be viewed by running:

$ pysph_viewer dam_break_output/

A 3D version of the dam-break problem is also available, and may be run as:

$ python

This runs the 3D dam-break problem which is also a SPHERIC benchmark Test 2

PySPH is more than a tool for wave-body interactions::

$ cd examples/transport_velocity
$ python

This runs the driven cavity problem using the transport velocity formulation of Adami et al. You can verify the results for this problem using the helper script examples/transport_velocity/ to plot, for example the streamlines look like the following image:

If you want to use PySPH for elastic dynamics, you can try some of the examples from the directory examples/solid_mech:

$ cd examples/solid_mech
$ python

Which runs the problem of the collision of two elastic rings:

The auto-generated code for the example resides in the directory ~/.pysph/source. A note of caution however, it’s not for the faint hearted.


PySPH is primarily developed at the Department of Aerospace Engineering, IIT Bombay. We are grateful to IIT Bombay for their support. Our primary goal is to build a powerful SPH based tool for both application and research. We hope that this makes it easy to perform reproducible computational research.

Lead developers:

Earlier developers:

  • Pankaj Pandey (stress solver and improved load balancing, 2011)
  • Chandrashekhar Kaushik (original parallel and serial implementation in 2009)


If you have any questions or are running into any difficulties with PySPH, please email or post your questions on the pysph-users mailing list here:

Please also take a look at the PySPH issue tracker.

Release History

History Node


History Node


History Node


This version
History Node


History Node


History Node


Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, Size & Hash SHA256 Hash Help File Type Python Version Upload Date
(2.4 MB) Copy SHA256 Hash SHA256
Source None Jun 12, 2015
(2.5 MB) Copy SHA256 Hash SHA256
Source None Jun 12, 2015
(2.6 MB) Copy SHA256 Hash SHA256
Source None Jun 12, 2015

Supported By

Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Google Google Cloud Servers DreamHost DreamHost Log Hosting