Hostname: page-component-89b8bd64d-ksp62 Total loading time: 0 Render date: 2026-05-07T13:31:12.325Z Has data issue: false hasContentIssue false

Adaptive particle refinement for compressible smoothed particle hydrodynamics

Published online by Cambridge University Press:  27 January 2025

Rebecca Nealon*
Affiliation:
Centre for Exoplanets and Habitability, University of Warwick, Coventry, UK Department of Physics, University of Warwick, Coventry, UK
Daniel J. Price
Affiliation:
School of Physics and Astronomy, Monash University, Clayton, VIC, Australia
*
Corresponding author: Rebecca Nealon; Email: rebecca.nealon@warwick.ac.uk
Rights & Permissions [Opens in a new window]

Abstract

We introduce adaptive particle refinement for compressible smoothed particle hydrodynamics (SPH). SPH calculations have the natural advantage that resolution follows mass, but this is not always optimal. Our implementation allows the user to specify local regions of the simulation that can be more highly resolved. We test our implementation on practical applications including a circumbinary disc, a planet embedded in a disc, and a flyby. By comparing with equivalent globally high-resolution calculations, we show that our method is accurate and fast, with errors in the mass accreted onto sinks of less than 9% and speed ups of 1.07–6.62$\times$ for the examples shown. Our method is adaptable and easily extendable, for example, with multiple refinement regions or derefinement.

Information

