Skip to main content

A general purpose Smoothed Particle Hydrodynamics framework

Project description

PySPH: a Python-based SPH framework

Drone Status Appveyor Status

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 pysph.readthedocs.org.

Here are videos of some example problems solved using PySPH.

Features

  • 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:

Installation

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 drone.io 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 dam_break.py

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 dam_break3D.py

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

Three-dimensional dam-break example

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

$ cd examples/transport_velocity
$ python cavity.py

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/ldcavity_results.py to plot, for example the streamlines look like the following image:

Lid-driven-cavity example

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 rings.py

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

Collision of two steel 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.

Credits

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)

Support

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: https://groups.google.com/d/forum/pysph-users

Please also take a look at the PySPH issue tracker.

Project details


Download files

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

Source Distributions

PySPH-1.0a1.zip (2.4 MB view details)

Uploaded Source

PySPH-1.0a1.tar.gz (2.3 MB view details)

Uploaded Source

PySPH-1.0a1.tar.bz2 (2.3 MB view details)

Uploaded Source

File details

Details for the file PySPH-1.0a1.zip.

File metadata

  • Download URL: PySPH-1.0a1.zip
  • Upload date:
  • Size: 2.4 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for PySPH-1.0a1.zip
Algorithm Hash digest
SHA256 bcd6a50abd445b2ce41d46aa713fe5760b2baeaaa5bed81d2184b45ca87d55ec
MD5 e84625976b7804318fad746af2b8b7c6
BLAKE2b-256 1c833e0b8c6ffa0b3c4f85ed9c8bdf81fd1c85ec777bd678384368f05571c50d

See more details on using hashes here.

File details

Details for the file PySPH-1.0a1.tar.gz.

File metadata

  • Download URL: PySPH-1.0a1.tar.gz
  • Upload date:
  • Size: 2.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for PySPH-1.0a1.tar.gz
Algorithm Hash digest
SHA256 ce5bb1eabef224c3695b1f159f74e9b3353505801f89733871cd25a35134ade6
MD5 a35ce14a6202e709c235b3ec62da0551
BLAKE2b-256 a622012a93b9a278aa3ef884a8fbeedd4d8fb689541e9f2ae53697289d520620

See more details on using hashes here.

File details

Details for the file PySPH-1.0a1.tar.bz2.

File metadata

  • Download URL: PySPH-1.0a1.tar.bz2
  • Upload date:
  • Size: 2.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for PySPH-1.0a1.tar.bz2
Algorithm Hash digest
SHA256 cc3301e790200bdbd252c636c3b1909965085fa85cc3fbdc485a9592a8794e73
MD5 7a651e04608780564409d106e4dd983a
BLAKE2b-256 9a9fb945965eb7a3cd26f7d7b875c9fe85faa87b457a0321ac7c5161b27628b8

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page