-1 Series in Astronomy and Astrophysics NUMERICAL METHODS IN ASTROPHYSICS An Introduction Peter Bodenheimer University of California Santa Cruz, USA Gregory P. Laughlin University of California Santa Cruz, USA Michai Rözyczka Nicolaus Copernicus Astronomical Center Warsaw, Poland HaroldW.Yorke Jet Propulsion Laboratory Pasadena, California, USA Taylor & Francis Taylor & Francis Group New York London
Contents Chapter 1 Basic Equations 1 1.1 The Boltzmann Equation 1 1.2 Conservation Laws of Hydrodynamics 6 1.3 The Validity of the Continuous Medium Approximation 10 1.4 Eulerian and Lagrangian Formulation of Hydrodynamics 12 1.5 Viscosity and Navier-Stokes Equations 14 1.6 Radiation Transfer 19 1.6.1 Absorption, Emission, and Scattering 21 1.6.2 Moments of the Boltzmann Equation for Photons 22 1.6.3 Optically Thick and Optically Thin Limits 25 1.6.4 Flux-Limited Diffusion 26 1.6.5 Energy Equation in the Optically Thick Limit 27 1.7 Conducting and Magnetized Media 29 1.7.1 Maxwell's Equations 29 1.7.2 Equations of Magnetohydrodynamics 32 1.7.3 Limits of the MHD Approximation 33 1.7.4 Field Freezing 34 1.7.5 Summary 36 References 36 Chapter 2 Numerical Approximations to Partial Differential Equations 39 2.1 Numerical Modeling with Finite-Difference Equations 39 2.2 Difference Quotient 41 2.3 Discrete Representation of Variables, Functions, and Derivatives 43 2.4 Stability of Finite-Difference Methods 49 2.5 Physical Meaning of Stability Criterion 52 2.6 A Useful Implicit Scheme 58 2.7 Diffusion, Dispersion, and Grid Resolution Limit 62 2.8 Alternative Methods 65 References 70 Chapter 3 /V-Body Particle Methods 73 3.1 Introduction to the N-Body Problem 73 3.2 Euler and Runge-Kutta Methods 74 3.3 The Description of Orbital Motion in Terms of Orbital Elements 79 3.4 The Few-Body Problem: Bulirsch-Stoer Integration 85 3.5 Lyapunov Time Estimation 87 3.6 Symplectic Integration 90 3.7 N-Body Codes for Large N 94 3.8 Close Encounters and Regularization 99
3.9 Force Calculation: The Tree Method 104 3.10 Force Calculation: Fast Fourier Transforms j 07 References j j^ Chapter 4 Smoothed Particle Hydrodynamics j 15 4.1 Rudimentary SPH 115 4.2 Colliding Planets: An SPH Test Problem 118 4.3 Necessary Improvements to Rudimentary SPH 120 4.3.1 Initial Conditions 122 4.3.2 Kernels with Compact Support 122 4.3.3 Combining SPH with a Tree Code 123 4.3.4 Variable Smoothing Lengths 124 4.3.5 A Resolution Requirement 126 4.3.6 Introducing an Energy Equation into SPH 127 4.3.7 Heat Transfer in SPH 128 4.3.8 Shocks in SPH 129 4.3.9 Time Integration 133 4.4 Summary 134 References 137 Chapter 5 Stellar Evolution 139 5.1 Equations for Equilibrium of a Star 140 5.2 Radiative, Conductive, and Convective Energy Transfer 141 5.3 Change in Chemical Composition 143 5.4 Boundary Conditions 144 5.5 An Implicit Lagrangian Technique: Henyey Method 147 5.6 Physics Packages 155 5.6.1 Equation of State 156 5.6.2 Opacity 158 5.6.3 Nuclear Reactions 160 5.7 Examples 164 5.7.1 Evolution of the Sun 164 5.7.2 Age Determination for a Star Cluster 166 References 168 Chapter 6 Grid-Based Hydrodynamics 169 6.1 Flow Discontinuities and How to Handle Them 170 6.1.1 Steepening of Sound Waves 170 6.1.2 Rankine-Hugoniot Conditions 173 6.1.3 Shock Tube and Riemann Problem 175 6.1.4 Artificial Viscosity 178 6.2 A Simple Lagrangian Hydrocode 181 6.3 Basic Eulerian Techniques 185 6.3.1 Conservation of Physical Quantities 185
6.3.2 Advection ] 86 6.3.3 Godunov Method for Calculating Fluxes 188 6.3.4 Operator Splitting 189 6.3.5 Accuracy, Convergence, and Efficiency 191 6.4 Adaptive Mesh Reflnement 193 6.5 A Multidimensional Eulerian Hydrocode 197 6.5.1 Source Terms 200 6.5.2 Advection Terms 201 6.5.3 Boundary Conditions 204 6.5.4 Time Step Control 204 6.6 2i-Dimensional Simulations 206 6.6.1 Axial Symmetry 206 6.6.2 Radiation Transport 208 6.6.3 Thin Circumstellar Disk 213 6.7 Examples 214 6.7.1 Rayleigh-Taylor Instability 2J4 6.7.2 Supernova Explosion 216 6.7.3 Protostar Collapse and Disk Formation 217 6.7.4 Spiral Waves in a Thin Self-Gravitating Disk 219 References 221 Chapter 7 Poisson Equation 223 7.1 Poisson Solutions: 1 224 7.1.1 Direct Summation 224 7.1.2 Fourier Methods for Solving Equation (7.4) 225 7.1.3 Self-Consistent Field 230 7.2 Poisson Solutions: II 235 7.2.1 Boundary Conditions 236 7.2.2 Alternating Direction Implicit Method 239 7.2.3 Successive Overrelaxation 241 7.2.4 Multigrid Method 243 7.2.5 Fourier Techniques 243 7.2.6 Cyclic Reduction 247 7.2.7 Polynomial Expansions in Three Dimensions 248 7.3 Test of the Potential 249 References 251 Chapter 8 Magnetohydrodynamics 253 8.1 Basic Assumptions and Definitions 253 8.2 MHD Source Terms 256 8.3 Solving the Induction Equation 259 8.4 Initial and Boundary Conditions 264 8.5 Examples and Exercises 265 8.5.1 Contraction of a Magnetized Ring 265 8.5.2 Propagation of a Jet with a Helical Field 265
8.5.3 Magnetic Buoyancy Instability 267 8.5.4 Magnetorotational Instability 270 8.6 Concluding Remarks 274 References 274 Chapter 9 Radiation Transport 277 9.1 Solving the Ray Equation for the Continuum 277 9.2 Solution for Frequency-Dependent Radiation Transfer in Spherical Symmetry 279 9.3 Frequency-Dependent Stellar Atmospheres 285 9.4 Technique for Flux-Limited Diffusion in Two Space Dimensions 290 9.5 Example: Spectrum of a Rotating, Collapsing Object 300 9.6 Example: 3-D Calculations of the Solar Photosphere 305 References 308 Chapter 10 Numerical Codes 309 10.1 Radiation Transfer 309 10.2 Stellar Evolution 311 10.3 One-Dimensional Lagrangian Hydro. 316 10.4 ZEUS: 3-D Hydrodynamics 317 10.5 N-Body Codes 318 10.6 Smoothed Particle Hydrodynamics 322 References 323 Index 325