Xiangyu-Hu / SPHinXsys

SPHinXsys provides C++ APIs for engineering simulation and optimization. It aims at complex systems driven by fluid, structure, multi-body dynamics and beyond. The multi-physics library is based on a unique and unified computational framework by which strong coupling has been achieved for all involved physics.
https://www.sphinxsys.org/
Apache License 2.0
259 stars 197 forks source link
computer-aided-engineering cpp finite-volume-method fluid-dynamics fluid-structure-interaction gpu high-performance-computing multi-physics multi-platforms multiphysics-coupling research-and-development smoothed-particle-hydrodynamics solid-dynamics sycl

SPHinXsys Logo SPHinXsys

Notice on repository transfer to SPHinXsys team

In order to promoting open-source democratization, this repository will be transferred to the SPHinXsys team in the next few weeks. After the transfer, the decision-making process for SPHinXsys will be made by a number of project leaders from different institutions.

Project Status
License Linux Windows macOS ci workflow

Project Communication
Twitter YouTube Bilibili

Description

SPHinXsys (pronunciation: s'fink-sis) is an acronym from Smoothed Particle Hydrodynamics for industrial compleX systems. The multi-physics library uses SPH (smoothed particle hydrodynamics) as the underlying numerical method for both particle-based and mesh-based discretization. Due to the unified computational framework, SPHinXsys is able to carry out simulation and optimization at the same time. Although SPHinXsys is not a standalone application itself, many examples designated for the specific type of applications are provided.

For more information on the SPHinXsys project, please check the project website: https://www.sphinxsys.org.

Examples at a glance

Using SPHinXsys library, straightforward and fast multi-physics modeling can be achieved. Here, we present several short examples in flow, solid dynamics, fluid structure interactions (FSI) and dynamic solid contact.

Fully compatible to classical FVM method

Through the unified computational framework in SPHinXsys, the algorithms for particle methods are full compatible to those in the classical finite volume method (FVM). The following gives an example of the flow around cylinder problem solved by FVM in SPHinXsys.

Note that the code for FVM algorithm is exact the same one for particle interaction in SPHinXsys. The only difference is that SPHinXsys reads a predefined mesh, other than generate particles, before the computation.

Target-driven optimization

The unique target-driven optimization is able to achieve the optimization target and physical solution all-in-once, which is able to accelerate optimization process greatly. The following gives an example of optimizing the conductivity distribution for a thermal domain problem targeting minimum average temperature.

Note that the physical solution of the thermal domain (right) and the optimal distribution of conductivity (left) are obtained at the same time when optimization is finished. Also note that the entire optimization process is very fast and only several times slower than that for a single physical solution with given conductivity distribution.

Python interface

While SPHinXsys is written in C++, it provides a python interface for users to write python scripts to control the simulation, including carry out regression tests for continuous integration (CI) and other tasks. One example is given below for the dambreak case. Please check the source code of 2D Dambreak case with python interface for the usage.

Heterogenous computing

Recently, we have a preview release for the heterogeneous computing version of SPHinXsys. By using SYCL, a royalty-free open standard developed by the Khronos Group that allows developers to program heterogeneous architectures in standard C++, SPHinXsys is able to utilize the power of GPU. Please check the Preview Release and the SYCL branch for details.

Publications

Main publication on the library:

  1. C. Zhang, M. Rezavand, Y. Zhu, Y. Yu, D. Wu, W. Zhang, J. Wang, X. Hu, "SPHinXsys: an open-source multi-physics and multi-resolution library based on smoothed particle hydrodynamics", Computer Physics Communications, 267, 108066, 2021.
    Main Publication

The algorithms in SPHinXsys are based on the following publications:

  1. Chi Zhang and Yujie Zhu and Dong Wu and Nikolaus A Adams and Xiangyu Hu, "Smoothed particle hydrodynamics: Methodology development and recent achievement", Journal of Hydrodynamics 34(5), 767--805, 2022
    Review Publication

  2. Luhui Han and Xiangyu Hu, "SPH modeling of fluid-structure interaction", Journal of Hydrodynamics, 2018: 30(1):62-69.
    FSI Publication

  3. Chi Zhang and Massoud Rezavand and Xiangyu Hu, "Dual-criteria time stepping for weakly compressible smoothed particle hydrodynamics", Journal of Computational Physics 404 (2020) 109135
    Dual Time Criteria

  4. Chi Zhang et al. "SPHinXsys: An open-source meshless, multi-resolution and multi-physics library", Software Impacts, 6 (2020) 100033
    Software Impact

  5. Chi Zhang, Massoud Rezavand, Xiangyu Hu, "A multi-resolution SPH method for fluid-structure interactions", Journal of Computational Physics, Journal of Computational Physics, 429 (2021) 110028.
    Software Impact

  6. Chi Zhang, Yanji Wei, Frederic Dias, Xiangyu Hu, "An efficient fully Lagrangian solver for modeling wave interaction with oscillating wave energy converter", Ocean Engineering, Volume 236, (2021) 109540
    OWSC

  7. Chi Zhang, Jianhang Wang, Massoud Rezavand, Dong Wu, Xiangyu Hu, "An integrative smoothed particle hydrodynamics framework for modeling cardiac function", Computer Methods in Applied Mechanics and Engineering, 381, 113847, 2021.
    Cardiac Function

  8. Yujie Zhu, Chi Zhang, Yongchuan Yu, Xiangyu Hu, "A CAD-compatible body-fitted particle generator for arbitrarily complex geometry and its application to wave-structure interaction", Journal of Hydrodynamics, 33(2), 195-206, 2021.
    CAD Particle

  9. Chi Zhang, Yujie Zhu, Xiuxiu Lyu, Xiangyu Hu, "An efficient and generalized solid boundary condition for SPH: Applications to multi-phase flow and fluid–structure interaction", European Journal of Mechanics - B/Fluids, 94, 276-292, 2022.
    Boundary FSI

  10. Yujie Zhu, Chi Zhang, Xiangyu Hu, "A dynamic relaxation method with operator splitting and random-choice strategy for SPH", Journal of Computational Physics, 458, 111105, 2022.
    Dynamic Relaxation

  11. Dong Wu, Chi Zhang, Xiaojing Tang, Xiangyu Hu, "An essentially non-hourglass formulation for total Lagrangian smoothed particle hydrodynamics", Computer Methods in Applied Mechanics and Engineering, 407, 115915, 2023.
    Hourglass

  12. Chi Zhang, Hao Gao, Xiangyu Hu, "A multi-order smoothed particle hydrodynamics method for cardiac electromechanics with the Purkinje network", Computer Methods in Applied Mechanics and Engineering, 407, 115885, 2023.
    Purkinje Network

  13. Yongchuan Yu, Yujie Zhu, Chi Zhang, Oskar J. Haidn, Xiangyu Hu, "Level-set based pre-processing techniques for particle method", Computer Physics Communications 289, 108744, 2023.
    Level Set

  14. Shuoguo Zhang, Wenbin Zhang, Chi Zhang, Xiangyu Hu, "A Lagrangian free-stream boundary condition for weakly compressible smoothed particle hydrodynamics", Journal of Computational Physics, 490, 112303, 2023.
    Free Stream

  15. Yaru Ren, Pengzhi Lin, Chi Zhang, Xiangyu Hu, "An efficient weighted correction method in Riemann SPH for the simulation of general free surface flows", Computer Methods in Applied Mechanics and Engineering, 417, 116460, 2023.
    Correction Method

  16. Shuaihao Zhang, Chi Zhang, Xiangyu Hu, Sérgio D.N. Lourenço, "A Riemann-based SPH method for modelling large deformation of granular materials", Computers and Geotechnics, 167, 106052, 2024.
    Riemann-Granular Flows

Software Architecture

SPHinXsys is cross-platform can be compiled and used in Windows, Linux and McOS systems.

Installation, tutorial and documentation

For installation, program manual and tutorials, please check https://www.sphinxsys.org/html/sphinx_index.html. Please check the documentation of the code at https://xiangyu-hu.github.io/SPHinXsys/.

Get involved to SPHinXsys

You are welcomed to use and get involved in SPHinXsys.

As the code is on git-hub, you can register an account there (if you do not have a github account yet) and fork out the SPHinXsys repository. You can work on the forked repository and add new features, and then commit them. You can also initiate a pull request to the main repository, so that your new features can be merged into it.

Besides forking the repository and begin to develop by your own, there are many other ways to make SPHinXsys better for every one. For example, you can initiate issues on any thing relevant to SPHinXsys, not only bugs and installation issues, check the pull requests for the current development status, ask questions, give suggestion and comment on SPHinXsys on the discussion page, etc.

You are also welcomed to join the main repository as a collaborator, by which you are able to branch directly in the main repository, and review the pull request.

If you have any further question, you are also welcomed to contact xiangyu.hu@tum.de.