## Simulation Methods

As many recent X-ray and optical observations have shown, most clusters of galaxies are not spherically symmetric systems. Therefore three-dimensional calculations are required to perform realistic simulations. Furthermore, the different cluster components must be taken into account. It is necessary to follow the evolution of the dark matter, and the galaxies as well as the intra-cluster medium (ICM). Dark matter and galaxies can be regarded as collisionless particles and can therefore be modeled by N-body simulations. In this kind of simulations only the gravitational interaction between the particles is taken into account. Each particle is moved in the force field of all the other particles. For current particle numbers of 1283 or 2563 it would take a lot of computing time to calculate the force by simply summing over all the other particles contributions. To accelerate the calculations different techniques have been developed, e.g. the particles are sorted onto a grid or into a tree structure. In this way several particles are combined and treated simultaneously without losing much accuracy but gaining a lot of computing time. Many simulations have been performed which simulate only the dark matter component and apply therefore only N-body calculations. Such simulations are very useful for many purposes because the dark matter makes up 75% - 85% of the gravitational mass. In this article, however, I will concentrate only on models which include the effect of the ICM.

For the simulation of the ICM the pressure must also be taken into account, i.e. the full hydrodynamic equations must be solved. Although the mean free path of the ions and electrons in the gas is sometimes larger than the typical size of the grid cells, the hydrodynamic treatment can be justified by the magnetic fields present in clusters. Although the fields are weak (of the order of 1 /j,G, see e.g. Kim et al. 1991) they are large enough to couple the particles on scales of a few kpc.

Two different methods have mainly been developed for the hydrody-namic treatment: (1) Smoothed Particle Hydrodynamics (SPH; Lucy 1977; Monaghan 1985). This is a Lagrangian approach, i.e. the calculation follows the fluid. The gas is treated as particles in this approach. Examples of this type of simulations are: Evrard (1990), Dolag et al. (1999), Takizawa (1999), and Takizawa & Naito (2000). (2) Grid-based codes. This is an Eulerian approach, i.e. the simulation volume is divided into cells and the fluid is moving in these cells which are fixed in space. Examples of simulations using grid codes can be found in Schindler & Müller (1993), Bryan et al. (1994), Roettiger et al. (1997), Ricker (1998), and Quilis et al. (1998).

Fortunately, the choice of simulation technique is not critical. Calculations with both methods yield very similar results. This was tested in a large project, the Santa Barbara Cluster Comparison Project (Frenk et al. 1999), in which the formation of a galaxy cluster was simulated using 12 different techniques developed by 12 different groups. Both methods, SPH and grid codes, were applied. Each simulation started with exactly the same initial conditions. The comparison showed very good agreement in the properties of the dark matter. Also, relatively good agreement was found in the gas temperature, the gas mass fraction and the gas profiles of the final cluster. The largest discrepancies were found in the X-ray luminosity which differed by up to a factor of 2. This discrepancy is probably not only an effect of different methods but also of different spatial resolutions.