Boundary SPH for Robust Particle–Mesh Interaction in Three Dimensions
Abstract
:1. Introduction
2. Materials and Methods
- For each fluid particle and mesh triangle , project p onto the 2D plane defined by t () and determine the closest point on the triangle to this projection (). Voronoi region tessellation is needed here to divide the 2D plane of each triangle into regions that identify if is closest to either a vertex or edge or if is located inside the triangle.
- For each fluid particle , determine the closest point on the mesh such that the distance between p and is minimized.
- For each fluid particle, determine the boundary normal based on the closest ’s position on the mesh as well as the signed distance from p to the closest based on .
2.1. Triangle Mesh Basics
- Choice of face type: Meshes can be defined based on their face type. Typical face types include triangles, quads, or n-gons.
- Choice of representation: This refers to the explicit format and type of data that are stored about the mesh. Types include but are not limited to vertex–vertex (“VV”), face–vertex meshes, and winged-edge meshes [34].
2.2. Pre-Processing 3D Meshes
- Vertices: In mesh data, vertices are stored as float3 vectors that may overlap based on how the mesh data was created. We must filter vertices into a condensed list where each vertex is unique and no overlaps exist among vertices. For example, Unity3D’s “Cube” primitive is originally represented by 24 vertices, which can be condensed into 8 vertices. We also must calculate the pseudonormal vector of each vertex that represents the boundary normal vector at the vertex. This pseudonormal vector is the average of the pseudonormal vectors of all triangles connected to a vertex, weighted by the angle of influence that the vertex has on the face area (see Figure 1).
- Edges: Edges are not stored in face–vertex triangle meshes and must be computed manually. Edges are composed of two vertices, with a midpoint calculated based on the average of its two vertices’ positions. We must also calculate the pseudonormal vector of each edge that represents the boundary normal vector. We take advantage of the idea that an edge can only connect two triangles at maximum and calculate the pseudonormal vector as the average of the two faces’ pseudonormal vectors. If a mesh is incomplete and is compsed of only one triangle, we simply set the pseudonormal vector as the same as the connected triangle’s pseudonormal vector.
- Triangles: Triangles are stored as a tuple of index values that point to vertices in the mesh’s vertices array. In our scheme, mesh triangles also feature a centroid position based on the average positions of its vertices, a pseudonormal vector orthogonal to the plane defined by the triangle, a signed distance float value from the triangle’s 2D plane to the origin, and 2D pseudonormal vectors of each edge along the 2D plane defined by the triangle. All of these properties need to be manually calculated.
2.3. Single Particle–Triangle Scenario
2.3.1. Calculating Plane Projection
- p: The particle’s current position in 3D space; it also represents the vector from world origin to the particle’s current position.
- : The triangle’s face pseudonormal vector.
- : The triangle’s centroid.
- : The signed distance between p and . A negative (−) distance means that the particle is “above” the mesh triangle, while a positive (+) distance means the particle is “below” the mesh triangle. Note that a positive sign does not necessarily mean that the particle is submerged or intersecting with the mesh obstacle as the particle may simply be in a concave segment of the mesh.
2.3.2. Calculating the Closest Point and Corresponding Boundary Normal
2.3.3. Calculating the Signed Distance
2.4. SPH Fluid Interaction
3. Results
3.1. Simple Setups
3.2. Water Tank Setups
3.3. Concave Mesh and Fluid Flow Setups
3.4. Mesh Boundary Performance
4. Conclusions
Author Contributions
Funding
Data Availability Statement
Conflicts of Interest
Appendix A. Mesh Pre-Processing Algorithm
Algorithm A1: Mesh Pre-Processing during Initialization |
Algorithm A2: PreprocessMesh() |
Algorithm A3: PreprocessVertices() |
Algorithm A4: PreprocessTriangles() |
Data: : Current triangle index, : original mesh triangles, : mesh’s condensed list of vertices, : mapper from original vertex indices to condensed vertices, ref : reference to mesh’s triangle data Result: Extending with angle, center, and normal data // Retrieving positions of triangle’s vertices ; ← First vertex’s position; ← Second vertex’s position; ← Third vertex’s position; // Updating vertex angles for this triangle ; // Updating triangle’s centroid and orthogonal normal vector ; ← Right-hand Rule; |
Algorithm A5: PreprocessEdges() |
References
- Reynolds, C. Big fast crowds on PS3. In Proceedings of the 2006 ACM SIGGRAPH Symposium on Videogames, New York, NY, USA, 30–31 June 2006; pp. 113–121. [Google Scholar] [CrossRef]
- Monaghan, J. Smoothed Particle Hydrodynamics and Its Diverse Applications. Annu. Rev. Fluid Mech. 2012, 44, 323–346. [Google Scholar] [CrossRef]
- Shadloo, M.; Oger, G.; Le Touzé, D. Smoothed particle hydrodynamics method for fluid flows, towards industrial applications: Motivations, current state, and challenges. Comput. Fluids 2016, 136, 11–34. [Google Scholar] [CrossRef]
- Ye, T.; Pan, D.; Huang, C.; Liu, M. Smoothed particle hydrodynamics (SPH) for complex fluid flows: Recent developments in methodology and applications. Phys. Fluids 2019, 31, 011301. [Google Scholar] [CrossRef]
- Zhang, C.; Zhu, Y.J.; Wu, D.; Adams, N.A.; Hu, X. Smoothed particle hydrodynamics: Methodology development and recent achievement. J. Hydrodyn. 2022, 34, 767–805. [Google Scholar] [CrossRef]
- Boregowda, P.; Liu, G.R. On the accuracy of SPH formulations with boundary integral terms. Math. Comput. Simul. 2023, 210, 320–345. [Google Scholar] [CrossRef]
- Peskin, C.S. Numerical analysis of blood flow in the heart. J. Comput. Phys. 1977, 25, 220–252. [Google Scholar] [CrossRef]
- Peskin, C.S. The immersed boundary method. Acta Numer. 2002, 11, 479–517. [Google Scholar] [CrossRef]
- Hou, G.; Wang, J.; Layton, A. Numerical Methods for Fluid-Structure Interaction—A Review. Commun. Comput. Phys. 2012, 12, 337–377. [Google Scholar] [CrossRef]
- Stockie, J.M.; Wetton, B.R. Analysis of Stiffness in the Immersed Boundary Method and Implications for Time-Stepping Schemes. J. Comput. Phys. 1999, 154, 41–64. [Google Scholar] [CrossRef]
- Monaghan, J. Simulating Free Surface Flows with SPH. J. Comput. Phys. 1994, 110, 399–406. [Google Scholar] [CrossRef]
- Morris, J.P.; Fox, P.J.; Zhu, Y. Modeling Low Reynolds Number Incompressible Flows Using SPH. J. Comput. Phys. 1997, 136, 214–226. [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]
- Bonet, J.; Kulasegaram, S.; Rodriguez-Paz, M.; Profit, M. Variational formulation for the smooth particle hydrodynamics (SPH) simulation of fluid and solid problems. Comput. Methods Appl. Mech. Eng. 2004, 193, 1245–1256. [Google Scholar] [CrossRef]
- Ferrand, M.; Laurence, D.R.; Rogers, B.D.; Violeau, D.; Kassiotis, C. Unified semi-analytical wall boundary conditions for inviscid, laminar or turbulent flows in the meshless SPH method. Int. J. Numer. Methods Fluids 2013, 71, 446–472. [Google Scholar] [CrossRef]
- Yildiz, M.; Rook, R.A.; Suleman, A. SPH with the multiple boundary tangent method. Int. J. Numer. Methods Eng. 2009, 77, 1416–1438. [Google Scholar] [CrossRef]
- Dalrymple, R.; Rogers, B. Numerical modeling of water waves with the SPH method. Coast. Eng. 2006, 53, 141–147. [Google Scholar] [CrossRef]
- Dalrymple, R.A.; Knio, O. SPH Modelling of Water Waves. In Coastal Dynamics ’01; American Society of Civil Engineers: Reston, VA, USA, 2012; pp. 779–787. [Google Scholar] [CrossRef]
- Marrone, S.; Antuono, M.; Colagrossi, A.; Colicchio, G.; Le Touzé, D.; Graziani, G. δ-SPH model for simulating violent impact flows. Comput. Methods Appl. Mech. Eng. 2011, 200, 1526–1542. [Google Scholar] [CrossRef]
- Antuono, M.; Colagrossi, A.; Marrone, S.; Lugni, C. Propagation of gravity waves through an SPH scheme with numerical diffusive terms. Comput. Phys. Commun. 2011, 182, 866–877. [Google Scholar] [CrossRef]
- Müller, M.; Schirm, S.; Teschner, M.; Heidelberger, B.; Gross, M. Interaction of fluids with deformable solids. Comput. Animat. Virtual Worlds 2004, 15, 159–171. [Google Scholar] [CrossRef]
- Monaghan, J.; Kajtar, J. SPH particle boundary forces for arbitrary boundaries. Comput. Phys. Commun. 2009, 180, 1811–1820. [Google Scholar] [CrossRef]
- Vacondio, R.; Altomare, C.; De Leffe, M.; Hu, X.; Le Touzé, D.; Lind, S.; Marongiu, J.C.; Marrone, S.; Rogers, B.D.; Souto-Iglesias, A. Grand challenges for Smoothed Particle Hydrodynamics numerical schemes. Comput. Part. Mech. 2020, 8, 575–588. [Google Scholar] [CrossRef]
- Torrens, P.M. Exploring behavioral regions in agents’ mental maps. Ann. Reg. Sci. 2016, 57, 309–334. [Google Scholar] [CrossRef]
- Okabe, A.; Boots, B.; Sugihara, K.; Chiu, S.N. Spatial Tessellations: Concepts and Applications of Voronoi Diagrams; John Wiley & Sons: Chichester, West Sussex, England, 2009; ISBN 0-471-98635-6. [Google Scholar]
- Gilbert, E.; Johnson, D.; Keerthi, S. A fast procedure for computing the distance between complex objects in three-dimensional space. IEEE J. Robot. Autom. 1988, 4, 193–203. [Google Scholar] [CrossRef]
- Jones, M.; Baerentzen, J.; Sramek, M. 3D distance fields: A survey of techniques and applications. IEEE Trans. Vis. Comput. Graph. 2006, 12, 581–599. [Google Scholar] [CrossRef]
- Sigg, C.; Peikert, R.; Gross, M. Signed distance transform using graphics hardware. In Proceedings of the IEEE Visualization, Seattle, WA, USA, 19–24 October 2003; pp. 83–90. [Google Scholar] [CrossRef]
- Mauch, S. A Fast Algorithm for Computing the Closest Point and Distance Transform. 2000. Available online: https://www.researchgate.net/publication/2393786_A_Fast_Algorithm_for_Computing_the_Closest_Point_and_Distance_Transform (accessed on 18 July 2023).
- Toga, A.W.; Payne, B.A. Distance Field Manipulation of Surface Models. IEEE Comput. Graph. Appl. 1992, 12, 65–71. [Google Scholar] [CrossRef]
- Baerentzen, J.; Aanaes, H. Signed distance computation using the angle weighted pseudonormal. IEEE Trans. Vis. Comput. Graph. 2005, 11, 243–253. [Google Scholar] [CrossRef] [PubMed]
- Thürrner, G.; Wüthrich, C.A. Computing Vertex Normals from Polygonal Facets. J. Graph. Tools 1998, 3, 43–46. [Google Scholar] [CrossRef]
- Fuhrmann, A.; Sobottka, G.A. Distance Fields for Rapid Collision Detection in Physically Based Modeling. Proc. GraphiCon 2003, 2003, 58–65. [Google Scholar]
- Baumgart, B.G. A polyhedron representation for computer vision. In Proceedings of the May 19–22, 1975, National Computer Conference and Exposition on—AFIPS ’75, Anaheim, CA, USA, 19–22 May 1975. [Google Scholar] [CrossRef]
- Fraga Filho, C.A.D. Reflective boundary conditions coupled with the SPH method for the three-dimensional simulation of fluid–structure interaction with solid boundaries. J. Braz. Soc. Mech. Sci. Eng. 2024, 46, 256. [Google Scholar] [CrossRef]
- Müller, M.; Charypar, D.; Gross, M. Particle-based fluid simulation for interactive applications. In Proceedings of the 2003 ACM SIGGRAPH/Eurographics Symposium on Computer Animation, San Diego, CA, USA, 26–27 July 2003; pp. 154–159. [Google Scholar]
- Desbrun, M.; Gascuel, M.P. Smoothed Particles: A new paradigm for animating highly deformable bodies. In Proceedings of the Eurographics Workshop, Poitiers, France, 31 August–1 September 1996; pp. 61–76. [Google Scholar]
Property | Notation | Equation |
---|---|---|
Vertices | (Usually provided in mesh data) | |
Centroid | ||
Face Pseudonormals * | ||
Edge Pseudonormals | , where is the set of triangles connected to the edge between and | |
Vertex Peudonormals | , where is the set of triangles connected to and is the vertex angle of in triangle t |
Region | Check | Outputs |
---|---|---|
and | is the vertex pseudonormal vector. | |
is ’s pseudonormal vector. | ||
is ’s pseudonormal vector. | ||
Other checks fail; default condition | is the face pseudonormal vector. |
Flat-Plane | Number of Particles | 64 | Ideal Density | 1000 |
Initial Spacing ab | 0.125 | Viscosity Coeff. | 0.001 | |
Render Size b | 0.12 | Bulk Modulus (k) | 100 | |
Particle Mass | 1 | Friction Coeff. () | 0.0 | |
Kernel Radius b | 0.125 | Restitution Coeff. () | 0.25 | |
10 deg. In-clined Plane (Slip) | Number of Particles | 25 | Ideal Density | 1000 |
Initial Spacing ab | 0.2 | Viscosity Coeff. | 0.001 | |
Render Size b | 0.12 | Bulk Modulus (k) | 100 | |
Particle Mass | 1 | Friction Coeff. () | 0.0 | |
Kernel Radius b | 0.125 | Restitution Coeff. () | 0.25 | |
10 deg. In-clined Plane (No-Slip) | Number of Particles | 25 | Ideal Density | 1000 |
Initial Spacing ab | 0.2 | Viscosity Coeff. | 0.001 | |
Render Size b | 0.12 | Bulk Modulus (k) | 100 | |
Particle Mass | 1 | Friction Coeff. () | 1.0 | |
Kernel Radius b | 0.125 | Restitution Coeff. () | 0.25 |
Tank (Empty) | Number of Particles | 15,750 | Ideal Density | 1000 |
Initial Spacing ab | 0.2 | Viscosity Coeff. | 0.001 | |
Render Size b | 0.05 | Bulk Modulus (k) | 250 | |
Particle Mass | 1 | Friction Coeff. () | 0.0 | |
Kernel Radius b | 0.2 | Restitution Coeff. () | 0.25 | |
Tank (with Wedge) | Number of Particles | 13,500 | Ideal Density | 1000 |
Initial Spacing ab | 0.2 | Viscosity Coeff. | 0.001 | |
Render Size b | 0.05 | Bulk Modulus (k) | 250 | |
Particle Mass | 1 | Friction Coeff. () | 0.0 | |
Kernel Radius b | 0.2 | Restitution Coeff. () | 0.25 | |
Dam Break | Number of Particles | 20,445 | Ideal Density | 600 |
Initial Spacing ab | 0.15 | Viscosity Coeff. | 0.001 | |
Render Size b | 0.05 | Bulk Modulus (k) | 250 | |
Particle Mass | 1 | Friction Coeff. () | 0.0 | |
Kernel Radius b | 0.2 | Restitution Coeff. () | 0.25 |
Flow Field (Sphere, Torus, and Bowl) | Number of Particles | 31,250 | Ideal Density | 600 |
Initial Spacing ab | 0.3 | Viscosity Coeff. | 0.001 | |
Render Size b | 0.1 | Bulk Modulus (k) | 250 | |
Particle Mass | 1 | Friction Coeff. () | 0.0 | |
Kernel Radius b | 0.2 | Restitution Coeff. () | 0.25 |
Scene | Num. Particles | Num. Obstacles | Num. Vertices | Num. Edges | Num. Triangles | Average FPS |
---|---|---|---|---|---|---|
Flat Plane | 64 | 2 | 12 | 23 | 14 | 179.912 |
10 Deg Inclined Plane (Slip) | 25 | 2 | 12 | 23 | 14 | 268.041 |
10 Deg Inclined Plane (No-Slip) | 25 | 2 | 12 | 23 | 14 | 251.574 |
Tank (Empty) | 15,750 | 1 | 8 | 18 | 12 | 179.894 |
Tank (with Wedge) | 13,500 | 2 | 14 | 30 | 20 | 189.525 |
Dam Break | 20,445 | 2 | 14 | 30 | 20 | 149.303 |
Flow Field (Sphere) | 31,250 | 2 | 394 | 1170 | 780 | 155.875 |
Flow Field (Torus) | 31,250 | 2 | 392 | 1170 | 780 | 152.735 |
Flow Field (Bowl) | 31,250 | 2 | 144 | 408 | 272 | 150.070 |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2024 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 (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Kim, R.; Torrens, P.M. Boundary SPH for Robust Particle–Mesh Interaction in Three Dimensions. Algorithms 2024, 17, 218. https://doi.org/10.3390/a17050218
Kim R, Torrens PM. Boundary SPH for Robust Particle–Mesh Interaction in Three Dimensions. Algorithms. 2024; 17(5):218. https://doi.org/10.3390/a17050218
Chicago/Turabian StyleKim, Ryan, and Paul M. Torrens. 2024. "Boundary SPH for Robust Particle–Mesh Interaction in Three Dimensions" Algorithms 17, no. 5: 218. https://doi.org/10.3390/a17050218
APA StyleKim, R., & Torrens, P. M. (2024). Boundary SPH for Robust Particle–Mesh Interaction in Three Dimensions. Algorithms, 17(5), 218. https://doi.org/10.3390/a17050218