# A New Parallel Framework of SPH-SWE for Dam Break Simulation Based on OpenMP

^{1}

^{2}

^{3}

^{4}

^{5}

^{6}

^{7}

^{*}

## Abstract

**:**

## 1. Introduction

^{2}, and implemented it on GPUs for high-performance parallel computing.

## 2. Methodology

#### 2.1. Governing Equations

_{f}represents the riverbed friction. In the SWEs, the area density is defined as:

_{w}represents the density of water.

#### 2.2. Water Depth Solutions

_{i}and ρ

_{i}represent the smooth length and the area density of the particle i; h

_{0}and ρ

_{0}represent the initial values of the smooth length and the area density, respectively; d

_{m}represents the latitude (1 represents one dimension, 2 represents two dimensions) and W represents the kernel function.

#### 2.3. Speed Solution

_{i}is the acceleration of the particle i, and the solution formula of each particle can be obtained as follows:

_{i}, as shown below:

_{ij}represents the particle spacing; π

_{ij}represents the numerical viscosity added to maintain stability. However, this method has the problem of numerical dissipation.

_{l}and d

_{r}represent the water depth on the left and right sides, respectively; k = l and k = r represent the left and right states, respectively; d

_{0}represents the initial estimated water depth; $c=\sqrt{gh}$ represents the shallow water wave velocity.

#### 2.4. Time Integration and Boundary Processing

_{k,}

_{1}= 2X

_{v}− X

_{i}and X

_{k,}

_{2}= 4X

_{v}− X

_{i}). Among them, X

_{k,}

_{1}and X

_{k,}

_{2}represent the coordinates of the newly generated virtual particles, and X

_{v}represents the virtual boundary particles; (2) When the internal angle of the boundary is less than or equal to 180°, two newly generated virtual particles are added outside the corner. Compared with the single point of the VBP method, this improvement reduces the kernel truncation error.

_{ij}in Equation (7), which helps to reduce the numerical oscillation; however, this can cause a decrease in the accuracy of the calculation results and an possible increase on computational time.

## 3. SPH-SWE Model Solution Framework

Algorithm 1. Calculation framework of the SPH-SWEs model. This algorithm is needed to read the particles data (include fluid particles/virtual particles/open boundary particle/riverbed particles). |

