# Angiography Simulation and Planning Using a Multi-Fluid Approach
## 3 Diffusion Simulation of Contrast Media
### Boundary Conditions
#### 3.2.1 Boundary Constructions  
To satisfy the non-slip boundary condition and for the density condition, we construct multiple boundary particle layers to cover the vessel walls. The position of boundary particles (without surface points) is calculated by the following three steps. First, we pre-sampled the blood vessel mesh as the method in [30]. The sampling of a single triangle is shown in Figure 3. We obtain contour sampling points of the triangle by its three vertices (yellow points). The number of edge sampling points (blue points) is \(n_{e}=\left\lfloor\frac{|y_{a}-y_{b}|}{\ell}\right\rfloor\) and these edge sampling points are distributed along the edges with interval \(\ell_{e}=\frac{|y_{a}-y_{b}|}{n_{e}}\), where \(v_{a}\) and \(v_{b}\) are two triangle vertices, \(\ell\) is the sampling interval. For the interior of the triangle, we choose the shortest edge \(e_{s}\) and its normal direction \(\overrightarrow{s}=\frac{e_{s}\times(e_{t})\times e_{s}}{|e_{s}\times(e_{t} \times e_{s})|}\) for the triangle sampling, where \(e_{l}\) is the longest edge of the triangle. Therefore, the sweeping steps \(n_{f}=\lfloor\frac{h_{f}}{\ell}\rfloor\) along a sweep direction \(\overrightarrow{s}\) with an interval \(l_{f}=\frac{h_{f}}{n_{f}}\), where \(h_{f}\) is the height of the shortest edge of the triangle, and the same sampling method for the triangle edge is adopted to sample the interior sampling points(green points) for each sweep step. Second, we extrapolate these sampling points by their corresponding normal. The sampling points of triangle vertices and edges are extrapolated by the mean normal of their circumambient triangles and the interior sampling points of a triangle are using this triangle normal for extrapolation. These sampling triangle points are extrapolated from 1 to \(n\) times along their corresponding outward normal with a distance \(\ell\). The maximum of \(n\) satisfies \(n\ell<\frac{h}{2}\) and \((n+1)\ell>\frac{h}{2}\), where \(h\) is the radius of the smooth kernel. Therefore, the position of the extrapolated points is the position of the boundary particles, the outward normal is the extrapolation vector of the boundary particles and \(n\ell\) is its nearest triangle distance. Finally, due to the complexity of the blood vessel structure, we optimize these extrapolated particles since they may aggregate locally. The boundary particles are constructed to fix the deficiency  
Figure 3: The sampling of triangles. of the fluid near the boundary, such as the density and the pressure. We build several layers of boundary particles to fix this problem. The construction of boundary particles bases on the sampling of the triangle mesh extrapolates these sampling points. However, these extrapolated points will aggregate in two situations in bifurcation region and neighbor triangle region. Therefore, we use the radius threshold Y1 and Y2 as radius threshold to optimize the particles for these two situations, as shown in Figure 4. During the optimization, if the distance between the current particle and another particle is smaller than the corresponding threshold, we replace these two particles by a new particle with a center position of the previous two particles and set the extrapolation vector and the nearest triangle distance by the corresponding mean value of the two previous particles. The detailed steps are as follows:  
First, the boundary particles extrapolated into the model are removed. Second, the dense regions of the boundary particles are produced at the bifurcation of the vessel as shown in Figure 4a and the neighbor of the triangles is shown in Figure 4b. We use do value of the extrapolation vector of the particles \((\overrightarrow{n_{1}}\cdot\overrightarrow{n_{2}})\) to judge the dense region at bifurcation or the other.