Modeling and Optimization of Hydraulic and Thermal Performance of a Tesla Valve Using a Numerical Method and Artificial Neural Network

The Tesla valve is a non-moving check valve used in various industries to control fluid flow. It is a passive flow control device that does not require external power to operate. Due to its unique geometry, it causes more pressure drop in the reverse direction than in the forward direction. This device’s optimal performance in heat transfer applications has led to the use of Tesla valve designs in heat sinks and heat exchangers. This study investigated a Tesla valve with unconventional geometry through numerical analysis. Two geometrical parameters and inlet velocity were selected as input variables. Also, the pressure drop ratio (PDR) and temperature difference ratio (TDR) parameters were chosen as the investigated responses. By leveraging numerical data, artificial neural networks were trained to construct precise prediction models for responses. The optimal designs of the Tesla valve for different conditions were then reported using the genetic algorithm method and prediction models. The results indicated that the coefficient of determination for both prediction models was above 0.99, demonstrating high accuracy. The most optimal PDR value was 4.581, indicating that the pressure drop in the reverse flow direction is 358.1% higher than in the forward flow direction. The best TDR response value was found to be 1.862.


Introduction
Non-moving-part valves (NMPVs) are efficient equipment used as passive fluid controllers. Compared to conventional check valves with moving parts, NMPVs have advantages in terms of manufacturing and do not require external power to operate [1]. One specific type of NMPV is the Tesla valve. The Tesla valve, first introduced by Nikola Tesla in 1920, is a check valve with no moving parts in its structure and is also known as a fluid diode [2][3][4]. This valve allows fluid to flow easily in the forward direction but prevents fluid from flowing in the reverse direction. Due to its unique construction, the Tesla valve causes a lower pressure drop in the forward direction than in the reverse direction [5]. In fact, Tesla valves can be considered one-way valves. Due to the demand for passive fluid flow control, especially in mini and micro scales, the utilization of Tesla valves is becoming increasingly attractive to researchers. These valves are widely utilized in industries for controlling flow rate and direction in equipment such as internal combustion engines [6], turbines [7], pumps [8], and compressors [9,10]. Tesla valves can also be used in mini and microfluid applications, such as micromixers [11], and for the decompression process in Polat and Cadirci [28] investigated the heat transfer of a microchannel heat sink with a diamond-shaped pin fin array under laminar, steady-state, and incompressible flow boundary conditions. They utilized a multi-layer ANN model coded in Python and trained with CFD outcomes to investigate Nusselt and Poiseuille numbers representing thermal and hydrodynamic features. The results showed that the pin-fin angle has the greatest impact on Nusselt and Poiseuille numbers. Kanesan et al. [29] developed a response model for thermal energy storage heat sinks, which are commonly used to cool electronics. They examined an aluminum heat sink for thermal energy storage (TES) using paraffin as the phase change material (PCM). By combining the trained ANN model with the genetic algorithm (GA) method, they optimized the variables related to the TES heat sink's geometry and the used PCM volume. This research demonstrates that combining ANN with GA creates a more effective optimization tool. Mahmoudabadbozchelou et al. [30] studied the enhancement of the heat transfer rate of impinging jets by adding nanoparticles to the background fluid. They utilized ANN and GA methods to optimize the uniform cooling of a continuously heated surface. The results indicated that the addition of nanoparticles to water led to an increase in heat transfer due to the increased thermal conductivity of the fluid, and larger particle sizes and concentrations caused a further increase. Kuang et al. [31] investigated the heat transfer in the boiling process of hydrogen flow and used ANN to identify the most influential parameter in this process. The study found that the boiling number is one of the most critical factors in determining the boiling heat transfer coefficient. The researchers also observed that the effect of saturation pressure on the flow boiling heat transfer coefficient is more significant than its effect on the flow rate of liquid hydrogen. Yunn Heng et al. [32] proposed a rapid and reliable transient thermal prediction technique for estimating the exit temperature of a parabolic trough collector tube. ANN was applied to analyze the increase in exit temperature produced by a single heat flux pulse. They observed that the outcomes could be utilized for preliminary system planning, heat balance assessment, and systems engineering. The study reported that this method works well with changing and steady solar radiation, making it useful for designing parabolic trough technologies in any weather condition worldwide. Ermis et al. [33] investigated phase change heat transfer in a finned-tube latent heat thermal storage system using an ANN approach. The trained ANN model predicted the total quantity of stored heat with an average error of 5.58%, resulting in a more accurate heat storage estimation than the numerical model results. In another study, Xie et al. [34] evaluated multi-layer neural network designs based on experimental datasets of Nusselt number and friction factor for three heat exchangers. Their findings demonstrated that the ANN method performs well in predicting heat transfer and fluid flow for laminar or turbulent regimes in such heat exchangers, such that the variance between their study's predicted and experimental results was approximately 4%. Their work suggests that ANNs can be utilized for thermal system performance anticipation, particularly heat exchanger modeling for heat transfer assessment. Beigmoradi et al. [35] conducted a study on the aerodynamic optimization of the rear end of a car using ANN. They selected several geometric parameters as input variables and studied the drag coefficient and maximum acoustic power level as responses. The Taguchi method was used to reduce the number of tests, and the GA method was used to optimize the model. The results indicate that the drag coefficient decreases with the increase in the rear box length parameter, but it leads to an increase in the acoustic power response. Li et al. [36] used three ANNs to predict the properties of China RP-3 kerosene at a faster rate. Their results show that the properties predicted by ANN models have high accuracy and are consistent with the calculations of the extended corresponding state principle method. They also observed that the prediction of properties is 10 4 times faster than the calculations, which is a significant achievement. George et al. [37] optimized the design of a multi-layer porous wave absorber by using the ANN method and a data set consisting of 200 combinations. The trained prediction model in their work has a determination coefficient of 0.97, indicating high accuracy in predicting results. They found that the optimal range of design variables for submergence depth was 0.055-0.067, the distance between plates was 0.064-0.080, and porosity was 0.117-0.173. Zhu et al. [38] investigated the total output power due to changes in the configuration of the array of wave energy converters. Using the ANN method, they trained a prediction model for the desired response. They reported that using energy converters with shorter distances improves energy absorption and was also suitable and beneficial for engineering applications.
The present study investigated a two-stage Tesla valve with an unconventional geometry numerically. The parameters of the divider baffle length (L), step length (S), and inlet velocity of the valve (V) were considered as input variables. Also, the diodicity (PDR) and the ratio of the temperature difference (TDR) in reverse and forward directions were selected as the responses. Of course, due to the consistency of the properties and mass flow rate of the passing fluid in both directions, TDR also indicates the heat transfer ratio. Numerous numerical experiments were conducted under different conditions to obtain the prediction models for each response, and the results were used to train artificial neural networks. These models can predict the values of the responses accurately and quickly without the need for complex calculations or additional experiments. Finally, the optimal conditions and designs of the Tesla valve for various applications were determined using the genetic algorithm method and the obtained prediction models. This approach can significantly reduce the time and cost required for designing and optimizing the Tesla valve for specific applications.

