Accurately obtaining the distribution of the open-channel velocity field in hydraulic engineering is extremely important, which is helpful for better calculation of open-channel flow and analysis of open-channel water flow characteristics. In recent years, machine learning has been used for open-channel velocity field prediction. However, effective training of data-driven models in machine learning heavily depends on the diversity and quantity of data. In this paper, a CFD-based pre-training neural network model (CFD–PNN) is proposed for accurate open-channel velocity field prediction, allowing the adaption to the task with small sample data. Also, a cross-sectional velocity field prediction method combining the computational fluid dynamics (CFD) and machine learning is established. By comparing CFD–PNN with six other neural network algorithm models and the CFD model, the results show that, in the case of small sample data, the CFD–PNN model can predict a more reasonable open-channel velocity field with higher prediction accuracy than other models. The average error of the velocity calculation for the trapezoidal open-channel cross-section is about 3.62%. Compared with other models, the accuracy is improved by 0.3–2.8%.

  • A velocity field prediction model based on CFD and machine learning.

  • The model adapts to tasks with small sample data.

  • Experimental verification using the measured data of trapezoidal open channels.

Graphical Abstract

Graphical Abstract
Graphical Abstract

Accurate calculation of velocity distribution has a wide range of applications in flow measurement, sediment transport, river restoration, and power plant design. Since the 1980s, some scholars have studied the laws of flow velocity distribution in open channels based on mathematical formulas. Nezu et al. (1989) classified open channels into two categories: narrow channels and wide channels. In a narrow open channel with a width-to-height ratio <5, the maximum flow velocity occurs below the free surface. Chiu (1989) derived and compared the velocity distribution equation of open-channel water flow based on the principle of maximum entropy. Chiu & Tung (2002) studied the maximum velocity and regularity in open-channel flow. Chiu & Hsu (2006) present a synthesis of a probability-based approach to modeling and predicting velocity distributions in fluid flows. Based on the Shannon entropy concept and the principle of maximum entropy, Marini et al. (2011) proposed a new method for calculating the two-dimensional velocity distribution of open-channel water flow. Luo & Singh (2011) derived two-dimensional distribution of velocity in open channels based on the Tsallis entropy concept. Fontana et al. (2013) developed a 2D entropy-based model providing a reliable estimation of the velocity distribution for open-channel flow with a rectangular cross-section. Bonakdari & Moazamnia (2015) developed an equation to predict the velocity field in narrow open channels based on Tsallis entropy. Luo et al. (2018) analyzed the differences and connections between four commonly used flow velocity laws and two theoretically and quantitatively entropy-based flow velocity distributions.

In recent years, some researchers have applied artificial neural network (ANN) and computational fluid dynamics (CFD) to predict flow velocity distribution in open channels. Yang & Chang (2005) applied an ANN to predict the velocity distribution in open channels by using the flow velocity profile measured by the acoustic Doppler velocimeter, and the results showed that the constructed ANN could fit the flow velocity profile. Sahu et al. (2011) proposed an ANN model to predict the point form velocity in meandering open channels. Baghalian et al. (2012) used artificial intelligence, analytical, experimental, and numerical methods to study the velocity field in a 90° bend. The results show that ANN model and numerical method have better performance than an analytical solution in most cases. Sun et al. (2014) studied the ability of the ANN model to describe and model the complex flow structure of combined open-channel water flow based on a large amount of data output by the CFD model. Pektas (2015) predicted the velocity distribution parameter by using the stepwise multilinear regression models, classification and regression tree (C&RT) models, and ANN models. The results show that the prediction performance of an ANN is the best. Bonakdari et al. (2011, 2020), Gholami et al. (2015, 2016), and Zaji & Bonakdari (2015, 2019) successively compared CFD and ANN methods in the prediction of the open-channel velocity field. They tried the traditional feedforward neural network, radial basis function neural network (RBFNN), multi-layer perceptron model based on decision trees (DT-MLP), radial basis function based on decision trees (DT-RBF), extreme learning machine (ELM), and other methods to predict velocity fields in open channels. The results show that the ANN method can more effectively predict the velocity distribution in open channels than CFD.

The current literature on the open-channel velocity field is mainly carried out in the hydraulic laboratory, where more flow velocity measurement data can be obtained, which benefits the analysis of open channels. However, in practical engineering applications, it is difficult to obtain more flow velocity point measurement data in the case of large open channels or unfavorable measurement environments, which will greatly affect the accuracy of the prediction results of the machine learning model. Therefore, the velocity field analysis of open channels with few data is difficult and remains to be researched.

This paper proposes a CFD-based pre-training neural network model (CFD–PNN) to predict the open-channel velocity field. This model combines the numerical modeling ability of CFD with the prediction ability of an ANN to solve the calculation problem of the open-channel velocity field with small sample data, and fills the shortage in this field. Taking an open channel in Dujiangyan, Sichuan Province, China, as an example, the ability of the CFD–PNN model to predict channel velocity field was studied. When the measured data of cross-sectional velocity points are few, CFD–PNN can improve the prediction accuracy and obtain a more reasonable profile distribution of the open-channel velocity field, which is more suitable for engineering applications.

