TREESPH: A UNIFICATION OF SPH WITH THE HIERARCHICAL TREE METHOD Lars Hernquist The Institute for Advanced Study and Neal Katz Princeton University Observatory

ABSTRACT A new, general–purpose code for evolving 3–D self–gravitating fluids in astrophysics, both with and

without collisionless matter, is described. In TREESPH hydrodynamic properties are determined using a Monte Carlo–like approach known as smoothed particle hydrodynamics (SPH). However, unlike most previous implementations of SPH, gravitational forces are computed with a hierarchical tree algorithm. A unification of these two techniques is attractive for a number of reasons, suggesting that TREESPH will be considerably more flexible than other similar numerical schemes.

First, since SPH and the hierarchical tree method are both gridless, TREESPH is fully Lagrangian and does not impose any artificial restrictions on the global geometry of the systems under study or any mesh–related limitations on the dynamic range in spatial resolution. In addition, TREESPH will be able to handle a variety of boundary conditions, depending upon the application.

Second, the dynamic nature of the data structures used to manipulate the particle distributions naturally permits the use of individual particle smoothing lengths and individual particle time steps. Both of these features have been incorporated into TREESPH, so it is adaptive in both space and time. As a result, the development of large density inhomogeneities can be resolved dynamically and TREESPH is not limited globally by local stability criteria such as the Courant condition.

Third, since the thermodynamic state of the gas is completely specified, processes such as radiative cooling and star formation can be prescribed in a physical manner.

Finally, SPH and the hierarchical tree method are both efficient for large particle number, N, with costs per step scaling as ∼ O(N) and ∼ O(N log N), respectively. Consequently, simulations with large N, and correspondingly high resolution, are now feasible.