Predicting the flow field around sluice gates is essential for controlling water levels and discharges in open channels and rivers. Smooth particle hydrodynamics (SPH) models can satisfactorily reproduce such free-surface flows, but they typically require long computational time and extensive computational resources. In this work, we propose a convolutional neural network (CNN) to predict the flow field around a sluice gate. A validated SPH model is used to carry out extensive simulations, and the generated data set is used to train and test CNN-based models. The results demonstrated that the developed CNN can accurately reproduce sluice gate flows, with R2 values exceeding 90% and significantly reducing the computational costs. Furthermore, various traditional machine learning algorithms comprising adaptive neuro-fuzzy inference system, genetic programing, multigene genetic programing, and one-dimensional CNN were also evaluated, and a comparison of the results showed that the developed CNN performed better than the traditional data-driven algorithms in predicting sluice gate flows. Therefore, the proposed method is a promising tool for providing rapid prediction of the spatial distribution of flow fields near the sluice, and potentially for predicting other spatially distributed hydrologic variables.

  • We developed a parameter-based convolutional neural network to predict the flow field around sluice gates.

  • Smooth particle hydrodynamics results were utilized to train, validate, and test the developed algorithm.

  • The developed model can accurately reproduce sluice gate flows and performed better than traditional data-driven algorithms.

mk

the mass corresponding to particle k (evaluated at a or b)

ρk

the density corresponding to particle k (evaluated at a or b)

t

time

vk

the position and velocity of the particles k (evaluated at a or b)

W

the smoothing kernel function

the gradient of the kernel function with respect to the coordinates of the particle

the dissipation term

the acceleration due to gravity

P

the pressure corresponding to the particle

the pressure corresponding to particle k (evaluated at a or b)

the position of the particles

h

the smoothing kernel length

the viscosity term

c

the numerical speed of sound

a

the artificial viscosity coefficient

h0

the gate opening

hw

the downstream overflow weir height

U0

average inlet velocity

ha

the inlet water level

h0/ha

nondimensional sluice gate opening

hw/ha

nondimensional overflow weir height

u/U0

the horizontal velocity

v/U0

the vertical velocity

SPH

smooth particle hydrodynamics

CNN

convolutional neural network

DL

deep learning

ML

machine learning

RF

the random forest

MLP

the multilayer perceptron

ANFIS

adaptive neuro-fuzzy inference system

GP

genetic programing

1D-CNN

one-dimensional convolutional neural network

MGGP

the multigene genetic programing

CUDA

compute unified device architecture

CPUs

the central processing units

GPUs

the graphics processing units

dp

the model to the particle distance

ANN

artificial neural network

Gates are one of the most widely used water regulation structures for controlling water levels and discharges in open channels, rivers, and lakes (Akoz et al. 2009; Ghorbani et al. 2020; Luo et al. 2021; Nikoli & Karamarkovi 2021; Peng et al. 2021; Salmasi & Abraham 2021). Examples of their applications in the field of hydrology and water resources include agricultural water canals, dams, and exits of lakes. Gates can be classified into many different types, and sluice gates have been extensively used in many water resources projects (Swamee 1992; Salmasi & Abraham 2021). Sluice gates are a type of underflow gate, where water flows beneath the gate and the flow is primarily governed by the gate opening. The flow discharge beneath a gate has been a topic of significant research because it is a fundamental problem in many water conservancy projects (Belaud et al. 2009; Yousif et al. 2019; Salmasi & Abraham 2021). The discharge under a gate can be typically estimated based on the discharge coefficient, and thus, many previous studies have focused on the estimations of the discharge coefficient (Rajaratnam & Subramanya 1967; Cassan & Belaud 2012; Salmasi & Abraham 2021).

However, recent studies showed that the construction and operation of gates can significantly affect the water quality, water ecology, and emission of greenhouse gases (Nakamura et al. 2019; Luo et al. 2021; Peng et al. 2021). A reasonable assessment of water quality, water ecology, and emission of greenhouse gases requires knowledge of the entire flow field, and the flow discharge under the sluice gate can be directly obtained based on the flow field data, so it is advantageous to model the entire flow field near a sluice gate. Numerical modeling is an important research method to simulate the flow field, which can provide a complete data set at a relatively low cost, but it has disadvantages such as inaccuracy, high computational requirements, and large disk storage space. Advances in modern artificial intelligence, especially deep learning (DL) algorithms, and the increasing amount of high-quality data provide a new way to establish the flow field distribution. To propose and evaluate the performance of the new method, we focus on a relatively simple test case: developing a convolutional neural network (CNN) model to model the flow field in a controlled gate system and compare it with a numerical model and traditional DL models.

Physical modeling and experimental methods are the most commonly used methods to study computational fluid dynamics. For example, Mohammad et al. (2022) investigate the flow resistance and velocity distribution in a smooth triangular channel under varying slope conditions in a laboratory environment. Parsamehr et al. (2022) evaluated the influence of roughness elements on the unfavorable riverbed slope on hydraulic jump characteristics. These experimental works deepen the understanding of computational fluid dynamics to reflect the real physical processes of fluid evolution. However, laboratory methods are often very time consuming and expensive, making it urgent to develop complementary methods.

With the development of computers, numerical models based on computational fluid dynamics are powerful tools for predicting free-surface flows subjected to the influence of hydraulic structures (Yan & Mohammadian 2017; Yan et al. 2020, 2021; Ahmadi et al. 2022). Numerical models can use computers to replace the natural environment, mechanical devices, and other physical simulations, compared with physical experiments, and reduce the simulation cost, and models can be used as a supplement to the experiment. The majority of the existing numerical studies have been carried out using mesh-based approaches (Vauclin et al. 2010), but it is challenging for these approaches to create good-quality grids for complex geometry and provide high-fidelity predictions for problems with large deformation and fluctuating free surfaces. More recently, advanced meshless numerical approaches, such as those based on smooth particle hydrodynamics (SPH), have been used to reproduce free-surface flows (Crespo et al. 2008; Razavitoosi et al. 2014). Gu et al. (2022) studied the application of DualSPHysics in the spillway hydraulic system and found that the DualSPHysics code based on the SPH method has a promising spillway flow in the engineering field. Nóbrega et al. (2022) used the SPH method, and the results show that the numerical results are in good agreement with the test data of wide crown weir and spillway chute. Therefore, SPH can better accommodate large deformation, free surface, and fluid–solid interaction problems (Xiong et al. 2006; Fei et al. 2021). However, these models typically require long computational time and extensive computing resources, limiting their wider usage in practical applications.