The actual channel measurement data in this paper are obtained from the Renmin Channel Hydrological Station in Dujiangyan, Sichuan Province, China. The photo of the Renmin channel is shown in Figure 1. The channel is an isosceles trapezoidal channel made of concrete. The bottom width of the channel is 18.6 m, the channel length is 379 m, and the angle with the side slope is 135°. The 3D model of the channel is shown in Figure 2(a). In the coordinate system with the center of the channel bottom as the origin, seven vertical lines are arranged at equal intervals with a distance of 3.1 m. The instrument used for the measurement is a rotating-element current-meter. The hydrological station measured the partial axial velocity point values at 27 water levels ranging from 0.5 to 3.3 m, with a total of 378 sets of data. According to the different water levels, the one-point method is used to measure the flow velocity for 11 water levels from 0.5 to 1.5 m, the two-point method is used to measure the 5 water levels from 1.6 to 2.0 m, and the three-point method is used to measure the 11 water levels from 2.15 to 3.3 m.
Figure 1

Renmin channel.

Figure 2

(a) 3D model of Renmin channel; (b) three-point flow measurement model. Please refer to the online version of this paper to see this figure in colour: http://dx.doi.org/10.2166/hydro.2023.121.

Figure 2

(a) 3D model of Renmin channel; (b) three-point flow measurement model. Please refer to the online version of this paper to see this figure in colour: http://dx.doi.org/10.2166/hydro.2023.121.

Close modal

Suppose the water level height is H and set a vertical line at the channel section. The one-point method is to measure the single-point flow velocity at the vertical line from the bottom of the channel and use the flow velocity at this point as the average velocity of the vertical line. The two-point method is to measure the flow velocity at two points at and from the vertical line to the bottom of the channel and take the average velocity of the two points as the average flow velocity of the vertical line. The three-point method is to measure the three-point flow velocity at , , and from the vertical line to the bottom of the channel and take the average flow velocity of the three points as the vertical average flow velocity. The three-point flow measurement model is shown in Figure 2(b), where the red dots indicate the location of the measurement points. This measurement method is often used to estimate flow through channel profiles. In this paper, the measurement data obtained by this method are used to analyze the flow velocity distribution. Due to the limitations of the actual engineering measurement of the channel, it can be seen from the three-point flow measurement model that the vertical lines in the x-coordinate direction are arranged at wide intervals, and there are only three points of flow velocity values on each vertical line. The distribution of flow velocity at the side slope of the channel is also unclear. Therefore, for this experimental channel, the spatial distribution of such measuring points is relatively sparse and the measurement data of profile velocity points are less, which makes it difficult to reflect the complete velocity field of this channel. Since the trapezoidal open channel in this paper is a wide and shallow open channel with a width-to-height ratio > 5, the maximum velocity appears at the water surface, so the secondary flow phenomenon can be ignored. The study selected 266 data (70%) of 19 water levels as the training set. The 112 data (30%) of the remaining eight water levels are used as the test set. The statistical information of measured velocity is shown in Table 1.

Table 1

The statistical information of measured velocity

Mean (m/s)Max (m/s)Min (m/s)σ
Train 1.43 2.19 0.44 0.43 
Test 1.40 2.14 0.54 0.41 
Mean (m/s)Max (m/s)Min (m/s)σ
Train 1.43 2.19 0.44 0.43 
Test 1.40 2.14 0.54 0.41 

The measurement data in this paper are derived from open channel flow in a steady state. Although the open channel in the natural environment will be affected by factors such as topography, wall roughness, and sediment at the bottom of the channel, which may cause the cross-sectional velocity field of the open channel with the same geometric parameters to vary from region to region. However, for a fixed open-channel flow in a steady state, the water level determines the profile velocity distribution, and the velocity value at a certain point in the profile is only determined by the water level and the coordinates . The expression of the velocity field can be expressed by the following equation:
(1)
where h is the height of the water level, x is the x-coordinate of the channel profile, y is the y-coordinate of the channel profile, and v is the point velocity at .
When the amount of data is insufficient, it is difficult for general neural network algorithms to simulate the real flow field and the model is prone to over-fitting. To better solve the problem of calculation and prediction of an open-channel velocity field under sparse data, this paper proposes a CFD–PNN model. Its schematic block diagram is shown in Figure 3. It is mainly composed of a CFD pre-training module and a fine-tuning module. The black wireframe contains the input and output parameters of the model. The CFD pre-training module learns the ideal open-channel velocity field distribution based on a large amount of simulation data generated by the numerical model built by the CFD simulation software. In this paper, Ansys Fluent software is used for the CFD numerical modeling. This module can make up for the model training problem caused by sparse data. The fine-tuning module modifies the model parameters to improve the prediction accuracy. The two modules of the model are described separately below.
Figure 3

CFD–PNN model diagram used in this paper.

Figure 3

CFD–PNN model diagram used in this paper.

Close modal

CFD pre-training module

