Alternative Artificial Neural Network Structures for Turbulent Flow Velocity Field Prediction

Turbulence in fluids has been a popular research topic for many years due to its influence on a wide range of applications. Computational Fluid Dynamics (CFD) tools are able to provide plenty of information about this phenomenon, but their computational cost often makes the use of these tools unfeasible. For that reason, in recent years, turbulence modelling using Artificial Neural Networks (ANNs) is becoming increasingly popular. These networks typically calculate directly the desired magnitude, having input information about the computational domain. In this paper, a Convolutional Neural Network (CNN) for predicting different magnitudes of turbulent flows around different geometries by approximating the equations of the Reynolds-Averaged Navier-Stokes (RANS)-based realizable k-ε two-layer turbulence model is proposed. Using that CNN, alternative network structures are proposed to predict the velocity fields of a turbulent flow around different geometries on a rectangular channel, with a preliminary stage to predict pressure and vorticity fields before calculating the velocity fields, and the obtained results are compared with the ones obtained with the basic structure. The results demonstrate that the proposed structures clearly outperform the basic one, especially when the flow becomes uncertain. In addition, considering the results, the best network configuration is proposed. That network is tested with a domain with multiple geometries and a domain with a narrowing of the channel, which are domains with different conditions from the training ones, showing fairly accurate predictions.


Introduction
For many years, turbulence in fluids has been a popular research topic due to its impact on a wide variety of applications. Several experimental studies of turbulent flows have improved the understanding of turbulent behaviour and have been used to design more efficient systems. Even though these experiments have been very valuable, there are cases where experimentation is either too expensive or impractical. In these cases, CFD provides a more detailed insight into the physics of turbulent flows. Although CFD has the potential to predict accurately the behaviour of flows, decreasing the need for conducting experiments, it has two main disadvantages. The first disadvantage is the high computational cost of the simulations, which can be prohibitive in cases with very complex geometries or in cases where very accurate turbulence models, such as LES (Large Eddy Simulation) or DNS (Direct Numerical Simulation), are required. The second disadvantage is the influence of the user, especially in the generation of the mesh and the selection of the closure model. These problems, coupled with the growth of artificial intelligence, have led to an increasing number of studies using Deep Learning (DL) techniques applied to CFD, either as a complement to the simulations or to perform the simulations directly. the proposed neural network to make predictions under different conditions from the training ones.

CFD Setup
Numerical simulations by means of CFD were conducted to obtain the required velocity, pressure, and vorticity fields for training, validating, and testing the studied CNNs. To perform these simulations, the Star-CCM+ [20] CFD commercial code was used.
The numerical domain consists of a two-dimensional 128 × 256 mm plate, with a geometry located on its geometrical center. The left and right sides of the plate are set as inlet and outlet, respectively, whereas top and bottom sides and the geometry contour are set as walls with no-slip conditions. A detailed view of the numerical domain is provided in Figure 1.
Mathematics 2021, 9, x FOR PEER REVIEW 3 of 22 the proposed different structures; and Section 4 shows an evaluation of the ability of the proposed neural network to make predictions under different conditions from the training ones.