Tesla Valve Structure
According to the results of the research conducted on Tesla valves and preliminary analysis, a specific structure for this device was proposed, which was based on the design by Bao and Wang [10]. The physical shape and geometrical characteristics of the Tesla valve structure are shown in Figure 1. A three-dimensional view of the intended structure is depicted in Figure 1a. The constant and variable dimensions of the simulated geometry are shown in Figure 1b and Figure 1c, respectively. The most significant difference between this Tesla valve and other conventional Tesla valves is the use of a unique three-way pattern that consists of a divider baffle. In this work, the divider baffle length (L) and step length (S) were considered as the two geometrical variables to investigate the performance of the Tesla valve. It should also be noted that in addition to the variables mentioned, the effects of the velocity of the input flow to the Tesla valve were investigated.  The fluid movement pattern in this unconventional design for the Tesla valve in reverse and forward directions is based on Figure 2a and Figure 2b, respectively. When the fluid enters the valve in the reverse direction, the dividers direct part of the fluid flow into the bent channels. While with the movement of the fluid in the forward direction, the main flow of the fluid can easily pass through the main channel of the valve. Therefore, it is expected that due to more friction and fluid interaction in the reverse direction, a greater ∆P will occur in this direction.

Assumptions and Boundary Conditions
All numerical analysis and simulation processes were performed using FEM in COM-SOL Multiphysics software. Since this study aims to enhance the diodicity and TDR of the Tesla valve, water fluid was simulated under special conditions. Consequently, several boundary conditions and assumptions were applied to achieve an appropriate result. Boundary conditions and assumptions are as follows:

