Treecodes for Cosmology Thomas Quinn University of Washington N-Body Shop

Similar documents
High performance computing and numerical modeling

Brad Gibson Centre for Astrophysics & Supercomputing Swinburne University

Fluid Dynamics. Part 2. Massimo Ricotti. University of Maryland. Fluid Dynamics p.1/17

Classical Equations of Motion

Modeling, Simulating and Rendering Fluids. Thanks to Ron Fediw et al, Jos Stam, Henrik Jensen, Ryan

Dynamics of Galaxies: Basics. Frontiers in Numerical Gravitational Astrophysics July 3, 2008

Symplectic integration. Yichao Jing

Geometric methods for orbit integration. PiTP 2009 Scott Tremaine

Smoothed Particle Hydrodynamics (SPH) Huamin Wang

NUMERICAL METHODS IN ASTROPHYSICS An Introduction

X i t react. ~min i max i. R ij smallest. X j. Physical processes by characteristic timescale. largest. t diff ~ L2 D. t sound. ~ L a. t flow.

Tutorial School on Fluid Dynamics: Aspects of Turbulence Session I: Refresher Material Instructor: James Wallace

Numerical Simulations. Duncan Christie

Computer Simulation Using Particles

AM 205 Final Project The N-Body Problem

2.5.1 Static tides Tidal dissipation Dynamical tides Bibliographical notes Exercises 118

Michela Mapelli. N-body techniques for astrophysics: Lecture 1 General Introduction

Relativistic Viscous Hydrodynamics for Multi-Component Systems with Multiple Conserved Currents

Langevin Methods. Burkhard Dünweg Max Planck Institute for Polymer Research Ackermannweg 10 D Mainz Germany

Introduction to Hamiltonian Monte Carlo Method

Numerical Solutions for Hyperbolic Systems of Conservation Laws: from Godunov Method to Adaptive Mesh Refinement

Chapter 1. Introduction

Towards Understanding Simulations of Galaxy Formation. Nigel Mitchell. On the Origin of Cores in Simulated Galaxy Clusters

Francis X. Giraldo,

Game Physics. Game and Media Technology Master Program - Utrecht University. Dr. Nicolas Pronost

Things I don't understand about Vlasov-Poisson numerics

The Shallow Water Equations

N-body Simulations. On GPU Clusters

Pressure corrected SPH for fluid animation

Tests of Spurious Transport in Smoothed Particle Hydrodynamics

CHAPTER 7 SEVERAL FORMS OF THE EQUATIONS OF MOTION

Cosmic Structure Formation on Supercomputers (and laptops)

Accretion Disks I. High Energy Astrophysics: Accretion Disks I 1/60

Gridless DSMC. Spencer Olson. University of Michigan Naval Research Laboratory Now at: Air Force Research Laboratory

The Hopf equation. The Hopf equation A toy model of fluid mechanics

Particle-based Fluids

Astronomy 8824: Numerical Methods Notes 2 Ordinary Differential Equations

Improvement of Calculation Stability for Slow Fluid Flow Analysis Using Particle Method *

Computational Astrophysics

Moving mesh cosmology: The hydrodynamics of galaxy formation

A Comparison of AMR and SPH cosmology codes

arxiv:astro-ph/ v1 21 Dec 2005

N-Body Methods. Chapter Numerical Stellar Dynamics Monte carlo methods Representing f (r;v;t)

An Overview of Fluid Animation. Christopher Batty March 11, 2014

A Hamiltonian Numerical Scheme for Large Scale Geophysical Fluid Systems

Numerical Studies of Backscattering from Time Evolving Sea Surfaces: Comparison of Hydrodynamic Models

Computational Astrophysics 1 Particle Mesh methods

Fluid-Structure Interaction Problems using SU2 and External Finite-Element Solvers

Transport equation cavitation models in an unstructured flow solver. Kilian Claramunt, Charles Hirsch

The Evolution of SPH. J. J. Monaghan Monash University Australia

Math background. Physics. Simulation. Related phenomena. Frontiers in graphics. Rigid fluids

Numerical Methods for ODEs. Lectures for PSU Summer Programs Xiantao Li

Outline. 1 Why PIC Simulations Make Sense. 2 The Algorithm. 3 Examples Surface High Harmonics Generation. 4 Extensions Of The PIC Algorithm

