# Boundary SPH for Robust Particle-Mesh Interaction in Three Dimensions
## 2 Materials and Methods  
This paper describes BSPH as an FSI methodology that enables interactions between SPH fluid particles and mesh-based 3D geometries. Specifically, BSPH decomposes the FSI problem into two smaller problems: (1) detecting a particle's closest projection onto the 3D mesh surface; and (2) deriving the reflected velocity based on the boundary normal at this closest projection. Key to this method is the concept of \"Voronoi Regions\" [24; 25], or the segmentation of a 2D or 3D space such that all points encased within a segment are closest to one of a set of feature points. In this case, this FSI method can be generalized to the following steps:  
1. For each fluid particle and mesh triangle \([p,t|p\in P,t\in T]\), project \(p\) onto the 2D plane defined by \(t\) (\(proj_{p}\)) and determine the closest point on the triangle to this projection (\(proj_{p,t}\)). Voronoi region tessellation is needed here to divide the 2D plane of each triangle into regions that identify if \(proj_{p}\) is closest to either a vertex or edge or if \(proj_{p}\) is located inside the triangle.
2. For each fluid particle \(p\in P\), determine the closest point on the mesh such that the distance between \(p\) and \(proj_{p,t}\) is minimized.
3. For each fluid particle, determine the boundary normal \(N_{b}\) based on the closest \(proj_{p,t}\)'s position on the mesh as well as the signed distance from \(p\) to the closest \(proj_{p,t}\) based on \(N_{b}\).  
This methodology shares conceptual similarities with the Gilbert-Johnson-Keerthi (GJK) distance algorithm: both methodologies rely on Voronoi region tessellation [26]. However, the GJK algorithm is only applicable to convex geometries. We instead follow concepts exhibited by a field of collision detection algorithms known as \"Discrete Signed Distance Fields\" [27]. Such methods attempt to detect minimum signed distances between query points and a 2D or 3D manifold by first \"extruding\" the faces, wedges, and vertices of the manifold outward and inward, then querying which extrusion each query point is located inside [28]. [PERSON]'s \"Characteristic/Scan-Conversion\" (CSC) method [29] is a notable application of the concept that uses \"scan-conversion\" for the point-extrusion check.  
We combine the strategies for the signed distance calculation from [PERSON] and [PERSON] [30] and [PERSON] [31]. [PERSON] and [PERSON]'s strategy compares query points with each triangle on a mesh to determine the closest point and offers suggestions for optimization, such as calculating the sign of the distance separately from the distance measurement and precomputing triangle vertices and normal components prior to runtime. Both suggestions are realized through [PERSON] and [PERSON] strategy of calculating the \"pseudonormal\" vectors of edges and vertices of a mesh and deriving the signed distance based on boundary normals and closest point alone. This is in agreement with [PERSON] and [PERSON]'s original method [32]. Particle-boundary interactions are adapted from [PERSON] et al.'s method [33], which also mentions the use of Voronoi Regions for fast detection of closest mesh points but leaves this step ambiguous in its implementation. More importantly, [PERSON] et al.'s application re-positions particles based on the bound ary normal of the closest point on the mesh for each particle, which we also adopt in our implementation.