•
This study was investigated in a steady state; • The fluid passing through the Tesla valve was turbulent, single-phase, and incompressible; • The thermophysical characteristics of the water were considered to be constant, as listed in Table 1; The gauge pressure of the Tesla valve outlet was considered zero.

Governing Equations
The present study numerically investigated the fluid flow and heat transfer inside the designed Tesla valve using CFD in two dimensions. Governing equations that must be solved for determining thermo-hydraulic parameters of the flow are conservation equations and k-ε turbulence model equations. For an incompressible viscous flow, the first equation is the mass conservation equation, and it can be expressed as follows [10,39]: The momentum conservation equation is written as follows: Also, the energy conservation equation is given by: where V, µ, µ t, and λ represent the velocity, dynamic viscosity, turbulent viscosity, and thermal conductivity, respectively. In this research, the standard k-ε turbulent model was employed in order to analyze the flow in the valve. This turbulence model is the most prevalent model used in CFD to represent the mean flow characteristics of turbulent flow. It is a two-equation model that uses two transport equations to provide a general description of turbulence. The turbulent kinetic energy and specific dissipation rate for turbulent flow in the standard k-ε model are defined by Equations (4) and (5), respectively [40][41][42].
where k and P k represent the turbulent kinetic energy and the production of this energy due to the mean velocity gradients, respectively, and the parameter ε is the energy dissipation rate obtained in the turbulent flow. Also, the constants related to the turbulence model are presented in Table 2. In the present study, the segregated approach, a pressure-based solver, was used to solve the governing equations. As implemented in COMSOL Multiphysics, this approach solves the velocity and pressure in one step. In contrast, other variables, such as temperature, are solved separately in other steps. This solver configuration allows for the decoupling and independent solution of different variables, which can help improve computational efficiency and convergence [43]. This research used a parallel direct sparse solver (PARDISO) in numerical simulations. The PARDISO solver is a state-of-the-art direct sparse solver in computational science and engineering. This solver is known for its efficiency, scalability, and ability to handle large-scale linear systems from various numerical simulations. It employs advanced algorithms and parallel computing techniques to efficiently handle the matrix factorization and solve the system of equations [44][45][46].
Diodicity is an essential factor that evaluates the Tesla valve's hydraulic performance. This parameter highlights the effectiveness of the valve based on the ratio of ∆P in reverse flow to forward flow in an identical flow rate [1]. By increasing diodicity, the performance of this device as a check valve will be improved. On the other hand, if this device is used in thermal applications, the thermal parameters of this device should be improved. The hydraulic and thermal diodicity of the Tesla valve were presented as PDR (pressure drop ratio) and TDR (thermal difference ratio), respectively, which were calculated as follows:

Mesh Independency
COMSOL Multiphysics was used to develop a two-dimensional triangular mesh type, as seen in Figure 3. In this simulation, the average mesh quality is 0.93. According to the statistics in Table 3, the thermal and hydraulic results of the numerical simulation with the number of 50.44 elements per 1 mm 2 are independent of the mesh. As can be seen, by increasing the mesh elements number to 88.58 per 1 mm 2 , the time to solve the simulation increases by 56%, while the results related to the temperature difference and pressure drop change by 1.23% and 0.44%, respectively.

Simulation Method Validation
Since this work is a numerical study, it needs to be validated by a reliable experimental reference. Therefore, all processes and numerical simulations in the present study were based on the experimental research conducted by Bao and Wang [10], and the results of this work were compared with their research findings to ensure the accuracy and validity of the analysis done in this work. In the present work, the thermo-hydraulic performance of the equivalent shunts (ES) Tesla valve with six stages was investigated and compared with the reference study [10]. Figure 4 shows that both hydraulic and thermal results obtained from the numerical analysis have a reasonable correlation with the findings provided in the experimental reference study, indicating that the numerical method adopted in this research has reasonable accuracy. It is worth noting that in the subsequent