This module is mainly composed of CFD numerical model and SSA-BP (Guo & Wang 2022) model. Firstly, the velocity field of the open channel is modeled and simulated by the CFD numerical model to obtain the simulated velocity data. Usually, simulated velocity data are sufficient to reflect the flow velocity distribution of the open channel in the hydraulic theory under ideal conditions. Then the CFD simulation data are fed into the SSA-BP model for training so that the pre-training network, net1 can learn the distribution of CFD data and predict the velocity field under ideal conditions. This module can alleviate the problem of over-fitting caused by sparse data and avoid the final model from predicting an overly cluttered velocity field. After that, net1 can be used for retraining with the fine-tuning module.

CFD numerical model

The CFD simulation was carried out using Ansys Fluent software. The result of mesh division is shown in Figure 4. The RNG (k-epsilon) model was selected for the turbulence model. The boundary conditions were set as shown in Table 2. The PISO pressure–velocity coupling algorithm was used because it is designed specifically for transient simulations. The gradient was calculated using least-squares cell-based method and the PRESTO discretization scheme was used for pressure. Momentum, turbulent kinetic energy, and turbulent dissipation rates were calculated using second-order upwind. Volume fraction was selected as compressive and transient formulation was selected as second-order implicit.
Table 2

Boundary condition applied in the CFD model

BoundaryBoundary conditionsSpecifications
Inlet Velocity-inlet Magnitude, normal to boundary 
Outlet Outflow – 
Surface Symmetry – 
Wall Wall No slip 
BoundaryBoundary conditionsSpecifications
Inlet Velocity-inlet Magnitude, normal to boundary 
Outlet Outflow – 
Surface Symmetry – 
Wall Wall No slip 
Figure 4

Diagram of meshing of channel model. (a) Front view; (b) Side view.

Figure 4

Diagram of meshing of channel model. (a) Front view; (b) Side view.

Close modal

Since the study is about the flow in a wide and shallow open channel under a steady state, the rigid-lid hypothesis method is used for the free water surface. In this experiment, CFD simulated the ideal profile velocity field of the trapezoidal open channel under 27 water levels, with a total of 35,617 velocity data.

SSA-BP model

Back propagation neural network

The basic idea of a back propagation neural network (BPNN) is the gradient descent method and its implementation steps are:

  • 1.

    Determine the network structure through the pre-selected network topology and activation function;

  • 2.

    Use the back propagation algorithm to iteratively correct the connection weights and biases of the neuron nodes in the network;

  • 3.

    Finally, the neural network learns the characteristics of the training samples and is used for data classification or regression.

The training is stopped with an artificially set target loss value and the maximum number of epochs.

The structure of the BPNN used in this study is shown in Figure 5. The input is the water level, the -coordinate value and the -coordinate value, and the output is the predicted velocity at .
Figure 5

Diagram of the BPNN model used in this paper.

Figure 5

Diagram of the BPNN model used in this paper.

Close modal
Sparrow search algorithm

The sparrow search algorithm is a new heuristic algorithm to find the optimal solution by simulating the process of the foraging and anti-predation behavior of sparrows, which was first proposed by Xue & Shen (2020). The principle is as follows:

Suppose the individual positions in the sparrow population can be expressed by the following equation:
(2)
where n is the number of sparrows in the population, d is the dimension of the parameter, and is the parameter of the jth dimension of the ith sparrow.

Individual sparrows in a population are divided into three categories: producers, scroungers, and danger perceivers. The producers usually have a higher fitness value and are responsible for searching for the position of the optimal fitness value and providing the search area and direction for the scroungers. The scroungers will follow the producer with the best fitness value to search while monitoring the producers. The danger perceivers are responsible for judging whether the environment is dangerous, and if it is dangerous, an alarm signal will be sent out to guide the group to move to a safe area. The proportion of producers and scroungers in the population is constant and is transformed into each other with the iterative calculation process of the algorithm.

  • 1.
    The position update formula of the producer is shown in the following equation:
    (3)
    where t is the current number of iterations and is the parameter value of the -th dimension of the th sparrow at the th iteration. is the maximum number of iterations. is a random number of (0, 1). is the alarm value, is the safety threshold, Q is a random number that obeys the normal distribution, and L is a all-one matrix.
  • 2.
    The position update formula of the scrounger is shown in the following equation:
    (4)

where is the position of the best fitness among the discoverers and is the position of the global worst fitness. , where A is a matrix with internal elements randomly assigned to 1 or −1.

  • 3.
    The position update formula of the danger perceivers is shown in the following equation:
    (5)

is the position of the global optimum fitness. is the step size control parameter, which is a random number obeying the standard normal distribution. K is a random number of [−1, 1], is the fitness value of the current sparrow individual, is the global best fitness value, and is the global worst fitness value. is a small constant, avoiding a denominator of 0.

Principle of the SSA-BP model
Usually, the initial weights and biases of BPNN are randomly initialized. According to the principle of gradient descent, this makes the completed model vary after each training, resulting in unstable training results. At present, a more effective method to solve this problem is to use the intelligent optimization algorithm combined with the BPNN model for training, i.e., the initial weights and biases are first optimized with the optimization algorithm, and the model is trained with the back propagation algorithm. This often results in a higher fitting accuracy of the final neural network model on the training set, but it may also cause over-fitting. However, in the case of a large amount of data and less noise in the training data, combining the intelligent optimization algorithm can not only improve the accuracy of BPNN fitting, but also increase the robustness of the model. In this paper, the parameters of BPNN are optimized based on the sparrow search algorithm. The flowchart of the SSA-BP model is shown in Figure 6.
Figure 6

