{"id":21252255,"url":"https://github.com/pypr/pysph","last_synced_at":"2025-04-08T09:03:32.788Z","repository":{"id":21359877,"uuid":"92426682","full_name":"pypr/pysph","owner":"pypr","description":"A framework for Smoothed Particle Hydrodynamics in Python","archived":false,"fork":false,"pushed_at":"2025-03-19T12:01:04.000Z","size":7357,"stargazers_count":477,"open_issues_count":15,"forks_count":138,"subscribers_count":27,"default_branch":"master","last_synced_at":"2025-04-01T08:37:17.587Z","etag":null,"topics":["cython","fluid-simulation","framework","gas-dynamics","high-performance-computing","message-passing-interface","opencl","python-library","scientific-computing","smoothed-particle-hydrodynamics","solid-mechanics"],"latest_commit_sha":null,"homepage":"http://pysph.readthedocs.io","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pypr.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGES.rst","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-05-25T17:17:00.000Z","updated_at":"2025-03-25T16:45:15.000Z","dependencies_parsed_at":"2024-12-19T18:10:57.330Z","dependency_job_id":"a304a077-b733-4dca-beec-1f9b3311297d","html_url":"https://github.com/pypr/pysph","commit_stats":{"total_commits":2736,"total_committers":43,"mean_commits":"63.627906976744185","dds":0.6904239766081872,"last_synced_commit":"b94cc7257a7c8008ad8faf0a2a9488f1435ee17f"},"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pypr%2Fpysph","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pypr%2Fpysph/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pypr%2Fpysph/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pypr%2Fpysph/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pypr","download_url":"https://codeload.github.com/pypr/pysph/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247809962,"owners_count":20999816,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cython","fluid-simulation","framework","gas-dynamics","high-performance-computing","message-passing-interface","opencl","python-library","scientific-computing","smoothed-particle-hydrodynamics","solid-mechanics"],"created_at":"2024-11-21T03:46:43.417Z","updated_at":"2025-04-08T09:03:32.755Z","avatar_url":"https://github.com/pypr.png","language":"Python","readme":"PySPH: a Python-based SPH framework\n------------------------------------\n\n|CI Status|  |MPI Build status|  |Documentation Status|\n\n\nPySPH is an open source framework for Smoothed Particle Hydrodynamics\n(SPH) simulations. It is implemented in\n`Python \u003chttp://www.python.org\u003e`_ and the performance critical parts\nare implemented in `Cython \u003chttp://www.cython.org\u003e`_ and PyOpenCL_.\n\nPySPH allows users to write their high-level code in pure Python. This Python\ncode is automatically converted to high-performance Cython or OpenCL which is\ncompiled and executed. PySPH can also be configured to work seamlessly with\nOpenMP, OpenCL, and MPI.\n\nThe latest documentation for PySPH is available at\n`pysph.readthedocs.org \u003chttp://pysph.readthedocs.org\u003e`_.\n\n.. |CI Status| image:: https://github.com/pypr/pysph/actions/workflows/tests.yml/badge.svg\n    :target: https://github.com/pypr/pysph/actions/workflows/tests.yml\n.. |MPI Build Status| image:: https://github.com/pypr/pysph/actions/workflows/zoltan-tests.yml/badge.svg\n    :target: https://github.com/pypr/pysph/actions/workflows/zoltan-tests.yml\n.. |Documentation Status| image:: https://readthedocs.org/projects/pysph/badge/?version=latest\n    :target: https://pysph.readthedocs.io/en/latest/?badge=latest\n    :alt: Documentation Status\n\n\nHere are `videos\n\u003chttps://www.youtube.com/playlist?list=PLH8Y2KepC2_VPLrcTiWGaYYh88gGVAuVr\u003e`_\nof some example problems solved using PySPH.\n\n\n.. _PyOpenCL: https://documen.tician.de/pyopencl/\n.. _PyZoltan: https://github.com/pypr/pyzoltan\n\nFeatures\n--------\n\n- Flexibility to define arbitrary SPH equations operating on particles\n  in pure Python.\n- Define your own multi-step integrators in pure Python.\n- High-performance: our performance is comparable to hand-written\n  solvers implemented in FORTRAN.\n- Seamless multi-core support with OpenMP.\n- Seamless GPU support with PyOpenCL_.\n- Seamless parallel support using\n  `Zoltan \u003chttp://www.cs.sandia.gov/zoltan/\u003e`_ and PyZoltan_.\n\nSPH formulations\n-----------------\n\nPySPH ships with a variety of standard SPH formulations along with\nbasic examples.  Some of the formulations available are:\n\n-  `Weakly Compressible SPH\n   (WCSPH) \u003chttp://www.tandfonline.com/doi/abs/10.1080/00221686.2010.9641250\u003e`_\n   for free-surface flows (Gesteira et al. 2010, Journal of Hydraulic\n   Research, 48, pp. 6--27)\n-  `Transport Velocity\n   Formulation \u003chttp://dx.doi.org/10.1016/j.jcp.2013.01.043\u003e`_ for\n   incompressilbe fluids (Adami et al. 2013, JCP, 241, pp. 292--307)\n-  `SPH for elastic\n   dynamics \u003chttp://dx.doi.org/10.1016/S0045-7825(01)00254-7\u003e`_ (Gray\n   et al. 2001, CMAME, Vol. 190, pp 6641--6662)\n-  `Compressible SPH \u003chttp://dx.doi.org/10.1016/j.jcp.2013.08.060\u003e`_\n   (Puri et al. 2014, JCP, Vol. 256, pp 308--333)\n-  `Generalized Transport Velocity Formulation (GTVF)\n   \u003chttps://doi.org/10.1016/j.jcp.2017.02.016\u003e`_ (Zhang et al. 2017, JCP, 337,\n   pp. 216--232)\n-  `Entropically Damped Artificial Compressibility (EDAC)\n   \u003chttp://dx.doi.org/10.1016/j.compfluid.2018.11.023\u003e`_ (Ramachandran et\n   al. 2019, Computers and Fluids, 179, pp. 579--594)\n-  `delta-SPH \u003chttp://dx.doi.org/10.1016/j.cma.2010.12.016\u003e`_ (Marrone et\n   al. CMAME, 2011, 200, pp. 1526--1542)\n-  `Dual Time SPH (DTSPH) \u003chttps://arxiv.org/abs/1904.00861\u003e`_ (Ramachandran et\n   al. arXiv preprint)\n-  `Incompressible (ISPH) \u003chttps://doi.org/10.1006/jcph.1999.6246\u003e`_ (Cummins et\n   al. JCP, 1999, 152, pp. 584--607)\n-  `Simple Iterative SPH (SISPH) \u003chttps://arxiv.org/abs/1908.01762\u003e`_ (Muta et\n   al. arXiv preprint)\n-  `Implicit Incompressibel SPH (IISPH)\n   \u003chttps://doi.org/10.1109/TVCG.2013.105\u003e`_ (Ihmsen et al. 2014, IEEE\n   Trans. Vis. Comput. Graph., 20, pp 426--435)\n-  `Gudnov SPH (GSPH) \u003chttps://doi.org/10.1006/jcph.2002.7053\u003e`_ (Inutsuka et\n   al. JCP, 2002, 179, pp. 238--267)\n-  `Conservative Reproducible Kernel SPH (CRKSPH)\n   \u003chttp://dx.doi.org/10.1016/j.jcp.2016.12.004\u003e`_ (Frontiere et al. JCP, 2017,\n   332, pp. 160--209)\n-  `Approximate Gudnov SPH (AGSPH) \u003chttps://doi.org/10.1016/j.jcp.2014.03.055\u003e`_\n   (Puri et al. JCP, 2014, pp. 432--458)\n-  `Adaptive Density Kernel Estimate (ADKE)\n   \u003chttps://doi.org/10.1016/j.jcp.2005.06.016\u003e`_ (Sigalotti et al. JCP, 2006,\n   pp. 124--149)\n-  `Akinci \u003chttp://doi.acm.org/10.1145/2185520.2185558\u003e`_ (Akinci et al. ACM\n   Trans. Graph., 2012, pp. 62:1--62:8)\n\nBoundary conditions from the following papers are implemented:\n\n-  `Generalized Wall BCs\n   \u003chttp://dx.doi.org/10.1016/j.jcp.2012.05.005\u003e`_ (Adami et al. JCP,\n   2012, pp. 7057--7075)\n-  `Do nothing type outlet BC\n   \u003chttps://doi.org/10.1016/j.euromechflu.2012.02.002\u003e`_ (Federico\n   et al. European Journal of Mechanics - B/Fluids, 2012, pp. 35--46)\n-  `Outlet Mirror BC\n   \u003chttp://dx.doi.org/10.1016/j.cma.2018.08.004\u003e`_ (Tafuni et al. CMAME,\n   2018, pp. 604--624)\n-  `Method of Characteristics BC\n   \u003chttp://dx.doi.org/10.1002/fld.1971\u003e`_ (Lastiwaka\n   et al. International Journal for Numerical Methods in Fluids, 2012,\n   pp. 35--46)\n-  `Hybrid  BC \u003chttps://arxiv.org/abs/1907.04034\u003e`_ (Negi et\n   al. arXiv preprint)\n\nCorrections proposed in the following papers are also the part for PySPH:\n\n-  `Corrected SPH \u003chttp://dx.doi.org/10.1016/S0045-7825(99)00051-1\u003e`_ (Bonet et\n   al. CMAME, 1999, pp. 97--115)\n-  `hg-correction \u003chttps://doi.org/10.1080/00221686.2010.9641251\u003e`_ (Hughes et\n   al. Journal of Hydraulic Research, pp. 105--117)\n-  `Tensile instability correction' \u003chttps://doi.org/10.1006/jcph.2000.6439\u003e`_\n   (Monaghan J. J. JCP, 2000, pp. 2990--311)\n-  Particle shift algorithms\n   (`Xu et al \u003chttp://dx.doi.org/10.1016/j.jcp.2009.05.032\u003e`_. JCP, 2009, pp. 6703--6725),\n   (`Skillen et al \u003chttp://dx.doi.org/10.1016/j.cma.2013.05.017\u003e`_. CMAME, 2013, pp. 163--173)\n\nSurface tension models are implemented from:\n\n-  `Morris surface tension`_ (Morris et al. Internaltional Journal for Numerical\n   Methods in Fluids, 2000, pp. 333--353)\n-  `Adami Surface tension formulation\n   \u003chttps://doi.org/10.1016/j.jcp.2010.03.022\u003e`_ (Adami et al. JCP, 2010,\n   pp. 5011--5021)\n\n.. _Morris surface tension:\n   https://dx.doi.org/10.1002/1097-0363(20000615)33:3\u003c333::AID-FLD11\u003e3.0.CO;2-7\n\nInstallation\n-------------\n\nUp-to-date details on how to install PySPH on Linux/OS X and Windows are\navailable from\n`here \u003chttp://pysph.readthedocs.org/en/latest/installation.html\u003e`_.\n\nIf you wish to see a working build/test script please see our `shippable.yml\n\u003chttps://github.com/pypr/pysph/blob/master/shippable.yml\u003e`_. For\nWindows platforms see the `appveyor.yml\n\u003chttps://github.com/pypr/pysph/blob/master/appveyor.yml\u003e`_.\n\nRunning the examples\n--------------------\n\nYou can verify the installation by exploring some examples. A fairly\nquick running example (taking about 20 seconds) would be the\nfollowing::\n\n    $ pysph run elliptical_drop\n\nThis requires that Mayavi be installed. The saved output data can be\nviewed by running::\n\n    $ pysph view elliptical_drop_output/\n\nA more interesting example would be a 2D dam-break example (this takes about 30\nminutes in total to run)::\n\n    $ pysph run dam_break_2d\n\nThe solution can be viewed live by running (on another shell)::\n\n    $ pysph view\n\nThe generated output can also be viewed and the newly generated output files\ncan be refreshed on the viewer UI.\n\nA 3D version of the dam-break problem is also available, and may be run\nas::\n\n    $ pysph run dam_break_3d\n\nThis runs the 3D dam-break problem which is also a SPHERIC benchmark\n`Test 2 \u003chttps://wiki.manchester.ac.uk/spheric/index.php/Test2\u003e`_\n\n.. figure:: https://github.com/pypr/pysph/raw/master/docs/Images/db3d.png\n   :width: 550px\n   :alt: Three-dimensional dam-break example\n\nPySPH is more than a tool for wave-body interactions:::\n\n    $ pysph run cavity\n\nThis runs the driven cavity problem using the transport velocity formulation of\nAdami et al. The output directory ``cavity_output`` will also contain\nstreamlines and other post-processed results after the simulation completes.\nFor example the streamlines look like the following image:\n\n.. figure:: https://github.com/pypr/pysph/raw/master/docs/Images/ldc-streamlines.png\n   :width: 550px\n   :alt: Lid-driven-cavity example\n\nIf you want to use PySPH for elastic dynamics, you can try some of the\nexamples from the ``pysph.examples.solid_mech`` package::\n\n    $ pysph run solid_mech.rings\n\nWhich runs the problem of the collision of two elastic rings:\n\n.. figure:: https://github.com/pypr/pysph/raw/master/docs/Images/rings-collision.png\n   :width: 550px\n   :alt: Collision of two steel rings\n\nThe auto-generated code for the example resides in the directory\n``~/.pysph/source``. A note of caution however, it's not for the faint\nhearted.\n\nThere are many more examples, they can be listed by simply running::\n\n    $ pysph run\n\n\nResearch papers using PySPH\n----------------------------\n\nThe following are some of the works that use PySPH,\n\n- Adaptive SPH method: https://gitlab.com/pypr/adaptive_sph\n- Adaptive SPH method applied to moving bodies: https://gitlab.com/pypr/asph_motion\n- Convergence of the SPH method: https://gitlab.com/pypr/convergence_sph\n- Corrected transport velocity formulation: https://gitlab.com/pypr/ctvf\n- Dual-Time SPH method: https://gitlab.com/pypr/dtsph\n- Entropically damped artificial compressibility SPH formulation: https://gitlab.com/pypr/edac_sph\n- Generalized inlet and outlet boundary conditions for SPH: https://gitlab.com/pypr/inlet_outlet\n- Method of manufactured solutions for SPH: https://gitlab.com/pypr/mms_sph\n- A demonstration of the binder support provided by PySPH: https://gitlab.com/pypr/pysph_demo\n- Manuscript and code for a paper on PySPH: https://gitlab.com/pypr/pysph_paper\n- Simple Iterative Incompressible SPH scheme: https://gitlab.com/pypr/sisph\n- Geometry generation and preprocessing for SPH simulations: https://gitlab.com/pypr/sph_geom\n\n\nCredits\n--------\n\nPySPH is primarily developed at the `Department of Aerospace\nEngineering, IIT Bombay \u003chttp://www.aero.iitb.ac.in\u003e`_. We are grateful\nto IIT Bombay for their support.  Our primary goal is to build a\npowerful SPH based tool for both application and research. We hope that\nthis makes it easy to perform reproducible computational research.\n\nTo see the list of contributors the see `github contributors page\n\u003chttps://github.com/pypr/pysph/graphs/contributors\u003e`_\n\n\nSome earlier developers not listed on the above are:\n\n- Pankaj Pandey (stress solver and improved load balancing, 2011)\n- Chandrashekhar Kaushik (original parallel and serial implementation in 2009)\n\n\nCiting PySPH\n-------------\n\nYou may use the following article to formally refer to PySPH,\na freely-available arXiv copy of the below paper is at\nhttps://arxiv.org/abs/1909.04504,\n\n - Prabhu Ramachandran, Aditya Bhosale, Kunal Puri, Pawan Negi, Abhinav\n   Muta, A. Dinesh, Dileep Menon, Rahul Govind, Suraj Sanka, Amal\n   S Sebastian, Ananyo Sen, Rohan Kaushik, Anshuman Kumar,  Vikas\n   Kurapati, Mrinalgouda Patil, Deep Tavker, Pankaj Pandey,\n   Chandrashekhar Kaushik, Arkopal Dutt, Arpit Agarwal. \"PySPH:\n   A Python-Based Framework for Smoothed Particle Hydrodynamics\". ACM\n   Transactions on Mathematical Software 47, no. 4 (31 December 2021):\n   1--38. DOI: https://doi.org/10.1145/3460773.\n\nThe bibtex entry is:::\n\n    @article{ramachandran2021a,\n        title = {{{PySPH}}: {{A Python-based Framework}} for {{Smoothed Particle Hydrodynamics}}},\n        shorttitle = {{{PySPH}}},\n        author = {Ramachandran, Prabhu and Bhosale, Aditya and Puri,\n        Kunal and Negi, Pawan and Muta, Abhinav and Dinesh,\n        A. and Menon, Dileep and Govind, Rahul and Sanka, Suraj and Sebastian,\n        Amal S. and Sen, Ananyo and Kaushik, Rohan and Kumar,\n        Anshuman and Kurapati, Vikas and Patil, Mrinalgouda and Tavker,\n        Deep and Pandey, Pankaj and Kaushik, Chandrashekhar and Dutt,\n        Arkopal and Agarwal, Arpit},\n        year = {2021},\n        month = dec,\n        journal = {ACM Transactions on Mathematical Software},\n        volume = {47},\n        number = {4},\n        pages = {1--38},\n        issn = {0098-3500, 1557-7295},\n        doi = {10.1145/3460773},\n        langid = {english}\n    }\n\n\nSupport\n-------\n\nIf you have any questions or are running into any difficulties with PySPH, you\ncan use the `PySPH discussions \u003chttps://github.com/pypr/pysph/discussions\u003e`_.\n\nPlease also take a look at the `PySPH issue tracker\n\u003chttps://github.com/pypr/pysph/issues\u003e`_ if you have bugs or issues to report.\n\nYou could also email or post your questions on the pysph-users mailing list here:\nhttps://groups.google.com/d/forum/pysph-users\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpypr%2Fpysph","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpypr%2Fpysph","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpypr%2Fpysph/lists"}