Simulation Method Validation
Since this work is a numerical study, it needs to be validated by a reliable experimental reference. Therefore, all processes and numerical simulations in the present study were based on the experimental research conducted by Bao and Wang [10], and the results of this work were compared with their research findings to ensure the accuracy and validity of the analysis done in this work. In the present work, the thermo-hydraulic performance of the equivalent shunts (ES) Tesla valve with six stages was investigated and compared with the reference study [10]. Figure 4 shows that both hydraulic and thermal results obtained from the numerical analysis have a reasonable correlation with the findings provided in the experimental reference study, indicating that the numerical method adopted in this research has reasonable accuracy. It is worth noting that in the subsequent part of this work, a two-stage Tesla valve was designed instead of the six-stage valve to allow for physical changes and further investigations.

Turbulent Model Validation
In this research, different turbulence models were tested and compared with the experimental results to select the turbulence model used in the numerical analysis, according to Figure 4a,b. Equation (10) was used to calculate the average error of numerical analysis for each turbulence model. According to the results of the numerical analysis using the k-ω turbulence model, the average error of the hydraulic results in the reverse flow was 25.7%, and it was 10.2% in the forward flow. However, when the SST k-ω model was used in the simulations, the average errors for the reverse and forward directions results were reduced to 22.7% and 2.6%, respectively. The realizable k-ε model showed an average error of 15% in the reverse flow and 3.3% in the forward flow for the results obtained in the analysis of the Tesla valve. On the other hand, the standard k-ε model gave an average error of 8.3% and 8.4% for hydraulic results in the reverse and forward directions, respectively. Based on these results, it can be concluded that the standard k-ε model is the

Turbulent Model Validation
In this research, different turbulence models were tested and compared with the experimental results to select the turbulence model used in the numerical analysis, according to Figure 4a,b. Equation (10) was used to calculate the average error of numerical analysis for each turbulence model. According to the results of the numerical analysis using the k-ω turbulence model, the average error of the hydraulic results in the reverse flow was 25.7%, and it was 10.2% in the forward flow. However, when the SST k-ω model was used in the simulations, the average errors for the reverse and forward directions results were reduced Entropy 2023, 25, 967 9 of 22 to 22.7% and 2.6%, respectively. The realizable k-ε model showed an average error of 15% in the reverse flow and 3.3% in the forward flow for the results obtained in the analysis of the Tesla valve. On the other hand, the standard k-ε model gave an average error of 8.3% and 8.4% for hydraulic results in the reverse and forward directions, respectively. Based on these results, it can be concluded that the standard k-ε model is the most appropriate turbulence model to use in numerical simulations because it gives suitable and close each other average errors in both directions.
The y+ is a dimensionless parameter similar to the local Reynolds number used in CFD to characterize the near-wall flow behavior by quantifying the distance from the solid wall to the nearest mesh element's center. This parameter is used as a criterion to evaluate the appropriateness of the grid element size on the walls' borders. On the other hand, it plays a crucial role in selecting an appropriate wall modeling approach, such as wall functions or low Reynolds number (LRN) models, based on the flow regime and the desired level of accuracy for capturing the near-wall physics. This parameter is calculated according to Equations (11) and (12). In these equations, V τ and τ w represent the friction velocity and wall shear stress, respectively. Also, y is the distance between the wall and the center of the nearest mesh element to the wall. Higher y+ values (often above 30) indicate fully turbulent flows where wall functions are effective. In comparison, lower y+ values suggest laminar or transitional flows requiring more refined modeling techniques to resolve the near-wall region accurately [47]. The calculation of y+ was performed across different turbulence models, and the results are presented in Table 4. It is evident from the data that the y+ values almost in all cases exceed 30, indicating a predominantly turbulent near-wall flow regime. According to the y+ parameter results, it can be seen that the use of the wall functions model was suitable for investigating the fluid flow behavior near the walls in the present study. These wall functions are derived from empirical correlations based on experimental data, and k-ε models widely use these wall functions to capture the turbulence characteristics near walls. Also, because the values of y+ were above 30, using the LRN wall model, which is used in the k-ω and SST k-ω turbulence models, was unsuitable for use in the present work [48,49]. Further, considering that the numerical results of the standard k-ε turbulence model were in better agreement with the experimental results compared to the realizable k-ε model, the standard k-ε model was used for further investigations in this work.
r num − r exp r exp (10)