Flow chart of SSA-BP model.

Figure 6

Flow chart of SSA-BP model.

Close modal

Fine-tuning module

This module mainly retrains the net1 obtained from the CFD pre-training module based on the measurement data.

The model net1, which has undergone the CFD pre-training module, learns the ideal velocity field distribution for CFD simulation. However, since there is still a certain degree of error between the CFD data and the measured data, it is difficult for net1 to get rid of this ‘error dilemma’ and to characterize the real velocity field well. Therefore, it is necessary to add a fine-tuning module.

The fine-tuning module adjusts the model parameters by retraining the pre-trained network with the measured data to improve the model's prediction accuracy. Compared with the neural network algorithm without the pre-training module, the fine-tuning module does not need to consider the initialization of network parameters because it uses the pre-trained model parameters obtained in the previous step as initialization parameters for training. This can also alleviate the problem of unstable training results caused by differences in parameter initialization. And because it is fine-tuned based on the model net1 that has learned the CFD features, the fine-tuned model net2 can not only effectively reduce the prediction error, but also retain the features of the CFD to avoid the predicted velocity field from deviating too much from the theoretical value.

There are currently two common training methods for fine-tuning: (1) All weights and biases are trained and updated; (2) Some weights and biases are fixed, and the remaining weights and biases are trained. After the previous experimental comparison, it is found that the model obtained by the first training method has higher prediction accuracy and can retain the distribution characteristics of CFD to a greater extent. Therefore, the CFD–PNN model in this paper adopts the method of training and updating all the weights and biases of the network in the fine-tuning module.

Model settings

In this paper, CFD, BPNN, SSA-BP, RBFNN, ELM, DT-RBF, and DT-MLP are used as benchmarks to compare with the CFD–PNN model. The purpose of the experiment is to predict the velocity field at an unknown water level.

This paper uses MATLAB to build the neural network. The input layer has three neuron nodes, which are the normalized water level h, -coordinate, and -coordinate. The output layer has a neuron node and the predicted velocity V can be obtained by de-normalizing the output result. The loss function used in the training process of the neural network is mean square error (MSE) and the training algorithm used is the Levenberg–Marquardt (LM) algorithm. The activation function in the network adopts the function and its expression is shown in the following equation:
(6)

In order to ensure that the predicted velocity value is not negative, nonnegative processing of data is added after inverse normalization, i.e., the velocity value <0 is set to 0. Since only the velocity magnitude in the axial direction of the channel profile can be measured, and according to the CFD simulation results, the radial velocity of the section is approximately equal to 0, this experiment only considers the axial velocity of the section not the radial velocity. 25,189 CFD simulation flow velocity data at the same water level as the training set are selected to construct the CFD–PNN model. In order to improve the training speed, 2,519 (10%) of the 25,189 data are selected by equal interval sampling to train the SSA-BP network to obtain the transferable network net1.

When the ANN model is trained in this paper, the input and output are normalized to the (0, 1) range and Equation (7) is used to achieve:
(7)
where is the normalized input parameter, is the original input parameter before normalization, is the maximum original input parameter, and is the minimum original input parameter. When the neural network model is used for prediction, the output result needs to be denormalized, as shown in the following equation:
(8)
where is the output parameter of the neural network, is the denormalized predicted value, is the maximum original output parameter, and is the minimum original output parameter.

The advantage of using data normalization is that it can make the data dimensionless. It facilitates the training of the neural network, accelerates the speed of convergence, and makes the training result more stable.

The performance evaluation indicators used in this paper are root mean square error (RMSE), mean absolute error (MAE), mean absolute percentage error (MAPE), correlation coefficient (R), and coefficient of determination (R2). As shown in the following equations:
(9)
(10)
(11)
(12)
(13)

In the above equations, m is the number of samples in the test set, is the ith measured value in the test set, is the ith predicted value, is the average value of the test set data, and is the average value of the predicted data.

The closer the values of RMSE, MAE, and MAPE are to 0 and the closer the values of R and R2 are to 1, the better the prediction performance of the model is.

Error analysis between CFD simulation results and measured values

The profile velocity fields under 27 water levels were obtained through CFD simulation and 378 velocity values at the same position as the measured data were selected for error statistics. The results are shown in Figure 7 and the error statistics are shown in Table 3. The velocity field at 2.8 m water level plotted from the CFD data is shown in Figure 8.
Table 3

Statistics of CFD prediction error

RMSEMAEMAPE (%)RR2
0.1093 0.0873 6.2424 0.9711 0.9339 
RMSEMAEMAPE (%)RR2
0.1093 0.0873 6.2424 0.9711 0.9339 
Figure 7

Comparison between CFD results and measured results.

Figure 7

Comparison between CFD results and measured results.

Close modal
Figure 8

Velocity field of 2.8 m water level calculated by CFD.

