Giter Club home page Giter Club logo

galstep's Introduction

About

This code uses the algorithm found in Springel, Di Matteo & Hernquist (2005) for generating the initial conditions for a disk galaxy simulation with the codes GADGET-2 or RAMSES (using the DICE patch), including a stellar disk, a gaseous disk, a dark matter halo and a stellar bulge. The first two components follow an exponential density profile, and the last two a Dehnen density profile with gamma=1 by default, corresponding to a Hernquist profile. You can check out the expressions in Ruggiero & Lima Neto (2017).

Some notes: this method fails to generate low mass halos (~10^10 solar masses) in equilibrium, since the velocity distribution for these near the center is strongly non gaussian. Secondly, if you run GADGET-2 without any gas cooling, the gaseous disk will gain lots of energy over time due to the artificial viscosity, and will get a lot thicker. Lastly, the gas component must me relaxed for a few hundred Myr to reach equilibrium in case your simulation doesn't include radiative cooling. If it does, relaxation will be a lot faster (a few tens of Myr at most).

About units: the value for the gravitational constant G used in this code is such that the unit for length is 1.0 kpc, for mass 1.0e10 solar masses, and for velocity 1.0 km/s. This is the default for GADGET-2, and works out of the box in RAMSES with the DICE patch.

Required libraries

Usage

You can run python galstep.py --help to see the message below. Also please check out the galaxy_params.ini file to see the available free parameters.

usage: galstep.py [-h] [--nogas] [-cores CORES] [--force-yes] [-o init.dat]

Generates an initial conditions file for a galaxy simulation with halo,
stellar disk, gaseous disk and bulge components.

optional arguments:
  -h, --help    show this help message and exit
  --nogas       Generates a galaxy without gas.
  -cores CORES  The number of cores to use during the potential canculation.
                Make sure this number is a factor of N_rho*N_z.
  --force-yes   Don't ask if you want to use the existing potential_data.txt
                file. Useful for automating the execution of the script.
  -o init.dat   The name of the output file.

Troubleshooting

If you are getting OSError: [Errno 24] Too many open files while trying to run this code in OSX, please try this.

Works which used this code

Author

Rafael Ruggiero
Ph.D student at Universidade de São Paulo (USP), Brazil
Contact: rafael.ruggiero [at] usp.br

Disclaimer

Feel free to use this code in your work, but please link this page in your paper.

galstep's People

Contributors

rennehan avatar ruggiero avatar

Watchers

James Cloos 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.