This book provides readers with the skills they need to write computer codes that simulate convection, internal gravity waves, and magnetic field generation in the interiors and atmospheres of rotating planets and stars. Using a teaching method perfected in the classroom, Gary Glatzmaier begins by offering a step-by-step guide on how to design codes for simulating nonlinear time-dependent thermal convection in a two-dimensional box using Fourier expansions in the horizontal direction and finite differences in the vertical direction. He then describes how to implement more efficient and accurate numerical methods and more realistic geometries in two and three dimensions. In the third part of the book, Glatzmaier demonstrates how to incorporate more sophisticated physics, including the effects of magnetic field, density stratification, and rotation. Featuring numerous exercises throughout, this is an ideal textbook for students and an essential resource for researchers. It describes how to create codes that simulate the internal dynamics of planets and stars. It builds on basic concepts and simple methods. It shows how to improve the efficiency and accuracy of the numerical methods. It describes more relevant geometries and boundary conditions. It demonstrates how to incorporate more sophisticated physics.
Preface xi PART I. THE FUNDAMENTALS
Chapter
A Model of Rayleigh-Benard Convection
1.1 Basic Theory
1.2 Boussinesq Equations
1.3 Model Description
Supplemental Reading
Exercises
Chapter
Numerical Method
2.1 Vorticity-Streamfunction Formulation
2.2 Horizontal Spectral Decomposition
2.3 Vertical Finite-Difference Method
2.4 Time Integration Scheme
2.5 Poisson Solver
Supplemental Reading
Exercises
Chapter
Linear Stability Analysis
3.1 Linear Equations
3.2 Linear Code
3.3 Critical Rayleigh Number
3.4 Analytic Solutions
Supplemental Reading
Exercises
Computational Projects
Chapter
Nonlinear Finite-Amplitude Dynamics
4.1 Modifications to the Linear Model
4.2 A Galerkin Method
4.3 Nonlinear Code
4.4 Nonlinear Simulations
Supplemental Reading
Exercises
Computational Projects
Chapter
Postprocessing
5.1 Computing and Storing Results
5.2 Displaying Results
5.3 Analyzing Results
Supplemental Reading
Exercises
Computational Projects
Chapter
Internal Gravity Waves
6.1 Linear Dispersion Relation
6.2 Code Modifications and Simulations
6.3 Wave Energy Analysis
Supplemental Reading
Exercises
Computational Projects
Chapter
Double-Diffusive Convection
7.1 Salt-Fingering Instability
7.2 Semiconvection Instability
7.3 Oscillating Instabilities
7.4 Staircase Profiles
7.5 Double-Diffusive Nonlinear Simulations
Supplemental Reading
Exercises
Computational Projects
PART II. ADDITIONAL NUMERICAL METHODS
Chapter
Time Integration Schemes
8.1 Fourth-Order Runge-Kutta Scheme
8.2 Semi-Implicit Scheme
8.3 Predictor-Corrector Schemes
8.4 Infinite Prandtl Number: Mantle Convection
Supplemental Reading
Exercises
Computational Projects
Chapter
Spatial Discretizations
9.1 Nonuniform Grid
9.2 Coordinate Mapping
9.3 Fully Finite Difference
9.4 Fully Spectral: Chebyshev-Fourier
9.5 Parallel Processing
Supplemental Reading
Exercises
Computational Projects
Chapter
Boundaries and Geometries
10.1 Absorbing Top and Bottom Boundaries
10.2 Permeable Periodic Side Boundaries
10.3 Annulus Geometry
10.4 Spectral-Transform Method
10.5 and5D Cartesian Box Geometry
10.6 and 5D Spherical-Shell Geometry
Supplemental Reading
Exercises
Computational Projects
PART III. ADDITIONAL PHYSICS
Chapter
Magnetic Field
11.1 Magnetohydrodynamics
11.2 Magnetoconvection with a Vertical Background Field
11.3 Linear Analyses: Magnetic
11.4 Nonlinear Simulations: Magnetic
11.5 Magnetoconvection with a Horizontal Background Field
11.6 Magnetoconvection with an Arbitrary Background Field
Supplemental Reading
Exercises
Computational Projects
Chapter
Density Stratification
12.1 Anelastic Approximation
12.2 Reference State: Polytropes
12.3 Numerical Method: Anelastic
12.4 Linear Analyses: Anelastic
12.5 Nonlinear Simulations: Anelastic
Supplemental Reading
Exercises
Computational Projects
Chapter
Rotation
13.1 Coriolis, Centrifugal, and Poincare Forces
13.2 Rotating Equatorial Box
13.3 Rotating Equatorial Annulus: Differential Rotation
13.4 5D Rotating Spherical Shell: Inertial Oscillations
13.5 Rotating Spherical Shell: Dynamo Benchmarks
13.6 Rotating Spherical Shell: Dynamo Simulations
13.7 Concluding Remarks
Supplemental Reading
Exercises
Computational Projects
Appendix A A Tridiagonal Matrix Solver
Appendix B Making Computer-Graphical Movies
Appendix C Legendre Functions and Gaussian Quadrature
Appendix D Parallel Processing: OpenMP
Appendix E Parallel Processing: MPI
Bibliography
Index