Magnetized Torus (GRMHD)
The athenakit.app.torus module supports analysis of magnetized accretion torus simulations in general relativity.
Load and inspect
import athenakit as ak
ad = ak.load("torus.out1.00200.bin")
print(f"GR: {ad.is_gr}, MHD: {ad.is_mhd}, Spin: {ad.spin}")
Slice plots
import matplotlib.pyplot as plt
# Density slice in the x-z plane
fig = ad.plot_slice('dens', axis='y', level=1, norm='log', cmap='inferno')
plt.title(f"t = {ad.time:.1f}")
plt.show()
Phase diagrams
# Density-temperature phase diagram weighted by volume
ad.set_hist2d([['dens', 'temp']], bins=128, scales=[['log','log']], weights='vol')
fig = ad.plot_phase('dens,temp', key='vol', cmap='viridis', norm='log')
plt.show()
GR-specific variables
When ad.is_gr is True, additional derived variables are available:
Variable |
Description |
|---|---|
|
Contravariant time component of 4-velocity |
|
Covariant time component (related to specific energy) |
|
Magnetic field invariant |
|
Magnetization σ = b²/ρ |