To make up for the shortcomings of numerical models regarding computational costs, data-driven models based on modern machine learning (ML) techniques have been recently employed to predict complex flows (Lui & Wolf 2019; Zhu et al. 2019; Hosseiny et al. 2020; Kabir et al. 2020; Zhao et al. 2020a, 2020b; Yan et al. 2021; Kumari et al. 2022; Zhang et al. 2022). For instance, Hosseiny et al. (2020) developed an efficient flood simulation model utilizing the random forest and multilayer perceptron (MLP) algorithms. Kabir et al. (2020) adopted an one-dimensional CNN (1D-CNN) to predict flood inundation. Yan et al. (2021) predicted the flow depths in a fluvial system using the multigene genetic programing (MGGP) approach. These studies showed that ML algorithms can successfully act as surrogates for hydraulic models and significantly reduce computational costs (Schmidt et al. 2020). In recent years, CNN algorithms have been widely applied in the field of water resources research and have been demonstrated to be promising tools for predicting complicated water-related processes (Zhang et al. 2022). Several recent studies have found CNN algorithms to be promising tools for predicting flow fields. For instance, Sekar et al. (2019) proposed a combined deep CNN and deep MLP approach and employed it to predict incompressible laminar steady flow fields over airfoils. Their study demonstrated that the proposed approach exhibited high efficiency and accuracy. Kreyenberg et al. (2019) estimated the velocity field using a CNN based on measured concentration distributions of density-driven solute transport. They demonstrated that the CNN algorithm can successfully represent the underlying mechanisms and thus can be used to close the information gap of missing system variables. Although the prior studies have made significant contributions, previous CNN-based ML studies have not focused on modeling the sluice gate flow, the prediction of which is essential for controlling water levels and discharges in open channels and rivers. This gap in the literature inhibits the adoption of ML techniques to modeling of free-surface flows subjected to the influence of hydraulic structures. The sluice gate is one of the most widely used hydraulic structures, and thus improving the practice of sluice gate flow modeling is of significant practical importance.

The primary objective of this article was to develop a CNN for creating realizations of sluice gate flows. More specifically, we attempted to construct a new CNN to predict the flow field of free-surface flows subjected to the influence of sluice gates with downstream overflow weirs based on the governing parameters. A validated SPH model was employed to generate data for the training and validating of the CNN. To specify, we first developed a SPH model and validated it against experimental data for sluice gate flows, and then employed the validated numerical model to carry out additional computations for various scenarios with different arrangements of sluice gates and downstream weirs, i.e., the training and validating arrangements. Subsequently, the outcome of the numerical model was processed and utilized to train and validate the CNN. The trained and validated CNN was then used to predict the flow field for several new arrangements, i.e., the testing arrangements. The predictions for the testing cases obtained by the CNN were then compared against the results of separately performed SPH simulations for those arrangements. Various traditional ML algorithms comprising adaptive neuro-fuzzy inference system (ANFIS), genetic programing (GP), MGGP, and one-dimensional CNN (1D-CNN) were also evaluated and employed to construct ML-based models. The innovation of this study is mainly reflected in the following two aspects: (1) a CNN architecture for the flow field distribution near the sluice was developed; (2) CNN-based rapid simulation model of the flow field near the sluice, which can achieve the rapid high accurate reconstruction of the flow field near the sluic.

The rest of this article is organized as follows. The methodologies comprising the governing equations of the SPH model, the numerical model setup, and the details of the ML models are described in Section 2. The results are presented and discussed in Section 3. Finally, the research is summarized, and conclusions are drawn in Section 4.

Mathematical representation

In the SPH approach, fluids and solids are described using particles, and the relevant quantities, such as mass, velocity, and pressure, are all related to these particles (Tartakovsky et al. 2007). By solving the dynamic equation of particle motions and tracking the trajectory of each particle, the mechanical behavior of the whole system can be obtained.

According to the concept of the smooth function and the particle approximation principle of the SPH method, the continuity equation of the fluid flow can be written in the following discrete form of the SPH (Husain et al. 2014):
(1)
where and are the mass and density corresponding to particle k (evaluated at a or b), t is time, , represent the velocity of the particles k (evaluated at a or b), W represents the smoothing kernel function, and represents the gradient of the kernel function with respect to the coordinates of the particle.
The momentum conservation equation can be expressed as follows (Liu & Liu 2010; Crespo et al. 2015):
(2)
where T represents the dissipation term, g represents the acceleration due to gravity, and P is the pressure corresponding to the particle.
The effects of dissipation can be modeled using the artificial viscosity scheme. In SPH notation, Equation (2) can be written as follows (Liu & Liu 2010; Springel & Hernquist 2002; Crespo et al. 2015; Domínguez et al. 2022):
(3)
where is the pressure corresponding to particle k (evaluated at a or b).
The viscosity term is given by the following formula:
(4)
where , , , and represent the position and velocity of the particles, respectively. , , with . h is the smoothing kernel length, c is the numerical speed of sound, and a is the artificial viscosity coefficient.

Model setup

The governing equations were numerically solved using the open-source code based on the SPH model named DualSPHysics (Crespo et al. 2015; González et al. 2018; Zubeldia et al. 2018; Domínguez et al. 2022). DualSPHysics is implemented in C ++ and Compute Unified Device Architecture language, and it performs numerical simulations on either the central processing units or graphics processing units (GPUs). The SPH simulations in this work were all performed using the GPU mode on a desktop with a NVIDIA GeForce RTX 3060 device.