Figure 8

Velocity field of 2.8 m water level calculated by CFD.

Close modal
According to the measured data, the distribution trend of the flow velocity in the central area at 2.8 m water level of the channel is drawn based on the triangle linear interpolation algorithm, which is shown in Figure 9. The black dots in the figure indicate the locations of the measurements. Due to the limited measured data, this figure can only roughly reflect the trend of the velocity distribution in the profile and cannot describe the complete velocity field. It can be seen from Figure 9 that the velocity distribution of this channel is not asymmetric and the region with higher velocity is located on the upper right side of the profile.
Figure 9

Trend diagram of velocity distribution in the center at 2.8 m water level.

Figure 9

Trend diagram of velocity distribution in the center at 2.8 m water level.

Close modal

Since the measured data in this paper are obtained from the open channel in the irrigation area, they will be affected by various influences in the natural environment, such as terrain, wind speed, air humidity, wall roughness, and part of the sediment at the bottom of the channel. Therefore, there will be a certain deviation between the real velocity field and the simulation results.

Comparison of prediction results of different algorithm models

It can be seen from Figure 10 that the velocity fields predicted by RBFNN, ELM, DT-RBF, and CFD–PNN are relatively smooth, while those predicted by the other three models are relatively chaotic. Therefore, in the case of less data, it is difficult for BPNN and SSA-BP to learn a smooth velocity field, while the velocity fields predicted by the other five models are smoother. Moreover, the velocity of the CFD–PNN model gradually decreases to 0 near the wall, which is more consistent with the theoretical velocity field.
Figure 10

Velocity field at 2.8 m water level profile predicted by eight models based on measured data. (a) CFD; (b) BPNN; (c) SSA-BP; (d) RBFNN; (e) ELM; (f) DT-RBF; (g) DT-MLP; and (h) CFD–PNN.

Figure 10

Velocity field at 2.8 m water level profile predicted by eight models based on measured data. (a) CFD; (b) BPNN; (c) SSA-BP; (d) RBFNN; (e) ELM; (f) DT-RBF; (g) DT-MLP; and (h) CFD–PNN.

Close modal
From the velocity field predicted by CFD–PNN in Figure 11, it can be seen that as the water level rises, the maximum velocity region has a tendency to shift to the right, which is consistent with the velocity distribution trend shown in Figure 9.
Figure 11

Velocity fields of 8 water levels predicted by CFD–PNN. (a) 0.7 m; (b) 1 m; (c) 1.3 m; (d) 1.7 m; (e) 2 m; (f) 2.3 m; (g) 2.8 m; and (h) 3.1 m.

Figure 11

Velocity fields of 8 water levels predicted by CFD–PNN. (a) 0.7 m; (b) 1 m; (c) 1.3 m; (d) 1.7 m; (e) 2 m; (f) 2.3 m; (g) 2.8 m; and (h) 3.1 m.

Close modal

It can be seen from Table 4 that the prediction error of each neural network model for flow velocity is lower than that of CFD. The CFD–PNN model achieves the optimum in all five evaluation indicators. Therefore, the CFD–PNN model can effectively reduce the prediction error. The CFD–PNN model has an RMSE of 0.0596, MAE of 0.0451, MAPE of 3.6216%, R of 0.9894, and R2 of 0.9786.

Table 4

Prediction error statistics of eight models

ModelRMSEMAEMAPE (%)RR2
CFD 0.1047 0.0883 6.4214 0.9709 0.9340 
BPNN 0.0636 0.0515 4.2557 0.9878 0.9756 
SSA-BP 0.0625 0.0478 3.9315 0.9883 0.9764 
RBFNN 0.0665 0.0508 4.1356 0.9867 0.9734 
ELM 0.0674 0.0492 4.0249 0.9863 0.9726 
DT-RBF 0.0882 0.0574 4.6802 0.9763 0.9532 
DT-MLP 0.0729 0.0560 4.4385 0.9839 0.9680 
CFD–PNN 0.0596 0.0451 3.6216 0.9894 0.9786 
ModelRMSEMAEMAPE (%)RR2
CFD 0.1047 0.0883 6.4214 0.9709 0.9340 
BPNN 0.0636 0.0515 4.2557 0.9878 0.9756 
SSA-BP 0.0625 0.0478 3.9315 0.9883 0.9764 
RBFNN 0.0665 0.0508 4.1356 0.9867 0.9734 
ELM 0.0674 0.0492 4.0249 0.9863 0.9726 
DT-RBF 0.0882 0.0574 4.6802 0.9763 0.9532 
DT-MLP 0.0729 0.0560 4.4385 0.9839 0.9680 
CFD–PNN 0.0596 0.0451 3.6216 0.9894 0.9786 

