Keywords

1 Introduction

The fields of the Artificial Intelligence (AI) [1,2,3] and Computational Fluid Dynamics (CFD) [4,5,6,7,8] are experiencing a rather parallel development. Both fields exist for decades, and due to the increasing computational capabilities, their impact has been growing rapidly in the recent years. First ideas of combination the technologies of date back a lot of years, e.g. to 1988, when Andrews [9] published the first review on the capabilities and problems in combination of AI and CFD. More recent publications [10,11,12] show different approaches for the AI-CFD interaction. In Ref. [13] a nice overview on the newest AI technologies and frameworks were presented. In problems with more complex physics, the combination of AI and CFD was demonstrated in Refs. [14, 15]

Further investigations on the different aspects of the problem in different areas including digital twins were presented by numerous researches [16,17,18,19,20,21,22,23,24,25].

2 The Test Case

For comparison with realistic data from a three dimensional flow with large velocity variations, a 3D cavity problem is considered. Corresponding experimental was data found in Ref. [26] (Fig. 1, 2).

Fig. 1
figure 1

Sketch of the experimental setup [26]

For the experimental investigations, different Reynolds numbers have been used as shown in Table 1 with the calculated velocities for the working fluid of isopropyl alcohol of density ρ = 0.785 g/cm3 and kinematic viscosity of ν = 0.031 cm2∕s.

Fig. 2
figure 2

Laser image of the velocity field [26]

Table 1 Reynolds numbers used for simulation/experiment

3 Mathematical and Numerical Flow Modeling

The computational modeling of the flow has been performed using the simulation software ANSYS Fluent [27]. To ensure reliable simulation results, a mesh sensitivity study has been performed and the meshes shown in Fig. 3 are used for the further calculations. Since the Reynolds number was within the laminar flow regime, the simulation was done with no turbulence model, but for a laminar flow simulation setup.

Fig. 3
figure 3

Mesh for the CFD-simulation

For the inlet boundary condition, a fully developed flow is set by an equation for the velocity.

The Simulation results show fine agreement with the experimental data as shown in Fig. 4.

Fig. 4
figure 4

Flow field Reynolds number 140 (left: simulation, right: experiments [26])

4 Developing a Simplified Model

The numerical simulation following the iterative solution of fluid physics by calculation of the Navier–Stokes equation system can take a lot of computational effort and time. Thus, the common CFD approach may not be feasible in cases, where limitations of resources and time are strict.

On the other hand, if the flow field is prescribed by a set of coefficients as found in interpolations of artificial network, this set of coefficients can be solved within very short time by simple matrix calculations which are very simple for nowadays computational infrastructure.

So the aim of the given study is to develop two different approaches for the calculation of the matrices that represent the flow field and to compare both results for different Reynolds numbers within a given range.

4.1 Simple Interpolation

The first approach is the calculation of a set of coefficients for the solution domain expressing the variables of interest as functions of the inlet condition following a regression function, whose coefficients are extracted from the data exported from the simulations. These coefficients represent the influence of the change of the variable (here the inlet velocity) to the behavior of the system, for different orders, linear, quadratic, and more if necessary.

$$\begin{array}{c}{Y}_{a}={b}_{0}\cdot 1+{b}_{1}\cdot {v}_{a}+{b}_{2}\cdot {v}_{a}^{2}\\ {Y}_{b}={b}_{0}\cdot 1+{b}_{1}\cdot {v}_{b}+{b}_{2}\cdot {v}_{b}^{2}\\ \vdots \end{array}$$
(1)

The equations can be put in matrix form as follows

$$\left[\begin{array}{ccc}1& {v}_{a}& {v}_{a}^{2}\\ 1& {v}_{b}& {v}_{b}^{2}\\ \cdots & \cdots & \cdots \end{array}\right]\cdot \left[\begin{array}{c}{b}_{0}\\ {b}_{1}\\ {b}_{2}\end{array}\right]=\left[\begin{array}{c}{Y}_{a}\\ {Y}_{b}\\ \vdots \end{array}\right]$$
(2)