CFD Setup
Numerical simulations by means of CFD were conducted to obtain the required velocity, pressure, and vorticity fields for training, validating, and testing the studied CNNs. To perform these simulations, the Star-CCM+ [20] CFD commercial code was used.
The numerical domain consists of a two-dimensional 128 × 256 mm plate, with a geometry located on its geometrical center. The left and right sides of the plate are set as inlet and outlet, respectively, whereas top and bottom sides and the geometry contour are set as walls with no-slip conditions. A detailed view of the numerical domain is provided in Figure 1. In order to collect enough samples for training the network, a total of 2065 simulations were performed. Each simulation was carried out with one of the geometries shown in Table 1. These geometries are based on the geometries of the study of Kashefi et al. [14], and they were generated by changing the size and orientation of eight basic geometries. In order to collect enough samples for training the network, a total of 2065 simulations were performed. Each simulation was carried out with one of the geometries shown in Table 1. These geometries are based on the geometries of the study of Kashefi et al. [14], and they were generated by changing the size and orientation of eight basic geometries.
With the previously mentioned domain, an unstructured polygonal mesh of around 50,000 cells was generated. This mesh contains more cells near the boundaries in order to ensure good results on the most critical areas. An example of the used meshes can be shown in Figure 2.
To verify sufficient mesh resolution of the generated meshes, the General Richardson Extrapolation method [21] was performed, applied to the drag coefficient. For this study, the case of a circle with a = 0.02 m is considered. This method consists of estimating the value of the analysed parameter when the cell quantity tends to infinite from a minimum of three meshes. Therefore, a coarse mesh (16,809 cells), a medium mesh (25,665 cells), and a fine mesh (43,963 cells) were considered. As summarized in Table 2, the convergence condition (R), which should be between 0 and 1 to ensure a monotonic convergence, is fulfilled, and the estimated values (RE) of the evaluated parameters are close to the ones obtained with the fine mesh. Therefore, the mesh is suitable for these simulations. In addition, the results were compared with the experimental ones of Roshko et al. [22] for Re = 6383, showing fairly similar values.
Regarding the fluid, incompressible turbulent unsteady air is considered. The density (ρ) of the fluid is equal to 1.18415 kg/m 3 , and its dynamic viscosity (µ) is equal to 1.85508·10 −5 Pa·s. These values are assumed to be constant. The velocity at the inlet (u ∞ ) is set at 5 m/s, which means that the Reynolds number (Re) ranges between 6380 and 12,760, depending on the geometry and according to Expression (1).
where L is the projection of the geometry on the direction of the flow. In order to collect enough samples for training the network, a total of 2065 simulations were performed. Each simulation was carried out with one of the geometries shown in Table 1. These geometries are based on the geometries of the study of Kashefi et al. [14], and they were generated by changing the size and orientation of eight basic geometries.  In order to collect enough samples for training the network, a total of 2065 simulations were performed. Each simulation was carried out with one of the geometries shown in Table 1. These geometries are based on the geometries of the study of Kashefi et al. [14], and they were generated by changing the size and orientation of eight basic geometries. In order to collect enough samples for training the network, a total of 2065 simulations were performed. Each simulation was carried out with one of the geometries shown in Table 1. These geometries are based on the geometries of the study of Kashefi et al. [14], and they were generated by changing the size and orientation of eight basic geometries. With the previously mentioned domain, an unstructured polygonal mesh of around 50,000 cells was generated. This mesh contains more cells near the boundaries in order to ensure good results on the most critical areas. An example of the used meshes can be shown in Figure 2. With the previously mentioned domain, an unstructured polygonal mesh of around 50,000 cells was generated. This mesh contains more cells near the boundaries in order to ensure good results on the most critical areas. An example of the used meshes can be shown in Figure 2.  With the previously mentioned domain, an unstructured polygonal mesh of around 50,000 cells was generated. This mesh contains more cells near the boundaries in order to ensure good results on the most critical areas. An example of the used meshes can be shown in Figure 2.  With the previously mentioned domain, an unstructured polygonal mesh of around 50,000 cells was generated. This mesh contains more cells near the boundaries in order to ensure good results on the most critical areas. An example of the used meshes can be shown in Figure 2.  With the previously mentioned domain, an unstructured polygonal mesh of around 50,000 cells was generated. This mesh contains more cells near the boundaries in order to ensure good results on the most critical areas. An example of the used meshes can be shown in Figure 2. For turbulence modelling, the RANS-based realizable k-ε two-layer [23] turbulence model is selected, since k-ε models are the most common ones to obtain mean flow characteristics for turbulent flow conditions. RANS turbulence models provide closure relations for the RANS equations that govern the transport of the mean flow quantities. To obtain these equations, each flow variable is divided into a mean value and its fluctuating compo-nent, and then, the mean values are inserted into the Navier-Stokes equations, obtaining the mean mass and momentum transport Equations (2) and (3).
where u and p are the mean velocity and pressure, respectively; I is the identity tensor; T is the viscous stress tensor; and f b is the body force.
Rectangle 0°, 3°, …, 177° a = 0.02 m; b/a = 1. With the previously mentioned domain, an unstructured polygonal mesh of around 50,000 cells was generated. This mesh contains more cells near the boundaries in order to ensure good results on the most critical areas. An example of the used meshes can be shown in Figure 2. To verify sufficient mesh resolution of the generated meshes, the General Richardson Extrapolation method [21] was performed, applied to the drag coefficient. For this study, the case of a circle with a = 0.02 m is considered. This method consists of estimating the value of the analysed parameter when the cell quantity tends to infinite from a minimum of three meshes. Therefore, a coarse mesh (16,809 cells), a medium mesh (25,665 cells), and a fine mesh (43,963 cells) were considered. As summarized in Table 2, the convergence  Depending on the modelling of the stress tensor, there are different RANS model categories. The k-ε model corresponds to the eddy viscosity models, which are based on the analogy between the molecular gradient-diffusion process and turbulent motion. This kind of models uses the turbulent dynamic eddy viscosity (µ t ) to model the stress tensor as a function of mean flow quantities. In the present case, T RANS is modeled by means of the Boussinesq approximation (4).
where S is the mean strain rate tensor defined by Equation (5).
The RANS-based k-ε model is a two-equation model which consists of the model transportation equation for turbulent kinetic energy (k) (5), the model transportation equation for the dissipation rate (ε) (6) which is empirical, and the turbulent viscosity (µ t ) specification (7).
where C ε3 is a model coefficient, whose value is 1 if G b ≥ 1 and 0 if G b < 0; G k represents the turbulent production given by Equation (11); G b represents the buoyancy production given by Equation (12); and γ M represents the compressibility modification given by Equation (13).
where Pr t is the turbulent Prandtl number; T is the mean temperature; g is the gravitational vector; C M is a model coefficient equal to 2; and c is the speed of sound. Among the various forms of the k-ε model that are available, the realizable k-ε twolayer model is considered in the present study. This model combines the realizable k-ε model, which satisfies certain mathematical constraints on the normal stresses consistent with the physics of turbulence, and the two-layer approach, which allows the k-ε model to be applied in the viscous-affected layer. With the realizable k-ε two-layer model, the coefficients are identical to the ones of these two models separately, but the model gains the added flexibility of an all-y + wall treatment. For the selected turbulence model and the studied cases, the model coefficients are the following ones: σ k is equal to 1; σ ε is equal to 1.2; C ε1 is equal to 1.44; C ε2 is equal to 1.9; and C µ is equal to 0.09.
Regarding the wall treatment, as mentioned before, the realizable k-ε two-layer model uses an all-y + wall treatment. This wall treatment emulates the low-y + wall treatment for fine meshes (near the boundaries), which resolves the viscous sublayer and needs little or no modelling to predict the flow across the wall boundary; the high-y + wall treatment for coarse meshes (far from the boundaries), which, instead of resolving the viscous sublayer, obtains the boundary conditions for the continuum equations.
For data generation, as non-stationary turbulence models are selected, the average values of the velocity, pressure, and vorticity fields are extracted. To obtain these average fields, 2 s of simulation are considered, once the flow is fully developed. The values of the fields are interpolated in order to fit the data into a 128 × 256 grid. Then, the procedure of Kashefi et al. [14] for data generation is followed.
where Φ is replaced by each set of u * x , u * y , p * , and ω * .

