# A Heterogeneous Parallel Algorithm for Euler-Lagrange Simulations of Liquid in Supersonic Flow
## 3 Results and Discussion
### Performance Analysis  
To test the proposed CPU/GPU mode, five simulations of the jet spray based on the experiments of [PERSON] et al. [20] are performed using two devices. The first device consists of two Intel Xeon Gold 5218 CPUs (Intel Corporation, Palo Alto, CA, USA) and runs CPU-based code. The other device consists of a Tesla V100 GPU (NVIDIA Corporation, Santa Clara, CA, USA) and uses the numerical scheme described in this paper. The specifications of CPU and GPU computing environments are listed in Table 3. For the CPU/GPU mode, a single CPU core coupled with one GPU is used, whereas for the CPU mode, 32 cores of the CPUs are used. The five simulations are prescribed with different numbers of computational droplets, namely, about 0.06 million, 0.12 million, 0.24 million, 0.48 million, and 0.96 million, resulting in the droplet-to-grid ratios of 0.09375, 0.1875, 0.375, 0.75, and 1.5, respectively. Details are shown in Table 4.  
Figure 10: Comparison of simulated spray penetration with experiments [12] in central plane. Figure 9: Superimposition of the contours of pressure, streamwise velocity, and droplets. Speedup (_SP_), an important parameter that can be used to assess the performance of a hybrid algorithm, is defined as:  
\[SP=\frac{t_{\text{cpu}}}{t_{\text{gpu}}} \tag{34}\]  
where \(t_{\text{cpu}}\) and \(t_{\text{gpu}}\) are the runtimes of one iteration for the CPU mode and that for the GPU/CPU mode, respectively. In this paper, the runtime of one iteration step is achieved by averaging the execution time of 1000 time steps. Figure 11 shows the time cost and composition for the two models. The green bar is the time cost for the gas phase, and the orange bar is that for the droplet phase. In the five simulations, the grid remains unchanged. Thus, the time cost for the gas phase remains the same. However, the CPU model has a higher time cost, while the droplet time consumption for the two models grows with increasing droplet numbers. However, the increase of the CPU model is not obvious, which is related to the management method of droplets on the CPU program. The CPU program associates each droplet with a control cell and establishes a linked list structure for the control cell to manage them dynamically. This droplet management method can provide great convenience in updating the gas phase information around the droplet and calculating the droplets' contribution to the gas phase. In addition, this droplet management method keeps the linked list structure from being too long. However, the inconvenience of this method is that all control cells need to be traversed when solving the liquid phase kernel function. In other words, even if there is no droplet in the computational domain, the calculation using the CPU code still costs time. Figure 12 illustrates the gas, droplet, and total computation speedups of the CPU/GPU mode for the different numbers of droplets simulated. It can be seen that, as the droplet-to-grid ratio varies from 0.09375 to 1.5, the gas phase speedup remains around 40, whereas the acceleration rate of the droplet phase slows down as the number of droplets increases. The latter trend can be attributed to the time required for data transfer between the array on GPU and CPU in the droplet's breakup and subtraction. \begin{table}
\begin{tabular}{c c c c} \hline \hline \multirow{2}{*}{**Case**} & **Number of Grids** & **Number of Droplets** & **Droplet-to-Grid** \\  & **(Million)** & **(Million)** & **Ratio** \\ \hline Case1 & 0.64 & 0.06 & 0.09375 \\ Case2 & 0.64 & 0.12 & 0.1875 \\ Case3 & 0.64 & 0.24 & 0.375 \\ Case4 & 0.64 & 0.48 & 0.75 \\ Case5 & 0.64 & 0.96 & 1.50 \\ \hline \hline \end{tabular}
\end{table} 
Table 4: Number of grids and droplets for five simulations.