Hybrid LES RANS Method Based on an Explicit Algebraic Reynolds Stress Model

Numerical modelling of phase change processes in clouds. Challenges and Approaches. Martin Reitzle Bernard Weigand

Godunov methods in GANDALF

White dwarf dynamical interactions. Enrique García-Berro. Jornades de Recerca, Departament de Física

"C:\Program Files\ANSYS Inc\v190\CFX\bin\perllib\cfx5solve.pl" -batch -ccl runinput.ccl -fullname "Fluid Flow CFX_002"

PDE Solvers for Fluid Flow

Dedalus: An Open-Source Spectral Magnetohydrodynamics Code

Superbubble Feedback in Galaxy Formation

Dynamics and Time Integration. Computer Graphics CMU /15-662, Fall 2016

Fluid Animation. Christopher Batty November 17, 2011

List of Comprehensive Exams Topics

Unified Modeling of Galaxy Populations in Clusters. Thomas Quinn University of Washington NSF PRAC Award

Theoretical implications of detecting gravitational waves

2 Equations of Motion

GAME PHYSICS SECOND EDITION. дяййтаййг 1 *

NATIONAL UNIVERSITY OF SINGAPORE PC5215 NUMERICAL RECIPES WITH APPLICATIONS. (Semester I: AY ) Time Allowed: 2 Hours

Research on Structure Formation of Plasmas Dominated by Multiple Hierarchical Dynamics

Evolution of the Small Galaxy Population. Thomas Quinn University of Washington NSF PRAC Award

Soft Bodies. Good approximation for hard ones. approximation breaks when objects break, or deform. Generalization: soft (deformable) bodies

A Fast N-Body Solver for the Poisson(-Boltzmann) Equation

Spectral Processing. Misha Kazhdan

Symplectic Maps for General Hamiltonians

A THEORETICAL INTRODUCTION TO NUMERICAL ANALYSIS

An optimum time-stepping scheme for N-body simulations

ASTR 610 Theory of Galaxy Formation Lecture 4: Newtonian Perturbation Theory I. Linearized Fluid Equations

Final Review Prof. WAN, Xin

CHAPTER 4. Basics of Fluid Dynamics

Phase Equilibria and Molecular Solutions Jan G. Korvink and Evgenii Rudnyi IMTEK Albert Ludwig University Freiburg, Germany

The RAMSES code and related techniques I. Hydro solvers

Validation of an Entropy-Viscosity Model for Large Eddy Simulation

Dense Arithmetic over Finite Fields with CUMODP

Lifshitz Hydrodynamics

Time-Parallel Algorithms for Weather Prediction and Climate Simulation

Numerical Algorithms as Dynamical Systems

NPTEL

A G-equation formulation for large-eddy simulation of premixed turbulent combustion

Time-Parallel Algorithms for Weather Prediction and Climate Simulation

Solving the Euler Equations!

LES of turbulent shear flow and pressure driven flow on shallow continental shelves.

Reynolds number scaling of inertial particle statistics in turbulent channel flows

What is Classical Molecular Dynamics?

High Performance Computing In Astrophysics: Parallel Gasdynamics And Gasoline

Kinetic relaxation models for reacting gas mixtures

Hydrodynamics, Thermodynamics, and Mathematics

AMSC 663 Project Proposal: Upgrade to the GSP Gyrokinetic Code

Navier-Stokes equations

Fig. 1 Cluster flip: before. The region inside the dotted line is flipped in one Wolff move. Let this configuration be A.

Transcription:

Treecodes for Cosmology Thomas Quinn University of Washington N-Body Shop

Outline Motivation Multipole Expansions Tree Algorithms Periodic Boundaries Time integration Gravitational Softening SPH Parallel Architecture of GASOLINE

Time stepping An N-body system is Hamiltonian Invariant under time translation Phase space density preserved Preserve these properties in a numerical integration by Exactly integrating an Approximate Hamiltonian Operator Splitting: 1 st applying part of a Hamiltonian, then applying the 2 nd part is equivalent to an approximate Hamiltonian

Time Stepping Consider Where Hamilton's equations give: This is Leap Frog! Obeys a Hamiltonian: Saha & Tremaine 1992

Leapfrog vs. Runge Kutta