Domain Representation
In this study, the same layers used by Ribeiro et al. [13] are implemented to represent the domain. Therefore, numerical domain is represented by three different layers: the Flow Region Channel (FRC), the Signed Distance Function (SDF) of the geometry, and the SDF of the walls.
The FRC layer contains information about the boundary conditions of the domain. This layer consists of giving a number to each cell of the grid depending on the boundary condition assigned to that cell. In this case, the geometry is represented by a 0, the fluid by a 1, no-slip walls by a 2, the inlet by a 3, the outlet by a 4, and the outline of the geometry by a 5. A detailed example of a FRC layer is shown Figure 3.

Domain Representation
In this study, the same layers used by Ribeiro et al. [13] are implemented to represent the domain. Therefore, numerical domain is represented by three different layers: the Flow Region Channel (FRC), the Signed Distance Function (SDF) of the geometry, and the SDF of the walls.
The FRC layer contains information about the boundary conditions of the domain. This layer consists of giving a number to each cell of the grid depending on the boundary condition assigned to that cell. In this case, the geometry is represented by a 0, the fluid by a 1, no-slip walls by a 2, the inlet by a 3, the outlet by a 4, and the outline of the geometry by a 5. A detailed example of a FRC layer is shown Figure 3. The SDF layer represents the minimum distance between each cell and the outline of a specified contour. This function was proposed by Guo et al. [8], and as demonstrated in that study, it provides significantly smaller errors than the typical binary representation. In this study two different SDF layers are used, one for the geometry, shown in Figure 4a, and another one for the no-slip walls of the channel, shown in Figure 4b. The SDF layer represents the minimum distance between each cell and the outline of a specified contour. This function was proposed by Guo et al. [8], and as demonstrated in that study, it provides significantly smaller errors than the typical binary representation. In this study two different SDF layers are used, one for the geometry, shown in Figure 4a, and another one for the no-slip walls of the channel, shown in Figure 4b.  To create this layer, firstly the zero level set (Z) is created (19). This is the level where the analysed contour is located, and therefore, SDF is equal to zero.
Then, the sign of SDF is defined.
Finally, the value of each cell is calculated following Expression (20). To create this layer, firstly the zero level set (Z) is created (19). This is the level where the analysed contour is located, and therefore, SDF is equal to zero.
Then, the sign of SDF is defined. SDF(x, y) = 0 if (x, y) is on the geometry contour; SDF(x, y) < 0 if (x, y) is inside the geometry; and SDF(x, y) > 0 if (x, y) is outside the geometry.
Finally, the value of each cell is calculated following Expression (20).
After generating all the input layers, they are scaled in a range of (0, 1), following the previously-mentioned Expression (18).