A schematic of sluice gate flows is illustrated in Figure 1. To validate the SPH model, we first simulated the experiment of Akoz et al. (2009), and thus the arrangements for the first numerical run were set to be consistent with the experiment. The details about the model setup for this baseline simulation are summarized as follows. The gate opening h0 was set as 0.012 m, and the downstream overflow weir height hw was set as 0. The x coordinate of the sluice gate was x = 0.218 m, and its crest width was 0.002 m, and the x coordinate of the overflow weir was located at x = 0.398 m with a crest width of 0.002 m. The x coordinate of the inlet patch was x = 0.054 m, and the velocity profiles at the inlet patch were obtained from Akoz et al. (2009) with an average inlet velocity U0 = 0.098 m s−1. The approach flow depth ha was set as 0.107 m. The y coordinate of the bed surface was set as 0. Preliminary simulations were performed to assess the sensitivity of the model to the particle distance (dp). Finally, a particle distance of 0.001 m was adopted, and the ratio value for ha/dp is 107. The minimum time step was set to be 0 s, and the actual transient time step was automatically determined by the code. The time of simulation was set to be 90 s. The Symplectic scheme was used for time integration, the Quintic Wendland kernel was used as the kernel function, and the artificial viscosity model with a viscosity value of 0.005 was employed for viscosity treatment.
Figure 1

Schematic of a sluice gate flow.

Figure 1

Schematic of a sluice gate flow.

Close modal

Numerical experiments

The validated SPH model was employed to perform numerical experiments to generate synthetic data. The experiments can be divided into two distinct sets: the first set was used to train and validate ML models, while the second set was used as unseen experiments to further test the developed models. Each numerical run had a distinct arrangement of the sluice gate and overflow weir. To ensure the general suitability of the developed models, the key quantities were converted into nondimensional parameters. More specifically, the lengths were divided by the approach water depth, and the velocities were divided by the average inlet velocity. At the upstream boundary, both the flow rate and the velocity were kept constant, to ensure that the velocity distributions for the numerical models were consistent with the measured velocities reported by Akoz et al. (2009). A total of 31 different cases were considered in the train-validation set, and 80% of the cases were used for model training and the remaining cases were used for model validation. For further testing of the developed CNN, eight different scenarios were considered in the numerical experiments. The averaged Froude number estimated based on the gate openings was 2.54.

The convolutional neural network

CNN is a special type of the artificial neural network (ANN). A traditional ANN establishes a statistical connection between inputs and outputs using hierarchical connected layers of neurons (Wu et al. 2009; Kurtulus & Razack 2010), and the parameters and weights in the network are usually determined by minimizing the loss function. However, for data with multiple arrays (e.g., images), there is typically a higher correlation between neighboring components and lower correlation between farther components. However, a neuron in a traditional ANN is not connected to other neurons in the same layer, which makes the network inadequate in extracting local patterns, and is fully connected to all neurons in the previous layer, which makes the network redundant (Khosravi et al. 2020; Ellafi et al. 2021). CNNs typically utilize the convolution and pooling operators to overcome this drawback. A convolution layer employs trainable filters to generate a feature map and highlight local features, and a pooling layer reduces the image resolution without losing the key features (Kreyenberg et al. 2019; Zhao et al. 2020a, 2020b). Therefore, CNNs can better extract the major patterns in an image and eliminate unnecessary computational costs.

Features

The flow field of the sluice gate flow is primarily governed by the upstream and downstream boundary conditions, and the arrangement of the sluice gate. The upstream boundary condition mainly consists of the flow velocity and inlet water level (ha) (Pahar & Dhar 2017). To eliminate the necessity of incorporating the upstream boundary condition as a feature for ML models and to enhance the generalization of the trained ML models, all of the dimensions were nondimensionalized by the inlet water level, and the velocity components were nondimensionalized by the inlet velocity. The downstream boundary condition can be represented by the downstream weir height (hw). Therefore, two dimensionless quantities, nondimensional sluice gate opening (h0/ha) and nondimensional overflow weir height (hw/ha), were fed into the ML models to predict the water mask and nondimensional velocity components (u/U0 and v/U0).

Overall architecture

The basic structure of CNN includes input layer, convolutional layer (conv), subsampling layer (pooling), full connection layer, and output layer (classifier). The convolutional layer + subsampling layer generally have several layers. We have attempted different tests to obtain the optimal parameters such as the model structures, learning_rate, batch_size, n_epochs, nkerns, and poolsize. We have initialized the models with the default values of the parameters and performed hyperparameter tuning through the validation datasets. The architecture of the CNN established in this study is presented in Figure 2. We designed this architecture specifically for modeling the spatial distribution of an output variable using a few governing variables as features. The first part of the network performed up-sampling to increase the resolution of the image from coarse to high, and the second part reduced the dimensions of the images to the target resolution. In this example, the two dimensionless variables (h0/ha and hw/ha) were fed, and their values were mapped into the feature space through a few layers of dense, batch normalization, activation, and reshape. This process transformed the values of the two input variables into an input image, and the backpropagation approach was employed to train the network. The optimal parameters are obtained from the training set, such as learning_rate, batch_size, n_epochs, nkerns and poolsize, using the trained parameters to initialize the model and perform hyperparameter tuning through the validation set.
Figure 2

Architecture of the developed CNN.

Figure 2

Architecture of the developed CNN.

Close modal

Regularization

To suppress the problem of overfitting and to make the network generalize well to unseen data, we used batch-normalization modules (Ioffe & Szegedy 2015; Pan et al. 2019) as the regularization strategy to improve the performance of the network. This approach changed the distribution of the inputs in each layer during the training process and performed normalization of the output in the hidden layers (Ioffe & Szegedy 2015; Pan et al. 2019). Therefore, this approach can eliminate the issue of internal covariate shift, which in turn addresses the issue of overfitting.

Downsampling, activation function, and loss function

The pooling operations were one of the most popular downsample operations; however, considering that the network was sufficiently large for the dataset and thus the downsampling was performed using convolutional layers, these convolutional layers can be regarded as trainable pooling layers. The ReLU function was used as the activation function (Khosravi et al. 2020) because it is one of the most widely used activation functions with high efficiency. The mean squared error between the ground truths and predictions was used as the loss function. The algorithm first calculated the partial derivation of the loss function with respect to the parameters and subsequently tuned each parameter along the gradient descent direction to minimize prediction errors.