This system can be solved for the whole domain to get the velocity for a given inlet velocity.

4.2 ANN Model

The next approach is more advanced one, using the ANN framework of Keras with the CFD simulation results, the coordinates and the boundary conditions as an input for the neuronal network with randomized order of the points.

The training is done in a sequential class, the relu activation layer an Adam optimizer with a learning rate of 0.005 and a loss function with Mean AbsouteError.

The architecture was built with four hidden layers with 256 nodes each.

5 Error Estimation

In estimation of the accuracy of the simulation results, next to the qualitative comparison of the flow fields, the given project aimed to also find quantitative error estimation.

Here, it was important to find a method to calculate the error that takes into account the differences of the high velocity zones as well as the differences of the zones with lower velocity also. After some development the decision was made to define two different error calculations as shown in Eqs. (3) and (4).

Since the Error1 takes the differences of each velocity at a certain point from the CFD calculation to the model prediction, here the relative error of the small velocities has a much higher influence compared to the error in the high velocity field. On the other hand for the Error2, the relative error of the differences of the sum of all velocities for the CFD calculation to the sum of all velocities of the model prediction has been calculated and thus, here the differences of the high velocity areas at the flow field plays a major role.

$$Error1=\frac{\sum \left|{V}_{CFD\left(x,y,z\right)}-{V}_{model\left(x,y,z\right)}\right|}{\sum \left|{V}_{CFD\left(x,y,z\right)}\right|}\cdot 100$$
(3)
$$Error2=\frac{\sum \left|{V}_{CFD\left(x,y,z\right)}\right|-\sum \left|{V}_{model\left(x,y,z\right)}\right|}{\sum \left|{V}_{CFD\left(x,y,z\right)}\right|}\cdot 100$$
(4)

6 Results

In Fig. 5 the comparison of the results of the interpolation to the CFD calculations are shown. It is shown that the prediction of the model shows rather big errors in the area of low Reynolds number but for the higher velocities, the error becomes low and the quality of the predictions is feasible.

Fig. 5
figure 5

Error of the interpolation model

The results of the error calculations for the predictions of the ANN in comparison to CFD are shown in Fig. 6. As before, the results of the predictions at the low Reynolds numbers are not good but becomes much better in a range of smaller than 10% at higher Reynolds numbers. It is interesting to notice that the simple interpolation algorithm appears to give better results than the more advanced AI approach.

Fig. 6
figure 6

Error of the AI model

A further comparison is shown in Fig. 7. As seen in the figure the velocity is plotted along traversal lines (Line 1 in a and d, line 2 in b and e, line 3 in c and f) for two different Reynolds numbers (Re = 15 for a, b, c and Re = 140 for d, e, f) each plot with the direct comparison of the velocity profile for the CFD simulation, the interpolation and the AI model.

Fig. 7
figure 7

Error of the interpolation and AI models

It is seen that the prediction of the fully developed pipe flow for the inlet and outlet (at line 1 and 3) is quite well for all cases, just in the middle of the cavity, at line 2, the differences become larger. In b, one can see the difference of the interpolation to the CFD result is smaller than the difference of the AI predictions. For the higher Reynolds number (e) the differences become negligible small for both (Interpolation and AI) in comparison to the CFD simulation.

7 Conclusions

Two different approaches have been developed for using the data of CFD calculations to train different meta models that are able to predict the three dimensional flow field of a cavity flow within very short time. The models were using a simple interpolation model and a more advances AI approach. In this paper both models have been compared among each other and both models show acceptable accuracy in the prediction of the flow field for higher Reynolds numbers but shows difficulty in the lower Reynolds numbers. Here the interpolation shows even better performance than the AI approach.

Following developments will be carried out to develop a supervision tool that performs randomized test simulations and compares them to the predictions and will form smaller submodels for areas where the prediction shows big differences. Here, again both approaches shall be compared.