Neural Network Architecture
In the present paper, a CNN based on the previous works from Ribeiro et al. [13] and Thuerey et al. [18] is proposed. For this network, an U-Net architecture [24] is considered, which is a special case of an encoder-decoder network. In this case, the net consists of four encoder/decoder blocks. Each encoder block contains two convolutional layers. The first convolutional layer is followed by a ReLU (Rectifier Linear Unit) layer, and the second one by a ReLU layer and a Max Pooling layer. In the first two encoding blocks, the kernel size is equal to 5, and strided convolutions are performed on the first layer of the block, aiming to reduce the data size for the training step. In contrast, the kernel size of the las two encoding blocks is equal to 3. After each block, the number of filters is doubled. The decoding phase performs the reverse process. Encoder and decoder blocks are connected to each other by concatenation layers. A schematic view of the used CNN is provided in Figure 5. MATLAB 2021a [25] commercial code with its Deep Learning Toolbox [26] was used for designing and training the network. With regards to the network training process, the Adam [27] optimizer was used, with a learning rate of 0.001, a batch size of 64, and a weight decay of 0.005. The data were split into 60% training, 30% validation, and 10% test, and the validation was performed after each epoch. Three different configurations have been considered for the selection of the most appropriate data-splitting ratio: 60% training, 30% validation, and 10% test (the selected ratio); 70/20/10%; and 80/10/10%. Among these configurations, the selected one is the one that provides the best predictions of all the analysed magnitudes. Among these magnitudes, pressure is the most sensitive to the data-split, and vorticity the least sensitive, the differences between configurations being almost negligible for this magnitude. Considerable differences also appear in the velocity fields.
In order to validate the used net, the training Root-Mean Square Error (RMSE) curves With regards to the network training process, the Adam [27] optimizer was used, with a learning rate of 0.001, a batch size of 64, and a weight decay of 0.005. The data were split into 60% training, 30% validation, and 10% test, and the validation was performed after each epoch. Three different configurations have been considered for the selection of the most appropriate data-splitting ratio: 60% training, 30% validation, and 10% test (the selected ratio); 70/20/10%; and 80/10/10%. Among these configurations, the selected Mathematics 2021, 9,1939 9 of 21 one is the one that provides the best predictions of all the analysed magnitudes. Among these magnitudes, pressure is the most sensitive to the data-split, and vorticity the least sensitive, the differences between configurations being almost negligible for this magnitude. Considerable differences also appear in the velocity fields.
In order to validate the used net, the training Root-Mean Square Error (RMSE) curves obtained with the network used in the present study are compared with the ones obtained with the net of Ribeiro et al. [13], which was designed for laminar flow prediction on a channel. As this network was originally designed to predict velocity and pressure fields, only the training curves of these magnitudes are considered for this comparison. These curves can be shown in Figure 6. With regards to the network training process, the Adam [27] optimizer was used, with a learning rate of 0.001, a batch size of 64, and a weight decay of 0.005. The data were split into 60% training, 30% validation, and 10% test, and the validation was performed after each epoch. Three different configurations have been considered for the selection of the most appropriate data-splitting ratio: 60% training, 30% validation, and 10% test (the selected ratio); 70/20/10%; and 80/10/10%. Among these configurations, the selected one is the one that provides the best predictions of all the analysed magnitudes. Among these magnitudes, pressure is the most sensitive to the data-split, and vorticity the least sensitive, the differences between configurations being almost negligible for this magnitude. Considerable differences also appear in the velocity fields.
In order to validate the used net, the training Root-Mean Square Error (RMSE) curves obtained with the network used in the present study are compared with the ones obtained with the net of Ribeiro et al. [13], which was designed for laminar flow prediction on a channel. As this network was originally designed to predict velocity and pressure fields, only the training curves of these magnitudes are considered for this comparison. These curves can be shown in Figure 6. The curves show that the proposed network outperforms the baseline network for turbulent flow predictions. All the curves show a broadly similar trend. At the beginning of the training, up to approximately epoch 50, the error of the proposed network decreases significantly more than the error of the baseline network, except in the case of . Thereafter, the difference between the two networks narrows, but when the results stabilize, the error of the proposed network is still lower. At the end of training, the proposed network has an error reduction of 28% in the case of , 42% in , and 30% in .

