No Arabic abstract
We describe a strategy for code modernisation of Gadget, a widely used community code for computational astrophysics. The focus of this work is on node-level performance optimisation, targeting current multi/many-core IntelR architectures. We identify and isolate a sample code kernel, which is representative of a typical Smoothed Particle Hydrodynamics (SPH) algorithm. The code modifications include threading parallelism optimisation, change of the data layout into Structure of Arrays (SoA), auto-vectorisation and algorithmic improvements in the particle sorting. We obtain shorter execution time and improved threading scalability both on Intel XeonR ($2.6 times$ on Ivy Bridge) and Xeon PhiTM ($13.7 times$ on Knights Corner) systems. First few tests of the optimised code result in $19.1 times$ faster execution on second generation Xeon Phi (Knights Landing), thus demonstrating the portability of the devised optimisation solutions to upcoming architectures.
The standard formulation of the smoothed particle hydrodynamics (SPH) assumes that the local density distribution is differentiable. This assumption is used to derive the spatial derivatives of other quantities. However, this assumption breaks down at the contact discontinuity. At the contact discontinuity, the density of the low-density side is overestimated while that of the high-density side is underestimated. As a result, the pressure of the low (high) density side is over (under) estimated. Thus, unphysical repulsive force appears at the contact discontinuity, resulting in the effective surface tension. This tension suppresses fluid instabilities. In this paper, we present a new formulation of SPH, which does not require the differentiability of density. Instead of the mass density, we adopt the internal energy density (pressure), and its arbitrary function, which are smoothed quantities at the contact discontinuity, as the volume element used for the kernel integration. We call this new formulation density independent SPH (DISPH). It handles the contact discontinuity without numerical problems. The results of standard tests such as the shock tube, Kelvin-Helmholtz and Rayleigh-Taylor instabilities, point like explosion, and blob tests are all very favorable to DISPH. We conclude that DISPH solved most of known difficulties of the standard SPH, without introducing additional numerical diffusion or breaking the exact force symmetry or energy conservation. Our new SPH includes the formulation proposed by Ritchie & Thomas (2001) as a special case. Our formulation can be extended to handle a non-ideal gas easily.
In this paper, we present a new formulation of smoothed particle hydrodynamics (SPH), which, unlike the standard SPH (SSPH), is well-behaved at the contact discontinuity. The SSPH scheme cannot handle discontinuities in density (e.g. the contact discontinuity and the free surface), because it requires that the density of fluid is positive and continuous everywhere. Thus there is inconsistency in the formulation of the SSPH scheme at discontinuities of the fluid density. To solve this problem, we introduce a new quantity associated with particles and density of that quantity. This density evolves through the usual continuity equation with an additional artificial diffusion term, in order to guarantee the continuity of density. We use this density or pseudo density, instead of the mass density, to formulate our SPH scheme. We call our new method as SPH with smoothed pseudo-density (SPSPH). We show that our new scheme is physically consistent and can handle discontinuities quite well.
Smoothed Particle Hydrodynamics (SPH) is a ubiquitous numerical method for solving the fluid equations, and is prized for its conservation properties, natural adaptivity, and simplicity. We introduce the Sphenix SPH scheme, which was designed with three key goals in mind: to work well with sub-grid physics modules that inject energy, be highly computationally efficient (both in terms of compute and memory), and to be Lagrangian. Sphenix uses a Density-Energy equation of motion, along with variable artificial viscosity and conduction, including limiters designed to work with common sub-grid models of galaxy formation. In particular, we present and test a novel limiter that prevents conduction across shocks, preventing spurious radiative losses in feedback events. Sphenix is shown to solve many difficult test problems for traditional SPH, including fluid mixing and vorticity conservation, and it is shown to produce convergent behaviour in all tests where this is appropriate. Crucially, we use the same parameters within Sphenix for the various switches throughout, to demonstrate the performance of the scheme as it would be used in production simulations.
We present a method for simulating the dynamics of a mixture of gas and multiple species of large Stokes number dust grains, typical of evolved protoplanetary discs and debris discs. The method improves upon earlier methods, in which only a single grain size could be represented, by capturing the differential backreaction of multiple dust species on the gas. This effect is greater for large dust-to-gas ratios that may be expected in the later stages of the protoplanetary disc life. We benchmark the method against analytic solutions for linear waves, drag and shocks in dust-gas mixtures, and radial drift in a protoplanetary disc showing that the method is robust and accurate.
At present, the giant impact (GI) is the most widely accepted model for the origin of the Moon. Most of the numerical simulations of GI have been carried out with the smoothed particle hydrodynamics (SPH) method. Recently, however, it has been pointed out that standard formulation of SPH (SSPH) has difficulties in the treatment of a contact discontinuity such as a core-mantle boundary and a free surface such as a planetary surface. This difficulty comes from the assumption of differentiability of density in SSPH. We have developed an alternative formulation of SPH, density independent SPH (DISPH), which is based on differentiability of pressure instead of density to solve the problem of a contact discontinuity. In this paper, we report the results of the GI simulations with DISPH and compare them with those obtained with SSPH. We found that the disk properties, such as mass and angular momentum produced by DISPH is different from that of SSPH. In general, the disks formed by DISPH are more compact: while formation of a smaller mass moon for low-oblique impacts is expected with DISPH, inhibition of ejection would promote formation of a larger mass moon for high-oblique impacts. Since only the improvement of core-mantle boundary significantly affects the properties of circumplanetary disks generated by GI and DISPH has not been significantly improved from SSPH for a free surface, we should be very careful when some conclusions are drawn from the numerical simulations for GI. And it is necessary to develop the numerical hydrodynamical scheme for GI that can properly treat the free surface as well as the contact discontinuity.