Artificial Neural Network Approach
One way to reduce computational time and save financial resources is by using blackbox methods, which deal with input and output data without considering the possible physical processes. A practical approach in this field is the artificial neural network (ANN), inspired by the human nervous system. Neurons are the fundamental processors in neural networks, and each neuron may receive multiple inputs from other neurons and have one or more outputs based on its activity [33].
In this study, a separate three-layer structure was designed for each response (TDR and PDR), consisting of input, hidden, and output layers, as shown in Figure 5a. The input layer has three neurons that serve as the network's inputs. The hidden layer has four neurons, and the output layer contains one neuron. Based on the investigations conducted, it was observed that prediction models with fewer than four neurons in the hidden layer did not have satisfactory performance. Conversely, an excessive increase in neurons in this layer led to overfitting in the model's results. The activation functions must be derivable to perform the backpropagation function in model training. Therefore, the tangent-sigmoid activation function was used in hidden layer neurons, and the linear activation function was used in the output layer neuron to obtain the response value. To better understand the performance of each neuron in the hidden and output layers, Figure 5b was presented, which shows the performed calculations.  MATLAB (2016b) software was applied to optimize models using the ANN approach, and the Levenberg-Marquardt method was employed to train artificial neural networks by utilizing the available data. The variables and their ranges for simulation and optimization were tabulated in Table 5, and these ranges were selected based on the geo- MATLAB (2016b) software was applied to optimize models using the ANN approach, and the Levenberg-Marquardt method was employed to train artificial neural networks by utilizing the available data. The variables and their ranges for simulation and optimization were tabulated in Table 5, and these ranges were selected based on the geometric and boundary conditions. Furthermore, Table 6 presents a list of numerical tests selected using the central composite design (CCD) method, which can minimize the number of tests, which is an important aspect, especially in experimental studies [50]. To ensure the development of reliable prediction models, a careful data allocation strategy was employed. As illustrated in Table 6, 70% of the data was allocated for training the models, 15% for validation purposes, and 15% for testing the models. Notably, this classification was performed randomly, ensuring an unbiased data distribution. To assess the validity and accuracy of the predicted results by the ANN method, three error functions were used, including the determination coefficient (R 2 ), mean absolute error (MAE), and root mean square error (RMSE).

Numerical Results
The Tesla valve functions as a one-way valve and creates a high-pressure drop in one direction compared to the other direction, making the flow of movement easier in one direction. Therefore, the ratio of ∆P in one direction to the other, known as diodicity, is one of the most important parameters in this device. Tesla valves can also be used in thermal applications. In this work, the thermal performance of the device was investigated in addition to its hydraulic performance. Due to the stability of fluid properties and mass flow rate in both flow directions, the ratio of directions temperature difference (TDR) also indicates the heat transfer ratio. The information related to the numerical tests is reported in Table 7, and preliminary analyses can be performed using these data. Based on the results, the maximum values of TDR and PDR are observed in test numbers 8 and 9, respectively. The highest ∆P in the reverse direction occurred in test number 7, and the highest ∆P in the forward movement occurred in numerical experiment 11. At the same time, the largest difference between the inlet and outlet temperatures in both reverse and forward flow directions was reported in numerical experiment 3.  Figure 6 shows the pressure contours, and it can be seen that the inlet pressure of reverse flows is higher than the forward flows direction. Additionally, the fluid pressure in the reverse flow is high due to the longer fluid movement path, more friction, more vortices, and more fluid collisions. Figure 7 displays the velocity contours, and it is evident that in the reverse direction of fluid flow in the Tesla valve, the fluid passes through the bent channels with a higher mass flow rate and velocity than the forward flow. Using these two contours, it was concluded that much flow passes through the bent paths in the reverse direction movement. Therefore, the thermal performance of the device is expected to be higher in the direction of the reverse flow, which is confirmed by Table 6. Figure 8 presents the temperature contours for checking the thermal performance. As shown in this figure, in the Tesla valve with the forward flow, the heat transfer is weaker since less fluid enters the bent channels, and the temperature of the liquid in the bent channels is higher. Of course, in the reverse flow temperature contour of experiment 11, the fluid temperature in the second bent channel is also high due to the geometry of the valve, which causes not much fluid to enter the bend, and the fluid temperature in that section increases. The temperature distribution is generally better in the Tesla valve with reverse flow. The results of tests 9, 11, and 13 are presented in all contours. Experiments 9 and 11 were compared to observe the effect of changing variable L on Tesla valve performance, and experiments 9 and 13 were compared to observe the impact of changing variable S on valve performance. In the following, the ANN method and predictions of this method were used for a more detailed investigation of the effect of variables and optimization of geometry and responses. Entropy 2023, 25, x FOR PEER REVIEW 14 of 23

