"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. It is very useful for readers having a basic understanding of classical physics, vector calculus, partial differential equations, and simple computer programming."--Claudia-Veronika Meister, Zentralblatt MATH
Preface xi
PART I. THE FUNDAMENTALS 1
Chapter 1 A Model of Rayleigh-Bénard Convection 3
1.1 Basic Theory 3
1.2 Boussinesq Equations 10
1.3 Model Description 13
Supplemental Reading 15
Exercises 15
Chapter 2 Numerical Method 17
2.1 Vorticity-Streamfunction Formulation 17
2.2 Horizontal Spectral Decomposition 19
2.3 Vertical Finite-Difference Method 21
2.4 Time Integration Scheme 22
2.5 Poisson Solver 24
Supplemental Reading 25
Exercises 25
Chapter 3 Linear Stability Analysis 27
3.1 Linear Equations 27
3.2 Linear Code 29
3.3 Critical Rayleigh Number 30
3.4 Analytic Solutions 31
Supplemental Reading 34
Exercises 34
Computational Projects 34
Chapter 4 Nonlinear Finite-Amplitude Dynamics 35
4.1 Modifications to the Linear Model 35
4.2 A Galerkin Method 36
4.3 Nonlinear Code 38
4.4 Nonlinear Simulations 43
Supplemental Reading 48
Exercises 49
Computational Projects 49
Chapter 5 Postprocessing 51
5.1 Computing and Storing Results 51
5.2 Displaying Results 51
5.3 Analyzing Results 54
Supplemental Reading 57
Exercises 57
Computational Projects 57
Chapter 6 Internal Gravity Waves 59
6.1 Linear Dispersion Relation 59
6.2 Code Modifications and Simulations 62
6.3 Wave Energy Analysis 66
Supplemental Reading 66
Exercises 67
Computational Projects 67
Chapter 7 Double-Diffusive Convection 68
7.1 Salt-Fingering Instability 69
7.2 Semiconvection Instability 72
7.3 Oscillating Instabilities 74
7.4 Staircase Profiles 76
7.5 Double-Diffusive Nonlinear Simulations 79
Supplemental Reading 80
Exercises 80
Computational Projects 80
PART II. ADDITIONAL NUMERICAL METHODS 83
Chapter 8 Time Integration Schemes 85
8.1 Fourth-Order Runge-Kutta Scheme 85
8.2 Semi-Implicit Scheme 87
8.3 Predictor-Corrector Schemes 89
8.4 Infinite Prandtl Number: Mantle Convection 91
Supplemental Reading 92
Exercises 93
Computational Projects 93
Chapter 9 Spatial Discretizations 95
9.1 Nonuniform Grid 95
9.2 Coordinate Mapping 97
9.3 Fully Finite Difference 98
9.4 Fully Spectral: Chebyshev-Fourier 102
9.5 Parallel Processing 108
Supplemental Reading 112
Exercises 112
Computational Projects 112
Chapter 10 Boundaries and Geometries 115
10.1 Absorbing Top and Bottom Boundaries 115
10.2 Permeable Periodic Side Boundaries 117
10.3 2D Annulus Geometry 122
10.4 Spectral-Transform Method 130
10.5 3D and 2.5D Cartesian Box Geometry 133
10.6 3D and 2.5D Spherical-Shell Geometry 135
Supplemental Reading 162
Exercises 162
Computational Projects 164
PART III. ADDITIONAL PHYSICS 167
Chapter 11 Magnetic Field 169
11.1 Magnetohydrodynamics 170
11.2 Magnetoconvection with a Vertical Background Field 173
11.3 Linear Analyses: Magnetic 179
11.4 Nonlinear Simulations: Magnetic 182
11.5 Magnetoconvection with a Horizontal Background Field 184
11.6 Magnetoconvection with an Arbitrary Background Field 187
Supplemental Reading 189
Exercises 190
Computational Projects 191
Chapter 12 Density Stratification 193
12.1 Anelastic Approximation 194
12.2 Reference State: Polytropes 207
12.3 Numerical Method: Anelastic 214
12.4 Linear Analyses: Anelastic 219
12.5 Nonlinear Simulations: Anelastic 222
Supplemental Reading 227
Exercises 227
Computational Projects 228
Chapter 13 Rotation 229
13.1 Coriolis, Centrifugal, and Poincaré Forces 229
13.2 2D Rotating Equatorial Box 233
13.3 2D Rotating Equatorial Annulus: Differential Rotation 241
13.4 2.5D Rotating Spherical Shell: Inertial Oscillations 247
13.5 3D Rotating Spherical Shell: Dynamo Benchmarks 259
13.6 3D Rotating Spherical Shell: Dynamo Simulations 264
13.7 Concluding Remarks 275
Supplemental Reading 277
Exercises 278
Computational Projects 279
Appendix A A Tridiagonal Matrix Solver 283
Appendix B Making Computer-Graphical Movies 284
Appendix C Legendre Functions and Gaussian Quadrature 288
Appendix D Parallel Processing: OpenMP 291
Appendix E Parallel Processing: MPI 292
Bibliography 295
Index 307