Neural Network Configurations
In the present study, four different network structures are proposed in order to determine which provides the best predictions of the turbulent flow velocity fields. All structures have the domain characteristics as input and the velocity fields as output, but three of them have an additional intermediate stage to calculate the pressure and vorticity The curves show that the proposed network outperforms the baseline network for turbulent flow predictions. All the curves show a broadly similar trend. At the beginning of the training, up to approximately epoch 50, the error of the proposed network decreases significantly more than the error of the baseline network, except in the case of u y . Thereafter, the difference between the two networks narrows, but when the results stabilize, the error of the proposed network is still lower. At the end of training, the proposed network has an error reduction of 28% in the case of u x , 42% in u y , and 30% in p.

Neural Network Configurations
In the present study, four different network structures are proposed in order to determine which provides the best predictions of the turbulent flow velocity fields. All structures have the domain characteristics as input and the velocity fields as output, but three of them have an additional intermediate stage to calculate the pressure and vorticity fields.
The basic structure (Figure 7a) is the most popular for predicting flow characteristics. This structure directly predicts the velocity fields. The pressure-based structure (Figure 7b) predicts the pressure field, and then the velocity fields considering the pressure field. The vorticity-based structure (Figure 7c) and pressure-and vorticity-based structure (Figure 7d) are equal to the pressure-based one, but these networks predict the vorticity field and both pressure and vorticity fields in the intermediate stage, respectively.

Results and Discussion
Aiming to determine which of the previously mentioned ANN configurations provides the best predictions of turbulent velocity fields, a qualitative and quantitative comparison of the results obtained with all the structures is conducted. For these two studies, the results obtained with a test-set of 207 geometries (10% of all the samples) are considered.

Qualitative Study
The qualitative study is performed by comparing the predictions of the studied neural network structures with the results obtained by CFD simulations. To conduct this comparison, three different geometries, with different characteristics, are selected. The first geometry (Figure 8a) is an ellipse, and it is considered an easy-to-predict geometry because of its symmetry, its low Reynolds number and the fact of not having sharp corners. The second geometry (Figure 8b) is a triangle, and it is considered an aerodynamic geometry due to its low angle of attack and the small surface area on which the fluid directly impinges. The third geometry (Figure 8c) is also a triangle, and it is considered a nonaerodynamic geometry because of its high angle of attack and the big area where the fluid directly impacts. These magnitudes are selected for the intermediate stage as they are directly related to velocity. Regarding pressure, according to Bernoulli's principle, a decrease in the pressure occurs simultaneously with an increase in the velocity, and vice versa. Concerning vorticity, this magnitude determines the local rotation of the fluid, thus relating the velocity components.

