WorksPhysics and Astronomy
Generalised and efficient wall boundary condition treatment in GPU-accelerated smoothed particle hydrodynamics
Abstract
This paper presents a generalised and efficient wall boundary treatment in the smoothed particle hydrodynamics (SPH) method for 3-D complex and arbitrary geometries with single- and multi-phase flows to be executed on graphics processing units (GPUs). Using a force balance between the wall and fluid particles with a novel penalty method, a pressure boundary condition is applied on the wall dummy particles which effectively prevents non-physical particle penetration into the wall boundaries also in highly violent impacts and multi-phase flows with high density ratios. A new density reinitialisation scheme is also presented to enhance the accuracy. The proposed method is very simple in comparison with previous wall boundary formulations on GPUs that enforces no additional memory caching and thus is ideally suited for heterogeneous architectures of GPUs. The method is validated in various test cases involving violent single- and multi-phase flows in arbitrary geometries and demonstrates very good robustness, accuracy and performance. The new wall boundary condition treatment is able to improve the high accuracy of its previous version \citep{ADAMI2012wall} also in complex 3-D and multi-phase problems, while it is efficiently executable on GPUs with single precision floating points arithmetic which makes it suitable for a wide range of GPUs, including consumer graphic cards. Therefore, the method is a reliable solution for the long-lasting challenge of the wall boundary condition in the SPH method for a broad range of natural and industrial applications.
Introduction
Due to the peculiarities of the smoothed particle hydrodynamics (SPH) method to cope with free-surface flows, complex geometries, multi-phase flows and many other natural or industrial problems, this method has attracted a considerable deal of attention in recent years (see e.g. Luo et al. [21]; Khayyer et al. [14]; Shimizu et al. [40]; Zhang et al. [53]; Hopp-Hirschler et al. [12]; Vázquez-Quesada et al. [44]). However, the contribution of SPH in solving industrial problems is not overwhelming yet, as a large amount of work still has to be done to address the unknown properties of SPH (Rezavand et al. [37]; Rahmat et al. [34]). As a well-known instance, the accurate treatment of the boundary conditions has always been a challenge (Adami et al. [1]; Valizadeh &) Monaghan 2015) and thus is highlighted as one of the SPH grand challenges [42]. As the applicability of SPH solvers in industrial problems highly depends on their computational efficiency, the treatment of boundary conditions on parallel architectures, in particular graphics processing units (GPUs), becomes increasingly more important.
Apart from the reflective boundary condition [9] that has been recently proposed, the widely applied wall boundary conditions in the SPH community can be divided into two general groups. In the first group (see e.g. Libersky et al. 1993; Monaco et al. 2011; Adami et al. 2012), a set of fictitious particles are used for modelling the wall boundaries to ensure that the support domain of the smoothing kernel function is covered by enough number of particles. The enhanced variants of the methods belonging to this group are suitable to realise complex 2-D and 3-D geometries [1], as well as multi-phase flows [38, 36], while being ideally suited to parallel architectures like GPUs (see e.g. Winkler et al. 2017; Peng et al. 2019). In the second group, either surface integrals are introduced when the physical quantities are computed close to the boundaries (see e.g. Kulasegaram et al. 2004; Marongiu et al. 2010; Mayrhofer et al. 2015), or artificial repulsive forces like a Lennard-Jones potential force are exerted on the fluid particles to prevent them crossing the boundaries (see e.g. Monaghan 1994; Monaghan & Kajtar 2009). Although using the surface integrals leads to consistent solutions and acceptable results, the extension to 3-D geometries or multi-phase flows is not straightforward and the normal vectors of the boundaries have to be computed at each time step for flexible boundaries [43]. On the other hand, 3-D complex geometries can be easily generated using the artificial repulsive forces while it may violate the kernel truncation in the immediate vicinity of the wall boundaries. These are due to the fact that in the models of the second group only a single layer of particles is required to mimic the boundaries, which is an advantageous characteristic.
The theoretical aspects of solid wall models in the weakly compressible SPH (WCSPH) have been comprehensively studied by Valizadeh & Monaghan [43], where several widely applied models are considered. They concluded that the method proposed by Adami et al. [1] together with the density diffusion terms of Antuono et al. [4] obtains the most satisfactory agreement with experiments among the discussed formulations in their work. As the SPH computations are inherently expensive, the efficiency of boundary treatment, as a crucial aspect of numerical analysis, on heterogeneous architectures is of substantial importance. In the context of GPU-accelerated SPH solvers, all the aforementioned wall boundary conditions are implemented and analysed (see e.g. Hérault et al. 2010; Crespo et al. 2015; Cercos-Pita 2015; Winkler et al. 2017; Alimirzazadeh et al. 2018; Peng et al. 2019). However, the conclusions of Valizadeh & Monaghan [43] are also reflected in this context and the majority of these solvers benefit from the methods of the first group, in particular the model proposed by Adami et al. [1], which shows that this method is the ideal choice for GPU-accelerated SPH solvers.
The above reflections are the motivations of the present study to generalise the work of Adami et al. [1] to 3-D complex geometries and multi-phase problems, which are not yet extensively addressed according to the existing literature [43, 38]. In this work we address this long-lasting open challenge of the SPH method and propose a novel wall boundary condition which ideally deals with complex 3-D geometries and multi-phase problems with abrupt physical discontinuities at the multi-phase interface and when interacting with wall boundaries. The method is also implemented on the heterogeneous architecture of GPUs to propose a reliable solution for a wide range of natural and industrial problems.
The proposed wall treatment achieves highly satisfactory results without a need for particle regularisation methods or accurate calculation of the wall normal vectors. On the other hand, to obtain accurate results the new methodology does not need density diffusion terms, which are not able to be extended in a straightforward way for multiphase flows and are deemed to be necessary by Valizadeh & Monaghan [43] to obtain the most satisfactory results with the method of Adami et al. [1]. We therefore believe that the present method can be a reliable solution for the long-lasting challenge of the wall boundary condition in the SPH method for a broad range of natural and industrial applications. The present method uses the estimates of the outward wall unit normal vectors with no need for its accurate calculation ([38, 48]) and thus enforces no additional memory caching which is ideally suited to GPU architectures and therefore more efficient. Using a force balance between the wall and fluid particles with a novel penalty method, a pressure boundary condition is applied on the wall dummy particles that effectively prevents particle penetration also in highly violent impacts and multi-phase flows with high density ratios. In addition, we introduce a new density reinitialisation technique to enhance the accuracy and robustness. Various 2-D and 3-D test cases are considered to asses the accuracy and robustness of the proposed method and the consistency of the formulation is also analysed from several aspects.
The rest of this paper is organized as follows: section 2 details the theoretical aspects of the proposed wall boundary conditions. The considerations for the implementation of the proposed method on GPUs are next explained in section 3. The numerical results are then presented and discussed in section 4 and finally, the concluding remarks of the present study are summarised in section 5. All the computational codes and data-sets accompanying this work are released in the repository of SPHinXsys Zhang et al. [52, 51] at https://www.sphinxsys.org.
Numerical method
Governing equations
For an inviscid flow the mass and momentum conservation equations can be written respectively as
and
where is the material or Lagrangian derivative, the density, the velocity, the pressure, the gravitational acceleration and a new force balance term obtained from a penalty method. Note that is applied only when a wall particle is interacting with a light phase (air) particle in multi-phase flow with high density ratios to prevent particle penetration into the wall boundaries. To close the system, pressure is estimated from density via an artificial equation of state, within the weakly compressible regime. Here, we use a simple linear equation for both the heavy and light phases
where and are the speed of sound and the initial reference density. In this study, we assume that the speed of sound is constant and we set , where denotes the maximum anticipated velocity of the flow.
Within the WCSPH framework, there are two different formulations to implement the conservation of mass, viz. the particle summation and continuity equation [29]. The former calculates density through a summation over all the neighbouring particles
where denotes the mass of particle and the smoothing kernel function is simply substituted by , with being the displacement vector between particle and and the smoothing length, respectively. The latter updates particle density by discretising the continuity equation as
where is the relative velocity and denotes the average velocity between particle and . In the two-phase cases of the present work, we follow Rezavand et al. [38] and use Eqs. (4) and (5) for the lighter phase and the denser phase, respectively. For the single-phase cases we use Eq. (5) for the entire domain including the boundary particles.
Following Monaghan [29], excluding the artificial viscosity, the momentum conservation equation can be discretised as
with being the average pressure between particle and .
WCSPH based on a Riemann solver
In the SPH methods based on the Riemann solvers ([45, 31, 48]), an inter-particle Riemann problem is constructed along the unit vector , with the initial left and right states reconstructed from particle and by piecewise constant approximation, respectively, as
where subscripts and denote left and right states, respectively, and the discontinuity is assumed at . For more details about the construction and solution of the single- and multi-phase Riemann problem, the readers are referred to Zhang et al. [48] and Rezavand et al. [38], respectively.
We approximate the intermediate velocity and pressure as [41, 48, 38]
where , and . In Eq. (8), the velocity and pressure solutions consist of a density-weighted average term and a numerical dissipation term. Due to the assumption of weak compressibility, the magnitudes of the second terms (numerical dissipation) are much smaller than that of the first term. To reduce the numerical dissipation, a limiter is applied for in Eq. (8) (Zhang et al. [48]; Rezavand et al. [38]). This results in a low-dissipation numerical scheme which will be further analysed in § 4.1.
Having the intermediate values determined, the mass and momentum conservation equations, i.e. Eqs. (5) and (6), can be rewritten as
and
where . The term was introduced by Rezavand et al. [38] for the sake of consistency and enhances the formulations in comparison to the work of Zhang et al. [48], which used instead. It is worth noting that Eq. (10) is also an antisymmetric relation and conservative.
Efficient wall boundary condition
As mentioned before, Valizadeh & Monaghan [43] concluded in a comprehensive study that the wall boundary model proposed by Adami et al. [1] together with a density diffusion term is in the very satisfactory agreement with experiments and is the best method among the discussed formulations in their work. Here we further improve the work of Adami et al. [1] for highly dynamic complex 3-D and multi-phase flows characterised by high density ratios to be executed on GPUs. The present formulation does not need the density diffusion terms deemed necessary by Valizadeh & Monaghan [43].
Here, we use dummy particles to impose the solid wall condition as shown in Figure 1. The main advantages of dummy particles compared to other wall boundary treatments mentioned earlier (e.g. the methods using surface integrals) is the simplicity when dealing with complex geometries, and also that the boundary is well-described throughout the simulation once the particles have been generated, which are of importance in the context of GPU-accelerated and high performance SPH solvers. From a practical point of view, this characteristic makes it possible to generate a separate data structure for the wall boundary particles on GPUs, which does not alter and can be reused during the whole simulation. Such methodologies have already demonstrated considerable computational performance enhancements (see e.g. Zhang et al. [49]).
Figure 1. Schematic illustration of the wall boundary condition: The blue particles represent the dummy wall boundaries and are fixed during the entire simulation. Fluid particles (in red) interact with the dummy particles and neighbouring fluid particles that lie in the support domain. In this work we use a 5th-order Wendland kernel [46] for which .
In figure 1, the fluid particles (in red) near the wall interact with the wall dummy particles (in blue), which lie within the support radius of the smoothing kernel function, . As a consequence, the dummy wall particles contribute to the mass and momentum conservation equations the same as the fluid particles. In order to realise the fluid-wall interactions, we only need to solve the constructed Riemann problem with the following intermediate pressure between particles of fluids and wall dummy particles, the same as for fluid-fluid interactions (see § 2.2)
where subscripts and denote fluid and wall, respectively. This will decrease the wall-induced numerical dissipation. It is worth mentioning that the intermediate velocity value is still obtained through Eq. (8), as for fluid-fluid interactions, depending on the problem being single- or multi-phase. We next calculate the pressure of the wall dummy particles by a summation over all contributions of the neighbouring fluid particles, similar to Adami et al. [1]
where is the wall acceleration. Note that, for the multi-phase problems with high density ratios, the above equation is divided by to vanish the contribution of the heavy phase particles in at a triple point, where water, air and solid particles meet [38]. The density of wall dummy particles is then obtained from pressure using the equation of state presented by Eq. (3). Another important aspect of this formulation is that the implementation of Eq. (12) retains the parallel nature of the algorithm related to the SPH method on GPUs [47, 32].
Penalty method
As mentioned before and seen in Eq. (2), in the present methodology we introduce a novel force balance term obtained from a penalty method, which effectively prevents particle penetration also in highly violent impacts and multi-phase flows with high density ratios. As also explained in Figure 1, this force is only applied when the particles of the lighter phase (e.g. ) interact with wall particles () and reads
where is the estimate for the unit normal vector of the wall particles, is the first derivative of the kernel function and is the penalty parameter for which denotes the penalty strength and
where is the initial particle spacing and
In the simulations of the present study and the unit normal vector for wall particles are calculated by [35, 48]
where the summation is only applied on the wall particles.
Density reinitialisation
In order to further enhance the robustness and accuracy of the proposed method, we propose a simple and efficient formulation to reinitialise the density field. In this formulation, the density field of fluid particles in free-surface flows is reinitialised at every time step using the following formulation
where and are the current and the initial number particle densities, respectively, denotes the density before reinitialisation and superscript 0 represents the initial reference value. For flows without free surface, Eq. (17) is simplified as
for internal flow. Note that the light phase experiences the heavy phase like moving wall boundary, while the heavy phase undergoes a free-surface-like flow with variable free-surface pressure in present multi-phase model. Therefore, Eqs. (17) and (18) are applied to light and heavy phases, respectively.
Time integration
At the beginning of every time step, the fluid density field is initialised by Eq. (17) or Eq. (18). To integrate the equations of motion in time, the kick-drift-kick (Monaghan [28]; Adami et al. [2]) scheme is employed. The first half-step velocity is obtained as
from which we obtain the position of particles at the next time step
Having the reinitialised density field and new positions, we update the density field either with the continuity equation in Eq. (5) and the following formulation for the heavy phases (e.g. water)
or solely with the summation formulation in 2.4 for the light phase (e.g. air). The pressure field is then updated using Eq. (3), accordingly. Now, we can obtain the time increment of the velocity field by Eq. (10) and then update the velocity of particles to the next time step as
For numerical stability, the time step size is limited by the CFL condition
and the body force condition
It is worth noting that following our previous work [38], also the present method uses the same speed of sound both for light and heavy phases which considerably enhances the computational efficiency of the method.
GPU implementation
In recent years the utilisation of the high floating point arithmetic performance of GPUs has become increasingly more widespread for high performance scientific computing. With the heterogeneous multi-thread architectures of GPUs, this new paradigm has made it possible to execute demanding large scale simulations on general purpose computing workstations. One of the leading technologies in this scope is the Nvidia graphic cards that are able to harness the computational power of thousands of GPU cores using the compute unified device architecture (CUDA).
In this study, we have implemented the proposed methodologies in CUDA using GPU well-suited data structures. Our numerical algorithm consists of the following main compartments: a) mass and momentum conservation equations, b) density update, c) pressure calculation for the dummy boundary particles, d) neighbour search and e) time integration. All of these multiple parts are implemented as CUDA kernels to be execute fully on the device (GPU), thereby minimizing the costly communications between host (CPU) and device memories. We only need to copy the simulation data once at the beginning from host to device, and vice versa when we need to save the computational results onto host at desired time intervals. The method is fully developed on single precision floating points arithmetic, which makes it possible to be efficiently executable even on consumer graphic cards.
Table 1 shows the percentage of the computational effort for all the aforementioned compartments according to the profiling results obtained by the Nvidia nvprof profiler for a 3-D multi-phase sloshing tank problem with 243 432 particles. As expected, the most resource intensive parts are the mass and momentum equations. It is noted that among the corresponding functions of the proposed wall boundary condition treatment, only the pressure calculation for wall particles and the density update formulation, respectively with 8.35% and 5.94%, take a considerable percentage of computational time. The computational effort corresponding to the penalty method and the normal vector calculation kernels are negligible. This demonstrates the efficiency of the proposed wall model on the GPU architectures, as the core kernels (penalty method and normal vectors) introduce almost no additional computational overhead and the proposed method is thus
| CUDA kernel | Time (%) |
| Mass conservation (Riemann solver) | 47.64 |
| Momentum conservation (Riemann solver) | 34.96 |
| BC pressure | 8.35 |
| Density update | 5.94 |
| Neighbour search (including sorting algorithms) | 2.31 |
| Time integration | 0.64 |
| Other functions | 0.16 |
caption: Percentage of the computational effort for different CUDA kernels for a 3-D multi-phase sloshing tank problem.
:::
evidently computationally efficient and also well suited to GPU architectures as it also does not expose additional memory caching.
In our framework, we use a single data structure for both fluid particles and the wall dummy particles. This is possible because, as we explained in § 2.3, the dummy particles contribute in the mass and momentum conservation equations in the same way as fluid particles. For this reason there is no need to store additional data, enforced by the wall boundary model, on the limited shared memory per streaming multiprocessor (SM), which is necessary in previous wall boundary models for GPUs (see e.g. Fourtakas et al. [8]). The above-mentioned characteristics also imply that the number of operations per data element access on the device memory is quite large and it tends to be a compute-bound kernel rather a memory-bound/bandwidth-bound kernel (Lee et al. [18]; Alimirzazadeh et al. [3]). Having in mind that the computational power of the GPUs is already quite high and is still rapidly growing, i.e. the number of registers and size of caches are increasing, this will be of high importance also for further optimizations in the near future. Similar advantages have been also observed in other GPU accelerated SPH solvers employing the wall boundary model proposed by Adami et al. [1] and running on single GPUs (see e.g. Winkler et al. [47]; Peng et al. [32]). The proposed method in the present study retains these advantages, while enhancing the accuracy, robustness and efficiency of the method of Adami et al. [1].
Numerical tests
In this section we first consider a two-phase hydrostatic tank with a high density ratio to assess the accuracy of the proposed method in static conditions. Other test cases including a two-phase sloshing tank and two single-phase dam break flows with complex arbitrary obstacles are also considered to validate the proposed method for modelling highly violent flows with high density ratio and to analyse the robustness of the proposed generalised method in complex 3-D problems, as well as challenging single-phase flows. We have used the quintic Wendland kernel Wendland [46] with a smoothing length of and a support radius of . To set the artificial speed of sound , the maximum velocity is estimated as according to the shallow-water theory Ritter [39], where is the initial depth of the denser phase and m. is the gravity acceleration for all the cases.
For the execution of the simulations we have used a workstation with an Intel(R) Xeon(R) CPU E5-2603 v4 equipped by 128 GB RAM and a Nvidia GeForce RTX 2080 Ti graphics card.
Two-phase hydrostatic tank
A 2-D two-phase hydrostatic tank is first considered to evaluate the proposed method in static conditions in the presence of gravity. In this case we quantify energy conservation properties of the proposed method, assess its accuracy and also analyse the convergence characteristics of the proposed boundary condition. The lower half of the tank is filled with water and the upper half is occupied by air, both initially at rest. The schematic of this problem is illustrated in Figure 2. The tank has a length of m and the initial water depth is m. Initially, particles are regularly placed on a Cartesian grid and to carry out convergence studies we use four initial particle spacings, namely , , and m. The two fluids are considered to be inviscid and the density of water and air are kg m and kg m, respectively. The obtained pressure contours and the particle distribution are depicted in Figure 3 at s. It can be observed that a quite smooth pressure field and a stable two-phase interface is obtained without notable non-physical interfacial behaviour. It is also noteworthy that both the pressure field and particle distribution in the vicinity of the wall boundaries are also quite uniform, which shows the effectiveness of the proposed wall boundary condition.
Figure 2. Two-phase hydrostatic tank: schematic illustration.