Training

Three CNNs were separately trained, including water masks, dimensionless streamwise velocity components, and dimensionless vertical velocity components. The validation set is used to estimate the generalization error during or after training and to update the hyperparameters. We tuned the hyperparameters including learning_rate, batch_size, and n_epochs using the validation set. Finally, the Adam optimization algorithm was employed for model training, and the learning rate was set as 0.001. The epoch was set as 1,000, the batch size was set to 4, and the kernel size was set as 3.

Reference machine learning algorithms

In this work, various traditional ML algorithms comprising ANFIS, GP, MGGP, and 1D-CNN were also evaluated and employed to construct ML-based models (Rezaali et al. 2021), which were used as reference models. A major difference between these algorithms and the CNN was that they cannot perform 2D convolutional or downsampling operations, and thus, they cannot directly extract 2D spatial features. A common practice to apply these algorithms to predict the spatial distribution of variables is to predict output variables at each point and then merge the predictions together to construct the spatial distribution of the target variable (Kabir et al. 2020; Yan et al. 2021). However, training separate models for each point is not practical. In this study, we added two additional input variables into the training data sets, namely, the indices for the rows and columns of the pixels. Incorporating these additional variables can help traditional ML algorithms to extract spatial patterns and provide predictions using a single model. The 1D-CNN model was constructed on the same platform as the 2D-CNN model. The ANFIS model was developed using the fuzzy logic toolbox in MATLAB. The GP and MGGP models were implemented primarily using an adapted version of the MATLAB code GPTIPS2 (Yan et al. 2021).

Data processing

All of the numerical simulations reached statistically steady states after 60 s, and thus, the data pertaining to the last 30 steps were extracted and averaged to obtain the time-averaged velocity fields. For each case, the water mask, the streamwise velocity component u, and vertical velocity component v were determined. The water mask was not a direct output of the numerical model and was defined to indicate whether a point contains water (water mask = 1) or not (water mask = 0). The velocity data together with the sluice gate opening and weir height were nondimensionalized by the inlet velocity and inlet water level. The nondimensionalized data were further normalized to fall between 0 and 1. Subsequently, a virtual mesh was created, and the processed data were mapped onto the mesh to construct three image-like matrices, which were matrices for water mask, normalized u, and normalized v.

For CNNs, the matrices were converted into grayscale images, which were the maps showing the spatial distribution of the water mask and flow velocities. For postprocessing, the predicted images were converted back to matrices. The velocity maps were corrected by the water mask maps to remove unphysically based values created by spatial interpolations. To specify, if the water mask at a grid was 0, then the velocity at the same grid was set as 0. Finally, the values in the matrices were denormalized to obtain actual values.

For the traditional ML algorithms, the matrices were not converted into images as they are not designed to process image-like data. Instead, the matrices were reshaped into datasets with multiple arrays, with each array containing one variable. The indices for the rows and columns of the virtual grids were added into the datasets as additional input variables. For postprocessing, the predictions obtained from the traditional ML models were reorganized and reshaped, based on the indices, to form the final matrices.

Assessment metrices

The performance of the developed models was evaluated primarily using the root-mean-square error (RMSE) and coefficient of correlation (R2), which can be expressed as follows:
(5)
(6)
where indicates the ground truths, denotes the estimations from the models, and N is the number of data pairs.

Validation of the SPH model

Figures 3 and 4 compare the measured and SPH-computed vertical distributions of the dimensionless velocity components, u/U0 and v/U0, at different locations. The magnitude of the vertical velocities was quite small in most of the regions except for near the gate, and thus only two measured velocity distributions located near the gate were provided and considered. As seen, the SPH predictions for both the horizontal and vertical velocities were in good agreement with the experimental data. The difference between the measurements and numerical predictions for the vertical velocity at x/ha = 1.626 was more apparent relative to the other locations. Our results for this location were very similar to the numerical data provided by Akoz et al. (2009), which also overpredicted the vertical velocity magnitude. A possible fact that led to this discrepancy was that we set the vertical velocity as zero at the inlet boundary in the numerical model, while there might be a small vertical velocity component in the experiment. However, for the other locations, the SPH model reproduced the flow field satisfactorily well. The RMSE and R2 values were also calculated and indicated on the plots, and the RMSE values were comparably low, while R2 values were high. Therefore, it is reasonable to conclude that the SPH model can satisfactorily represent the underlying processes of the sluice gate flow and is thus qualified to perform numerical experiments for generating synthetic data.
Figure 3

Comparisons of the measured and SPH-computed vertical distributions of horizontal velocities upstream of the sluice gate.

Figure 3

Comparisons of the measured and SPH-computed vertical distributions of horizontal velocities upstream of the sluice gate.

Close modal
Figure 4

Comparisons of the measured and SPH-computed vertical distributions of vertical velocities upstream of the sluice gate.

Figure 4

Comparisons of the measured and SPH-computed vertical distributions of vertical velocities upstream of the sluice gate.

Close modal

Numerical experiments

The validated SPH model was employed to carry out additional computations for different arrangements of the sluice gates and overflow weirs. The considered sluice gate openings (h0/ha) ranged from 0.112 to 0.224. Preliminary simulations were conducted, and the results showed that the flow became fully unconfined flow with larger gate openings. The height of the downstream weir (hw/ha) ranged from 0 to 0.187. The incorporation of the overflow weir can further increase the complexity of the problem by considering the influence of an additional hydraulic structure and can also be seen as a way of considering different downstream boundary conditions. For each case, the numerical data were extracted and randomly divided into three parts by MATLAB: 60% of the data were used for model training, 20% of the data were used for validation, and the remaining 20% of the data were used for model testing.

