Coder Social home page Coder Social logo

disk_models's Introduction

disk_models - Sets of routines to setup three-dimensional models of accretion disks

example_figures/mesh.png

Overview

Sets of routines to setup three-dimensional models of accretion disks in hydrostatic and centrifugal equilibrium.

Installation

You need to have git installed. In addition, you need the NumPy, SciPy and PyTables Python packages.

git clone https://github.com/djmunoz/disk_models.git

cd disk_models

sudo python setup.py install

If you do not have root permission, you might have to do

python setup.py install --user

To install the package in your $HOME/.local/

That is all!

example_figures/fragmentation.png

Basic usage

To run these scripts and creat an HDF5 initial condition snapshot, follow the next steps:

  1. Load module:
import disk_models as dm
  1. Choose a density profile type: Choose a density profile type (see 'disk_density_profiles.py' for already implemented axisymmetric profiles),e.g., a Lynden-Bell - Pringel self-similar profile modified to have a central cavity:
sigma_type='similarity_cavity'
  1. Create disk model: Create the disk model under this profile type (other parameters included)
d = dm.disk3d(sigma_type="similarity_cavity",csnd0=0.12,l=1.0,R_cav=2.5,xi=3.1,Rout=15,adiabatic_gamma=1.00001)
  1. Create mesh: Create the disk mesh data structure
mesh = dm.disk_mesh3d(mesh_type="mc",Ncells=500000,fill_background=True, fill_center=True,fill_box=True,BoxSize=50)
  1. Create the initial snapshot: Create an instance of the snapshot() structure, and generate a model snapshot
s = dm.snapshot()
s.create(d,mesh)
  1. Save to disk: Write the snapshot to a file
s.write_snapshot(d,mesh,filename="disk.dat.hdf5",time=0)

disk_models's People

Contributors

djmunoz avatar

Watchers

 avatar  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.