Skip to content

JGcode3675/accretion-disk-sim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Accretion Disk Simulation

3D relativistic accretion disk simulation around a 10 solar mass black hole, built with Python and Vispy (GPU-accelerated OpenGL).

Physics

  • Paczyński-Wiita pseudo-Newtonian potential — approximates general relativistic effects (correct ISCO, perihelion precession, unstable orbits)
  • Keplerian orbital initialization with radial density profile and vertical scale height
  • 800 particles integrated with scipy.integrate.odeint

Visualization

  • Custom colormap (dark red → orange → yellow → white → blue-white)
  • Doppler beaming — approaching side of the disk appears brighter
  • Variable particle size — inner particles are larger/more intense
  • Fading trails — transparent at the tail, semi-opaque at the head
  • Solid black hole shadow with photon ring at ~2.6 r_s
  • Positions normalized to Schwarzschild radii (r_s)
  • Interactive camera — drag to rotate, scroll to zoom, middle-click to pan

Setup

python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt

Usage

python3 accretion_disk.py

The animation window will open with a slowly rotating camera. Drag to rotate, scroll to zoom, middle-click to pan. Close the window to exit.

Parameters

Parameter Default Description
M 10 M_sun Black hole mass
num_particles 800 Number of disk particles
r_inner 4.5 r_s Inner disk edge
r_outer 80 r_s Outer disk edge
num_frames 300 Animation frames
view_elev 25° Camera elevation

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages