GithubHelp home page GithubHelp logo

annacrnn / rebound_fragmentation Goto Github PK

View Code? Open in Web Editor NEW
6.0 2.0 1.0 181 KB

Fragmentation and bulk composition tracking code for the C version of REBOUND. Based on Childs & Steffen 2021.

License: GNU General Public License v3.0

C 83.79% Python 16.21%
n-body module fragmentation composition tracking-algorithm

rebound_fragmentation's Introduction

Fragmentation and Bulk Composition Tracking Codes by Anna Childs

Fragmentation code:

fragmentation.c is built to model fragmentation in collisions for the C version of REBOUND. To use, simply copy and paste fragmentation.c into the problem.c file you wish to use fragmentation with. Set r->collision_resolve = reb_collision_resolve_fragment; in the main() function, this calls the fragmentation code. Two global pararameters need to be set by the user: min_frag_mass and int tot_no_frags. These two parameters can be found at the top of fragmentation.c and have default values set to double min_frag_mass = 1.4e-8; and int tot_no_frags = 0;. min_frag_mass is the minimum mass a fragment may have. This needs to be defined such that the number of bodies does not grow too large and halt the simulation. int tot_no_frags is the total number of frags (an integer) in the system when starting a simulation. If you are starting a simulation from t=0, then int tot_no_frags = 0;. If you are restarting a simulation from an archive file, you must specify the total number of fragments that the system is starting with. This must be done so that new fragments added to the simulation recieve unique hashes that correspond to the fragment number. IMPORTANT: If you plan on using the bulk composition tracking code, each body (ALL bodies including the star(s)) must be assigned a unique hash before the start of the integration.

The fragmentation.c code will automatically produce a collision_report.txt which details the time of every collision, the bodies involved, how the collision was resolved, and how many fragments were produced. Collision outcomes are assigned a numerical value: 0=elastic bounce, 1=merger, 2=partial accretion, 3=partial erosion, 4=supercatastrophic disruption. This report is necessary for running the bulk composition tracking code.

Bulk composition tracking code:

The bulk composition tracking code tracks the composition change as a function of mass exchange for bodies with a homogenous composition. This code is a post-processing code that works in conjunction with fragmentation.c for REBOUND. IMPORTANT: If you plan on using the bulk composition tracking code, each body (ALL bodies including the star(s)) must be assigned a unique hash before the start of the integration. This is necessary so that the bodies may be tracked accurately throughout the entire simulation.

To run: composition_tracking.py must be installed and compiled with 'chmod +x composition_tracking.py' in the same file as the input files. Run with ./composition_tracking.py

Input files: composition_input.txt, collision_report.txt

Output files: composition_output.txt

Format of input files:
  • collision_report.txt will be generated by fragmentation.c for REBOUND.
  • composition_input.txt must be generated by the user. Each body must be assigned a unique hash at the START of the integration. Each body must be assigned a composition in composition_input.txt (ALL bodies including the star(s)). Each body will be on it's own row. The first column is body hash, second column is body mass, and for j species/elements being tracked, the next j columns will have the mass fraction in decimal form of each specie/element. No delimiters should be added. All values should be separated by whitespace and each specie should have it's own column. All values should be an int or float data type. The relative abundances for each body should add up to 1.0. Please see example_composition_input.txt for an example of the input format for a system with 200 bodies and 5 different species/elements.
Format of output files:

composition_output.txt will output the final compositions of all the bodies. The format of the output file will be in the same form as the composition_input.txt file: body hash in first column, body mass in second column, body mass fraction of specie j in the 2+jth column.

If either code is used please cite Childs & Steffen 2022 (MNRAS).

For questions, comments or bugs please email [email protected]

rebound_fragmentation's People

Contributors

annacrnn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

nofe4108

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.