Figures 57 present the maps for water mask, u/U0, and v/U0, respectively. Note that these maps were actually grayscale, and pseudo color was used here to better visualize the results. The water profiles can be seen from the water mask maps. For the free-flow-outlet cases (hw/ha = 0), the upstream water level generally decreased with the gate opening. In the last case (h0/ha = 0.224), the flow became almost fully unconfined flow, so the upstream water level was quite similar to the downstream water level. For the cases where the outflow was obstructed by the downstream weir, the downstream water level was apparently governed by the downstream weir height: the water level increased with the height of the overflow weir.
Figure 5

The maps of water mask obtained from the SPH model.

Figure 5

The maps of water mask obtained from the SPH model.

Close modal
Figure 6

The maps of dimensionless horizontal velocity obtained from the SPH model. Blue: u/U0 = 0 and red: u/U0 = 1.

Figure 6

The maps of dimensionless horizontal velocity obtained from the SPH model. Blue: u/U0 = 0 and red: u/U0 = 1.

Close modal
Figure 7

The maps of dimensionless vertical velocity obtained from the SPH model. Yellow: v/U0 = 0 and blue: v/U0 = 1.

Figure 7

The maps of dimensionless vertical velocity obtained from the SPH model. Yellow: v/U0 = 0 and blue: v/U0 = 1.

Close modal

The map for the horizontal velocity (u/U0) clearly shows that a jet-like flow was formed due to the influence of the sluice gate. The downstream velocity was significantly higher than the upstream water velocity due to the contraction caused by the sluice gate. However, the difference in horizontal velocities between the regions upstream and downstream of the sluice gate generally decreased with larger gate openings. It was also apparent that the downstream weir directed the flow toward upward and created an overflow with a void region near the bottom of the weir.

The map for the vertical velocity (v/U0) showed that there was a significant increase in vertical velocity near the sluice gate opening, as the water level suddenly decreased through this region. Without the downstream weir, the horizontal distribution of the vertical velocity was quite uniform, since the jet-like flow primarily moved horizontally in the downstream direction. However, the vertical velocity substantially increased due to the placement of the downstream weir, which caused the formation of the weir overflow.

These observations were consistent with existing knowledge and general engineering judgments. Therefore, the quality of the synthetic data was believed satisfactory. Eight of these cases were then used as unseen test cases (indicated using red outlines), and the remaining cases were used for training and validating the ML models.

Performance of the CNN model

Figures 810 present the ground truth maps of the target variables and those obtained by the developed CNN model for a sample case with h0/ha = 0.168 and hw/ha = 0. To evaluate the performance of the constructed model in reproducing the actual flow field, all of the results were converted back to the dimensional form. Generally, the maps generated based on the CNN model were impressively similar to those for the ground truths. In terms of the water mask, the CNN model successfully reproduced the sudden drop in the water level around the sluice gate. There was a small unrealistic discontinuity in the upstream region, but it was only caused by errors in a few pixels and did not significantly affect the overall performance. In general, the predicted upstream and downstream water levels were satisfactorily close to the ground truths. The CNN model also reproduced the patterns of the velocity field very well. It is very impressive that the high-velocity regions in both the upstream and downstream areas have been successfully captured. There were more oscillations in the predicted maps. A possible approach to resolving these imperfections is to increase the data set size, which requires more computing resources. At most pixels, the predicted velocities matched the actual velocities very well.
Figure 8

Comparison of sample maps for water mask between SPH and CNN models: h0/ha = 0.168 and hw/ha = 0.

Figure 8

Comparison of sample maps for water mask between SPH and CNN models: h0/ha = 0.168 and hw/ha = 0.

Close modal
Figure 9

Comparison of sample maps for horizontal velocity between SPH and CNN models: h0/ha = 0.168 and hw/ha = 0.

Figure 9

Comparison of sample maps for horizontal velocity between SPH and CNN models: h0/ha = 0.168 and hw/ha = 0.

Close modal
Figure 10

Comparison of sample maps for vertical velocity between SPH and CNN models: h0/ha = 0.168 and hw/ha = 0.

Figure 10

Comparison of sample maps for vertical velocity between SPH and CNN models: h0/ha = 0.168 and hw/ha = 0.

Close modal
To further quantify the performance of the CNN model, Figures 11 and 12 present the RMSE and R2 values for all cases in the training, validation, and test datasets. It is apparent that the model predicted the scenarios with median values of the input quantities better than those with extreme values (i.e., the numbers located farthest from the average of the data set), which was partially attributed to the relatively few samples of extreme cases for model training. For the scenario with the largest gate opening and a free outflow, the network performed the worst. The flow in this extreme scenario was almost fully unconfined flow, and thus, the flow characteristics were different from other scenarios. Overall, the RMSE values were satisfactorily low and the R2 values were comparably high, indicating that the developed CNN model can provide acceptable predictions for sluice gate flows.
Figure 11

RMSE values for the CNN predictions of water masks and horizontal and vertical velocities.

Figure 11

RMSE values for the CNN predictions of water masks and horizontal and vertical velocities.

Close modal
Figure 12

R2 values for the CNN predictions of water masks and horizontal and vertical velocities.

Figure 12

R2 values for the CNN predictions of water masks and horizontal and vertical velocities.

Close modal

Performance of different ML algorithms

This work has already demonstrated that the developed CNN-based model can provide reasonable predictions for the flow field near a sluice gate. To better assess the performance of various ML algorithms, it is necessary to compare the errors between different models. Previous studies on ML, such as those by Feng et al. (2020), Sekar et al. (2019), and Kreyenberg et al. (2019), utilized the train and validation sets to compare models, demonstrating the feasibility of this approach. In this work, the model performance was compared by analyzing the errors of the training and validation sets.

The sample RMSE and R2 values corresponding to the reference algorithms for the train-validation data sets were computed and shown in box plots (Figures 13 and 14). In this example, the compared variable was u/U0, and error indices were calculated based on the grayscale values. It can be seen in Figure 8 that the CNN model generally provided lower RMSE and higher R2 values than the other tested models, demonstrating the good performance of the proposed algorithm. If both the training and validation performances are inferior to CNN, it is unlikely for the test performance to surpass that of the training and validation datasets in normal circumstances. The better generalization capability of the proposed CNN compared to the traditional ML algorithms should be primarily attributed to the 2D convolutional layers, which can better extract spatial features.
Figure 13