Figure 3. Two-phase hydrostatic tank: (a) particle distribution and (b) pressure field at s.
The accuracy and convergence properties of the proposed methodology are next evaluated through the comparison of the numerically computed pressure profile with the analytical hydrostatic pressure values. Figure 4 (a) compares the obtained pressure profile with the analytical solution and Figure 4 (b) shows the convergence properties of the proposed method using the -norm of error [7]. As it can be observed, an approximately first-order convergence is obtained.

Figure 4. Two-phase hydrostatic tank: (a) comparison of the pressure profile with analytical solution and (b) -norm convergence analysis at s.
As a substantial characteristic of numerical schemes, the energy conservation properties of the proposed method are also investigated here. Time histories of the global kinetic and potential energies of the system are plotted in Figure 5. One can clearly observe that after the initial effects of gravity, the energy variation vanishes and the system reaches an steady state. According to the results obtained with various particle resolutions, the solution evidently converges towards more accuracy with increasing resolution, however, the increased resolution of m has led to considerable noises in potential energy plot, which are due to the large number of particles contributing in the calculation of the values. Considering the obtained rest situation and having the theoretical
Figure 5. Two-phase hydrostatic tank: time histories of (a) global kinetic energy and (b) global potential energy of the system in comparison with analytical values and obtained with various particle resolutions.
amount of energy ( J) in mind, it is concluded that the proposed method has dissipated only 0.26% of the total energy until around s and the total energy stayed conserved afterwards.
Two-phase sloshing tank
The long lasting challenge of a robust wall boundary for 3-D multi-phase flows in the context of the SPH method has been subject of research since decades [43]. Our previously demonstrated progresses in dealing with multi-physics highly violent flows (e.g. [38, 48, 50 b}]) are further enhanced in the present study and in this section we examine the robustness and accuracy of the proposed method in one of the most challenging violent and complex multi-phase flows. If the motion frequency in a liquid sloshing tank is close to the natural frequency of the liquid due to the gravity wave, resonant condition happens, which may cause enormous impact loads on the structures. In this cases, where particles of a light phase are interacting with the wall boundaries and simultaneously with the heavy phase particles, some particles of the light phase penetrate into the wall and ultimately leave the 3-D computational domain. In this section, we also demonstrate the ability of the proposed method to effectively prevent this phenomena and compare the results with the method of Adami et al. [1].
Due to the highly non-linear phenomena in sloshing, similar benchmark cases have been used to validate several multi-physics SPH formulations (see e.g. [15, 22, 49, 10]). Cercos-Pita [5] and Winkler et al. [47] have also solved this problem on GPUs.
In this section we consider a 3-D two-phase liquid-gas sloshing case, which has been experimentally studied by Rafiee et al. (Rafiee et al. [33]. The schematic of this problem is illustrated in Figure 6. A tank of height m and width m is partially filled with water to 20% of the height, i.e. m, while the remainder is filled by air. The flow is considered to be inviscid also in this case, where the density of water and air are set to kg · m and kg · m, respectively. The tank motion is defined by a sinusoidal excitation of , where m and s are the amplitude and frequency, respectively. The simulations of this section have been carried out with m, which results in 410 752 total particles. Figure 8 shows the sloshing flow evolution within the 3-D domain in different time frames. The particles are identified with their phase index and it can be seen that the multi-phase interface is well captured and the dynamic nature of the flow along with the splashing phenomena are well reproduces. Moreover, the interaction of fluid particles with the wall boundaries is efficiently simulated and no non-physical penetration is noted.
Figure 6. 3-D two-phase liquid-gas sloshing tank: schematic illustration.

Figure 8. 3-D two-phase liquid-gas sloshing tank: snapshots of the flow evolution together with the details of multi-phase interface. The snapshots illustrate the time frames of , , and s and m.
The efficiency of the proposed method in preventing the particle penetration phenomena mentioned in previous sections is detailed in Figure 7. It can be clearly observed that without applying the penalty force term between particles of the light phase and the wall boundary particles, several particles of the light phase have penetrated into the wall boundaries at a triple point where all three phases, namely water, air and solid walls, are present. This behaviour continues to the next time steps and the particles ultimately leave the computational domain, which violates the conservation of mass principle and causes numerical instability. The proposed method effectively prevents this non-physical behaviour and leads to accurate and stable solutions.

Figure 7. 3-D two-phase liquid-gas sloshing tank: zoom-in views of the flow simulations (a) with and (b) without the penalty force term being applied between particles of the light phase and the wall boundary particles.
In order to further analyse the accuracy and performance of the proposed wall boundary condition in some cases where triple points occur, the interaction of fluid particles with wall boundaries at a triple point is shown in figure 9. It can be evidently seen that the interactions of both liquid and gas particles with the wall particles are very well reproduced, the interfaces between various phases are sharply maintained and quite smooth pressure and velocity fields are achieved. We can see that with the herein proposed wall boundary treatment an accurate and efficient interaction between fluid and wall particles is realised and non-physical penetration is prevented. Note that as the particles of the wall boundaries are constantly fixed, for easier interpretations of the figures we have not depicted them here.
The obtained results for the 3-D two-phase liquid-gas sloshing tank by the present method are also quantitatively validated against experimental results of Rafiee et al. [33] in figure 10. The pressure signals at three sensors shown in figure 6 are calculated and plotted here. A good agreement is evidently achieved between the experiments and the results obtained by the presented methodology. More importantly, the peak impact pressures predicted by the present method are found to be in a clearly better agreement with the experiments in comparison to the previous two-phase and single-phase simulations of Rezavand et al. [38] and Zhang et al. [49], respectively. These analysis demonstrate that the newly proposed wall boundary condition can outperform the previous methodologies in the simulation of highly violent impacts and prediction of the impact pressure, while achieves also more accurate simulations.

Figure 9. 3-D two-phase liquid-gas sloshing tank: zoom-in views of the (a) pressure field and (b) velocity field at a triple point where liquid, gas and solid wall particles interact at s where the first strong impact occurs.
Dam break with an obstacle
In this section we consider a 3-D dam break case with an obstacle placed on the downstream horizontal bed, which is known as the SPHERIC benchmark #2 and its detailed description can be found in https://spheric-sph.org/tests/test-2. This test case has been studied by Kleefsman et al. [16] first experimentally and then by an Eulerian volume of fluid (VOF) method. Later, this test case was simulated with the standard WCSPH and truly incompressible SPH (ISPH) methods by Lee et al. [19] and was recently also studied using a weakly compressible moving particle semi-implicit (WCMPS) by Jandaghian et al. [13]. In our simulations, particles are initially placed regularly on a Cartesian grid and in order to further analyse the convergence properties of the proposed method, we carry out the simulations with three different particle resolutions, viz. , and m, which correspond to 69 773, 349 340 and 2 061 483 number of particles, respectively.
Figure 10. 3-D two-phase liquid-gas sloshing tank: time histories of the impact pressure at (a) , (b) and (c) sensors in comparison with the experimental results of Rafiee et al. [33], previous two-phase SPH simulations of Rezavand et al. [38] and single-phase SPH simulations of Zhang et al. [49]
The evolution of the breaking dam flow is illustrated in several snapshots in Figure 11 and Figure 12, where the contours of pressure and velocity fields are shown, respectively. All physical features of the flow are very well captured and the distribution of both pressure and velocity fields are quite smooth at the vicinity of the solid walls, as well as the free-surface. The interaction of the water flow with the obstacle at s is also very well reproduced and the splash-up after the surge wave impacts the obstacle is well exhibited. The above observations demonstrate the effectiveness and accuracy of the proposed wall boundary treatment.

Figure 11. 3-D dam break with obstacle: snapshots of the flow evolution together with pressure distribution within the domain. The snapshots illustrate the time frames of , , and s and m.

Figure 12. 3-D dam break with obstacle: snapshots of the flow evolution together with velocity distribution within the domain. The snapshots illustrate the time frames of , , and s and m.
In order to further validate the accuracy of the proposed method, we quantitatively compare the values of impact pressure (, ) and wave height (, $i \in {2, 3, 4} obtained from seven sensors as describes in the test case documentation with the same names. The measured pressure signals are obtained by the method explained by Zhang et al. [48]. The pressure signals cause by the violent impact of the generated water wave are compared against experiments of Kleefsman et al. [16] in Figure 13. A good agreement is noted between the present SPH simulations and the experimental
Figure 13. 3-D dam break with obstacle: time histories of the impact pressure at (a) , (b) , (c) and (d) sensors with different particle resolutions and in comparison with the experimental results of Kleefsman et al. [16].
results. The peak impact pressure signals are well captured and also the long-term behaviours of the residual pressures are well reproduced. The pressure peak at sensor is slightly underestimated by the proposed method, however, the calculated pressure signals converge to the experimental results as the particle resolution increases. The sensor is located at the top of the obstacle with the presence of free-surface and effects of air, which might have caused the underestimation. A similar behaviour is however reported also by Mokos et al. [25] for both higher sensors ( and ) although they have carried out multi-phase simulation with the consideration of the air phase. It can be observed that our proposed wall treatment has evidently improved the pressure predictions in comparison to their multi-phase simulation for both challenging sensors, and .
Figure 14 portrays the time history of the water levels recorded at three different probes as identified by the experiment documentation. A good agreement with the experiments is noted also here and the long-term behaviour of wave height is well reproduced. The run-up and the water level peaks are slightly overestimated, which are attributed to the inviscid nature of the method that, as discussed in 4.1, introduces a marginal energy dissipation. It is also worth noting that in these plots the proposed method demonstrates a reasonable rate of convergence, as seen also in previous test cases.
Figure 14. 3-D dam break with obstacle: time histories of the wave height at (a) , (b) and (c) with different particle resolutions and in comparison with the experimental results of Kleefsman et al. [16].
Dam break with a wedge
Sharp boundaries and accurate reproduction of the resulting fluid-wall interactions have also always been a challenge for the SPH method. In order to further asses the proposed method in 3-D arbitrary geometries with sharp boundaries, here we consider a dam break flow with a wedge located at the middle of the downstream bed. The configuration of the problem is described in Figure 15. A similar 2-D test case has already been used by Valizadeh & Monaghan [43], however, we consider a wedge of rad angle, which results in sharper geometries and more abrupt changes in the flow pattern. The height of the wedge is m and here we set an initial inter-particle distance of corresponding to 5 734 250 number of particles.
Figure 15. 3-D dam break with a wedge: schematic illustration.
The evolution of the breaking dam flow and its interactions with the wedge are illustrated in several snapshots in Figure 16 and Figure 17, with the contours of pressure and velocity fields being shown, respectively. All physical features of the flow are very well captured and the distribution of both pressure and velocity fields are quite smooth. The interaction of water with the wedge at s and also the water jet formed after the wedge are effectively simulated. The above observations demonstrate the effectiveness and accuracy of the proposed wall boundary treatment. As it can be also observed, the large number of particles has resulted in simulations with more details of the flow structure.

Figure 16. 3-D dam break with a wedge: snapshots of the flow evolution together with pressure distribution within the domain. The snapshots illustrate the time frames of , 4, 6 and 8 s and m.

Figure 17. 3-D dam break with a wedge: snapshots of the flow evolution together with velocity distribution within the domain. The snapshots illustrate the time frames of , , and s and m.
The interaction of the high-speed water flow with the wedge is illustrated in more 重庆时时彩彩 details in Figure 18. It can be seen that the free-surface, particle splashing and the interaction with wedge are accurately simulated. The pressure and velocity fields are also quite smoothly captured. It is also worth mentioning that the effect of the sharp upper tip of the wedge on the flow pattern is very well noted, where it deviates the water particles from their relatively straight trajectory led by the water jet.

Figure 18. 3-D dam break with a wedge: zoom-in views of the (a) pressure field and (b) velocity field at s where the water flow interacts with the wedge and a high-speed water jet is developed.
Concluding remarks
In this study, we have presented a robust and efficient wall boundary condition for the SPH method which is accurately generalised for arbitrary 3-D complex geometries, multi-phase flows, and highly dynamic problems. As it has been concluded by Valizadeh & Monaghan [43], the wall boundary condition treatment presented by Adami et al. [1] in combination with a density diffusion formulation achieves the most satisfactory results among the widely used methodologies in the field of SPH. The presented method in this paper, generalises the method of Adami et al. [1] for complex 3-D problems, as well as multi-phase flows, while improves its accuracy, robustness and efficiency.
The proposed methodology is also implemented using CUDA to be executed on GPUs. Various specifications of the method are discussed and profiling results of the GPU-accelerated framework are summarized. The analysis highlights that the GPU kernel functions corresponding to the proposed method impose negligible computational overhead and memory caching, which identifies that the proposed methodology is ideally suited to the heterogeneous architecture of GPUs.
The proposed method is validated against existing experimental data, previous numerical studies and analytical solutions for both single- and multi-phase problems. It is shown that accurate solutions are obtained and potential non-physical particle penetration into the walls are prevented. Furthermore, it is evidently exhibited that in predicting violent impact events, the proposed method outperforms the previous methodologies of Rezavand et al. [38] and Zhang et al. [49], which have employed the wall boundary treatment proposed by Adami et al. [1]. Concerning arbitrary configurations with sharp geometries, the proposed method performs also very well and obtains accurate simulation, reproducing substantial features of the flows and fluid-wall interactions.
As the presented wall boundary condition exhibits unprecedented accuracy and is also efficiently executable on GPUs with no additionally imposed computational overhead, the method is a reliable solution for the long-lasting challenge of the wall boundary condition in the SPH method for a broad range of natural and industrial applications.
Acknowledgements
The authors gratefully acknowledge the financial support by Deutsche Forschungsgemeinschaft (DFG HU1572/10-1, DFG HU1527/12-1) for the present work.
References
- [1]Adami, S., Hu, X.Y. & Adams, N.A. 2012 A generalized wall boundary condition for smoothed particle hydrodynamics. J. Comput. Phys. 231 (21), 7057 – 7075.DOI
- [2]Adami, S, Hu, XY & Adams, Nikolaus A 2013 A transport-velocity formulation for smoothed particle hydrodynamics. J. Comput. Phys. 241, 292–307.DOI
- [3]Alimirzazadeh, Siamak, Jahanbakhsh, Ebrahim, Maertens, Audrey, Leguizamón, Sebastián & Avellan, François 2018 Gpu-accelerated 3-d finite volume particle method. Computers & Fluids 171, 79–93.DOI
- [4]Antuono, Matteo, Colagrossi, Andrea & Marrone, Salvatore 2012 Numerical diffusive terms in weakly-compressible sph schemes. Computer Physics Communications 183 (12), 2570–2580.DOI
- [5]Cercos-Pita, Jose L 2015 Aquagpush, a new free 3d sph solver accelerated with opencl. Computer Physics Communications 192, 295–312.
- [7]Fatehi, R & Manzari, MT 2011 Error estimation in smoothed particle hydrodynamics and a new scheme for second derivatives. Computers & Mathematics with Applications 61 (2), 482–498.DOI
- [8]Fourtakas, Georgios, Dominguez, Jose M, Vacondio, Renato & Rogers, Benedict D 2019 Local uniform stencil (lust) boundary condition for arbitrary 3-d boundaries in parallel smoothed particle hydrodynamics (sph) models. Computers & Fluids 190, 346–361.DOI
- [9]Fraga Filho, Carlos Alberto Dutra, Peng, Chong, Ibne Islam, Md Rushdie, McCabe, Christopher, Baig, Samullah & Durga Prasad, Gonella Venkata 2019 Implementation of three-dimensional physical reflective boundary conditions in mesh-free particle methods for continuum fluid dynamics: Validation tests and case studies. Physics of Fluids 31 (10), 103606.DOI
- [10]Gotoh, Hitoshi, Khayyer, Abbas, Ikari, Hiroyuki, Arikawa, Taro & Shimosako, Kenichiro 2014 On enhancement of incompressible sph method for simulation of violent sloshing flows. Applied Ocean Research 46, 104–115.DOI
- [12]Hopp-Hirschler, Manuel, Shadloo, Mostafa Safdari & Nieken, Ulrich 2019 Viscous fingering phenomena in the early stage of polymer membrane formation. Journal of Fluid Mechanics 864, 97–140.
- [13]Jandaghian, Mojtaba, Krimi, Abdelkader, Zarrati, Amir Reza & Shakibaeinia, Ahmad 2021 Enhanced weakly-compressible mps method for violent free-surface flows: Role of particle regularization techniques. Journal of Computational Physics 434, 110202.
- [14]Khayyer, Abbas, Gotoh, Hitoshi, Shimizu, Yuma & Nishijima, Yusuke 2021a A 3d lagrangian meshfree projection-based solver for hydroelastic fluid–structure interactions. Journal of Fluids and Structures 105, 103342.DOI
- [15]Khayyer, Abbas, Shimizu, Yuma, Gotoh, Hitoshi & Hattori, Shunsuke 2021b Multi-resolution isph-sph for accurate and efficient simulation of hydroelastic fluid-structure interactions in ocean engineering. Ocean Engineering 226, 108652.DOI
- [16]Kleefsman, KMT, Fekken, G, Veldman, AEP, Iwanowski, B & Buchner, B 2005 A volume-of-fluid based simulation method for wave impact problems. Journal of computational physics 206 (1), 363–393.DOI
- [18]Lee, Daren, Dinov, Ivo, Dong, Bin, Gutman, Boris, Yanovsky, Igor & Toga, Arthur W 2012 Cuda optimization strategies for compute-and memory-bound neuroimaging algorithms. Computer methods and programs in biomedicine 106 (3), 175–187.
- [19]Lee, Eun-Sug, Violéau, Damien, Issa, Réza & Ploix, Stéphane 2010 Application of weakly compressible and truly incompressible sph to 3-d water collapse in waterworks. Journal of Hydraulic Research 48 (S1), 50–60.
- [21]Luo, Min, Khayyer, Abbas & Lin, Pengzhi 2021 Article methods in ocean and coastal engineering. Applied Ocean Research 114, 102734.DOI
- [22]Lyu, Hong-Guan & Sun, Peng-Nan 2021 Further enhancement of the particle shifting technique: towards better volume conservation and particle distribution in sph simulations of violent free-surface flows. Applied Mathematical Modelling.DOI
- [25]Mokos, Athanasios, Rogers, Benedict D & Stansby, Peter K 2017 A multi-phase particle shifting algorithm for SPH simulations of violent hydrodynamics with a large number of particles. J. Hydraul. Res. 55 (2), 143–162.DOI
- [28]Monaghan, J J 2005 Smoothed particle hydrodynamics. Rep. Prog. Phys. 68 (8), 1703.
- [29]Monaghan, J. J. 2012 Smoothed Particle Hydrodynamics and Its Diverse Applications. Annu. Rev. Fluid Mech. 44 (1), 323–346.DOI
- [31]Moussa, Bachir Ben & others 2006 On the convergence of SPH method for scalar conservation laws with boundary conditions. Methods Appl. Anal. 13 (1), 29–62.
- [32]Peng, Chong, Wang, Shun, Wu, Wei, Yu, Hai-sui, Wang, Chun & Chen, Jian-yu 2019 Loquat: an open-source gpu-accelerated sph solver for geotechnical modeling. Acta Geotechnica 14 (5), 1269–1287.DOI
- [33]Rafiee, Ashkan, Pistani, Fabrizio & Thiagarajan, Krish 2011 Study of liquid sloshing: numerical and experimental approach. Comput. Mech. 47 (1), 65–75.DOI
- [34]Rahmat, Amin, Weston, Daniel, Madden, Daniel, Usher, Shane, Barigou, Mostafa & Alexiadis, Alessio 2020 Modeling the agglomeration of settling particles in a dewatering process. Physics of Fluids 32 (12), 123314, arXiv: https://doi.org/10.1063/5.0029213.
- [35]Randles, PW & Libersky, Larry D 1996 Smoothed particle hydrodynamics: some recent improvements and applications. Computer methods in applied mechanics and engineering 139 (1-4), 375–408.DOI
- [36]Rezavand, Massoud, Taeibi-Rahni, Mohammad & Rauch, Wolfgang 2018 An ISPH scheme for numerical simulation of multiphase flows with complex interfaces and high density ratios. Comput. Math. Appl. 75 (8), 2658–2677.DOI
- [37]Rezavand, Massoud, Winkler, Daniel, Sappl, Johannes, Seiler, Laurent, Meister, Michael & Rauch, Wolfgang 2019 A fully lagrangian computational model for the integration of mixing and biochemical reactions in anaerobic digestion. Computers & Fluids 181, 224–235.DOI
- [38]Rezavand, Massoud, Zhang, Chi & Hu, Xiangyu 2020 A weakly compressible sph method for violent multi-phase flows with high density ratio. Journal of Computational Physics 402, 109092.DOI
- [39]Ritter, August 1982 Die fortpflanzung der wasserwellen. Zeitschrift des Vereines Deutscher Ingenieure 36 (33), 947–954.
- [40]Shimizu, Yumi, Khayyer, Abbas, Gotoh, Hitoshi & Nagashima, Ken 2020 An enhanced multiphase isph-based method for accurate modeling of oil spill. Coastal Engineering Journal pp. 1–22.DOI
- [41]Toro, EF 1989 A fast Riemann solver with constant covolume applied to the random choice method. Int. J. Numer. Methods Fluids 9 (9), 1145–1164.DOI
- [42]Vacondio, Renato, Altomare, Corrado, De Leffe, Matthieu, Hu, Xiangyu, Le Touzé, David, Lind, Steven, Marongiu, Jean-Christophe, Marrone, Salvatore, Rogers, Benedict D & Souto-Iglesias, Antonio 2020 Grand challenges for smoothed particle hydrodynamics numerical schemes. Computational Particle Mechanics pp. 1–14.DOI
- [43]Valizadeh, Alireza & Monaghan, Joseph J 2015 A study of solid wall models for weakly compressible sph. Journal of Computational Physics 300, 5–19.
- [44]Vázquez-Quesada, Adolfo, Español, Pep, Tanner, Roger I & Ellero, Marco 2019 Shear thickening of a non-colloidal suspension with a viscoelastic matrix. Journal of Fluid Mechanics 880, 1070–1094.
- [45]Vila, JP 1999 On particle weighted methods and smooth particle hydrodynamics. Math. Models Methods Appl. Sci. 9 (02), 161–209.DOI
- [46]Wendland, Holger 1995 Piecewise polynomial, positive definite and compactly supported radial functions of minimal degree. Adv. Comput. Math. 4 (1), 389–396.DOI
- [48]Zhang, Chi, Hu, XY & Adams, Nikolaus A 2017 A weakly compressible SPH method based on a low-dissipation Riemann solver. J. Comput. Phys. 335, 605–620.DOI
- [49]Zhang, Chi, Rezavand, Massoud & Hu, Xiangyu 2020a Dual-criteria time stepping for weakly compressible smoothed particle hydrodynamics. Journal of Computational Physics 404, 109135.DOI
- [50]ZHANG, CHI, REZAVAND, MASSOUD & HU, XIANGYU 2021a A multi-resolution sph method for fluid-structure interactions. Journal of Computational Physics 429, 110028.arxiv.org/abs/1911.13255
- [51]ZHANG, CHI, REZAVAND, MASSOUD, ZHU, YUJIE, YU, YONGCHUAN, WU, DONG, ZHANG, WENBIN, WANG, JIANHANG & HU, XIANGYU 2021b Sphinxsys: an open-source multi-physics and multi-resolution library based on smoothed particle hydrodynamics. Computer Physics Communications p. 108066.DOI
- [52]ZHANG, CHI, REZAVAND, MASSOUD, ZHU, YUJIE, YU, YONGCHUAN, WU, DONG, ZHANG, WENBIN, ZHANG, SHUOGUO, WANG, JIANHANG & HU, XIANGYU 2020b Sphinxsys: An open-source meshless, multi-resolution and multi-physics library. Software Impacts 6, 100033.DOI
- [53]ZHANG, CHI, WANG, JIANHANG, REZAVAND, MASSOUD, WU, DONG & HU, XIANGYU 2021c An integrative smoothed particle hydrodynamics method for modeling cardiac function. Computer Methods in Applied Mechanics and Engineering 381, 113847.DOI