Results and Discussion
Aiming to determine which of the previously mentioned ANN configurations provides the best predictions of turbulent velocity fields, a qualitative and quantitative comparison of the results obtained with all the structures is conducted. For these two studies, the results obtained with a test-set of 207 geometries (10% of all the samples) are considered.

Qualitative Study
The qualitative study is performed by comparing the predictions of the studied neural network structures with the results obtained by CFD simulations. To conduct this comparison, three different geometries, with different characteristics, are selected. The first geometry (Figure 8a) is an ellipse, and it is considered an easy-to-predict geometry because of its symmetry, its low Reynolds number and the fact of not having sharp corners. The second geometry (Figure 8b) is a triangle, and it is considered an aerodynamic geometry due to its low angle of attack and the small surface area on which the fluid directly impinges. The third geometry (Figure 8c) is also a triangle, and it is considered a non-aerodynamic geometry because of its high angle of attack and the big area where the fluid directly impacts.  The results show that, although some errors appear in the contour and in the wake behind the geometry, all the structures are able to predict the velocity fields of the easy-topredict geometry and the aerodynamic geometry fairly precisely. For these two geometries, the basic structure is the one which provides the worst results, being the structure which shows the highest errors. Between the other three structures, no clear differences are visible, but the pressure-and vorticity-based structure seems to be the most accurate structure with very low errors across the predicted fields.
The predictions of the non-aerodynamic geometry show the larger differences between structures. In this case, the basic structure is clearly outperformed by the other ones, showing poor predictions on the boundary of the geometry and, most markedly, on the wake behind the geometry. This means that giving additional information about the flow to the network eases predictions when the flow behaviour is uncertain. The networks which include the prediction of the pressure show the best results on the wake behind the geometry, and the ones which include the prediction of the vorticity show the best results near the geometry. This is attributed to the fact that changes in the pressure field start to appear at a considerable distance from the geometry, but the largest changes in the vorticity field occur very close to the geometry, at its contour.

Quantitative Study
The quantitative study is focused on studying the error of the test-set. For a general overview of the error in the whole test-set, the mean error obtained with all the structures is analysed. Table 3 summarizes the mean error of the predicted velocity components. The mean error shows that all the proposed structures outperform the basic one. The proposed networks diminish the mean absolute u x error between 41.5% and 45.9%, the pressure-based structure being the most accurate structure. Regarding the mean absolute u y error, the proposed structures reduce the error between 45.2% and 64.5%, the pressureand vorticity-based structure being the one which provides the best predictions.
In order to obtain more detailed information about the error distribution in the test-set, histograms with the absolute error of the velocity fields in both directions are made. These histograms can be shown in Figure 9.
The histograms of the absolute error confirm the results shown with the mean absolute errors. Although there is not a significant difference in the maximum u x error obtained with the tested structures, the predictions made with the basic structure have the highest errors in almost all ranges above 0.05 m/s. As for the rest of the structures, although they show quite similar error distributions, the pressure-and vorticity-based structure is the structure with the least errors up to 2 m/s, but above this value, this structure produces more errors than the other two structures. On the other hand, the pressure-based structure has more errors below 2 m/s, but fewer above this value. For that reason, the mean error of the pressure-based structure is the lower one.
The predictions of all structures show a very similar trend of u y error distribution, with the basic structure having the largest errors and the pressure-and vorticity-based structure having the smallest ones.

Performance Analysis
The main goal of calculating flow characteristics through neural networks is to reduce the high computational cost of CFD simulations. For this reason, the time required by each structure to make the predictions is considered a parameter of great relevance. Table 4 shows the time required to obtain the predictions with each studied method using a single core of an Intel Xeon 5420 CPU.