Comparison of the performance of different ML models in predicting dimensionless horizontal velocities (u/U0) in sluice gate flows: RMSE.

Figure 13

Comparison of the performance of different ML models in predicting dimensionless horizontal velocities (u/U0) in sluice gate flows: RMSE.

Close modal
Figure 14

Comparison of the performance of different ML models in predicting dimensionless horizontal velocities (u/U0) in sluice gate flows: R2.

Figure 14

Comparison of the performance of different ML models in predicting dimensionless horizontal velocities (u/U0) in sluice gate flows: R2.

Close modal

Reconstruction of the complete flow field

Figures 11 and 12 separately compared the performance of the proposed model in predicting water masks and horizontal and vertical velocities, and Figure 15 shows an example of the final vector plots of the flow field (h0/ha = 0.168 and hw/ha = 0) in the test data sets. These flow fields were reconstructed using U and V values. The comparison in Figure 15 demonstrates that the final flow field predicted by the developed CNN was very similar to the ground truth flow field, further confirming that the proposed approach can reasonably reproduce the flow field of sluice gate flows.
Figure 15

Comparison of sample vector plots of the flow field: (a) ground truth and (b) predicted by the developed CNN (h0/ha = 0.168 and hw/ha = 0).

Figure 15

Comparison of sample vector plots of the flow field: (a) ground truth and (b) predicted by the developed CNN (h0/ha = 0.168 and hw/ha = 0).

Close modal

Key contributions and limitations

Numerical modeling of gate flows using the SPH approach receives relatively less attention compared to those using mesh-based models, and the current study incorporated an overflow weir. The established SPH model is believed more promising than mesh-based models, and the simulations with an additional overflow weir highlight the merits of SPH approaches. In addition, the validated SPH model was utilized to perform synthetic experiments, which provide high-fidelity data for the development and evaluation of ML-based models.

The key contribution of this work is that it demonstrated the potential of the proposed CNN for predicting sluice gate flows. Modeling sluice gate flows has many practical applications in the field of hydrology and water resources, so the development of such a suitable ML algorithm and a novel type of model is very beneficial for researchers and engineers in this field. In this study, the training and validation sets were used to determine the generalization ability of different MLs, demonstrating the stronger ability of CNN. Furthermore, two sets of tests were done to demonstrate the risk of no overfitting of the CNN model. This study showed that the developed CNN models can satisfactorily reproduce the sluice gate flows and outperformed the traditional ML algorithms. A major reason for the good performance of the proposed network was that it contains convolutional layers and is thus more capable of extracting spatial features. Predicting the sluice gate flows using computational fluid dynamics models would take several hours (even days for larger domains), while reproducing the sluice gate flows using the developed CNNs would only take a few minutes. Therefore, the contribution made in this study is significant for reducing the computational costs of modeling flow fields.

The CNN-based surrogate for the SPH model also has some other merits: (1) It is easy to use because it only requires a modeler to update the input data for simulations of new scenarios and does not require the installation of the complicated SPH modeling software. (2) It can significantly reduce the requirement for storage disk space. The network can provide predictions for arbitrary cases in a few seconds, so it becomes unnecessary to store the numerical outputs; thus, the disk space required for storing the network was less than 450 MB, while the storage size for the numerical data obtained in this study was more than 75 GB. (3) It may outperform numerical models in the future. ML algorithms can elucidate unseen mechanisms and eliminate errors due to assumptions or improper predefined relationships between variables. Therefore, when more high-fidelity observational data are available for model training, an ML-based model may eventually outperform a numerical model. Furthermore, the developed CNN can predict the complete flow field using a few governing parameters, implying that the proposed CNN approach is potentially a powerful tool for predicting the flow fields for any cases with the fluid–solid coupling process.

However, it is acknowledged that this work also has some limitations. The developed CNNs can only accommodate a single target variable, and hence, the three CNNs were trained separately in this study instead of using one CNN to predict all the three variables. In the map for the horizontal velocity (u/U0), the downstream weir directed the flow upward and created an overflow with a void region near the bottom of the weir. This void region does not have a clear physical meaning, and it seems to be a limitation of the model. A hydraulic jump seems to be observed in some test cases. Some test cases, primarily due to the presence of the tailgates. In this article, we mainly propose the method of CNN reconstruction of the gate flow field. In the future work, we will further study whether hydraulic jump has limitations to the ML model and further evaluate the applicability of ML in highly turbulent and two-phase (air–water) cases. Besides, the developed models performed relatively worse for the cases with extreme values and became almost invalid for fully unconfined flows. Therefore, further studies should be conducted to improve the prediction capability of the models for extreme values and to develop general models that are suitable for both sluice gate flows and fully unconfined flows.

This study proposed a CNN to predict the flow fields near sluice gates, and the performance of the developed network was compared with those of 1D-CNN, ANFIS, GP, and MGGP models. The developed CNN-based models can directly reproduce, based on the sluice gate and downstream overflow weir configurations, the spatial distribution of water masks, and dimensionless horizontal and vertical velocity components, which can in turn reconstruct the complete flow fields near sluice gates. The results showed that the developed CNN models can satisfactorily reproduce the sluice gate flows, and outperformed the traditional ML algorithms. The better performance exhibited by the proposed network can be primarily attributed to the 2D convolutional layers, which can better extract spatial features. The comparisons between the SPH results (ground truths) and CNN predictions, as well as those between the performance of the CNN algorithm and traditional ML algorithms, showed that the developed CNNs can accurately reproduce the flow field near sluice gates and significantly reduce the computational cost, and it performed better than the traditional data-driven algorithms in predicting sluice gate flows. These findings also implied that the CNN approach was potentially a powerful tool for predicting the flow fields for any cases under the influence of solid structures. Future studies are recommended to improve the prediction capability of the models for extreme values. In the future, the data set can be further extended to include more data, especially for the flow field distribution near different types of sluice gates, to further improve the generalization ability of the ML models. Future works can also be conducted to develop general models that are suitable for both sluice gate flows and fully unconfined flows. It is also meaningful to conduct future studies to evaluate whether the ML models are subjected to limitations regarding the predictions of hydraulic jumps and to further evaluate the applicability of ML in predicting highly turbulent and two-phase (air–water) cases.

