Antares Codes and applications to structures in CFD-MHD GROUP (ASIAA)

David Chien-Chang Yen TIARA, 8F, 2nd General Bldg. (Fu Jen Catholic University1 (第二綜合大樓), Hsinchu, [email protected]) Taiwan Outline of this lecture

• Goals of galaxies simulations • An introduction of Antares codes • Governing Equations • Numerical techniques • Examples of galaxies simulations • References and codes

2 Goals of galaxies simulations

• The structure of the inner gas-dust disk • The evolution of the inner gas-dust disk • Spiral structures • Fuel AGN and starburst ring activities in the center. An introduction of Antares codes

• CFD-MHD initiative, a joint research project of the ASIAA, ASIM (Institute of Mathematics), and NTU Math (2002). • High-performance codes of computational fluid dynamics and magneto-hydrodynamics (CFD- MHD) for astrophysical problems • Self-gravitating force calculations • Characteristics decomposition on the boundary, guaranteed non-reflection • Antares is not ANTARES 4 The structure of Antares codes

5 Antares codes (大火程序) vs ANTARES codes

古時中國叫天蠍座為青龍,而天蠍主星中文名為心宿二,又名大火, 西名Antares(火星之敵),心宿二以其寶石紅著稱於世,二、三千年 前這個星被測定為夏至的標準。商、周時期就設定『火正』的天官專 門來看這顆星,以便定立節氣。『詩經』裡就有這麼一句話『七月流 火、九月授衣』。意思是說7月份『大火』星已向地平線接近像流星 一樣(表示盛暑),再過二個月秋天就要來臨,得要多加衣物穿著了 • Antares codes (CFD-MHD, ASIAA, named by Prof. Chi Yuan) • ANTARES is Astronomy with a Neutrino Telescope and Abyss Environmental Research • ANTARES = A Numerical Tool for Astrophysical RESearch with applications to solar granulation. H. J. Muthsam et all. Hydrodynamical simulations of the barred spiral NGC 6782 On the Orbital Evolution of a Jovian Planet Embedded in a Self-Gravitating Disk Proto-stellar Jet Problems Accretion Disk (binary system) Governing equations for galaxies and proto-stellar disks

(i) Equation of continuity   ( v)  0 t

(ii) Equation of motion (v) P  vv   V t 

2 V V0 V1 Vg  Vg  4 G (z) (iii) Equation of state P  a2 (isothermal gas)

P  K  (polytropic gas) Governing equations for hydrodynamic escape

Image credit: A. Vidal-Madjar Second-order Runge-Kutta method

Equations Equations       u  0 U  F  S, t x t x    u c2 u 2   U  ( ,u), t x x F  (u,u 2  c2 ),  S  (0, ) Numerical approach x t u(1)  u n  D F n  tS n x  i1/ 2 t u(2)  u(1)  D F (1)  tS (1) x  i1/ 2 1 u n1  u n  u(2)  2 13 Relaxed Scheme for one-dimensional problem

   1 U  F  S Ui  (Fi1/ 2  Fi1/ 2 )  Si t x t xi where  x i is the spatial mesh size and the p-components of the numerical fluxes are given, using the MUSCL scheme,

( p) F  v | ( p) i1/ 2 i1/ 2 vF

1 ( p) ( p) 1 1    (F  F )  a (u u )  (x   x  ) | ( p) 2 i i1 2 p i1 i 4 i i i1 i1 vF with the flux limiters  1 ( p) ( p)   i |vF ( p)  (Fi1  a p ui1  Fi  a p ui )(i ) xi F ( p)  a u  F ( p)  a u  i p i i1 p i1   14 i ( p) ( p) Fi1  a p ui1  Fi  a p ui The main feature of Antares codes

 un-split method, semi-discretization, the second-order Runge-Kutta time integration  exact Riemann solver  self-gravitating forces calculation  Semi-implicit method for conduction terms  absorbing waves boundary conditions

15

Hydrodynamics simulations

•Evaluation of flux by solving Riemann problem

•A Riemann problem, named after Bernhard Riemann, consists of a conservation law of together with piecewise constant data having single discontinuity.   U  F  0 t x

U L , for x  0 U (x,0)   U R , for x  0

17 linear advection equation

ut  aux  0, u(x,0)  u0 (x) constant

The solution is u(x,t)  u0 (x  at)

18 Characteristic lines of the linear advection equation

u(x,t)

u0 (x) 19 The Burgers’ equation

ut uux  0, u(x,0)  u0 (x) not a constant

The solution is u(x,t)  u0 (x u(x,t)t)

20 Characteristic lines of the Burgers’ equation

u(x,t)

u0(x)

21 Shock formation

u(x,Tb)

u0(x) Domain dependence and range influence The Courant-Friedrichs-Lewy (CFL) condition (stable condition) ( , ) x1 t1

x0 D(x,t0) Numerical domain dependence must cover physical domain.

t

x

allowable x  at unallowable, why ? Exact Riemann Solver for isothermal gas

•Riemann solver : (a) 1-shock and 2-shock, * *   L u  uL  c(  * )  L 