It should be noted that in the fine-tuning module, it is necessary to avoid the model from forgetting the characteristics of the pre-trained model during the learning process. There are two methods used in the experiment:
  • 1.

    The LM algorithm is used for training with a small number of epochs set. Because over-training will make the velocity field predicted by the final model net2 forget the characteristics of CFD, which will easily lead to over-fitting and reduce the robustness. In this experiment, the number of epochs of model fine-tuning is set to 1, so that the velocity field predicted by the final model net2 largely retains the distribution of the CFD calculation results. The experimental comparison results are shown in Figure 12. It can be seen that with the increase in the number of training epochs, the CFD–PNN model deviates more and more from the distribution of the CFD calculation, and the predicted velocity field becomes more and more chaotic, which is inconsistent with the actual situation. And it can be seen from Table 5 that when the number of epochs is small (1 and 10), the prediction error is relatively lower, and the two cases have their own advantages in different evaluation indicators.

  • 2.

    The gradient descent with momentum (GDM) algorithm is selected for training with a large number of epochs set. Compared with the first method, although this will take longer for fine-tuning, it can stop the training after the model reaches convergence, avoiding the problem of over-fitting caused by over-training. Figure 13 and Table 6 show the results of training the model with different epoch numbers using the GDM algorithm in the fine-tuning module. It can be seen from Figure 13 that with the increase in the number of epochs, the difference in the velocity field predicted by CFD–PNN is getting smaller and smaller, and it can be determined that the model has converged at this time. And it can be seen from Table 6 that the prediction accuracy of the model is improved under a large number of epochs.

Figure 12

Prediction at 2.8 m water level velocity field of CFD–PNN in the fine-tuning module using LM algorithm with four different epoch numbers. (a) 1 epoch; (b) 10 epochs; (c) 100 epochs; (d) 1,000 epochs.

Figure 12

Prediction at 2.8 m water level velocity field of CFD–PNN in the fine-tuning module using LM algorithm with four different epoch numbers. (a) 1 epoch; (b) 10 epochs; (c) 100 epochs; (d) 1,000 epochs.

Close modal
Figure 13

Prediction at 2.8 m water level velocity field of CFD–PNN in the fine-tuning module using GDM algorithm with four different epoch numbers. (a) 100 epoch; (b) 1,000 epochs; (c) 10,000 epochs; (d) 100,000 epochs.

Figure 13

Prediction at 2.8 m water level velocity field of CFD–PNN in the fine-tuning module using GDM algorithm with four different epoch numbers. (a) 100 epoch; (b) 1,000 epochs; (c) 10,000 epochs; (d) 100,000 epochs.

Close modal
Table 5

Prediction error statistics of CFD–PNN under four different epoch numbers using LM algorithm in the fine-tuning module

Number of epochsRMSEMAEMAPE (%)RR2
0.0597 0.0447 3.6240 0.9893 0.9785 
10 0.0578 0.0454 3.6480 0.9901 0.9799 
100 0.0614 0.0480 3.8135 0.9887 0.9773 
1000 0.0615 0.0484 3.9270 0.9887 0.9772 
Number of epochsRMSEMAEMAPE (%)RR2
0.0597 0.0447 3.6240 0.9893 0.9785 
10 0.0578 0.0454 3.6480 0.9901 0.9799 
100 0.0614 0.0480 3.8135 0.9887 0.9773 
1000 0.0615 0.0484 3.9270 0.9887 0.9772 
Table 6

Prediction error statistics of CFD–PNN under four different epoch numbers using GDM algorithm in the fine-tuning module

Number of EpochsRMSEMAEMAPE (%)RR2
100 0.0742 0.0563 4.4725 0.9837 0.9669 
1000 0.0632 0.0486 3.9219 0.9882 0.9760 
10000 0.0612 0.0465 3.7411 0.9888 0.9774 
100000 0.0596 0.0451 3.6216 0.9894 0.9786 
Number of EpochsRMSEMAEMAPE (%)RR2
100 0.0742 0.0563 4.4725 0.9837 0.9669 
1000 0.0632 0.0486 3.9219 0.9882 0.9760 
10000 0.0612 0.0465 3.7411 0.9888 0.9774 
100000 0.0596 0.0451 3.6216 0.9894 0.9786 

Evaluation of the consistency of the CFD–PNN model with distribution characteristics of the CFD numerical solution

According to Figure 8, it can be known that, ideally, the maximum velocity of the velocity field of the trapezoidal open channel is located on the water surface, the flow velocity at the channel wall is 0, and the distribution of velocity contours has annular characteristics. Taking the 2.8 m water level as an example, it can be seen from Figure 10 that the velocity fields predicted by the RBFNN, ELM, DT-RBF, and CFD–PNN have annular distribution characteristics, and the position of the maximum velocity is on the water surface. However, RBFNN, ELM, and DT-RBF failed to show the trend of velocity dropping to 0 near the channel wall. To better prove that CFD–PNN still retains the characteristics of CFD after parameter transfer training, the seven neural network models are compared with the simulation results of CFD. Since there are data with a velocity value of 0 in the CFD data, MAPE is not applicable in this case, so the remaining four evaluation indicators are adopted. The experiment selected 10,428 CFD simulation data of eight water levels in the test set.

