Coder Social home page Coder Social logo

shangfei / rebound-sph Goto Github PK

View Code? Open in Web Editor NEW
8.0 1.0 0.0 37.05 MB

An open-source multi-purpose smoothed particle hydrodynamics (SPH) / N-body hybrid code

License: GNU General Public License v3.0

Makefile 0.12% Jupyter Notebook 64.96% Python 7.61% C 27.30% Shell 0.01%

rebound-sph's Introduction

REBOUND-SPH - A multi-purpose SPH / N-body hybrid code

IMPORTANT NOTICE

This repository is undergoing active developement. Currently, there are three examples starting with "sph_" under the examples directory. Type make in your terminal to give it a try. Note you may need to modify the Makefile to get it work. And the protoplanetary disk example is not included yet. If you have troubles to get started, feel free to write me an email (if you know me) or simply create an issue using the "Issue" tab.

INTRODUCTION

REBOUND-SPH is a smoothed particle hydrodynamics (SPH) / N-body hybrid code. It inherits the modular structure and functions from the N-body integrator REBOUND, which is mainly developed by Hanno Rein as well as several major contributors including myself. With the newly integrated SPH scheme, one can use REBOUND-SPH to study fluid dynamics from the Lagrangian perspective, i.e. properties of fluid (such as density and pressure) are tracked following each moving fluid parcel (an SPH particle). An SPH particle is fundamentally different from an N-body particle: 1) an N-body particle represents a discrete bundle of mass and interacts with other particles through gravity; 2) an SPH particle represents a spatial distribution of mass using the "smoothing kernel" (similar to a Gaussian function) and as a matter of fact, the physical density at a given point is the summation of all overlapping contribution from nearby SPH particles; 3) SPH particles interacts with each via pressure as well as gravity (optional). In REBOUND-SPH, user has the freedom to run pure SPH simulations or SPH / N-body hybrid simulations. For pure N-body simulations, user is recommended to use REBOUND.

  • The code is written entirely in C, conforms to the ISO standard C99 and can be used as a thread-safe shared library
  • Real-time, 3D OpenGL visualization (C version)
  • Parallelized with OpenMP (for shared memory systems)
  • Parallelized with MPI using an essential tree for gravity and collisions (for distributed memory systems)
  • No configuration is needed to run any of the example problems. Just type make && ./rebound in the problem directory to run them
  • Comes with standard ASCII, REBOUND binary and HDF5 output routines

EXAMPLES

A Jupiter-mass planet embedded in a 0.02 solar mass protoplanetary disk. The simulation uses 2 million SPH particles, and the image is rendered with SPLASH.

images/SPLASH_REBOUND-SPH.png

A Jupiter mass planet (the moving object) encounters a Solar mass star (the fixed point) at a distance about one Solar radius and gets tidally disrupted. This is a very low resolution simulation done on my laptop. The planet is simulated with only 2,500 SPH particles. However, the behavior of the tidal stream is well captured.

images/tidal_disruption.gif

And this is an AMR simulation done by myself before (Liu et al. 2013). Look how similar the accreted streams are. Note that the grid simulation was done on a cluster with more than a hundred CPUs.

images/tidal_disruption_grid.png

rebound-sph's People

Contributors

hannorein avatar dtamayo avatar shangfei avatar silburt avatar dsspiegel avatar rieder avatar amarillons avatar esemwy avatar guillochon avatar calixte07 avatar kecnry avatar meldonization avatar rejleb avatar rjanish avatar dongsubo avatar

Stargazers

 avatar  avatar Ayush Gupta avatar  avatar Fujun Du avatar Francisco J. Pozuelos avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.