* *   R u  uR  c(  * )  R  (b) 1-rarefaction and 2-rarefaction

* * u  clog( )  uL  clog( L ) * * u  clog( )  uR  clog( R ) (c) 1-rarefaction and 2-shock, and (d) 1-shock and 2- rarefaction . For rarefaction vs shock case, we can not have exact solution and the Newton method is used to obtain the mid-state value. Sod shock tube problem Rarefaction waves Self-gravitating forces calculation

The self-gravitating force calculation for an infinitely thin disk is considered based on the derivatives of potential function satisfying the Poisson equation (x, y, z)  4(x, y) (z) (x, y, z)   K(x  x, y  y, z  z) (x, y) (z)dxdydz 1 1 K(x, y, z)  4 x2  y2  z 2   F x  x , y ,0, and F y  x , y ,0 i, j x i j i, j y i j x y  x, y   i, j  i, j x  xi  i, j y  y j . N N x  x y  Fi, j  K(x  x ' , y  y ' ,0) ' '   ' ' x  x '   ' ' y  y ' dxdy D i j i , j i , j i i , j j i' 1 j' 1 i' , j' x With the help of FFT, the entire computational complexity has been 2 2 2 2 reduced from O(N xN ) to O((N log2N) Fourier transform

Continuous type: For a continuous function of one variable f(x), the Fourier transform is defined as ~  f ()   f (x)ei2 xdx,   ~ and its inverse transform is f (x)   f ()ei2x d. 

Discrete type: Consider a complex series x i with N samples of the form x 0 , x 1 , x 2 ,  , x N  1 . The forward and backward transforms are defined as 1 N 1 ˆ ik 2n/ N xn   xk e for n  0..N 1. N k0

N 1 ˆ ik 2n/ N xn   xk e for n  0..N 1. k0 Danielson-Lanczos Lemma The discrete Fourier transform of length N (where N is even) can be rewrite as the sum of two discrete Fourier transforms, each of length N / 2. N 1 Nxˆ  x ei2nk/ N n k 0 k N / 21  x ei2nk/(N / 2) k 0 2k N / 21  ei2n/ N x ei2nk/(N / 2) k 0 2k 1 e n o  xˆn W xˆn where W  ei2 / N and n  0,, N 1. O(Nlog(N)) When N is the power of 2 and its exponent is p and define the complexity as T(p), the Danielson Lanczos lemma gives us, T( p)  2T( p 1)  2 p  2(2T( p  2)  2 p1)  2 p  22T( p 1)  2 2 p  2 p1T(1)  ( p 1)2 p  p2 p  O(N log(N)). Examples Astronomical Problems

Probing the galactic central region of galaxies. We want to study the evolution of galaxies and proto-stellar disk with or without viscosity, and with or without self- gravitating force. We want to study the evolution of galaxies and proto-stellar disk with or without self-gravitating force. The gap formation in proto-stellar disks The migration of planets in proto-stellar disks  NGC 1300, NGC 4945, NGC 4622  Hydrodynamic escape problems Galaxies Simulations Outline of Galaxies Simulations

• Spiral density waves • Initial settings • A study on the Toomre’s Q variable • NGC 4945 simulations Spiral density waves

Gas-dynamical system on the polar coordinate       r u    u   0       1   2  1    2   u  r u  P    uv    v  P    t r r r  2  r   v  r uv   v  P 1 1    u v     r r   Assume the gas is isothermal P  c 2  , the perturbation equations are

  0 1,u  u1,v  r v1,  0  1  SG and the spiral form is ~ ( ,u ,v , )  (~ ,u~ ,v~ ,)exp(i t  m  s(r)dr ) . 1 1 1 1 1 1 1    Lin-Shu dispersion relation

2 2 2 2 s c  2 G 0 | s |  (1v )  0, it is the Lin-Shu dispersion relation for gaseous disks and the   m modified epi-cyclic frequency v  .  cs 1/ 2 c  It has two roots  Q1  Q1  v2 1 , where Q  .   G 0 Equations of motion in terms of r ,  , z  2 d 2r  d    d  d 2 z   r   , r 2    J  r 2 ,   . 2     0 0 dt  dt  r  dt  dt z r   t We consider an orbit r 0 r 1 , equation becomes 2 d 2r t  1  J  dt 2 3 r . Linearization of the above equation r r1t 0 2 2   d   2  4 1 r0    yields d r 1 2 where  0 2 dr   r  0    dt 2 1 Wavy regions and evanescence region

When Q  2  v 2  1  0 , we cannot have any waves. In this region is called evanescence region and waves are damped. Lindblad Resonance Bar-driven spirals at Lindblad resonances according to asymptotic theory

IILR OILR OLR Leading waves Relatively open Tightly wound trailing waves trailing waves

OLR occurs when p= +/2 r d (2  42 (1 )) ILR occurs when p= -/2 2 dr 39 (Yuan & Kuo 1997) Numerical Simulation of the 3-kpc Arm of the : Equations          u    v  0          2       u   u  P    uv     t x y 2  x   v   uv   v  P       y 

•53 km/sec at 3 kpc •135 km/sec at undermined location on the opposite direction Numerical Simulation of the 3-kpc Arm of the Milky Way: Initial settings •Gas dynamical system with periodic force (rotating bar). Huntley bar potential: quadratic vanishing at the origin and 1/r^2 decaying at far away from the origin •Isothermal gas •Cartesian coordinate and grid size 256 X 256 (62.5pc x 62.5 pc) •Pattern speed for 2arm is 120 km/sec/kpc. The location of the resonance is at 3 kpc. ( For 2-arm case, CO is at 1.53 kpc.) •Self-gravitating computation: This computation bases on N- body discrete, but using FFT to speed up computational time. Non-Self Gravitating Self Gravitating (force 10%) Self Gravitating (force 10%) Self Gravitating (force 5%) Self Gravitating (force 5%) Radial Velocity Toomre Q variables • Introduction • Fueling the AGN of NGC 4945 • Observations of NGC 4945 • Simulations • Comparison between observations and simulations • Mass inflow rate • Summary 49 Fueling AGNs through spiral density waves excited at the outer inner Lindblad resonance

Frequency-radius diagram ξo : dimensionless distance (Maciejewski, 2004, MNRAS, 354, Zr : amplitude of perturbation 883) displacement of fluid elements 50 (Yuan & Yang, 2006, ApJ, 644, 180) Bending of the isovelocity contours along the spiral density waves excited at OLR

51 Bending of the isovelocity contours along the spiral density waves excited at OLR

52 Bending of the isovelocity contours along the spiral density waves excited at OLR

53 Bending of the isovelocity contours along the spiral density waves excited at OLR

54 Bending of the isovelocity contours along the spiral density waves excited at OLR

55 Bending of the isovelocity contours along the spiral density waves excited at OLR

56 Isovelocity curves bend inward along spirals excited at OLR

Isovelocity curves bend outward along spirals excited at OILR

57 (Yuan & Kuo, 1998, ApJ, 497, 689) Fueling the AGN of NGC 4945

58 Observations:

NGC 4945 SB(s)cd or SAB(s)cd Sy2 Distance : 3.82 Mpc 1" = 19 pc Among the well-studied AGNs, NGC 4945 is closest to us.

19.5' X 19.5' 59 Observations:

Intensity-weighted 12CO(2-1) mean velocity map of the central region of the galaxy observed with the Submillimeter Array (SMA)

60 Observations:

61 Observations:

Continuum-subtracted Paαimage (Marconi et al., 2000, A&A, 357, 24 ) , the black contours are from the Hα+[NII] image (Moorwood et al., 1996, A&A, 308, L1)

62 Simulations : Governing Equations

(i) Equation of continuity V V0 V1 Vg  dV v(r)2  ( v)  0 0  r2 (r)  t dr r (ii) Equation of motion V1(R,,t)  (R)cos[2(  pt)] (v) P  vv   V R2 t  (R)  0 2 2 2 (A1  R ) (iii) Equation of state (R)  R2 as R  0 2 P  a  (isothermal gas) (R)  R2 as R  

a 1 r A1  , R  r s rs 2  Vg  4 G (z) 63 Comparison between 12CO(2-1) observation and simulation

64 Comparison between Paαimage and simulation

65 Mass inflow rate at 50 pc

Mass inflow rate from simulation: -1 0.012 Mʘ yr

Accretion rate from observation: -1 0.0031Mʘ yr Guainazzi et al. (2000), Greenhill et al. (1997) 66 Summary for NGC 4945 simulation

We examine the mechanism of fueling AGNs through spiral density waves excited at the outer inner Lindblad resonances in the case of NGC 4945 by detailed comparisons of high resolution CO observation and Paαimage of its nucleus with two dimensional hydrodynamic simulations. The resulting hydro-dynamical model yields a mass inflow rate of an order of magnitude higher than the mass accretion rate, which is sufficient to fuel the AGN of NGC 4945.

67 Flow chart

Fit the observed velocity data to get the initial rotation Step 1 curve

Use the observed images and velocity fields to determine Step 2 which kind of density waves the spirals are

Estimate the locations of the resonances to get the rotating Step 3 speed of the bar

Vary the two parameters, Ψo and A1, in the bar potential Step 4

Compare simulation results and observations Step 5

68 References and codes

References: •Lin, Lien-Hsuan; Yuan, Chi; Buta, R.;Hydrodynamical Simulations of the NGC 6782; ApJ...684.1048L (2008) •Zhang H; Yuan C; Lin DNC; Yen David CC;On the orbital evolution of a Jovian planet embedded in a self-gravitating disk; ApJ...676.639Z (2008) •Yuan, Chi; Yang, Chao-Chin "On the Spiral Structure of NGC 5248: An Analytic Approach" APJ...644..180Y (2006) •Yuan, Chi; David C.C. Yen " Evolution of Self-Gravitating Gas Disks Under the Influence of a Rotating Bar Potential" JKAS...38..197Y (2005)

Codes: Contact with Prof. R. E. Taam, the leader of CFD-MHD group in ASIAA. 69