The ANN Results
In this section, the results of the ANN method are discussed. The predicted results for TDR and PDR responses using the models obtained from the ANN method are compared with the numerical analysis results and presented in Figure 9a,b. It can be seen that the results obtained by both methods are similar. The models for the TDR and PDR responses developed through the ANN method are described in Equations (13) and (15), respectively. The optimized weights and biases of the models related to the responses were obtained using the ANN method and LM algorithm. The R 2 parameter was examined to assess the accuracy of the models (Table 8), and it was observed that the TDR model correctly predicts 99.1% of the responses. Also, the R 2 error function with a value of 0.992 for the PDR model indicates that this model can correctly predict 99.2% of responses and has only 0.8% error.
To show the effect of each input variable (L, S, and V) on the output responses, the plots in Figure 9c,d were presented. In these plots, one variable was changed from −1 to +1 levels while the other two remained constant at zero levels. Also, the reference point in these graphs is the point where all three variables are at zero level. As seen in Figure 9c, changes in the L variable up to a certain level do not affect TDR, and from that level onwards, it causes TDR to decrease. Changes in the S parameter initially cause a decrease in TDR, and the intensity of this reduction gradually decreases. With an increase in the value of V, TDR also increases, but the slope of this plot is higher in the initial part, indicating a greater intensity. In the following, the effects of the independent input variables on the response of the diodicity are discussed, shown in Figure 9d. According to the high slope of the L parameter graph, it seems that the effect of this variable on the diodicity is more significant than the rest of the variables. After the L parameter, the Tesla valve input velocity variable has the most impact on PDR, and this response rises with the increase in velocity.