Figure 15 shows the consistent matching results between seven models and CFD at water levels of 0.7, 1, 1.3, 1.7, 2, 2.3, 2.8, and 3.1 m. 1–8 of the abscissa are eight water levels of 0.7–3.1 m. From Figures 14 and 15, and Table 7, it can be seen that the matching accuracy of CFD–PNN with the CFD numerical solution is significantly better than other neural network models. The RMSE of CFD–PNN is 0.1387, the MAE is 0.1128, the R is 0.9677, and the R2 is 0.9238, so it can be proved that the CFD–PNN model preserves the distribution characteristics of the CFD numerical solution.
Table 7

Statistics of the difference between the prediction results of the seven models and the CFD simulation results

ModelRMSEMAERR2
BPNN 0.4057 0.2769 0.6656 0.3485 
SSA-BP 0.4588 0.3115 0.6890 0.1668 
RBFNN 0.3244 0.1800 0.7975 0.5833 
ELM 0.3265 0.1944 0.8013 0.5779 
DT-RBF 0.3330 0.1946 0.7878 0.5611 
DT-MLP 0.3680 0.2224 0.7360 0.4640 
CFD–PNN 0.1387 0.1128 0.9677 0.9238 
ModelRMSEMAERR2
BPNN 0.4057 0.2769 0.6656 0.3485 
SSA-BP 0.4588 0.3115 0.6890 0.1668 
RBFNN 0.3244 0.1800 0.7975 0.5833 
ELM 0.3265 0.1944 0.8013 0.5779 
DT-RBF 0.3330 0.1946 0.7878 0.5611 
DT-MLP 0.3680 0.2224 0.7360 0.4640 
CFD–PNN 0.1387 0.1128 0.9677 0.9238 
Figure 14

Comparison of predictions from seven models and CFD simulation results.

Figure 14

Comparison of predictions from seven models and CFD simulation results.

Close modal
Figure 15

Comparison of predictions from seven models and CFD simulation results.

Figure 15

Comparison of predictions from seven models and CFD simulation results.

Close modal

In this paper, a CFD-based pre-training neural network model (CFD–PNN) is proposed and applied to the numerical simulation and prediction of the profile velocity field of a straight trapezoidal open channel, using 378 velocity data measured by the Renmin Channel Hydrological Station in Dujiangyan, Sichuan Province. The CFD–PNN model is experimentally compared with CFD simulation results and six other neural network prediction results. The conclusion is as below:

  • 1.

    In the case of less measured data, the CFD–PNN model can effectively reduce the prediction error, improve the prediction accuracy, and the predicted velocity field is also more reasonable. Compared with the measured flow velocity values, the CFD–PNN model has an RMSE of 0.0596, MAE of 0.0451, MAPE of 3.6216%, R of 0.9894, and R2 of 0.9786. It outperforms six other neural network algorithm models and the CFD model in all five evaluation indicators. Compared with other models, the accuracy is improved by 0.3–2.8%.

  • 2.

    In order to make the final prediction model retain the distribution characteristics of the CFD model as much as possible, an appropriate training method needs to be adopted in the fine-tuning module. The LM algorithm with a small number of epochs can be used for training when time-saving is needed, and the GDM algorithm can be used for training until the model converges when time cost is not considered.

The authors would like to reveal their appreciation and gratitude to the Renmin Channel Hydrological Station for the flow velocity measurement data. In addition, we are grateful to the editor and anonymous reviewers for their constructive comments on the manuscript.

This research was supported by Sichuan Science and Technology Program (NO: 2021YFG0121, NO: 2022ZHCG0042).

Data cannot be made publicly available; readers should contact the corresponding author for details.

The authors declare there is no conflict.