Performance Analysis
The main goal of calculating flow characteristics through neural networks is to reduce the high computational cost of CFD simulations. For this reason, the time required by each structure to make the predictions is considered a parameter of great relevance. Table 4 shows the time required to obtain the predictions with each studied method using a single core of an Intel Xeon 5420 CPU. The computational times required by each method show that predicting velocity fields using CNN, in comparison with CFD, entails a reduction of around four orders of magnitude in terms of computational time. As expected, the simplest CNN structure (the basic structure) is the fastest one, and the most complex (the pressure-and vorticity-based structure) is the slowest one. Nonetheless, the differences between structures are negligible in comparison with the time required by CFD.  The computational times required by each method show that predicting velocity fields using CNN, in comparison with CFD, entails a reduction of around four orders of magnitude in terms of computational time. As expected, the simplest CNN structure (the basic structure) is the fastest one, and the most complex (the pressure-and vorticity-based structure) is the slowest one. Nonetheless, the differences between structures are negligible in comparison with the time required by CFD.

Network Testing
In order to evaluate the ability of the neural network proposed in this study to make predictions under different conditions from the training ones, two different domains are considered, one with two geometries and another one with a different channel.
To make the predictions of the velocity fields on these domains, the best neural network structure is considered. For predicting the u x velocity field, the pressure-based structure is considered, since it provides the minimum mean error and is the better one for predicting the wake behind the geometry, which is one of the most important parameters. To predict the u y velocity field, the pressure-and vorticity-based structure is considered, since it has been demonstrated to be the most accurate for this field. A schematic view of the structure of the used ANN is provided in Figure 10.
To make the predictions of the velocity fields on these domains, the best neural network structure is considered. For predicting the velocity field, the pressure-based structure is considered, since it provides the minimum mean error and is the better one for predicting the wake behind the geometry, which is one of the most important parameters. To predict the velocity field, the pressure-and vorticity-based structure is considered, since it has been demonstrated to be the most accurate for this field. A schematic view of the structure of the used ANN is provided in Figure 10.

Multiple Objects
The domain used in this case contains two geometries, particularly two circles. Therefore, the input layers for this case have some adaptations. The FRC layers contain two geometries and geometry boundaries, and the SDF layer of the geometry has two zero level sets. The SDF of the walls remains equal. A schematic view of the numerical domain and the input layers is provided in Figure 11. The predictions of the velocity fields performed by CFD and the proposed network are displayed in Figure 12.

Multiple Objects
The domain used in this case contains two geometries, particularly two circles. Therefore, the input layers for this case have some adaptations. The FRC layers contain two geometries and geometry boundaries, and the SDF layer of the geometry has two zero level sets. The SDF of the walls remains equal. A schematic view of the numerical domain and the input layers is provided in Figure 11. The predictions of the velocity fields performed by CFD and the proposed network are displayed in Figure 12.
structure is considered, since it provides the minimum mean error and is the better one for predicting the wake behind the geometry, which is one of the most important parameters. To predict the velocity field, the pressure-and vorticity-based structure is considered, since it has been demonstrated to be the most accurate for this field. A schematic view of the structure of the used ANN is provided in Figure 10.

Multiple Objects
The domain used in this case contains two geometries, particularly two circles. Therefore, the input layers for this case have some adaptations. The FRC layers contain two geometries and geometry boundaries, and the SDF layer of the geometry has two zero level sets. The SDF of the walls remains equal. A schematic view of the numerical domain and the input layers is provided in Figure 11. The predictions of the velocity fields performed by CFD and the proposed network are displayed in Figure 12.  The results show that the proposed network is able to predict the velocity fields of a domain with multiple geometries in a fairly reliable way, with tolerable errors. These results show two problematic areas. The first problematic area is the contour of the geometries. Whereas with a single geometry, these errors were already visible; in this case they are slightly higher. The second problematic area is the area between geometries. Although the errors are not very high, the neural network does not adequately predict the interaction between geometries, since the area with the most errors is the region where the wake of the first geometry impacts the second geometry.  The results show that the proposed network is able to predict the velocity fields of a domain with multiple geometries in a fairly reliable way, with tolerable errors. These results show two problematic areas. The first problematic area is the contour of the geometries. Whereas with a single geometry, these errors were already visible; in this case they are slightly higher. The second problematic area is the area between geometries. Although the errors are not very high, the neural network does not adequately predict the interaction between geometries, since the area with the most errors is the region where the wake of the first geometry impacts the second geometry.