The ANN Results
In this section, the results of the ANN method are discussed. The predicted results for TDR and PDR responses using the models obtained from the ANN method are compared with the numerical analysis results and presented in Figure 9a,b. It can be seen that the results obtained by both methods are similar. The models for the TDR and PDR responses developed through the ANN method are described in Equations (13) and (15), respectively. The optimized weights and biases of the models related to the responses were obtained using the ANN method and LM algorithm. The R 2 parameter was examined to assess the accuracy of the models (Table 8), and it was observed that the TDR model correctly predicts 99.1% of the responses. Also, the R 2 error function with a value of 0.992 for the PDR model indicates that this model can correctly predict 99.2% of responses and has only 0.8% error.
To show the effect of each input variable (L, S, and V) on the output responses, the plots in Figure 9c,d were presented. In these plots, one variable was changed from −1 to +1 levels while the other two remained constant at zero levels. Also, the reference point in these graphs is the point where all three variables are at zero level. As seen in Figure 9c, changes in the L variable up to a certain level do not affect TDR, and from that level onwards, it causes TDR to decrease. Changes in the S parameter initially cause a decrease in TDR, and the intensity of this reduction gradually decreases. With an increase in the value of V, TDR also increases, but the slope of this plot is higher in the initial part, indicating a greater intensity. In the following, the effects of the independent input variables on the response of the diodicity are discussed, shown in Figure 9d. According to the high slope of the L parameter graph, it seems that the effect of this variable on the diodicity is more significant than the rest of the variables. After the L parameter, the Tesla valve input velocity variable has the most impact on PDR, and this response rises with the increase in velocity. Entropy 2023, 25, x FOR PEER REVIEW 16 of 23  ( 2 ) 2 1 1+ ( 2 ) In the following, the two-by-two effects of the variables on the responses were investigated according to Figure 10. Figure 10a shows that as L increases, the TDR value remains somewhat stable and then decreases, and the effect of this decrease is more significant at lower S. Figure 10b confirms this observation and shows that the effect of the L parameter on TDR is more pronounced at higher inlet velocities. Figure 10c reveals that the heat transfer capability of the Tesla valve increases with the increase of the inlet velocity (V), and this increase is more significant at lower S values. Furthermore, it can be seen that increasing S leads to a decrease in TDR. Turning to the three-dimensional plots for PDR response, Figure 10d shows that increasing L reduces PDR, and this effect is more pronounced at smaller S values. Figure 10e,f demonstrate that increasing the inlet velocity increases PDR, which is more prominent at smaller L and S values. It is worth mentioning that increasing the L parameter leads to a decrease in the diodicity of the Tesla valve. This section discusses the influence of variables on the performance of the Tesla valve and the analysis of these effects using streamlines (Figure 11). In this figure, the primary issue that can be noticed is that in the direction of forward movement, compression of the lines in the main channel is greater than bent channels, indicating a large fluid flow through this path. While in the reverse flow direction, the fluid flow is spread in all the channels of the Tesla valve. The effect of changing the divider baffle length on PDR can be observed based on the fluid flow streamlines of the 9th and 11th numerical experiments. According to the streamlines in the reverse direction, it is apparent that increasing the divider baffle length causes most of the fluid flow to pass without entering the second bent channel, and this function reduces the ΔP and diodicity. However, it should be noted that as L increases, the dimensions of the central path reduce, leading to increased ΔP in This section discusses the influence of variables on the performance of the Tesla valve and the analysis of these effects using streamlines (Figure 11). In this figure, the primary issue that can be noticed is that in the direction of forward movement, compression of the lines in the main channel is greater than bent channels, indicating a large fluid flow through this path. While in the reverse flow direction, the fluid flow is spread in all the channels of the Tesla valve. The effect of changing the divider baffle length on PDR can be observed based on the fluid flow streamlines of the 9th and 11th numerical experiments. According to the streamlines in the reverse direction, it is apparent that increasing the divider baffle length causes most of the fluid flow to pass without entering the second bent channel, and this function reduces the ∆P and diodicity. However, it should be noted that as L increases, the dimensions of the central path reduce, leading to increased ∆P in both directions of fluid movement. Comparing the streamlines of experiments 9th and 13th reveals the effect of changing the parameter S on the Tesla valve's performance. It is clearly seen that in the 9th test, more flow enters the bent channels in reverse flow than in the 13th test, and due to this matter, the ∆P ratio of reverse flow to the forward flow is higher in this design. Additionally, it should be mentioned that increasing the S variable leads to a larger Tesla valve, causing more friction and ∆P in both directions. and 4.581, respectively, with a low prediction error of 0.8%. The number of 4.581, obtained numerically for diodicity, indicates that the ΔP obtained in the reverse direction is 358.1% higher than the ΔP obtained in the forward direction. Overall, the approach of using a genetic algorithm and ANN models to predict the optimal design parameters for the Tesla valve proved successful, and the numerical analysis confirmed the accuracy of the predictions.
Using the models provided by ANN, it is possible to predict designs with the best performance at different velocities. In this case, the desired velocity value is entered into the prediction model, and then the genetic algorithm is used to optimize the models. The optimal designs at different inlet velocities for TDR and PDR responses were presented in Tables 10 and 11, respectively. As observed in the tables, the predicted results agree with those obtained from numerical methods in all cases. Furthermore, upon careful examination of these results, it becomes evident that both responses can be enhanced by increasing the inlet velocity and selecting an appropriate geometric design for the Tesla valve. Next, the performance of the two-stage Tesla valve designed by Bao and Wang [10] was reported in Table 12 to compare with the results of the designs presented in this study. It is evident from the tables that the optimal designs exhibit significantly superior performance compared to the reference design, and this improvement is more visible in PDR. Figure 11. Streamlines of (a) reverse flow direction and (b) forward flow direction for different numerical experiments. Figure 11. Streamlines of (a) reverse flow direction and (b) forward flow direction for different numerical experiments.
As mentioned in the previous sections, one of the most important goals of the current research is to provide optimal designs for the Tesla valve in different conditions. The goal was to maximize the values of PDR and TDR, and genetic algorithm and ANN models were used to predict the optimal design parameters. According to Table 9, the designs with maximum PDR and TDR values were predicted, and the predicted results for the values of the responses were also presented. Next, the given Tesla valves were designed and then numerically tested to ensure that the predictions were correct and that these designs had the most optimal response values. The data relating to these numerical analyzes were also reported in Table 9. As can be seen, the predicted results have good accuracy, and at the same time, these designs have the maximum value of diodicity and TDR in reality. The maximum value of TDR in the Tesla valve with the design of L = 4.502 mm, S = 2 mm, and V = 2 m/s was obtained and had a predicted value of 1.908. The numerical results reported the TDR value for this design as 1.862, and it can be said that the ANN model has a 2.5% error in predicting this number. Using this number, it can be argued that in this design, the heat transfer in the reverse direction is 86.2% more than in the forward movement. One of the essential parameters in Tesla valves is diodicity, and it was predicted that the maximum value of this response is achieved in the design of L = 2 mm, S = 2.048 mm, and V = 2 m/s. The predicted and calculated values for PDR were 4.546 and 4.581, respectively, with a low prediction error of 0.8%. The number of 4.581, obtained numerically for diodicity, indicates that the ∆P obtained in the reverse direction is 358.1% higher than the ∆P obtained in the forward direction. Overall, the approach of using a genetic algorithm and ANN models to predict the optimal design parameters for the Tesla valve proved successful, and the numerical analysis confirmed the accuracy of the predictions. Using the models provided by ANN, it is possible to predict designs with the best performance at different velocities. In this case, the desired velocity value is entered into the prediction model, and then the genetic algorithm is used to optimize the models. The optimal designs at different inlet velocities for TDR and PDR responses were presented in Tables 10 and 11, respectively. As observed in the tables, the predicted results agree with those obtained from numerical methods in all cases. Furthermore, upon careful examination of these results, it becomes evident that both responses can be enhanced by increasing the inlet velocity and selecting an appropriate geometric design for the Tesla valve. Next, the performance of the two-stage Tesla valve designed by Bao and Wang [10] was reported in Table 12 to compare with the results of the designs presented in this study. It is evident from the tables that the optimal designs exhibit significantly superior performance compared to the reference design, and this improvement is more visible in PDR.