In a Rotating Frame

Comoving Equations of Motion But these can be derived from a Hamiltonian: Where p' = a 2 v'

Canonical Comoving Equations The two pieces of the Hamiltonian can be integrated to give: A single timestep is taken by applying

Hierarchical Timestepping Large dynamic range in density implies large range in timescales: Timesteps organized in power of 2 rungs

Symplectic Variable Timesteps? At a minimum, must be reversible Because of timestep decision, reversibility is expensive or impossible. Trial timesteps and implicit step choices Force splitting schemes At least minimize time asymmetries: Make timestep choice where the acceleration is calculated. => KDK scheme KDK more efficient and better momentum conserve.

Timestep Criteria EpsAccStep: dt ~ sqrt(softening/acceleration) DensityStep: dt ~ sqrt(1/density) GravStep: dt ~ sqrt(r ij 3 /(m i + m j )) Courant: smoothing/sound speed See M. Zemp et al 2007 for an optimal criterion

Gravitational Softening Recall: we are solving the CBE, and particles sample f(z). The standard sum is a Monte-Carlo integral. The 1/ x x' term is not well suited to this. Introduce softening to minimize <force error> Does not effect two body relaxation time! Too small: two body scattering Too large: lose structural detail Ultimately a computational cost decision

SPH advantages Naturally partners with a particle gravity code Arbitrary geometry Lagrangian Galilean invariant Less dissipative for density weighted quantities Fast Easy to implement Flexibility with Equations of State

Basic principles of SPH Model the fluid as a collection of elements represented by particles Move particles using Lagrangian forms of the fluid equations Assign thermodynamic properties to the particles. Some properties determined by local averages Use an interpolation method to get these averages from local particles.

Interpolation The interpolant of any function f(r) is: h is the smoothing length and determines the extent of the averaging volume. W is the smoothing kernel which satisfies:

Interpolation for finite points In general:

Calculating Gradients Integration by parts can move the derivative: Better accuracy is obtained with gradients of density weighted quantities:

The Weighting Function Requirements: Continuous 2 nd derivatives Compact Symmetric Cubic Spline Symmetrize explicitly

SPH equations Density: Momentum Energy Alternatively: Entropy Equation (comparable performance)

Artificial Viscosity Momentum diffusion necessary to stabilize all numerical hydro formulations.

Artificial Viscosity & Diffusion All hydro codes introduce diffusion for stability SPH only has diffusion if explicitly added High Reynold numbers flows have turbulence below the resolution which can be modeled by diffusion (Smagorinsky 1963)

Wadsley et al 2008 Bubble comparison

Metal Diffusion Turbulence should also diffuse metals. For a scalar, A: Shen, Wadsley & Stinson 2010

Metal distribution

Cooling Cooling timescales can be short compared to a dynamical time Implicit (stiff) solver for thermal energy, assume work and density are constant. Addition of non-equilibrium metal cooling: Enhances low T cooling in the presence of UV

Metal Cooling

Parallel Architecture of GASOLINE Master layer: overall flow control; serial Processor Set Tree layer (PST): parallel glue Parallel KD layer (PKD): Access to particle/tree data Serial, runs simultaneously on all processors Machine Dependent layer (MDL): Interface to parallel primitives Implemented in MPI, Posix-threads, PVM, serial,...

MDL Allows for easy portability/performance tuning Implements: Asynchronous remote procedure call Memory swapping Read-only and combining remote memory access Diagnostic utilities

MDL Cache Software cache of remote data Amortizes access of remote data Avoids excess memory use Read-only Combiner: commutative/associative operations e.g.: sum, maximum Necessary for symmetric SPH

PST layer Balanced, binary tree of processors. Organizes parallel dispatch and top level tree

Domain Decomposition Domains are complete subtrees: domain tree coincides with top level of gravity tree ORB tree used to balance work Root find at each level to find split that balances work Non-Active particles split separately based on memory

Timestep Overview Adjust timesteps Kick velocities Drift Particles Domain Decompose Build tree, calculate Moments Calculate gravity forces Calculate SPH forces (predicted v & u needed) Kick velocities

Outline Motivation Multipole Expansions Tree Algorithms Periodic Boundaries Time integration Gravitational Softening SPH Parallel Architecture of GASOLINE