Type
Research Article
Creative Commons
Creative Common License - CCCreative Common License - BY
This is an Open Access article, distributed under the terms of the Creative Commons Attribution licence (https://creativecommons.org/licenses/by/4.0/), which permits unrestricted re-use, distribution and reproduction, provided the original article is properly cited.
Copyright
© The Author(s), 2025. Published by Cambridge University Press on behalf of Astronomical Society of Australia
Figure 0

Figure 1. Schematic showing our refining and derefining process. The flow of the fluid is left to right and parent particles are larger and blue, children particles smaller and pink and the particle size is proportional to its mass. Particles that are split or merged in the time step shown are indicated with outlines and $\ell$ shows the refinement level. Left: As a parent particle crosses the boundary it is split into two children particles, their common centre of mass is at the parent’s location and they are split tangentially to the boundary. Right: Children particles are paired according to our modified k-d tree grouping (indicated with the grey boxes). When the centre of mass of a cell crosses the boundary the particles are merged, with the parent adopting the average velocity and position of the children. Further details are in Section 2.

Figure 1

Figure 2. Flowchart summarising the APR routine implemented in Phantom.

Figure 2

Table 1. Summary of the APR simulations shown in Section 3. Columns state the Name of the simulation, the radius of the central refinement region $r_{\ell}$, the steps into each refinement zone $dr_{\ell}$ and the average number of particles used N. The error, speed up and storage are all compared to the high-resolution reference cases. The method to measure the error is described in the text for each simulation and is measured according to Equation (6). The storage is calculated as a fraction compared to the high-resolution reference calculation. All simulations have 3 levels of increased refinement except F6 which has $\ell=6$. Here ‘B’ refers to binary, ‘P’ to planet-disc and ‘F’ to flyby simulations.

Figure 3

Figure 3. Column density of the HD142527 simulations from Price et al. (2018a) at $t=1\,137$ yr. The left and right panels have no APR and are separated by a factor of two in spatial resolution. The middle panel shows simulation B4 with three levels of refinement, locally matching the evolution of the high-resolution reference case. The refinement zone is shown with the light green circles where the highest resolution region is indicated with a solid line and the nested regions with dotted lines. The similarities in the streamers and circumprimary disc confirm our APR implementation is capable of accurately locally increasing the resolution of a simulation. A movie of these simulations is available online.

Figure 4

Figure 4. Mass of each sink in the HD142527 simulations with different combinations of refinement region sizes. The mass accretion rate reflects the properties of the disc surrounding the sink, confirming the structure of circumprimary disc in the APR simulations is the same as the high-resolution reference calculation (as seen in Fig. 3).

Figure 5

Figure 5. Column density of the region surrounding a planet embedded in a disc shown in the corotating frame. The left and right panels have no APR and are separated by a factor of two in spatial resolution. The middle panel shows simulation P6 with three levels of refinement, matching the circumprimary disc structure and spiral arms in the high-resolution reference simulation. The refinement zone is shown as in Fig. 3. This test demonstrates that structures like spiral arms are faithfully reproduced even when they cross the refinement boundaries. A movie of these simulations is available online.

Figure 6

Figure 6. Mass and radius of the planet in the planet-disc simulation with different combinations of refinement region sizes. The APR simulations and high-resolution simulations are again distinct from the low resolution reference simulation.

Figure 7

Figure 7. Comparison of discs formed from captured material around the perturber in the flyby simulation (see Smallwood et al. 2024). The ‘Low resolution’ and ‘High-resolution’ panels do not have APR and are separated by a factor of two in resolution. Simulations F1 and F4 initially have $N=5\times10^5$ particles with 3 levels of APR, F5 has $N=4\times10^6$ particles with 3 levels of refinement and F6 has $N=5\times10^5$ particles with 6 levels of refinement. The refinement zone is shown as in Fig. 3. The disc structure is similar irrespective of the base resolution of the simulation but the tidal stream onto the disc depends on the size of the refinement region and the number of levels. A movie of these simulations is available online.

Figure 8

Figure 8. Mass of the perturber star in the flyby simulation for different combinations of refinement regions and maximum refinement levels. As before, increasing the resolution using APR leads to a lower mass accretion rate and the similarities between the APR and high-resolution reference evidence the similarity in the disc structure around the perturber star.

Figure 9

Figure 9. Quantifying the resolution of the perturber disc in the flyby calculations using $\langle h \rangle /H$ as a function of R. Three levels of refinement corresponds to a factor of two in linear resolution and this is recovered here by the $\langle h \rangle /H$ decreasing by about half for three refinement levels. Colour scheme is the same as in Fig. 8.

Figure 10

Table A1. Summary of the $h_\textrm{fact}$ employed and the average number of neighbours $N_\textrm{neigh}$ for the kernels tested in Fig. A1 (e.g. Price et al. 2018b).

Figure 11

Figure A1. Wave in a box test showing the effect of different kernels with APR. The blue points show the particles within the $y=0.5$ cross-section across the x dimension of the box at $t=2.0$. The dark blue line shows their average density, while the red line shows the average density of the same simulation without APR. The density discontinuity at the refinement boundary maintains a constant amplitude across all of the simulations.

Figure 12

Figure A2. Planet disc interaction test showing the effect of different kernel choices and $r_\textrm{sep}$ on the noise introduced at the refinement boundary in a full simulation. Refinement boundaries are indicated in the same way as Fig. 3. The boundary is smoothest for the Wendland C4 kernel when $r_\textrm{sep} = 0.2$ but we note the difference is marginal.

Figure 13

Figure A3. Wave in a box test showing the effect of different particle placement options when a split or merge occurs shown at the initial split (upper, $t=0.5$) and at the end of the simulation (lower, $t=2.0$). The colours are the same as in Fig. A1. Relaxing is most successful when the split first occurs but makes negligible difference during the course of the simulation. Directional splitting also makes little difference in the long term but does prevent particles from splitting across the boundary.

Figure 14

Figure A4. The planet disc interaction test, examining the effect of having different $n_\textrm{child}$. The left column has $n_\textrm{child}=2$ with nested refinement levels, the upper right has $n_\textrm{child}=4$ and one level of refinement, the lower right $n_\textrm{child}=8$ and one level. The refinement zones are shown as in Fig. 3. Rows have the same local resolution around the planet. While the nested refinement zones do add noise at the boundaries, this is demonstrably less than bigger numbers of children.

Figure 15

Figure A5. Testing the size of the refinement zone, where the four simulations are characterised by the number of sound crossings that can occur between the refinement and derefinement boundaries. The refinement region is indicated with a green circle in the figure.