Conclusions
This research aimed to optimize the design of a two-stage Tesla valve and study its fluid flow and heat transfer characteristics numerically. The input variables were selected as L, S, and V, and two responses, TDR and PDR, were used to evaluate thermal and hydraulic performances. Then, an ANN was trained for each response using data obtained from numerical experiments to predict the responses for different designs. By using these models, without doing experimental and numerical work and complex calculations, and in the shortest time, the responses related to the design of the desired Tesla valve can be predicted. In the following, the optimal designs of this device for different conditions were presented using models trained by the ANN method and genetic algorithm. According to the findings, the following was determined: • It was shown that the models obtained using the ANN method could correctly predict the results for the thermal and hydraulic diodicities of the Tesla valve with a determination coefficient of 99.1% and 99.2%, respectively; • It was found that increasing the length of the divider baffle decreases PDR. Also, increasing this variable from a specific limit reduces the value of the TDR response; • The fluid inlet velocity parameter positively affects the responses, and generally, with its increase, PDR and TDR also increase; • The highest value of diodicity was predicted for the Tesla valve with L = 2 mm, S = 2.048 mm, and V = 2 m/s parameters. This prediction was confirmed by performing numerical tests. The predicted diodicity value for this design is 4.546, and numerical tests reported this number to be 4.581. The prediction error of this response is very low and equal to 0.8%. This Tesla valve with a PDR of 4.581 indicates that the pressure drop in the reverse flow direction is 358.1% more than in the forward flow direction; • The most optimal TDR response value was predicted to be 1.908, obtained in the condition of L = 4.502 mm, S = 2 mm, and V = 2 m/s. Numerical tests were performed on the designed Tesla valve, and the actual TDR was 1.862, a 2.5% difference from the predicted value. TDR with this value shows that the Tesla valve with the mentioned design has 86.2% more heat transfer in the reverse direction.