Baghalian
S.
,
Bonakdari
H.
,
Nazari
F.
&
Fazli
M.
2012
Closed-form solution for flow field in curved channels in comparison with experimental and numerical analyses and artificial neural network
.
Engineering Applications of Computational Fluid Mechanics
6
(
4
),
514
526
.
https://doi.org/10.1080/19942060.2012.11015439
.
Bonakdari
H.
&
Moazamnia
M.
2015
Modeling of velocity fields by the entropy concept in narrow open channels
.
KSCE Journal of Civil Engineering
19
(
3
),
779
789
.
https://doi.org/10.1007/s12205-013-0173-8
.
Bonakdari
H.
,
Baghalian
S.
,
Nazari
F.
&
Fazli
M.
2011
Numerical analysis and prediction of the velocity field in curved open channel using artificial neural network and genetic algorithm
.
Engineering Applications of Computational Fluid Mechanics
5
(
3
),
384
396
.
https://doi.org/10.1080/19942060.2011.11015380
.
Bonakdari
H.
,
Zaji
A. H.
,
Gharabaghi
B.
,
Ebtehaj
I.
&
Moazamnia
M.
2020
More accurate prediction of the complex velocity field in sewers based on uncertainty analysis using extreme learning machine technique
.
ISH Journal of Hydraulic Engineering
26
(
4
),
409
420
.
https://doi.org/10.1080/09715010.2018.1498753
.
Chiu
C. L.
1989
Velocity distribution in open channel flow
.
Journal of Hydraulic Engineering
115
(
5
),
576
594
.
https://doi.org/10.1061/(ASCE)0733-9429(1989)115:5(576)
.
Chiu
C. L.
&
Hsu
S. M.
2006
Probabilistic approach to modeling of velocity distributions in fluid flows
.
Journal of Hydrology
316
(
1–4
),
28
42
.
https://doi.org/10.1016/j.jhydrol.2005.04.011
.
Chiu
C. L.
&
Tung
N. C.
2002
Maximum velocity and regularities in open-channel flow
.
Journal of Hydraulic Engineering
128
(
4
),
390
398
.
https://doi.org/10.1061/(ASCE)0733-9429(2002)128:4(390)
.
Fontana
N.
,
Marini
G.
&
De Paola
F.
2013
Experimental assessment of a 2-D entropy-based model for velocity distribution in open channel flow
.
Entropy
15
(
3
),
988
998
.
https://doi.org/10.3390/e15030988
.
Gholami
A.
,
Bonakdari
H.
,
Zaji
A. H.
&
Akhtari
A. A.
2015
Simulation of open channel bend characteristics using computational fluid dynamics and artificial neural networks
.
Engineering Applications of Computational Fluid Mechanics
9
(
1
),
355
369
.
https://doi.org/10.1080/19942060.2015.1033808
.
Gholami
A.
,
Bonakdari
H.
,
Zaji
A. H.
,
Michelson
D. G.
&
Akhtari
A. A.
2016
Improving the performance of multi-layer perceptron and radial basis function models with a decision tree model to predict flow variables in a sharp 90° bend
.
Applied Soft Computing
48
,
563
583
.
https://doi.org/10.1016/j.asoc.2016.07.035
.
Guo
N.
&
Wang
Z.
2022
A combined model based on sparrow search optimized BP neural network and Markov chain for precipitation prediction in Zhengzhou City, China
.
AQUA – Water Infrastructure, Ecosystems and Society
71
(
6
),
782
800
.
https://doi.org/10.2166/aqua.2022.047
.
Luo
H.
&
Singh
V. P.
2011
Entropy theory for two-dimensional velocity distribution
.
Journal of Hydrologic Engineering
16
(
3
),
303
315
.
https://doi.org/10.1061/(ASCE)HE.1943-5584.0000319
.
Luo
H.
,
Singh
V.
&
Schmidt
A.
2018
Comparative study of 1D entropy-based and conventional deterministic velocity distribution equations for open channel flows
.
Journal of Hydrology
563
,
679
693
.
https://doi.org/10.1016/j.jhydrol.2018.06.010
.
Marini
G.
,
De Martino
G.
,
Fontana
N.
,
Fiorentino
M.
&
Singh
V. P.
2011
Entropy approach for 2D velocity distribution in open-channel flow
.
Journal of Hydraulic Research
49
(
6
),
784
790
.
https://doi.org/10.1080/00221686.2011.635889
.
Nezu
I.
,
Nakagawa
H.
&
Rodi
W.
1989
Significant difference between secondary currents in closed channels and narrow open channels
. In
Proceedings of 23rd IAHR Congress
, Vol.
A
,
Delft, The Netherlands
, pp.
125
132
.
Pektas
A. O.
2015
Computational modeling with sensitivity analysis: case study velocity distribution of natural rivers
.
Neural Computing and Applications
26
(
7
),
1653
1667
.
https://doi.org/10.1007/s00521-015-1830-2
.
Sahu
M.
,
Jana
S.
,
Agarwal
S.
,
Khatua
K. K.
&
Mohapatra
S.
2011
Point form velocity prediction in meandering open channel using artificial neural network
. In
2nd International Conference on Environmental Science and Technology
. (Vol.
6
, pp.
209
212
).
Sun
S.
,
Yan
H.
&
Kouyi
G. L.
2014
Artificial neural network modelling in simulation of complex flow at open channel junctions based on large data sets
.
Environmental Modelling & Software
62
,
178
187
.
https://doi.org/10.1016/j.envsoft.2014.08.026
.
Xue
J.
&
Shen
B.
2020
A novel swarm intelligence optimization approach: sparrow search algorithm
.
Systems Science & Control Engineering
8
(
1
),
22
34
.
https://doi.org/10.1080/21642583.2019.1708830
.
Yang
H. C.
&
Chang
F. J.
2005
Modelling combined open channel flow by artificial neural networks
.
Hydrological Processes: An International Journal
19
(
18
),
3747
3762
.
https://doi.org/10.1002/hyp.5858
.
Zaji
A. H.
&
Bonakdari
H.
2015
Efficient methods for prediction of velocity fields in open channel junctions based on the artificial neural network
.
Engineering Applications of Computational Fluid Mechanics
9
(
1
),
220
232
.
https://doi.org/10.1080/19942060.2015.1004821
.
Zaji
A. H.
&
Bonakdari
H.
2019
Velocity field simulation of open-channel junction using artificial intelligence approaches
.
Iranian Journal of Science and Technology, Transactions of Civil Engineering
43
(
1
),
549
560
.
https://doi.org/10.1007/s40996-018-0185-1
.
This is an Open Access article distributed under the terms of the Creative Commons Attribution Licence (CC BY 4.0), which permits copying, adaptation and redistribution, provided the original work is properly cited (http://creativecommons.org/licenses/by/4.0/).