Read parameters Output initial data of the model Mesh riverbed particles and calculate fluid particles and the net water depth$\left\{\mathit{L}\mathit{o}\mathit{o}\mathit{p}\begin{array}{c}\end{array}1\right\}$ Search particles$\left\{\mathit{L}\mathit{o}\mathit{o}\mathit{p}\begin{array}{c}\end{array}2\right\}$ do$t=0\to $total_number_of_timesteps**Step****1:**- Calculate the water depth of fluid particles$\left\{\mathit{L}\mathit{o}\mathit{o}\mathit{p}\begin{array}{c}\end{array}3\right\}$.$${\rho}_{i}={\displaystyle \sum _{j}{m}_{j}}{\mathit{W}}_{i}({x}_{i}-{x}_{j},{h}_{i})\begin{array}{c}\end{array}{h}_{i}={h}_{0}{\left(\frac{{\rho}_{0}}{{\rho}_{i}}\right)}^{1/{d}_{m}}$$
**Step****2:**- Calculate time water depth of fluid particles and the speed gradient$\left\{\mathit{L}\mathit{o}\mathit{o}\mathit{p}\begin{array}{c}\end{array}4\right\}$.$$\nabla {n}_{i}={\displaystyle \sum _{j}{V}_{j}}({n}_{i}-{n}_{j},{h}_{i})\nabla {W}_{i}({x}_{i}-{x}_{j},{h}_{i})\begin{array}{c}\begin{array}{cc}& (n=d/u/v)\end{array}\end{array}$$
**Step****3:**- Calculate time increments.$\Delta t=CFL\underset{i=1}{\overset{N}{\mathrm{min}}}\left(\frac{{h}_{i}}{ci+\Vert {\mathit{\nu}}_{i}\Vert}\right)$
**Step****4:**- Calculate accelerations of fluid particle,corrections of riverbed gradients,speeds, and displacements$\left\{\mathit{L}\mathit{o}\mathit{o}\mathit{p}\begin{array}{c}\end{array}5\right\}$. ${\overrightarrow{\mathit{a}}}_{\mathit{i}}=\frac{g+{\overrightarrow{\mathit{v}}}_{\mathit{i}}\xb7{\overrightarrow{\mathit{k}}}_{\mathit{i}}{\overrightarrow{\mathit{v}}}_{\mathit{i}}+{\overrightarrow{\mathit{t}}}_{\mathit{i}}\xb7\nabla {b}_{i}}{1+\nabla {b}_{i}\xb7\nabla {b}_{i}}\nabla {b}_{i}-{\overrightarrow{\mathit{t}}}_{\mathit{i}}+{\overrightarrow{\mathit{S}}}_{f,i}$
**Step****5:**- Calculate displacements of open boundary particles.
**Step****6:**- Fluid particle division.${\nu}_{k}={c}_{\nu}\frac{{d}_{N}}{dk}{\nu}_{N}\begin{array}{cc}& {c}_{\nu}=\frac{{A}_{N}}{{\displaystyle {\sum}_{k=1}^{M}{A}_{k}}}\end{array}$
**Step****7:**- Calculate fluid particle of the riverbed$\left\{\mathit{L}\mathit{o}\mathit{o}\mathit{p}\begin{array}{c}\end{array}1\right\}$.$$\{\begin{array}{l}{d}_{i}={\displaystyle \sum _{j}{d}_{j}{\mathit{W}}_{i}({x}_{i}-{x}_{j},{h}_{i}){V}_{j}\begin{array}{c}\begin{array}{cc}& {S}_{i}={\displaystyle \sum _{j}{\mathit{W}}_{i}({x}_{i}-{x}_{j},{h}_{i}){V}_{j}}\end{array}\end{array}}\\ shepard\begin{array}{cc}& correction:{d}_{i}=\frac{{d}_{i}}{{S}_{i}}\end{array}\end{array}$$
**Step****8:**- Search partilces$\left\{\mathit{L}\mathit{o}\mathit{o}\mathit{p}\begin{array}{c}\end{array}2\right\}$.
end do |

- Calculation of fluid particles in the riverbed;
- Particle search, and calculation of the water depth;
- Calculation of the fluid particle depth and velocity gradient;
- Acceleration and riverbed gradient correction;
- Calculation of velocity and displacement rate.

#### 3.1. Fluid Particle Riverbed Calculation

Algorithm 2. Computing fluid particle riverbed. |

1. Stage 1: $h\text{\_}t/sum\text{\_}h\text{\_}t=0$, initialize to 0 |

2. !$OMP PARALLEL DO PRIVATE(private variable),& |

3. !$OMP& SHARED(shared variable), DEFAULT(none), SCHEDULE(static) |

4. do $i=1\to $ total_number_of_fluid particles |

5. if particle_i is valid then |

6. Calculate particles’ mesh locations based on the riverbed’s mesh |

7. !$sum\text{\_}h\text{\_}t(i)$ is used to make shepard correction(CSPM) |

8. CALL PURE celij_hb $\left(i,h\text{\_}t(i),sum\text{\_}h\text{\_}t(i)\right)$ |

9. endif |

10. enddo |

11. !$OMP END PARALEL DO |

#### 3.2. Particle Search

_{i}or 2h

_{j}was used as the judgment condition of i effective particles.

- Before each time step, the temporary grid position was updated, and each grid was assigned to a unique number; the grid size can be set to a fixed size dx_grid/dy_grid;
- According to the position of the current SPH particles, all the SPH particles were allocated to the temporary mesh space, and the particle chain in the mesh was established;
- According to the range (2h
_{i}) of the tight support region of particle i, the search of other meshes (- xsize to xsize, - ysize to ysize) was completed in the tight support region of the mesh, storing the mesh number; - All the SPH particles i and j in the mesh were searched (icell-xsize to icell + size, jcell-ysize to jcell + ysize) in the tight support domain.

Algorithm 3: The particle search. Read in the particles data (include fluid particles/virtual parti`cles/open boundary particle/riverbed particles). |

1. In each timestep 2. Mesh all particles based on fixed size dx_grid/dy_grid(generally select the maximum smooth length) and particles into nc array3. ncx/ncy: total number of grids in x/y direction4. iboxvv/iboxff/iboxob: store the virtual particles, fluid particles and open boundary particles within the affected region into two dimensional arrays5. !$OMP PARALLEL DO PRIVATE (private variable),SHARED(shared variable),&6. !$OMP& SHARED(shared variable),DEFAULT(none)7. do $i=1\to $ total_number_of_fluid particles 8. if particle_i is valid then9. Calculate mesh of the particle i: icell/jcell10. Calculate search mesh range of particle i: xsize/yszie11. do row $\in $ -ysize,ysize12. irow=jcell+1 13. do column $\in $ -xsize,xsize14. icolumn=icell+column 15. Calculate number of search grid: gridn16. gridn=icolumn+(irow-1)*ncx17. !Search for Virtual particles in the scope of I particle18. do j $\in $ nc(grindn,1)19. if particle_i and particle_j are neighbours then20. Write particle_ j to iboxvv array21. endif22. enddo23. !Search for Fluid particles in the scope of i particle24. do j $\in $ nc(grindn,2)25. if particle_i and particle_j are neighbours then26. Write particle_ j to iboxff array27. endif28. enddo29. !Search for Open boundary particles in the scope of i particle30. do j $\in $ nc(grindn,3)31. if particle_i and particle_j are neighbours then32. Write particle_ j to iboxob array33. endif34. enddo35. enddo36. enddo37. endif38. enddo39. !$OMP END PARALLEL DO |

#### 3.3. Water Depth Calculation

^{−3}. Nevertheless, different approaches can be selected according to different calculation models.

_{i}

^{k}were re-calculated and updated. In the same time step, the updated smooth length was then used for the sub-sequent SPH interpolation. The calculation framework is displayed in Algorithm 4.

Algorithm 4: Water depth calculation. |

1. Stage 1: Guess for density and smoothed length2. !$OMP PARALLEL DO PRIVATE(private variable),&3. !$OMP& SHARED(shared variable),DEFAULT(none),SCHDULE(static)4. do $i=1\to $ total_number_of_fluid particles5. if particle_i is valid then6. 1a: $rhop(i)=rhop(i)+dt\cdot rhop(i)\cdot ar(i)$7. 1b: $h\text{\_}\mathrm{var}(i)=h\text{\_}\mathrm{var}(i)-(dt/dm)\xb7h\text{\_}\mathrm{var}(i)\xb7ar(i)$8. endif9. enddo10. !$OMP END PARALLEL DO11. CALL particle search() %Search particles12. Stage 2: Calculate depth13. do while ((maxval(resmax) .gt. Minimum error) .and. (Iterationtimes .lt. max)14. !$OMP PARALLEL DO PRIVATE(private variable),&15. !$OMP& SHARED(shared variable),DEFAULT(none),SCHEDULE(static)16. do $i=1\to $ total_number_of_fluid particles17. if particle_i is valid then18. CALL PURE fluid particle(i,rhop_sum(i),alphap(i))19. CALL PURE virtual particle(i,rhop_sum(i),alphap(i))20. CALL PURE open boundary particle((i,rhop_sum(i),alphap(i))21. %Calculate next step’s water depth and the smooth length 22. ${\phi}_{i}^{k}=rhop(i)\left[{\rho}_{i}^{k}\right]-rhop\text{\_}sum(i)\left[{\displaystyle \sum _{j}{m}_{j}{W}_{i}({x}_{i}-{x}_{j},{h}_{i})}\right]$ 23. ${\alpha}_{i}^{k}=alphap(i)\left[-\frac{1}{{\rho}_{i}{d}_{m}}{\displaystyle \sum _{j}{m}_{j}{r}_{ij}\frac{d{W}_{i}}{d{r}_{ij}}}\right]$ 24. ${\rho}_{i}^{k+1}=rhop(i)\left[1-\frac{{\phi}_{i}^{k}}{{\phi}_{i}^{k}+{\rho}_{i}^{k}{\alpha}_{i}^{k}}\right]$ 25. ${h}_{i}={h}_{o}{\left(\frac{{\rho}_{0}}{{\rho}_{i}^{k+1}}\right)}^{1/{d}_{m}}$ 26. endif27. enddo28. !$OMP END PARALLEL DO29. enddo |

#### 3.4. Velocity Calculations

_{i}is the depth/velocity of particle i. The calculation conducted for this step is displayed in Algorithm 5.

Algorithm 5: Calculation of fluid particle velocity and water depth gradient. |

1. Stage 1: sum_f/alphap/grad_up/grad_vp/grad_dw=0, Initialize to 02. !$OMP PARALLEL DO PRIVATE(private variable),&3. !$OMP& SHARED(shared variable),DEFAULT(none),SCHDULE(static)4. do $i=1\to $ total_number_of_fluid particles5. if particle_i is valid then6. !First conduct matrix for gradient correction 7. CALL PURE celij_corr(i,sum_f (I,1:4))8. CALL PURE celij_alpha(i,alphap(i),grad_dw(i,1:2),grad_up(i,1:2), grad_vp(i,1:2))9. CALL PURE celij_alpha_vir(i,alphap(i))10. CALL PURE celij_alphap_ob(i,alphap(i),grad_dw(i,1:2),grad_up(i,1:2), grad_vp(i,1:2))11. endif12. enddo13. !$OMP END PARALLEL DO |

#### 3.5. Calculation of Fluid Particle Acceleration, Riverbed Scouring, Speed, and Displacement

Algorithm 6: Calculation of acceleration, velocity, and position. The Lagrangian equation of motion for a particle i is d/dt ∂L/(∂v_i )-∂L/(∂x_i )=0, where the Lagrangian functional L is defined in term of kinetic energy K and potential energy π as L = K-π, where π is a function of particles position but not velocity. |

1. Stage 1: Calculate ${\overrightarrow{\mathit{t}}}_{\mathit{i}}(\mathit{a}\mathit{x}(\mathit{i})/\mathit{a}\mathit{y}(\mathit{i}))$2. !$OMP PARALLEL DO PRIVATE(private variable),&3. !$OMP& SHARED(shared variable),DEFAULT(none),SCHDULE(static)4. do $i=1\to $ total_number_of_fluid particles5. if particle_i is valid then6. 1a. use Riemann solution to calculate ${\overrightarrow{\mathit{t}}}_{\mathit{i}}$7. 1b. use Numerical viscosity to calculate ${\overrightarrow{\mathit{t}}}_{\mathit{i}}$8. ! ar(i) is used to calculate depth9. CALL PURE fluid particle(i,ar(i),ay(i),ar(i))10. CALL PURE virtual particle(i,ar(i),ay(i),ar(i))11. CALL PURE open boundary particle(i,ar(i),ay(i),ar(i))12. endif13. Stage 2: Calculate $\nabla {b}_{i}={\displaystyle {\displaystyle \sum}_{j}}{b}_{j}\tilde{\nabla}{W}_{i}\left({x}_{i}-{x}_{j},{h}_{i}\right){V}_{j}$14. Stage 3: Calculate ${\overrightarrow{\mathit{a}}}_{\mathit{i}}=\frac{g+{\overrightarrow{\mathit{v}}}_{\mathit{i}}\xb7{\overrightarrow{\mathit{k}}}_{\mathit{i}}{\overrightarrow{\mathit{v}}}_{\mathit{i}}+{\overrightarrow{\mathit{t}}}_{\mathit{i}}\xb7\nabla {b}_{i}}{1+\nabla {b}_{i}\cdot \nabla {b}_{i}}\nabla {b}_{i}-{\overrightarrow{\mathit{t}}}_{\mathit{i}}+{\overrightarrow{\mathit{S}}}_{f,i}$15. Stage 4: Calculate velocity and position of fluid particle $\mathit{i}$16. enddo17. !$OMP END PARALLEL DO |

## 4. Applications

#### 4.1. Validation 1: 2-D Dry Bed Dam Break with Particle Splitting

_{s}is the time spent by a single processor in the serial mode; T

_{p}is the time spent by threads (p) in the parallel mode. E(p) (parallel efficiency) is the ratio of the acceleration ratio to the number of CPU cores used in the calculation (and E(p)$\le $ 1), indicating the average execution efficiency of each processor. When the acceleration ratio was close to the number of cores, the parallel efficiency was higher, and the utilization rate of each thread was higher, as calculated below.

#### 4.2. Validation 2: 2-D Dam Break with A Rectangular Obstacle Located in the Downstream Area

## 5. Conclusions

## Author Contributions

## Funding

## Conflicts of Interest

## References

- Chang, Y.S.; Chang, T.J. SPH simulations of solute transport in flows with steep velocity and concentration gradients. Water
**2017**, 9, 132. [Google Scholar] [CrossRef] - Gu, S.; Zheng, X.; Ren, L.; Xie, H.; Huang, Y.; Wei, J.; Shao, S. SWE-SPHysics simulation of dam break flows at South-Gate Gorges Reservoir. Water
**2017**, 9, 387. [Google Scholar] [CrossRef] [Green Version] - Chen, R.; Shao, S.; Liu, X.; Zhou, X. Applications of shallow water SPH model in mountainous rivers. J. Appl. Fluid Mech.
**2015**, 8, 863–870. [Google Scholar] [CrossRef] - Peng, X.; Yu, P.; Chen, G.; Xia, M.; Zhang, Y. Development of a Coupled DDA–SPH Method and its Application to Dynamic Simulation of Landslides Involving Solid–Fluid Interaction. Rock Mech. Rock Eng.
**2020**, 53, 113–131. [Google Scholar] [CrossRef] - Verbrugghe, T.; Dominguez, J.M.; Altomare, C.; Tafuni, A.; Vacondio, R.; Troch, P.; Kirtenhaus, A. Non-linear wave generation and absorption using open boundaries within DualSPHysics. Comput. Phys. Commun.
**2019**, 240, 46–59. [Google Scholar] [CrossRef] - Ni, X.; Feng, W.; Huang, S.; Zhao, X.; Li, X. Hybrid SW-NS SPH models using open boundary conditions for simulation of free-surface flows. Ocean Eng.
**2020**, 196, 106845. [Google Scholar] [CrossRef] - Gonzalez-Cao, J.; Altomare, C.; Crespo, A.J.C.; Dominguez, J.M.; Gomez-Gesteira, M.; Kisacik, D. On the accuracy of DualSPHysics to assess violent collisions with coastal structures. Comput. Fluids
**2019**, 179, 604–612. [Google Scholar] [CrossRef] - Atif, M.M.; Chi, S.W.; Grossi, E.; Shabana, A. Evaluation of breaking wave effects in liquid sloshing problems: ANCF/SPH comparative study. Nonlinear Dyn.
**2019**, 97, 45–62. [Google Scholar] [CrossRef] - Meringolo, D.D.; Marrone, S.; Colagrossi, A.; Liu, Y. A dynamic δ-SPH model: How to get rid of diffusive parameter tuning. Comput. Fluids
**2019**, 179, 334–355. [Google Scholar] [CrossRef] - Shu, A.; Wang, S.; Rubinato, M.; Wang, M.; Qin, J.; Zhu, F. Numerical Modeling of Debris Flows Induced by Dam-Break Using the Smoothed Particle Hydrodynamics (SPH) Method. Appl. Sci.
**2020**, 10, 2954. [Google Scholar] [CrossRef] - Wu, S.; Rubinato, M.; Gui, Q. SPH Simulation of interior and exterior flow field characteristics of porous media. Water
**2020**, 12, 918. [Google Scholar] [CrossRef] [Green Version] - Wang, S.; Shu, A.; Rubinato, M.; Wang, M.; Qin, J. Numerical Simulation of Non-Homogeneous Viscous Debris-Flows based on the Smoothed Particle Hydrodynamics (SPH) Method. Water
**2019**, 11, 2314. [Google Scholar] [CrossRef] [Green Version] - Gingold, R.A.; Monaghan, J.J. Smoothed particle hydrodynamics: Theory and application to non-spherical stars. Mon. Not. R. Astron. Soc.
**1977**, 181, 375–389. [Google Scholar] [CrossRef] - Hopkins, P. A general class of Lagrangian smoothed particle hydrodynamics methods and implications for fluid mixing problems. Mon. Not. R. Astron. Soc.
**2013**, 428, 2840–2856. [Google Scholar] [CrossRef] - Cremonesi, M.; Meduri, S.; Perego, U. Lagrangian-Eulerian enforcement of non-homogeneous boundary conditions in the Particle Finite Element Method. Comput. Part. Mech.
**2020**, 7, 41–56. [Google Scholar] [CrossRef] - Sugiyama, K.; Li, S.; Takeuchi, S.; Takagi, S.; Matsumoto, Y. A full Eulerian finite difference approach for solving fluid-structure coupling problems. J. Comput. Phys.
**2011**, 230, 596–627. [Google Scholar] [CrossRef] [Green Version] - Miller, G.H.; Colella, P. A conservative three-dimensional Eulerian method for coupled solid-fluid shock capturing. J. Comput. Phys.
**2002**, 183, 26–82. [Google Scholar] [CrossRef] [Green Version] - Liu, M.B.; Liu, G.R. Smoothed Particle Hydrodynamics (SPH): An Overview and Recent Developments. Arch. Comput. Methods Eng.
**2010**, 17, 25–76. [Google Scholar] [CrossRef] [Green Version] - Liu, G.R.; Liu, M.B. Smoothed Particle Hydrodynamics: A Meshfree Particle Method; World Scientific: Singapore, 2003. [Google Scholar]
- Dalrymple, R.A.; Rogers, B.D. Numerical modeling of water waves with the SPH method. Coast. Eng.
**2006**, 53, 141–147. [Google Scholar] [CrossRef] - Huang, C.; Lei, J.M.; Peng, X.Y. A kernel gradient free (KGF) SPH method. Int. J. Numer. Methods Fluids
**2015**, 78. [Google Scholar] [CrossRef] - Monaghan, J.J.; Kocharyan, A. SPH simulation of multi-phase flow. Comput. Phys. Commun.
**1995**, 87, 225–235. [Google Scholar] [CrossRef] - Chen, A.S.; Djordjevic, S.; Leandro, J. An analysis of the combined consequences of pluvial and fluvial flooding. Water Sci. Technol.
**2010**, 62, 1491–1498. [Google Scholar] [CrossRef] - Liang, Q.; Borthwick, A.G.L.; Stelling, G. Simulation of dam and dyke break hydrodynamics on dynamically adaptive quadtree grids. Int. J. Numer. Methods Fluids
**2004**, 46. [Google Scholar] [CrossRef] - Chang, T.J.; Kao, H.M.; Chang, K.H.; Hsu, M.H. Numerical simulation of shallow water dam break flows in open channels using smoothed particle hydrodynamics. J. Hydrol.
**2011**, 408, 78–90. [Google Scholar] [CrossRef] - Kao, H.M.; Chang, T.J. Numerical modeling of dambreak-induced flood inundation using smoothed particle hydrodynamics. J. Hydrol.
**2012**, 448–449, 232–244. [Google Scholar] [CrossRef] - Colagrossi, A.; Landrini, M. Numerical simulation of interfacial flows by smoothed particle hydrodynamics. J. Comput. Phys.
**2003**, 191, 448–475. [Google Scholar] [CrossRef] - Yang, F.L.; Zhang, X.F.; Tan, G.M. One and two-dimensional coupled hydrodynamics model for dam break flow. J. Hydrodyn.
**2007**, 19, 769–775. [Google Scholar] [CrossRef] - Wang, Z.; Shen, H.T. Lagrangian simulation of one-dimensional dam-break flow. Hydraul. Eng.
**1999**, 125, 1217–1220. [Google Scholar] [CrossRef] - Ata, R.; Soulaimani, A. A stabilized SPH method for inviscid shallow water flows. Int. J. Numer. Methods Fluids
**2005**, 47, 139–159. [Google Scholar] [CrossRef] - Leffe, M.D.; Touzé, D.L.; Alessandrini, B. SPH Modeling of a shallow-water coastal flows. Hydraul. Res.
**2010**, 48, 118–125. [Google Scholar] [CrossRef] - Rodriguez-Paz, M.; Bonet, J. A corrected smooth particle hydrodynamics formulation of the shallow-water equations. Comput. Struct.
**2005**, 83, 1396–1410. [Google Scholar] [CrossRef] - Panizzo, A.; Longo, D.; Bellotti, G.; De Girolamo, P. Tsunamis early warning system. Part 3: SPH modeling of nlswe. In Proceedings of the XXX Convegno di Idraulica e Costruzioni Idrauliche, Rome, Italy, 10–15 September 2006. [Google Scholar]
- Vacondio, R.; Rogers, B.D.; Stansby, P.K.; Mignosa, P. A correction for balancing discontinuous bed slopes in two-dimensional smoothed particle hydrodynamics shallow water modeling. Int. J. Numer. Methods Fluids
**2013**, 71, 850–872. [Google Scholar] [CrossRef] - Vacondio, R.; Rogers, B.D.; Stansby, P.K.; Mignosa, P. SPH Modeling of Shallow Flow with Open Boundaries for Practical Flood Simulation. J. Hydraul. Eng.
**2012**, 138, 530–541. [Google Scholar] [CrossRef] - Vacondio, R.; Rogers, B.D.; Stansby, P.K.; Mignosa, P. Smoothed Particle Hydrodynamics: Approximate zero-consistent 2-D boundary conditions and still shallow water tests. Int. J. Numer. Methods Fluids
**2011**, 69, 226–253. [Google Scholar] [CrossRef] - Vacondio, R.; Rogers, B.D.; Stansby, P.K. Accurate particle splitting for SPH in shallow water with shock capturing. Int. J. Numer. Methods Fluids
**2012**, 69, 1377–1410. [Google Scholar] [CrossRef] - Skillen, A.; Lind, S.J.; Stansby, P.K.; Rogers, B.D. Incompressible Smoothed Particle Hydrodynamics (SPH) with reduced temporal noise and generalised Fickian smoothing applied to body-water slam and efficient wave-body interaction. Comput. Methods Appl. Mech. Eng.
**2013**, 265, 163–173. [Google Scholar] [CrossRef] - Fourtakas, G.; Rogers, B.D.; Laurence, D.R.P. Modelling Sediment resuspension in Industrial tanks using SPH. Houille Blanche
**2013**, 2, 39–45. [Google Scholar] [CrossRef] - St-Germain, P.; Nistor, I.; Townsend, R.; Shibayama, T. Smoothed-Particle Hydrodynamics Numerical Modeling of Structures Impacted by Tsunami Bores. J. Waterw. Port Coast. Ocean Eng.
**2014**, 140, 66–81. [Google Scholar] [CrossRef] - Cunningham, L.S.; Rogers, B.D.; Pringgana, G. Tsunami wave and structure interaction: An investigation with smoothed-particle hydrodynamics. Proc. Inst. Civ. Eng. Eng. Comput. Mech.
**2014**, 167, 106–116. [Google Scholar] [CrossRef] [Green Version] - Aureli, F.; Dazzi, S.; Maranzoni, A.; Mignosa, P.; Vacondio, R. Experimental and numerical evaluation of the force due to the impact of a dam-break wave on a structure. Adv. Water Resour.
**2015**, 76, 29–42. [Google Scholar] [CrossRef] - Canelas, R.B.; Domínguez, J.M.; Crespo, A.J.C.; Gómez-Gesteira, M.; Ferreira, R.M.L. A Smooth Particle Hydrodynamics discretization for the modelling of free surface flows and rigid body dynamics. Int. J. Numer. Methods Fluids
**2015**, 78, 581–593. [Google Scholar] [CrossRef] - Heller, V.; Bruggemann, M.; Spinneken, J.; Rogers, B.D. Composite modelling of subaerial landslide–tsunamis in different water body geometries and novel insight into slide and wave kinematics. Coast. Eng.
**2016**, 109, 20–41. [Google Scholar] [CrossRef] - Fourtakas, G.; Rogers, B.D. Modelling multi-phase liquid-sediment scour and resuspension induced by rapid flows using Smoothed Particle Hydrodynamics (SPH) accelerated with a graphics processing unit (GPU). Adv. Water Resour.
**2016**, 92, 186–199. [Google Scholar] [CrossRef] - Mokos, A.; Rogers, B.D.; Stansby, P.K. A multi-phase particle shifting algorithm for SPH simulations of violent hydrodynamics with a large number of particles. J. Hydraul. Res.
**2017**, 55, 143–162. [Google Scholar] [CrossRef] [Green Version] - Alshaer, A.W.; Rogers, B.D.; Li, L. Smoothed Particle Hydrodynamics (SPH) modelling of transient heat transfer in pulsed laser ablation of Al and associated free-surface problems. Comput. Mater. Sci.
**2017**, 127, 161–179. [Google Scholar] [CrossRef] - Sun, P.N.; Colagrossi, A.; Marrone, S.; Antuono, M.; Zhang, A.M. A consistent approach to particle shifting in the δ-Plus-SPH model. Mech. Eng.
**2019**, 348, 912–934. [Google Scholar] [CrossRef] - Sun, P.; Zhang, A.M.; Marrone, S.; Ming, F. An accurate and efficient SPH modeling of the water entry of circular cylinders. Appl. Ocean Res.
**2018**, 72, 60–75. [Google Scholar] [CrossRef] - Zheng, X.; Shao, S.; Khayyer, A.; Duan, W.; Ma, Q.; Liao, K. Corrected first-order derivative ISPH in water wave simulations. Coast. Eng. J.
**2017**, 59. [Google Scholar] [CrossRef] - Luo, M.; Reeve, D.; Shao, S.; Karunarathna, H.; Lin, P.; Cai, H. Consistent Particle Method simulation of solitary wave impinging on and overtopping a seawall. Eng. Anal. Bound. Elem.
**2019**, 103, 160–171. [Google Scholar] [CrossRef] - Ran, Q.; Tong, J.; Shao, S.; Fu, X.; Xu, Y. Incompressible SPH scour model for movable bed dam break flows. Adv. Water Resour.
**2015**, 82, 39–50. [Google Scholar] [CrossRef] [Green Version] - Xia, X.; Liang, Q. A GPU-accelerated smoothed particle hydrodynamics (SPH) model for the shallow water equations. Environ. Model. Softw.
**2016**, 75, 28–43. [Google Scholar] [CrossRef] - Liang, Q.; Xia, X.; Hou, J. Catchment-scale High-resolution Flash Flood Simulation Using the GPU-based Technology. Procedia Eng.
**2016**, 154, 975–981. [Google Scholar] [CrossRef] [Green Version] - Satake, S.I.; Yoshimori, H.; Suzuki, T. Optimazations of a GPU accelerated heat conduction equation by a programming of CUDA Fortran from an analysis of a PTX file. Comput. Phys. Commun.
**2012**, 183, 2376–2385. [Google Scholar] [CrossRef] - Yang, C.T.; Huang, C.L.; Lin, C.F. Hybrid CUDA, OpenMP, and MPI parallel programming on multicore GPU clusters. Comput. Phys. Commun.
**2011**, 182, 266–269. [Google Scholar] [CrossRef] - Ohshima, S.; Hirasawa, S.; Honda, H. OMPCUDA: OpenMP Execution Framework for CUDA Based on Omni OpenMP Compiler. In Beyond Loop Level Parallelism in OpenMP: Accelerators, Tasking and More; Sato, M., Hanawa, T., Müller, M.S., Chapman, B.M., de Supinski, B.R., Eds.; IWOMP 2010. Lecture Notes in Computer Science, 6132; Springer: Berlin/Heidelberg, Germany, 2010. [Google Scholar] [CrossRef]
- Loncar, V.; Young, S.L.E.; Skrbic, S.; Muruganandam, P.; Adhikari, S.; Balaz, A. OpenMP, OpenMP/MPI, and CUDA/MPI C programs for solving the time-dependent dipolar Gross-Pitaevskii equation. Comput. Phys. Commun.
**2016**, 209, 190–196. [Google Scholar] [CrossRef] [Green Version] - Bronevetsky, G.; Marques, D.; Pingali, K.; McKee, S.; Rugina, R. Compiler-enhanced incremental checkpointing for OpenMP applications. In Proceedings of the 2009 IEEE International Symposium on Parallel & Distributed Processing, Rome, Italy, 23–29 May 2009; pp. 1–12. [Google Scholar] [CrossRef] [Green Version]
- Dagum, L.; Menon, R. OpenMP: An industry standard API for shared-memory programming. IEEE Comput. Sci. Eng.
**1998**, 5, 46–55. [Google Scholar] [CrossRef] [Green Version] - Slabaugh, G.; Boyes, R.; Yang, X. Multicore Image Processing with OpenMP [Applications Corner]. IEEE Signal Process. Mag.
**2010**, 27, 134–138. [Google Scholar] [CrossRef] - Chorley, M.J.; Walker, D.W. Performance analysis of a hybrid MPI/OpenMP application on multi-core clusters. J. Comput. Sci.
**2010**, 1, 168–174. [Google Scholar] [CrossRef] [Green Version] - Adhianto, L.; Chapman, B. Performance modeling of communication and computation in hybrid MPI and OpenMP applications. Simul. Model. Pract. Theory
**2007**, 15, 481–491. [Google Scholar] [CrossRef] - Wright, S.J. Parallel algorithms for banded linear systems. Siam J. Sci. Stat. Comput.
**1991**, 12, 824–842. [Google Scholar] [CrossRef] - Jiao, Y.-Y.; Zhao, Q.; Wang, L. A hybrid MPI/OpenMP parallel computing model for spherical discontinuous deformation analysis. Comput. Geotech.
**2019**, 106, 217–227. [Google Scholar] [CrossRef] - Przemysław, S. Algorithmic and language-based optimization of Marsa-LFIB4 pseudorandom number generator using OpenMP, OpenACC and CUDA. J. Parallel Distrib. Comput.
**2020**, 137, 238–245. [Google Scholar] - Vacondio, R. Shallow Water and Navier-Stokes SPH-Like Numerical Modelling of Rapidly Varying Free-Surface Flows. Ph.D. Thesis, Università degli Studi di Parma, Parma, Italy, 2010. [Google Scholar]
- Vacondio, R.; Rodgers, B.D.; Stansby, P.K.; Mignosa, P. User Guide for the SWE-SPHysics Code. 2013. Available online: https://wiki.manchester.ac.uk/sphysics/images/SWE-SPHysics_v1.0.00.pdf (accessed on 2 April 2020).
- Marion, J.; Thornton, S. Classical Dynamics of Particles and Systems; Harcourt Brace Jovanovich Inc.: San Diego, CA, USA, 1988. [Google Scholar]
- Monaghan, J.J. Smoothed particle hydrodynamics. Rep. Prog. Phys.
**2005**, 68, 1703–1759. [Google Scholar] [CrossRef] - Bonet, J.; Lok, T.-S.L. Variational and momentum preservation aspects of Smooth Particle Hydrodynamic formulations. Comput. Methods Appl. Mech. Eng.
**1999**, 180, 97–115. [Google Scholar] [CrossRef] - Vila, J.P. On particle weighted methods and smooth particle hydrodynamics. Math. Models Methods Appl. Sci.
**1999**, 9, 161–209. [Google Scholar] [CrossRef] - Dinshaw, B.S. Von Neumann stability analysis of smoothed particle hydrodynamics—Suggestions for optimal algorithms. J. Comput. Phys.
**1995**, 121, 357–372. [Google Scholar] - Toro, E. Direct Riemann solvers for the time-dependent Euler equations. Shock Waves
**1995**, 5, 75–80. [Google Scholar] [CrossRef] - Hernquist, L.; Katz, N. TREESPH: A unification of SPH with the hierarchical tree method. Astrophys. J. Suppl.
**1989**, 70, 419–446. [Google Scholar] [CrossRef] - Toro, E. Shock Capturing Methods for Free Surface Shallow Water Flows; Wiley: New York, NY, USA, 1999. [Google Scholar]
- Nikolaos, D.K. A dissipative galerkin scheme for open-channel flow. Hydraul. Eng.
**1984**, 110, 337–352. [Google Scholar] - Majda, A.; Osher, S. Numerical viscosity and the entropy condition. Commun. Pure Appl. Math.
**1979**. [Google Scholar] [CrossRef] - Stranex, T.; Wheaton, S. A new corrective scheme for SPH. Comput. Methods Appl. Mech. Eng.
**2011**, 200, 392–402. [Google Scholar] [CrossRef] - Monaghan, J.J.; Gingold, R.A. Shock simulation by the particle method SPH. J. Comput. Phys.
**1983**, 52, 374–389. [Google Scholar] [CrossRef] - Monaghan, J.J. Particle methods for hydrodynamics. Comput. Phys. Rep.
**1985**, 3, 71–124. [Google Scholar] [CrossRef] - Chen, F.; Qiang, H.; Gao, W. Coupling of smoothed particle hydrodynamics and finite volume method for two-dimensional spouted beds. Comput. Chem. Eng.
**2015**, 77, 135–146. [Google Scholar] [CrossRef] - Kleefsman, K.M.T.; Fekken, G.; Veldman, A.E.P.; Iwanowski, B.; Buchner, B. A volume-of-fluid based simulation method for wave impact problems. J. Comput. Phys.
**2005**, 206, 363–393. [Google Scholar] [CrossRef] [Green Version]

**Figure 1.**Simulation results of different kernel functions. (

**a**,

**c**) Results of water depths calculations. (

**b**,

**d**) Results of velocity calculations.

**Figure 2.**Absolute errors of different kernel functions and processing methods. (

**a**–

**c**) The absolute errors of water depth and velocity calculated by B-spline kernel function, quartic spline, and quadratic spline kernel function, respectively. (

**d**) The absolute errors of water depth and velocity calculated by using the artificial viscosity method.

**Figure 4.**Simulation results of the SPH-SWE module. (

**a**,

**b**) water depth and velocity diagram at t = 30 s; (

**c**,

**d**) water depth and velocity diagram at t = 50 s.

**Figure 5.**Framework of particle search [81].

**Figure 7.**Results of 2-D Dry-Bed Dam Break with particle splitting at 1.2 s obtained from the simulations with: (

**a**) 4374 particles; (

**b**) 9801 particles; (

**c**) 38,801 particles.

**Figure 8.**Numerical vs. experimental results comparison (velocities on the

**left**and water depths on the

**right**).

**Figure 11.**Scheme of the second model used for validation of the new SPH-SWE model proposed [2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83].

Parameters | Artificial Viscosity | Lax Friedrichs Flux | Two-Shocks Riemann Solver | |
---|---|---|---|---|

Mean Absolute Error | Speed | 0.0617 | 0.0476 | 0.0351 |

WD | 0.0515 | 0.0482 | 0.0356 | |

Mean Relative Error | Speed | 0.0718 | 0.0667 | 0.0586 |

WD | 0.0142 | 0.0089 | 0.0092 | |

Standard deviation of error | Speed | 0.1042 | 0.0728 | 0.0568 |

WD | 0.0681 | 0.0633 | 0.0484 |

Parameters | 30 s | 50 s | |
---|---|---|---|

Mean Absolute Error | Speed | 0.0529 | 0.0603 |

Water Depth | 0.0567 | 0.0613 | |

Mean Relative Error | Speed | 0.0548 | 0.1037 |

Water Depth | 0.0075 | 0.0081 | |

Standard deviation of error | Speed | 0.1543 | 0.1514 |

Water Depth | 0.1257 | 0.1238 |

Case | Number of Fluid Particles | Number of Virtual Particles | Number of Riverbed Particles |
---|---|---|---|

Case 1 | 4374 | 1276 | 14,094 |

Case 2 | 9801 | 3300 | 31,581 |

Case 3 | 38,801 | 9424 | 125,561 |

Cases | $\mathit{R}(\mathit{t})$ | $\mathit{C}(\mathit{t})$ | $\mathit{A}(\mathit{t})$ | $\mathit{T}(\mathit{t})$ | $\mathit{t}(\mathit{s})$ | |
---|---|---|---|---|---|---|

Open Source Code (Case 1) | N/A | 1040.44 | 213.12 | 1253.56 | 1.0 | |

Parallel Operation Code | Single Core | 87.47 | 174.95 | 49.99 | 312.41 | 4.01 |

2000 | 60.27 | 118.38 | 36.59 | 215.24 | 5.82 | |

1000 | 36.43 | 70.34 | 18.84 | 125.61 | 9.98 | |

Open Source Code (Case 2) | N/A | 5892.29 | 1039.82 | 6932.11 | 1.0 | |

Parallel Operation Code | Single Core | 338.853 | 643.8207 | 146.8363 | 1129.51 | 6.14 |

2000 | 116.8514 | 218.6252 | 41.4634 | 376.94 | 18.39 | |

1000 | 75.2985 | 150.597 | 33.7545 | 259.65 | 26.70 | |

Open Source Code (Case 3) | N/A | 107,218.04 | 16,021.09 | 123,239.13 | 1.0 | |

Parallel Operation Code | Single Core | 5498.28 | 10,481.09 | 1202.75 | 17,182.12 | 7.17 |

2000 | 554.20 | 990.83 | 134.35 | 1679.38 | 73.38 |

Number of Single-Thread Particles (pcs) | $\mathit{p}\text{}\left(\mathbf{pcs}\right)$ | ${\mathit{T}}_{\mathit{p}}\text{}\left(\mathbf{s}\right)$ | $\mathit{S}(\mathit{p})\text{}\left(\mathbf{s}\right)$ | $\mathit{E}(\mathit{p})\text{}(\%)$ |
---|---|---|---|---|

2000 | 20 | 1679.38 | 10.23 | 51.16 |

2500 | 16 | 1759.15 | 9.77 | 61.05 |

3000 | 13 | 1833.58 | 9.37 | 72.08 |

4000 | 10 | 1935.12 | 8.88 | 88.79 |

5000 | 8 | 2300.79 | 7.47 | 93.35 |

6000 | 7 | 2579.88 | 6.66 | 95.14 |

7000 | 6 | 2934.02 | 5.86 | 97.60 |

8000 | 5 | 3455.94 | 4.97 | 99.44 |

10,000 | 4 | 4312.39 | 3.98 | 99.61 |

20,000 | 2 | 8616.82 | 1.99 | 99.70 |

**Table 6.**Particle numbers for each case tested (unit: pcs). Remarks: In all three cases, 8 threads were used for parallel calculation.

Case | Particle Spacing | Number of Fluid Particles | Number of Virtual Particles | Number of Riverbed Particles | T_{8} (s) | T (s) |
---|---|---|---|---|---|---|

Case 4 | 0.01 | 12,423 | 4798 | 129,645 | 1511.38 | 7.12 |

Case 5 | 0.005 | 51,858 | 9582 | 516,889 | 14,538.83 | 7.32 |

Case 6 | 0.002 | 323,145 | 23,934 | 807,111 | 108,868.42 | 7.46 |

**Table 7.**Run time in different configurations for 2-D Dam Break with a rectangular obstacle downstream.

Cases | R (t) | C (t) | A (t) | T_{8} (s) | t (s) |
---|---|---|---|---|---|

Case 4 | 468.53 | 876.60 | 166.25 | 1511.38 | 7.12 |

Case 5 | 4216.26 | 8432.52 | 1890.05 | 14,538.83 | 7.32 |

Case 6 | 34,837.91 | 66,409.72 | 7620.80 | 108,868.42 | 7.46 |

© 2020 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/).

## Share and Cite

**MDPI and ACS Style**

Wu, Y.; Tian, L.; Rubinato, M.; Gu, S.; Yu, T.; Xu, Z.; Cao, P.; Wang, X.; Zhao, Q.
A New Parallel Framework of SPH-SWE for Dam Break Simulation Based on OpenMP. *Water* **2020**, *12*, 1395.
https://doi.org/10.3390/w12051395

**AMA Style**

Wu Y, Tian L, Rubinato M, Gu S, Yu T, Xu Z, Cao P, Wang X, Zhao Q.
A New Parallel Framework of SPH-SWE for Dam Break Simulation Based on OpenMP. *Water*. 2020; 12(5):1395.
https://doi.org/10.3390/w12051395

**Chicago/Turabian Style**

Wu, Yushuai, Lirong Tian, Matteo Rubinato, Shenglong Gu, Teng Yu, Zhongliang Xu, Peng Cao, Xuhao Wang, and Qinxia Zhao.
2020. "A New Parallel Framework of SPH-SWE for Dam Break Simulation Based on OpenMP" *Water* 12, no. 5: 1395.
https://doi.org/10.3390/w12051395