# Internal Flow Prediction in Arbitrary Shaped Channel Using Stream-Wise Bidirectional LSTM
## 4 Results and Discussion
### Computation Time  
To evaluate the impact of the SB-LSTM module on the prediction time in deep learning, two comparisons were conducted. First, the time required for a deep learning model with the SB-LSTM module attached was compared with that of the deep learning model without the module. Second, the time required for the SB-LSTM model was compared with that of the conventional CFD calculation method. The calculation time was measured using the RTX 3090 GPU for the deep learning models, whereas a single core of the AMD Ryzen 5 5600G CPU was used for CFD calculations. In both tests, the average computation times were measured by performing the calculation on 1000 pieces of test data. In this study, the time required to solve the SIMPLE algorithm solver using the CFD method was measured utilizing a time command in Linux. The average calculation time was 1.16811 seconds. In the case of surrogate models, the experiment was set up to examine the impact of different batch sizes. A total of 12 experiments were conducted, with batch sizes of 1, 10, and 100. The results of each experiment are summarized in Table 3.  
\begin{table}
\begin{tabular}{c c c c c c c} \hline \hline
**Method** & \multicolumn{3}{c}{_MRE (All) (\(\downarrow\))_} & \multicolumn{3}{c}{_MRE (Corner) (\(\downarrow\))_} \\  & \(\mathbf{u}\) & \(\mathbf{v}\) & \(\mathbf{P}\) & \(\mathbf{u}\) & \(\mathbf{v}\) & \(\mathbf{P}\) \\ \hline ED & 4.099\% & 10.200\% & 20.524\% & 54.007\% & 48.999\% & 35.241\% \\ U-Net & 4.056\% & 10.102\% & 20.962\% & 53.675\% & 48.794\% & 35.183\% \\ ED with & 1.370\% & 5.591\% & 5.019\% & 30.738\% & 31.814\% & 15.831\% \\ SB-LSTM & **1.195\%** & **5.212\%** & **4.524\%** & **30.350\%** & **29.102\%** & **13.724\%** \\ \hline \hline \end{tabular}
\end{table}
Table 2: Quantitative comparisons of mean relative error between four different methods, with \(\downarrow\) indicating that lower is better. The best result is highlighted in **bold** and the second-best result is underlined.  
For a batch size of one, the calculation time for the model with the SB-LSTM module was \(0.8\times 10^{-3}\) seconds longer than that for the ED model and \(0.5\times 10^{-3}\) s longer than that for the U-Net model, compared to the model without the SB-LSTM module. Although this is small considering that the CPU time required was 1.611 s, the SB-LSTM module can be considered inefficient in terms of calculation time as it took an additional 23% and 11% of the time compared to the baseline models. However, the additional time was due to the sequential calculation of the LSTM within the SB-LSTM module, which accounts for a large amount of time.  
Figure 15: Figure of mean absolute error for each component of the models used in the experiment. From top left to bottom right: (**a**) \(u\), (**b**) \(v\), (**c**) \(P\).  
\begin{table}
\begin{tabular}{c c c c} \hline \hline
**Method** & **Batch Size** & \
\begin{tabular}{c} **Average** \\ **Computation Time (s)** \\ \end{tabular} &
\begin{tabular}{c} **Inference Speed** \\ **Acceleration Ratio** \\ \end{tabular} \\ \hline ED & 1 & \(3.4044\times 10^{-3}\) & 493.80 \\  & 10 & \(2.0150\times 10^{-3}\) & 834.3 \\  & 100 & \(1.8760\times 10^{-3}\) & 896.11 \\ \hline U-Net & 1 & \(4.4070\times 10^{-3}\) & 381.46 \\  & 10 & \(2.6121\times 10^{-3}\) & 643.58 \\  & 100 & \(2.4786\times 10^{-3}\) & 678.25 \\ \hline ED with SB-LSTM & 1 & \(4.2567\times 10^{-3}\) & 394.93 \\  & 10 & \(2.2202\times 10^{-3}\) & 757.1 \\  & 100 & \(1.9821\times 10^{-3}\) & 876.39 \\ \hline U-Net with SB-LSTM & 1 & \(4.9103\times 10^{-3}\) & 342.36 \\  & 10 & \(2.8264\times 10^{-3}\) & 594.78 \\  & 100 & \(2.5271\times 10^{-3}\) & 665.23 \\ \hline \hline \end{tabular}
\end{table}
Table 3: Comparison of average computational time of four different methods in GPU environment.  
portion of the total time when the batch size is one. As the batch size increases, the speedup value becomes comparable to that of the existing model.