This work was supported by the Open Research Fund of State Environmental Protection Key Laboratory of Drinking Water Source Protection, Chinese Research Academy of Environmental Sciences (2022YYSYKFYB05), the Open Fund from Engineering Research Center for Seismic Disaster Prevention and Engineering Geological Disaster Detection of Jiangxi Province (SDGD202202), and Natural Sciences and Engineering Research Council of Canada (NSERC Discovery Grants).

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

The authors declare there is no conflict.

Ahmadi, M., Kuriqi, A., Nezhad, H. M., Ghaderi, A. & Mohammadi, M. 2022 Innovative configuration of vertical slot fishway to enhance fish swimming conditions. Journal of Hydrodynamics 34 (5), 917–933.
Akoz
M. S.
,
Kirkgoz
M. S.
&
Oner
A. A.
2009
Experimental and numerical modeling of a sluice gate flow
.
Journal of Hydraulic Research
47
(
2
),
167
176
.
Belaud
G.
,
Cassan
L.
&
Baume
J. P.
2009
Calculation of contraction coefficient under sluice gates and application to discharge measurement
.
Journal of Hydraulic Engineering
135
(
12
),
1086
1091
.
Cassan
L.
&
Belaud
G.
2012
Experimental and numerical investigation of flow under sluice gates
.
Journal of Hydraulic Engineering
138
(
4
),
367
373
.
Crespo
A. J.
,
Gómez-Gesteira
M.
&
Dalrymple
R. A.
2008
Modeling dam break behavior over a wet bed by a SPH technique
.
Journal of Waterway, Port, Coastal, and Ocean Engineering
134
(
6
),
313
320
.
Crespo
A. J.
,
Domínguez
J. M.
,
Rogers
B. D.
,
Gómez-Gesteira
M.
,
Longshaw
S.
,
Canelas
R.
,
Vacondio
R.
,
Barreiro
A.
&
García-Feal
O.
2015
DualSPHysics: Open-source parallel CFD solver based on Smoothed Particle Hydrodynamics (SPH)
.
Computer Physics Communications
187
,
204
216
.
Domínguez
J. M.
,
Fourtakas
G.
,
Altomare
C.
,
Canelas
R. B.
,
Tafuni
A.
,
García-Feal
O.
,
Martínez-Estévez
I.
,
Mokos
A.
,
Vacondio
R.
,
Crespo
A. J.
,
Rogers
B. D.
,
Stansby
B. D.
&
Gómez-Gesteira
M.
2022
DualSPHysics: from fluid dynamics to multiphysics problems
.
Computational Particle Mechanics
9
(
5
),
867
895
.
Ellafi
M. A.
,
Deeks
L. K.
&
Simmons
R. W.
2021
Application of artificial neural networks to the design of subsurface drainage systems in Libyan agricultural projects
.
Journal of Hydrology: Regional Studies
35
.
doi:10.1016/j.ejrh.2021.100838686627
.
Feng
D.
,
Fang
K.
&
Shen
C.
2020
Enhancing streamflow forecast and extracting insights using long-short term memory networks with data integration at continental scales
.
Water Resources Research
56
,
e2019WR026793
.
https://doi.org/10.1029/2019WR026793
.
Ghorbani
M. A.
,
Salmasi
F.
,
Saggi
M. K.
,
Bhatia
A. S.
,
Kahya
E.
&
Norouzi
R.
2020
Deep learning under H2O framework: A novel approach for quantitative analysis of discharge coefficient in sluice gates
.
Journal of Hydroinformatics
22
(
6
),
1603
1619
.
González-Cao
J.
,
García-Feal
O.
,
Domínguez
J. M.
,
Crespo
A. J. C.
&
Gómez-Gesteira
M.
2018
Analysis of the hydrological safety of dams combining two numerical tools: Iber and DualSPHysics
.
Journal of Hydrodynamics
30
,
87
94
.
Gu
S.
,
Zheng
W.
,
Wu
H.
,
Chen
C.
&
Shao
S.
2022
DualSPHysics simulations of spillway hydraulics: a comparison between single-and two-phase modelling approaches
.
Journal of Hydraulic Research
60
(
5
),
835
852
.
Hosseiny
H.
,
Nazari
F.
,
Smith
V.
&
Nataraj
C.
2020
A framework for modeling flood depth using a hybrid of hydraulics and machine learning
.
Scientific Reports
10
(
1
),
1
14
.
Husain
S. M.
,
Muhammed
J. R.
,
Karunarathna
H. U.
&
Reeve
D. E.
2014
Investigation of pressure variations over stepped spillways using smooth particle hydrodynamics
.
Advances in Water Resources
66
,
52
69
.
Ioffe
S.
&
Szegedy
C.
Normalization: accelerating deep network training by reducing internal covariate shift. arXiv preprint arXiv:1502.03167
.
Kabir
S.
,
Patidar
S.
,
Xia
X.
,
Liang
Q.
,
Neal
J.
&
Pender
G.
2020
A deep convolutional neural network model for rapid prediction of fluvial flood inundation
.
Journal of Hydrology
590
,
125481
.
Khosravi
K.
,
Panahi
M.
,
Golkarian
A.
,
Keesstra
S. D.
,
Saco
P. M.
,
Bui
D. T.
&
Lee
S.
2020
Convolutional neural network approach for spatial prediction of flood hazard at national scale of Iran
.
Journal of Hydrology
591
,
125552
.
Kreyenberg
P. J.
,
Bauser
H. H.
&
Roth
K.
2019
Velocity field estimation on density-driven solute transport with a convolutional neural network
.
Water Resources Research
55
(
8
),
7275
7293
.
Liu
M. B.
&
Liu
G.
2010
Smoothed particle hydrodynamics (SPH): an overview and recent developments
.
Archives of Computational Methods in Engineering
17
,
25
76
.
Mohammad Nezhad
H.
,
Mohammadi
M.
,
Ghaderi
A.
,
Bagherzadeh
M.
,
Ricardo
A. M.
&
Kuriqi
A.
2022
Flow resistance and velocity distribution in a smooth triangular channel
.
Water Supply
22
(
5
),
5253
5264
.
Nakamura
K.
,
Hung
T.
,
Van Tinh
N.
,
Matsuda
S.
,
Kadota
K.
,
Horino
H.
,
Hai
P. T.
,
Komatsu
H.
,
Hasegawa
K.
,
Fukuda
S.
,
Hirata
J.
,
Oura
N.
,
Kishimoto-Mo
A. W.
,
Yonemura
S.
&
Onishi
T.
2019
Effect of organizational paddy water management by a water user group on methane and nitrous oxide emissions and rice yield in the Red River Delta, Vietnam
.
Agricultural Water Management
217
,
179
192
.
Nikoli, M. V. & Karamarkovi, R. M.
2021
Flow control in a multichamber settling basin by sluice gates driven by a CFD and an ancillary analytical model
.
Journal of Hydroinformatics
23
(
4
),
689
708
.
Nóbrega
J. D.
,
Matos
J.
,
Schulz
H. E.
&
Canelas
R. B.
2022
Smooth and stepped converging spillway modeling using the SPH method
.
Water
14
(
19
),
3103
.
Pahar
G.
&
Dhar
A.
2017
Robust boundary treatment for open-channel flows in divergence-free incompressible SPH
.
Journal of Hydrology
546
,
464
475
.
doi:10.1016/j.jhydrol.2017.01.034
.
Pan
B.
,
Hsu
K.
,
AghaKouchak
A.
&
Sorooshian
S.
2019
Improving precipitation estimation using convolutional neural network
.
Water Resources Research
55
(
3
),
2301
2321
.
Parsamehr
P.
,
Kuriqi
A.
,
Farsadizadeh
D.
,
Dalir
A. H.
,
Daneshfaraz
R.
&
Ferreira
R. M.
2022
Hydraulic jump over an adverse slope controlled by different roughness elements
.
Water Resources Management
36
(
14
),
5729
5749
.
Rajaratnam
N.
&
Subramanya
K.
1967
Flow equation for the sluice gate
.
Journal of the Irrigation and Drainage Division
93
(
3
),
167
186
.
Razavitoosi
S. L.
,
Ayyoubzadeh
S. A.
&
Valizadeh
A.
2014
Two-phase SPH modelling of waves caused by dam break over a movable bed
.
International Journal of Sediment Research
.
doi:10.1016/S1001-6279(14)60049-4
.
Sekar
V.
,
Jiang
Q.
,
Shu
C.
&
Khoo
B. C.
2019
Fast flow field prediction over airfoils using deep learning approach
.
Physics of Fluids
31
(
5
),
057103
.
Springel
V.
&
Hernquist
L.
2010
Cosmological smoothed particle hydrodynamics simulations: the entropy equation
.
Monthly Notices of the Royal Astronomical Society
333
(
3
),
649
664
.
Swamee
P. K.
1992
Sluice-gate discharge equations
.
Journal of Irrigation and Drainage Engineering
118
(
1
),
56
60
.
Tartakovsky
A. M.
,
Meakin
P.
,
Scheibe
T. D.
&
Wood
B. D.
2007
A smoothed particle hydrodynamics model for reactive transport and mineral precipitation in porous and fractured porous media
.
Water Resources Research
43
(
5
),
5437
.
Wu
C. L.
,
Chau
K. W.
&
Li
Y. S.
2009
Methods to improve neural network performance in daily flows prediction
.
Journal of Hydrology
372
(
1–4
),
80
93
.
Xiong
H.
,
Chen
L.
&
Lin
J.
2006
Smoothed particle hydrodynamics modeling of free surface flow
.
Journal of Hydrodynamics
18
(
S1
),
433
435
.
Yan
X.
&
Mohammadian
A.
2017
Numerical modeling of vertical buoyant jets subjected to lateral confinement
.
Journal of Hydraulic Engineering
143
(
7
),
04017016
.
Yan
X.
,
Mohammadian
A.
&
Rennie
C. D.
2020
Numerical modeling of flow and local scour around pipeline in steady currents using moving mesh with masked elements
.
Journal of Hydraulic Engineering
146
(
5
),
06020005
.
Yousif
A. A.
,
Sulaiman
S. O.
,
Diop
L.
,
Ehteram
M.
,
Shahid
S.
,
Al-Ansari
N.
&
Yaseen
Z. M.
2019
Open channel sluice gate scouring parameters prediction: different scenarios of dimensional and non-dimensional input parameters
.
Water
11
(
2
),
353
.
Zhang
Z.
,
Flora
K.
,
Kang
S.
,
Limaye
A. B.
&
Khosronejad
A.
2022
Data-Driven Prediction of Turbulent Flow Statistics Past Bridge Piers in Large-Scale Rivers Using Convolutional Neural Networks
.
Water Resources Research
58
(
1
),
e2021WR030163
.
Zhao
G.
,
Pang
B.
,
Xu
Z.
,
Peng
D.
&
Zuo
D.
2020a
Urban flood susceptibility assessment based on convolutional neural networks
.
Journal of Hydrology
590
,
125235
.
Zhao
Y.
,
Akolekar
H. D.
,
Weatheritt
J.
,
Michelassi
V.
&
Sandberg
R. D.
2020b
RANS turbulence model development using CFD-driven machine learning
.
Journal of Computational Physics
411
,
109413
.
Zhu
L.
,
Zhang
W.
,
Kou
J.
&
Liu
Y.
2019
Machine learning methods for turbulence modeling in subsonic flows around airfoils
.
Physics of Fluids
31
(
1
),
015105
.
Zubeldia
E. H.
,
Fourtakas
G.
,
Rogers
B. D.
&
Farias
M. M.
2018
Multi-phase SPH model for simulation of erosion and scouring by means of the shields and drucker–Prager criteria
.
Advances in Water Resources
117
,
98
114
.
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/).