Different Channel
This domain contains a single geometry, but the walls of the channel have a narrowing on their middle. Therefore, the input layers for this case also have to be adapted. In the FRC layer, although the outline of the walls remains with no-slip wall conditions, the inner part of the walls has been considered as geometry, since among the possible options it is considered to be the most appropriate one. The SDF layer of the geometry is equal to the training ones, but the SDF layer of the walls contains a zone of negative values. A schematic view of the numerical domain and the input layers is provided in Figure 13, and the predictions of the velocity fields performed by CFD and the proposed network are displayed in Figure 14.

Different Channel
This domain contains a single geometry, but the walls of the channel have a narrowing on their middle. Therefore, the input layers for this case also have to be adapted. In the FRC layer, although the outline of the walls remains with no-slip wall conditions, the inner part of the walls has been considered as geometry, since among the possible options it is considered to be the most appropriate one. The SDF layer of the geometry is equal to the training ones, but the SDF layer of the walls contains a zone of negative values. A schematic view of the numerical domain and the input layers is provided in Figure 13, and the predictions of the velocity fields performed by CFD and the proposed network are displayed in Figure 14.    There are three areas where considerable differences are observed. The first zone is the narrowing of the channel, where the neural network underpredicts the speed increase that occurs. The second, and most conflicting, area is the near-wall area. When the channel narrows, the network underpredicts the impact with the walls then (noticeable in ), and when the channel widens again, although a decrease in velocity is visible, the network is unable to predict the wake behind the walls (noticeable in ). The third region is the geometry contour. As with multiple geometries, when changing the channel, the errors in the geometry contour increase in comparison to the simple case. There are three areas where considerable differences are observed. The first zone is the narrowing of the channel, where the neural network underpredicts the speed increase that occurs. The second, and most conflicting, area is the near-wall area. When the channel narrows, the network underpredicts the impact with the walls then (noticeable in u y ), and when the channel widens again, although a decrease in velocity is visible, the network is unable to predict the wake behind the walls (noticeable in u x ). The third region is the geometry contour. As with multiple geometries, when changing the channel, the errors in the geometry contour increase in comparison to the simple case.

Conclusions
In the present paper, a CNN for predicting different magnitudes of turbulent flows is proposed. With this CNN, alternative neural network structures for turbulent flow velocity field prediction are proposed. In contrast with the typical network structure, which directly calculated the velocity fields, the proposed structures perform a preliminary calculation of pressure and vorticity fields in order to obtain more information about the flow. Performing the predictions using the proposed networks instead of using CFD means a reduction of about four orders of magnitude in terms of computational time.
The results indicate that the proposed network structures outperform the basic structure, showing a decrease between 41.5% and 45.9% of mean absolute u x error and a decrease between 45.2% and 64.5% of mean absolute u y error. When the flow is simple, the results provided by the basic structure are correct, but the more uncertain the flow, the greater the differences between structures, with the structures with a preliminary calculation of pressure and vorticity fields being much more accurate than the basic one. These differences are more visible on the wake behind the geometry.
Finally, the best network structure is proposed considering the obtained results, and its ability to predict turbulent flow velocity fields in domains different from those used to train the network is evaluated. This network calculates the pressure and vorticity fields on the preliminary stage, and used the pressure field to calculate the horizontal component of the velocity field and both the pressure and vorticity fields to calculate the vertical component of the velocity field. To assess the network, two different domains are considered, one which has two geometries and another one which has a narrowing of the channel. The results show that the network is able to predict the velocity fields when the domain has two geometries, but when changing the channel, the errors are significant.
Therefore, this study demonstrates that obtaining fluid characteristics to predict the desired magnitude improves predictions substantially, and that this type of structure is applicable to different domains for the ones used for the training process. Funding: The authors were supported by the government of the Basque Country through research grants ELKARTEK 21/10: BASQNET: Estudio de nuevas técnicas de inteligencia artificial basadas en Deep Learning dirigidas a la optimización de procesos industriales.

Institutional Review Board Statement: Not applicable.
Informed Consent Statement: Not applicable.

Data Availability Statement:
The data presented in this study are available on request from the corresponding author.

G b
Buoyancy production G k Turbulent production I Identity tensor k Turbulent kinetic energy L Projection of the geometry on the direction of the flow