          Astron. Astrophys. 325, 857-865 (1997)

## 5. Tests

Any form of artificial viscosity must be able to form and propagate a shock. The modification of the artificial viscosity, Eq. (13) and (16), is tested in a shock forming test and compared with the standard artificial viscosity, Eq. (6), introduced by Monaghan and Gingold (1983). The ability of the modified artificial viscosity to compress the gas without viscous deceleration and heating has also been tested in a homologous compression of a gas sphere. The test constructed by Evrard (1988) is used to study the differences between the artificial viscosities in a gravitational collapse of an initially cool gas cloud.

The number of particles is varied between 8192 and 16384, and the number of neighbours for each particle is 64, so that h is varying in time and space. In the equation of state the adiabatic index is to model an ideal monoatomic gas. Dimensionless units are used to keep the quantities in the model around unity, where the gravitational constant . In a model the total mass , the typical length and time , which relates to the gravitational constant as . The real quantities of the model can be calculated by inserting the corresponding quantities in the desired unit system.

### 5.1. Shock formation test

A box with dimensions is used. Periodic boundary conditions are applied in the x - and y -directions. At the ends of the tube, and , no boundary conditions were applied, so the particles are allowed to move away from the tube. Their velocities are however low compared with the velocity of the shock and do not affect the shock model. The 16384 particles are ordered in a cubic centered grid, such that 8192 particles are distributed at , and the rest at . With a total mass of 1.0 mass units the density distribution is The initial thermal energy density is set to 0.01, and the particles have no initial velocity. A shock is formed at the discontinuity at , which propagates to the right. This is a rather weak shock, which is a better test than a strong shock. The reason is that here the particle velocities are not much larger than the sound speed, because if they are the standard and modifies artificial viscosity become similar. Fig. 1 shows the shocks at with the standard artificial viscosity, Eq. (6), and Fig. 2 using modified artificial viscosity, Eq. (13) and (16). A comparison between Fig. 1 and 2 shows that the shocks formed by the two versions of artificial viscosity are similar, so that the modified artificial viscosity is able to work in the same way as the standard artificial viscosity. Fig. 1a-c. A shock in a shock tube with standard artificial viscosity, Eq. (6), which was formed by the density discontinuity described in Eq. (20). a shows at time the velocity distribution, b the pressure and c the density distribution. Fig. 2a-c. Same as Fig. 1, but with modified artificial viscosity, Eq. (13) and (16).

### 5.2. Homologous compression of a gas sphere

The ability of the modified artificial viscosity, Eq. (13) and (16), to handle compression of a gas realistically is tested. Initially 8192 particles are distributed unifomly in a sphere with radius on a slightly disturbed cubic centered grid. There are no boundary conditions applied, but there is an initial velocity distribution directed towards the origin according to where is a constant and the position in the sphere. The particles are initially isothermal with a thermal energy density of , and with a total mass of , which gives an initial density of . The sum of the total kinetic, , and thermal, , energies is Assume that the compression is adiabatic, so that Poisson's equation, is valid. From the equation of state, , and the adiabatic index, , it follows that If it is assumed that all kinetic energy is converted to thermal energy at maximum compression, the thermal energy density at this point is This gives a density and radius of the compressed gas sphere as This zeroth order approximation is useful to compare with calculations with different forms of artificial viscosity. The initial conditions also have the advantage that no artificial viscosity is needed to prevent interparticle penetration. A small initial pressure is sufficient to decellerate the particles to zero and prevent them to move through the origin. The results from the test with modified artificial viscosity can therefore not only be compared with the analytical approximation Eq. (25), but also with a model without any artificial viscosity. The energy curves from such a comparison are shown in Fig. 3. In Fig. 4 the density distributions at time are compared. Fig. 3. The energy curves for the homologous compression of a gas with different forms of artificial viscosity. The solid line represents the compression without any artificial viscosity at all, the dashed the modified artificial viscosity, Eq. (13) and (16), and the dotted the standard artificial viscosity, Eq. (6). The curves that decline in the beginning represent the kinetic energies for the three models, those that rise represent the internal and the uppermost straight curves represent the total energy. Fig. 4a-c. The density distribution for the homologous compression of the sphere at maximum compression without any artificial viscosity in a, with standard artificial viscosity in b, Eq. (6), and modified artificial viscosity, Eq. (13) and (16) in c. The results in a and c are plotted with the same scale, while another scale must be used in b. The solid line in a and c represent the zeroth order theoretical estimate from Eq. (26) at maximum compression where the radius is 0.029 and the density 10000.

The heating in the case with standard artificial viscosity, Eq. (6), starts immediately, because it depends on the relative velocities, while the heating without artificial viscosity and with the modified artificial viscosity is negligable until . The modified artificial viscosity has a little less steep energy curve compared with the case without artificial viscosity, but gives an almost a compressed gas as without artificial viscosity as seen in Fig. 4. The true density distribution is not known, but the zeroth order approximation from Eq. (25) gives approximately the same size as the model without artificial viscosity.

### 5.3. The Evrard gravitational collapse

The initial conditions are those from Evrard (1988), which is a isotherm sphere at rest with a thermal energy density of , radius and mass . Initially 8192 particles are distributed uniformly in a sphere with radius on a slightly disturbed cubic centered grid with a density distribution of Standard, Eq. (6), and modified artificial viscosity, Eq. (13) and (16) are tested with this model and compared with each other.

Due to the cold initial state the sphere begins to collapse. Since the central part is more dense than the outer payers, the collapse is more rapid around the origin. A high central pressure and density is build up, and the central parts starts to expand at . Where the expanding parts meet the infalling gas, an outward propagating shock front forms. Eventually the gas reach a virial equilibrium.

The total energies are shown in Fig. 5a and b. The curves are more shallow in Fig. 5a, where standard viscosity was used, than in Fig. 5b. In Fig. 6 the velocity, density and pressure distributions are plotted with standard artificial viscosity at when the shock is formed. This can be compared with the results from modified artificial viscosity for the same quantities which are shown in Fig. 7. The main difference between these models are the sharper gradients with modified artificial viscosity. This is an effect of the ability to compress the gas with modified artifial viscosity. The infalling gas is allowed to move inwards without decelleration until it meets the shock front. Fig. 5. The energy curves for the Evrard gravitational collapse using standard artificial viscosity, Eq. (6), represented by a dashed line, and modified artificial viscosity, Eq. (13) and (16), represented by a solid line. The uppermost curves represent the internal thermal energy, the next the kinetic, the straight line the total and the two curves below the others' the potential energy. The solid line is from an accurate one-dimensional PPM calculation at from Steinmetz & Müller (1993). Fig. 6a-c. The velocity, density and pressure distributions for the Evrard gravitational collapse using standard artificial viscosity, Eq. (6). The radial velocity, density and pressure are plotted at t=0.8. The crosses are values at t=0.77 are results from an accurate one-dimensional PPM calculation from Steinmetz & Müller (1992). Fig. 7a-c. Same as Fig. 6, but with modified artificial viscosity, Eq. (13) and (16).    © European Southern Observatory (ESO) 1997

Online publication: April 28, 1998 