This section will show the capabilities of mDBC and the improvements comparing with original DBC. Initially 2D simulations are investigated including still water with a triangular corner (a wedge) and a sloshing tank, and the 3D cases of a dam break impacting a cuboid obstacle, and flow through a fish pass. In each test case the performance of the boundary conditions will be assessed.
Still water on bed with a wedge (sharp corner)
A 2D still water tank with dimensions of 2.4 m × 1.2 m encloses a trigonal wedge in the bottom centre of the tank with a height of \(0.24\) m. The initial water height is \(H=0.5\) m. Results are analysed during 4 s of physical time. The ratio of smoothing length \(h\) to initial particle spacing \(dp\), \(h/dp=2\). Two simulations with different resolutions were executed (dp = 0.02 m and dp = 0.01 m).
The final instant (t = 4 s) is depicted in Fig. 2 for the two different resolutions and using DBC (left) and mDBC (right). The first row corresponds to dp = 0.02 m and the second row to dp = 0.01 m. Good results and improvements can be observed using mDBC with smoother and more physical pressure values now being obtained for the boundary particles, not only in the flat surface but also in the corners. Figure 3 shows more detail at the corners for the case with dp = 0.01 m, where this improvement becomes more apparent.
The vertical distribution of pressure is plotted to show the accuracy of the hydrostatic pressure distribution. Values of depth (\(z/H\)) against pressure (\(p/\rho gH)\) are plotted in Fig. 4 (at 4 s) for each fluid particle. For both resolutions, much improved hydrostatic pressure behaviour is obtained using mDBC, accurate down to the solid surface. In addition, the kinetic energy of the particles is measured. The time series for the summation of kinetic energy of all the fluid particles is shown in Fig. 5 (note a logarithmic scale is used). It is clear that mDBC generates much smaller particle movement than DBC. Runs up to 20 s showed negligible noise in the pressure, but a small amount of noise became apparent around 200 s.
Sloshing tank (moving boundaries)
The second 2D test case reproduces an experiment with moving boundaries. This is the SPHERIC Benchmark Test Case 10 (https://spheric-sph.org/tests/test-10), consisting of a sloshing tank of 0.9 m × 0.508 m with an initial water level \(H=0.093\) m (Fig. 6). The numerical pressures are obtained using DBC and mDBC and compared with the experimental values detected at Sensor 1 (Fig. 6). Two simulations with different resolutions are executed (\(dp=0.004\) m and \(dp=0.002\) m), again with \(h/dp=2\).
The instant of the simulation at time t = 2.47 s seconds is shown in Fig. 7, where the first impact of the fluid with left wall (Sensor 1) has just occurred. The colour of the particles corresponds to their pressure values.
Figure 8 shows in more detail the pressure field of the particles with DBC (left) and mDBC (right) with \(dp=0.002\) m. Two improvements can be observed using mDBC: (i) values of pressure for the boundary particles in the walls using mDBC are less noisy than the ones shown for DBC and (ii) the unphysical gap between the fluid and the boundary is negligible when mDBC is used. This is an important improvement since the computation of pressure values at Sensor 1 (Fig. 6) with DBC provides representative results only if the numerical pressure gauge is moved to take into account the size of the gap between the fluid and the boundary. The work of [32] estimated the size of the gap to be the smoothing length (\(h\)). There is a small high pressure region seen towards the top of the boundary of Fig. 8(b), which is a spurious but ineffectual pressure carried from a previous time step. This may occur when there are no nearby fluid particles: the correction matrix (Eq. (9)) does not meet the criteria to be solved due to its poor conditioning and the Shepard filter (Eq. 11) cannot be used as there are no fluid particles near a ghost node. This spurious pressure is not a concern in practice as it only results when there are no nearby fluid particles (within the support length of the ghost node) and so can have no effect on the fluid dynamics. As soon as there is fluid near the boundary, the correction matrix is able to solve and so provides correct densities (and pressures) in the boundary.
The experimental pressure (black line) is compared with numerical results in Fig. 9. The blue line, in the first row, corresponds to numerical pressure computed using DBC with pressure gauge at the original location; however the results are erroneous due to the large gap (in the order of \(h\)) without fluid particles. The second row shows the numerical pressure (green line) using DBC with pressure gauge moved \(+h\) into the fluid, much improving agreement with experimental data. However the use of mDBC, avoiding the gap and creating a realistic boundary layer, allows the computation of pressure at the exact location of the gauge obtaining very good results; the red line in the bottom panel of Fig. 9 shows again a good agreement with the experimental data. Note that negative pressures are observed in the experimental data and the mDBC numerical data around the time of the most violent impacts, coinciding with highly transient pressure shocks rebounding after high velocity water impact. The fact these transients are captured provides a further demonstration of the benefit of the mDBC approach over DBC. While persistent negative pressures can be an issue in SPH (leading potentially to the tensile instability), no evidence of this instability was observed here as the negative pressure event is so short-lived (existing for only O(1) time steps).
3D Dam break over cuboid obstacle
This is the SPHERIC Benchmark Test Case 2 (https://spheric-sph.org/tests/test-2) shown in Fig. 10; surface elevation was measured at positions H1, H2, H3 and H4 and pressures on the centreline plane of the cuboid obstacle surface [33]. Particle spacings \(dp =0.01\) m and 0.02 m were applied giving a particle number close to 1 million and 170,000, respectively. In this case \(h/dp=1.3.\)
Results of surface elevation at H4, H3, H2 are shown in Fig. 11 to be in close agreement with experiment, closer than DBC which shows a spurious value for H2 for small time.
Figure 12 shows the particle distribution at \(t=0.8\) s with jet height close to maximum, and the spurious DBC value at H2 is due to jet formation too far upstream, in front of the obstacle.
Pressures are shown at P2 (front face) and P5 (top corner of upper surface) in Fig. 13. For P2 agreement of mDBC with experiment is again close, generally closer than DBC. The peak pressures for P2 are in close agreement with experiment. Note again that DBC requires measurement at + h from the surface. For P5 mDBC with finer resolution is generally close to experiment as is DBC. Now the coarser mDBC shows some spurious fluctuations not present with the finer resolution.
This test case demonstrates how SPH with mDBC predicts highly transient free surface flow and pressures quite accurately.
Fish pass
The complex 3D test case of a fish pass, as shown in Fig. 14, is now simulated. A fish pass is a structure that facilitates the natural migration of some species of fish on or around artificial and natural barriers (such as dams, locks and waterfalls). Technical fish passes include: pool and weir fish passes, which is the type treated in the present work; vertical slot fish passes, and Denil fish passes. The principle of a pool and weir fish pass is to divide a channel by installing cross-walls, in order to form a succession of stepped pools from the headwater to the tailwater. The discharge usually passes through openings in the cross-walls and fishes migrate from one pool to the next through the submerged orifices (or gates) or through the notches (or weirs). Previous examples of fish pass flows being simulated using DualSPHysics with DBC include the work of Novak et al. [8] for a vertical slot type fish pass.
The fish pass considered here comprises a long channel inclined at an angle of 4.5° to the horizontal with vertical cross baffles restricting the flow, dividing the pass into three pools. Each of the baffles has a gate in one of the bottom corners and a weir in the opposite top corner, the orientation of the gates and weirs alternates between pairs of baffles, as shown in Fig. 15. For this case \(h/dp=1.3\), α in the range 0.01 (standard) to 0.001 was tested and particle shifting based of Fick’s equation [34] was applied to regularise the particle distributions. The particles are shifted a distance \(\delta {{\varvec{r}}}_{s}\) according to the equation
$$ \delta {\varvec{r}}_{s} = \user2{ } - D\nabla C_{i} $$
(13)
where \(C\) is the particle concentration and \(D\) is the diffusion coefficient given by Skillen et al. [34] as
$$ D = A h {\varvec{u}}_{i} {\text{d}}t $$
(14)
where \(A\) is a dimensionless constant which takes the value \(A=2\) for this case.
Experiments conducted at the University of Parma are used for comparison. Five test cases were measured: two involving flow only through the gates; three involving flow over only the weirs. The flow rates and water depths are shown in Table 1.where all the water depths are measured with respect to the base of the weir in wall 3.
Table 1 Flow rates and water depths measured with respect to weir 3 for fish pass test cases The numerical fish pass uses the inflow-outflow boundary conditions described in [31] to control the fluid particles entering and leaving the channel. The inlet is created in the centre of the upstream pool and the outlet in the centre of pool 3. To set up steady conditions, the experimental levels in each pool are first input and velocities are increased to provide the experimental flow rate. The correct flow rates are then maintained at inlet and outlet and water levels may be compared with experiment. Hin is the depth in the inlet zone above the base of the weir in Gate 3 (\(z=0\) in Fig. 14). H1, H2, H3 are depths in the centre of pools 1, 2, 3.
Gate only cases
We consider Q2 with an initial particle spacing of \(dp=0.01\) m (150,827 particles), \(dp=0.005\) m (914,467 particles) and \(dp=0.0025\) m (6,234,131 particles); results for Q1 were similar. Water level results are shown in Fig. 15. The water level in pool 1 with the smallest spacing is in close agreement with experiment although in pool 2 it is 0.0075 m, or three particle spacings, different.
Weir only cases
For the cases Q3–5 flow is only allowed to pass over the weirs, as the gates have been blocked off. Two particles spacings of \(dp=0.01\) m (207,784 particles) and \(dp=0.005\) m (1,372,059 particles) are used. We show results for Q5 as all cases are quite similar and the water levels are in close agreement with experiment, within one particle spacing, shown in Fig. 16.
These results show that flow through a very complex geometry may be modelled with mDBC. The results with weir only show very close agreement with experiment while those with gate only were less close. This is probably because rapidly varying free surface flows are well suited to SPH, corresponding with accelerated flow over the weirs. With accelerated flow through the gates and relatively tranquil free surface flow, mixing due to turbulence will be significant and the SPH model does not have a turbulence model. With the flow over the gates mixing due to the jets over the gate is gravity dominated. Flow visualisation is shown in Fig. 17 for flow rate Q3 with particle spacing \(dp=0.005\) m.
Computational performance
The computational performance of DualSPHysics on GPUs with mDBC and DBC is of practical importance as real problems generally require high resolution. This section compares the runtimes of DBC and mDBC for the same resolution, although mDBC achieves a given level of accuracy with lower resolution than mDBC. The performance of both boundary conditions is presented for two cases on a CPU for reference and on different generations of GPUs. The CPU device used here is an Intel Core i7-6700 K with a clock speed of 4.0 GHz and 8 execution threads (4 physical cores). The specifications of the GPU cards (commonly used for numerical computing) are shown in the Table 2.
Table 2 GPU specifications Two SPHERIC benchmark cases are selected to analyse the performance with the different boundary conditions; a 2-D case with moving boundaries and a 3-D problem. The 2-D sloshing tank case shown in Sect. 4.2 was simulated for 7 physical seconds using dp = 0.002 m and 26,791 particles. This simulation was executed on the devices in Table 2, and the runtimes are shown in Table 3 with the ratio mDBC to DBC runtime. The 3-D dam break case was simulated for 6 physical seconds using dp = 0.02 m (172,422 particles) and dp = 0.01 m (1,015,809 particles). The execution times of the 3-D dam break case described in Sect. 4.3 are included in Table 4.
Table 3 Runtimes of the 2-D sloshing tank simulation using dp = 0.002 m with different hardware devices Table 4 Runtimes of the 3-D dam break simulation with different hardware devices The use of mDBC thus results in a 10–20% increase in execution time over DBC for 2-D and 3-D simulations for the same resolution. This increase depends on the number and distribution of boundary and fluid particles of the simulation case, since extra calculation time is required for the interpolation carried on the ghost nodes projected from the boundary particles into the fluid domain. In practice a given level of accuracy may be achieved with mDBC with a lower level of resolution than DBC, reducing execution time below that for DBC.