Water distribution port local three-dimensional flow field prediction method, device, equipment, medium and program product
By constructing an XGBoost model and utilizing the physical parameter data of the local water distribution point, the three-dimensional flow field structure is predicted, which solves the problem of inaccurate acquisition of the local flow field structure of the water distribution point and improves the water conveyance efficiency and structural stability of the channel.
Patent Information
- Application Number
- CN202510946678.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-09
- Publication Date
- 2025-11-18
AI Technical Summary
Existing technologies cannot accurately obtain the local flow field structure at the water diversion point, leading to siltation and scouring, which affects the water conveyance efficiency and structural stability of the channel.
An XGBoost model was constructed using machine learning methods. By acquiring local physical parameter data of the water divider, a sample set was trained and the three-dimensional flow field structure, including longitudinal, transverse and vertical velocities, was predicted.
This improved the accuracy of obtaining the local flow field structure at the water distribution point, and enhanced the water conveyance efficiency and structural stability of the channel.
Smart Images

Figure CN120974174A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data processing technology, and in particular to methods, apparatus, equipment, media, and program products for predicting local three-dimensional flow fields at watersheds. Background Technology
[0002] As hydraulic structures connecting different canal systems within an irrigation district, water distribution inlets facilitate water transport between these channels, thus mitigating issues such as uneven water resource distribution to some extent. However, the presence of water distribution inlets alters the flow structure of the water body. Water from the main canal forms bends during the diversion process, leading to turbulent flow patterns in the local area of the water distribution inlet, resulting in phenomena such as vortices and backflows. This non-uniform velocity distribution in the water distribution inlet area causes siltation and scouring at the inlet gate, severely impacting the canal's water transport efficiency and structural stability. Therefore, to rationally regulate water resources in the irrigation district and address the siltation and scouring problem at water distribution inlets, it is necessary to explore the flow field architecture in the local area of the water distribution inlet to achieve precise water distribution and canal engineering safety.
[0003] However, due to inherent limitations such as the nonlinear characteristics of the flow field and the insufficient accuracy of measuring instruments, existing technologies cannot accurately obtain the local flow field structure at the water divider. Summary of the Invention
[0004] This invention provides a method, apparatus, equipment, medium, and program product for predicting the local three-dimensional flow field at a water divider, which solves the problem of low accuracy in obtaining the local flow field structure at a water divider in the prior art, and improves the accuracy of obtaining the local flow field structure at a water divider.
[0005] This invention provides a method for predicting the local three-dimensional flow field at a watershed, comprising: Obtain physical parameter data of the local area of the water diversion point to be predicted. The physical parameter data includes at least the main channel flow rate, diversion ratio, water depth and location of the local area of the water diversion point to be predicted in the channel where the water diversion point is located. The physical parameter data is input into the trained prediction model to obtain the three-dimensional flow field prediction result of the local area of the watershed to be predicted, which is output by the prediction model. The three-dimensional flow field prediction result includes longitudinal velocity, transverse velocity and vertical velocity. The prediction model is trained based on a sample set, and each training sample in the sample set includes sample physical parameter data and a three-dimensional flow field label corresponding to the sample physical parameter data.
[0006] According to the present invention, a method for predicting the local three-dimensional flow field at a watershed is provided, wherein the prediction model is the XGBoost model.
[0007] According to the present invention, a method for predicting the local three-dimensional flow field at a watershed is provided, wherein the training samples are obtained by filtering from the experimental dataset using a maximum difference algorithm.
[0008] According to the present invention, a method for predicting the local three-dimensional flow field at a watershed is provided. The prediction model includes a first prediction model, a second prediction model, and a third prediction model. The step of inputting the physical parameter data into the trained prediction model and obtaining the three-dimensional flow field prediction result of the watershed to be predicted output by the prediction model includes: The physical parameter data are respectively input into the first prediction model, the second prediction model, and the third prediction model; Obtain the longitudinal velocity output by the first prediction model, the transverse velocity output by the second prediction model, and the vertical velocity output by the third prediction model.
[0009] According to the present invention, a method for predicting the local three-dimensional flow field at a watershed is provided, wherein the sample set includes a training set and a test set. Before training the prediction model, the hyperparameters of the prediction model are determined based on the root mean square error index corresponding to the test set.
[0010] According to the present invention, a method for predicting the local three-dimensional flow field at a water distribution point is provided, wherein the physical parameter data further includes the water distribution point angle, the main channel width, and the side channel width.
[0011] The present invention also provides a device for predicting the local three-dimensional flow field at a water divider, comprising: The input data acquisition module is used to acquire physical parameter data of the local area of the water diversion point to be predicted. The physical parameter data includes at least the main channel flow rate, diversion ratio, water depth and location of the local area of the water diversion point to be predicted in the channel where the water diversion point is located. The model prediction module is used to input the physical parameter data into the trained prediction model and obtain the three-dimensional flow field prediction result of the local area of the watershed to be predicted output by the prediction model. The three-dimensional flow field prediction result includes longitudinal velocity, transverse velocity and vertical velocity. The prediction model is trained based on a sample set, and each training sample in the sample set includes sample physical parameter data and a three-dimensional flow field label corresponding to the sample physical parameter data.
[0012] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the local three-dimensional flow field prediction method for the watershed as described above.
[0013] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the local three-dimensional flow field prediction method for the watershed as described above.
[0014] The present invention also provides a computer program product, including a computer program that, when executed by a processor, implements the local three-dimensional flow field prediction method for the water divider as described above.
[0015] The present invention provides a method, apparatus, device, medium, and program product for predicting the local three-dimensional flow field at a watershed. The method includes: acquiring physical parameter data of the watershed area to be predicted, the physical parameter data including at least the main channel inflow, diversion ratio, water depth, and location of the watershed area; inputting the physical parameter data into a trained prediction model to obtain the three-dimensional flow field prediction result of the watershed area output by the prediction model, the three-dimensional flow field prediction result including longitudinal velocity, transverse velocity, and vertical velocity; wherein the prediction model is trained based on a sample set, and each training sample in the sample set includes sample physical parameter data and a corresponding three-dimensional flow field label.
[0016] In this way, by introducing machine learning methods into the prediction of the local three-dimensional flow field structure at the watershed, and by constructing a sample set that includes sample physical parameter data and the corresponding three-dimensional flow field labels, the accuracy of the results obtained from the local flow field structure at the watershed can be improved. Attached Figure Description
[0017] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0018] Figure 1 This is a flowchart illustrating the method for predicting the local three-dimensional flow field at the watershed provided by the present invention.
[0019] Figure 2 This is a schematic diagram of the experimental system layout in the local three-dimensional flow field prediction method for the watershed provided by the present invention.
[0020] Figure 3 This is a schematic diagram of the experimental measurement point layout scheme in the local three-dimensional flow field prediction method of the watershed provided by the present invention.
[0021] Figure 4This is a schematic diagram of model hyperparameter optimization in the local three-dimensional flow field prediction method at the watershed provided by the present invention.
[0022] Figure 5 This is a diagram showing the prediction results of longitudinal flow velocity in the local three-dimensional flow field prediction method for the watershed provided by this invention.
[0023] Figure 6 This is a diagram showing the prediction results of the transverse velocity in the local three-dimensional flow field prediction method at the watershed provided by this invention.
[0024] Figure 7 This is a diagram showing the prediction results of vertical flow velocity in the local three-dimensional flow field prediction method for the watershed provided by this invention.
[0025] Figure 8 This is a schematic diagram of the structure of the local three-dimensional flow field prediction device for the water divider provided by the present invention.
[0026] Figure 9 This is a schematic diagram of the structure of the electronic device provided by the present invention. Detailed Implementation
[0027] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.
[0028] It should be understood that, when used in this specification and the appended claims, the term "comprising" indicates the presence of the described features, integrals, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or collections thereof.
[0029] It should also be understood that the terminology used in this specification is for the purpose of describing particular embodiments only and is not intended to limit the invention. As used in this specification and the appended claims, the singular forms “a,” “an,” and “the” are intended to include the plural forms unless the context clearly indicates otherwise.
[0030] It should also be further understood that the term "and / or" as used in this specification and the appended claims refers to any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.
[0031] As used in this specification and the appended claims, the term "if" may be interpreted, depending on the context, as "when," "once," "in response to determination," or "in response to detection." Similarly, the phrases "if determined" or "if detected [the described condition or event]" may be interpreted, depending on the context, as meaning "once determined," "in response to determination," "once detected [the described condition or event]," or "in response to detection [the described condition or event]."
[0032] The following is combined Figures 1-6 This invention describes the method for predicting the local three-dimensional flow field at a watershed. For example... Figure 1 As shown, the method for predicting the local three-dimensional flow field at the water divider includes the following steps: S110. Obtain the physical parameter data of the local area of the water diversion point to be predicted. The physical parameter data shall include at least the main channel flow rate, diversion ratio, water depth and location of the local area of the water diversion point to be predicted. S120. Input the physical parameter data into the trained prediction model and obtain the three-dimensional flow field prediction results of the local area of the watershed to be predicted output by the prediction model. The three-dimensional flow field prediction results include longitudinal velocity, transverse velocity and vertical velocity. The prediction model is trained based on a sample set. Each training sample in the sample set includes sample physical parameter data and the corresponding three-dimensional flow field label.
[0033] The method provided by this invention introduces machine learning methods into the prediction of the local three-dimensional flow field structure at the watershed. By constructing a sample set including sample physical parameter data and the corresponding three-dimensional flow field labels, the construction and training of a data-driven model can be achieved, thereby improving the accuracy of the results obtained from the local flow field structure at the watershed.
[0034] The local area of the water diversion outlet is a part of the water diversion outlet region, for example... Figure 3 The region between cross-sections 04 and 05. The method provided by this invention constructs a sample set, trains a prediction model based on the sample set to obtain a prediction model, and uses the prediction model to predict the local three-dimensional flow field at the watershed.
[0035] Sample sets can be obtained through experiments. For example... Figure 2As shown, the experiment employed a circulating water tank system constructed from PVC glass panels, consisting of a main channel and side channels arranged orthogonally (with a 90° angle between their central axes), both with rectangular cross-sections. The main channel measures 13.25m (length) × 0.3m (width) × 0.4m (height), while the side channel, located 3m downstream of the main channel inlet, measures 2.45m (length) × 0.2m (width) × 0.4m (height). The experimental system mainly comprises a water supply tank, a variable frequency pump, the tank body, and a return water tank. To ensure adequate inflow, two sets of energy dissipation pipes of different specifications were installed at the main channel inlet to achieve uniform flow. During the experiment, the total system flow was adjusted using the variable frequency pump, and the lateral flow distribution ratio was controlled by the opening of the tailgate at the end of the main channel. Furthermore, water level gauges installed on the sidewalls of the tank allowed for real-time monitoring of water depth changes, ensuring that the flow stability met experimental requirements under various operating conditions.
[0036] In the experiment, an electromagnetic flowmeter was used to accurately measure the inflow rate (Q1) in the main channel, while an ultrasonic open channel flow meter was used to monitor the outflow rate (Q2) in the main channel. Based on the principle of mass conservation, the flow rate of the side channel (Q3) was calculated, i.e., Q3 = Q1 - Q2. Six typical operating conditions were set up in the experiment, and different combinations of flow rates and split ratios were formed by adjusting the system, as shown in Table 1, to comprehensively examine the hydraulic characteristics of the water splitting point.
[0037] Table 1
[0038] In the experiment, a high-density flow velocity measurement cross-sectional layout method was adopted, such as... Figure 3 As shown, 11 measurement cross-sections were set up in the main channel. Five cross-sections (5cm spacing) were set up in the area near the water diversion gate to accurately capture the complex flow structure in this area. Three cross-sections (10cm spacing) were set up in the upstream section, and six cross-sections were set up in the downstream section. Cross-sections 09, 10, and 11, closer to the water diversion gate, were spaced 10cm apart, while cross-sections 12, 13, and 14, farther from the water diversion gate, were spaced 30cm apart. Eight vertical lines were evenly distributed in each measurement cross-section, with a 3cm spacing near the water diversion gate and a 5cm spacing in other areas. To obtain a fine velocity distribution, all vertical lines were spaced with measuring points at 1cm intervals. This arrangement ensured measurement accuracy in key areas while also considering overall measurement efficiency.
[0039] Three-dimensional flow velocities were measured using an acoustic Doppler current meter (ADV) at a frequency of 200 Hz and a sampling time of 60 s, yielding 12,000 instantaneous flow velocity values at each measurement point. To minimize the influence of the probe on the flow velocity measurement, values with a signal-to-noise ratio greater than 15 and a correlation coefficient greater than 85% were selected for processing.
[0040] ADV measurements include three velocity components corresponding to three directions (x, y, z). u i , v i , w i The instantaneous values of ) are obtained. The filtered data are then averaged to obtain the corresponding time-averaged flow velocities (U, V, W): ; Where: i is the sampling sequence number, N is the total number of samples; U is the longitudinal velocity, V is the transverse velocity, and W is the vertical velocity.
[0041] When using a predictive model to predict the three-dimensional velocity distribution in the local area of a watershed, it is necessary to clearly define the independent and dependent variables, i.e., the input and output terms of the model. For the flow field structure of a channel containing a watershed, the longitudinal velocity U, as the most important velocity component in the flow field, directly affects the split ratio and the channel's water conveyance capacity. The transverse velocity V, as the velocity component perpendicular to the mainstream direction, is closely related to the formation of secondary flows and eddies, and has a significant impact on processes such as sediment deposition, pollutant transport, and energy loss in the channel. The vertical velocity W can promote the mixing of upper and lower water layers, affect the suspension and sedimentation of pollutants and sediment, and plays an important role in water mixing and energy distribution. Therefore, velocities U, V, and W are listed as output terms of the three-dimensional flow field structure in the local area of the watershed. In other words, the prediction results of the three-dimensional flow field in the local area of the watershed include the longitudinal, transverse, and vertical velocities of that area.
[0042] The inputs to the model need to select key factors that influence the three-dimensional velocity distribution. For channels with branch outlets, the main channel inflow (Q1), branch ratio (R), water depth (H), branch outlet angle (α), main channel width (B1), and side channel width (B2) all affect the velocity distribution. Furthermore, within the branch outlet structure, different locations (x, y, z) reflect spatial variations in velocity. The local location of the branch outlet can be determined by constructing a coordinate system with a fixed point (e.g., the center point of the branch outlet) as the origin.
[0043] In some potential application scenarios, the angle α of the water divider may always be 90°, and the widths of the main channel and the side channels may remain unchanged. In other words, these parameters will not change, and their impact on the local flow field at the water divider is constant. Therefore, these parameters can be removed during prediction. That is, the physical parameter data input to the trained prediction model only includes the inflow rate from the main channel of the channel where the water divider is located, the split ratio, the water depth, and the location of the local area of the water divider to be predicted. In other words, the three-dimensional velocity distribution in the local area of the water divider can be characterized by the following function: ; in, This represents the predictive model.
[0044] In some irrigation districts, the angle of the branch outlet varies, as do the widths of the main channel and the side channels. Therefore, the impact of these parameters on the local flow field at the branch outlet is variable, and these parameters need to be considered during prediction. Thus, in one possible implementation, the physical parameter data input to the trained prediction model includes not only the main channel inflow, branch ratio, water depth, and the location of the branch outlet, but also the branch outlet angle, main channel width, and side channel width. That is, the three-dimensional velocity distribution at the branch outlet can be characterized by the following function: .
[0045] In one possible implementation, different models can be used to predict the longitudinal velocity U, the transverse velocity V, and the vertical velocity W. Specifically, the prediction models include a first prediction model, a second prediction model, and a third prediction model. Physical parameter data are input into the trained prediction models to obtain the three-dimensional flow field prediction results of the watershed to be predicted, including: The physical parameter data are input into the first prediction model, the second prediction model, and the third prediction model, respectively. Obtain the longitudinal velocity output by the first prediction model, the transverse velocity output by the second prediction model, and the vertical velocity output by the third prediction model.
[0046] By setting corresponding prediction models for longitudinal, transverse, and vertical flow velocities, the relationships between these velocities and physical parameter data can be learned and predicted in a targeted manner, thereby improving the accuracy of the prediction results for the local three-dimensional flow field at the watershed.
[0047] In the method provided by this invention, the prediction model is the XGBoost model. XGBoost (Extreme Gradient Boosting), first proposed in 2011, is a learning framework based on the Boosting Tree model. Traditional Boosting Tree models only utilize the first derivative, using the residuals of the first n-1 trees when training the nth tree, making distributed training difficult. XGBoost, however, performs a second-order Taylor expansion of the loss function and employs multi-threading on the CPU for parallel computation. Furthermore, XGBoost uses various methods to avoid overfitting. A brief introduction to the XGBoost algorithm is as follows: Assuming the model has k decision trees, the ensemble model XGBoost can be represented as follows: ; Where: F is the set of regression trees, It is a regression tree in the set.
[0048] The main idea of this algorithm is that each update is based on the prediction results of the previous model. A new tree, f, is added to fit the residuals between the prediction results of the previous tree and the true values, forming a new model. This new model then serves as the basis for the next stage of model learning. ; in: This represents the prediction result for the t-th prediction. This represents the prediction result from the previous (t-1) timeframe. This represents the residual fit value of the newly added regression tree.
[0049] XGBoost aims to improve the predicted values. As close as possible to the true value y i Therefore, a large generalization ability is required. Mathematically speaking, this is a function optimization problem, so the objective function simplifies to: ; in: The error function (loss function) maximizes the fit of the samples by continuously learning the model in order to obtain the minimum variance between the prediction result and the prediction target. As a regularization term, the complexity of the tree is defined, and the stability of the model is increased by continuously simplifying the model using the following formula: ; Where: T represents the number of leaf nodes in the tree. These are the weighting coefficients; The weight function of the leaf nodes in the tree The square of the modulus, that is Regularization is used to avoid overfitting.
[0050] The training process of the prediction model is described below. Before training, a sample set needs to be constructed, divided into a training set and a test set. Training is performed using the training set, and the test set is used to test the performance of the prediction model. In one possible implementation, the training samples in the sample set are obtained from the experimental dataset using the Maximum Dissimilarity Algorithm (MDA). The experimental dataset is obtained by conducting experiments and collecting data based on the experimental settings described above. The Maximum Dissimilarity Algorithm (MDA) is a difference-based classification method. The goal of this method is to select a representative subset of size M from a dataset of size N. The data sample X = {x1, x2, ..., xn}, composed of N-dimensional vectors, is used to obtain a vector subset {k1, ..., km} representing data diversity. The subset is initialized by transferring a vector from the data sample {k1}. Iteratively, the remaining M-1 elements are selected, the difference between each remaining data point in the database and the elements in the subset is calculated, and the least dissimilar element is transferred to the subset. The process ends when the algorithm reaches M iterations. For the dataset obtained from the experiment, taking the longitudinal flow velocity U as an example, MDA was used to classify and filter the dataset, selecting 80% of the dataset as the training group and 20% as the test set.
[0051] Through the maximum difference method, Tables 2, 3, and 4 list the statistical characteristics of the sample sets used for the first, second, and third prediction models, respectively. Specifically, Table 2 shows the statistical characteristics of the longitudinal flow velocity data, Table 3 shows the statistical characteristics of the lateral flow velocity data, and Table 4 shows the statistical characteristics of the vertical flow velocity data. Since the training set is prioritized, both the maximum and minimum values belong to the training set. Therefore, the method provided by this invention, using the maximum difference method, can find data at the edge of the database, where the difference between data gradually decreases from the training set to the test set.
[0052] Table 2
[0053] Table 3
[0054] Table 4
[0055] Furthermore, in one possible implementation of the method provided by this invention, before training the prediction model, the original data in the sample set is normalized to a value between [0,1], thereby eliminating the difference in magnitude between data points, accelerating the convergence speed of the solution, and improving the accuracy of the model. The normalization process can be expressed by the formula: ; in, The normalized sample set; X The original sample set; X min It is the minimum value in the original sample set; X max This represents the maximum value in the original sample set.
[0056] To evaluate the performance of the prediction model, specifically its ability to predict the local velocity distribution at the watershed, the following metrics are introduced: correlation coefficient (R), mean absolute error (MAE), root mean square error (RMSE), and Nash efficiency coefficient (NSE). The formulas for calculating these metrics are shown below: ; ; ; ; in, These are the measured values, i.e., the labels corresponding to the training samples. This represents the average of the measured values. The predicted value, i.e., the result output by the model. is the average of the predicted values; N is the number of data points.
[0057] When developing and using XGBoost models, hyperparameters need to be determined to achieve optimal performance. Grid search and cross-validation are used to tune the hyperparameters, and the optimal performance is chosen based on the RMSE (Root Mean Square Error) on the test set. The hyperparameter values optimized in each step are kept constant in subsequent steps. In other words, the hyperparameters of the prediction model are determined based on the RMSE metric corresponding to the test set before training the prediction model.
[0058] The optimized values of each hyperparameter in each prediction model are explained below.
[0059] 1. n_estimators This parameter represents the number of iterations during training; a parameter that is too small... n_estimators This can lead to underfitting, preventing the model from fully utilizing its learning capabilities, while excessively large... n_estimators This can lead to overfitting. Changing the range (0, 2000] will cause this. n_estimators This parameter, changing which will have a significant impact on subsequent steps. For example... Figure 4 As shown in part (a), when n_estimators When the value exceeds a certain threshold, the decrease in RMSE becomes negligible. Considering both the RMSE value and the number of iterations, the appropriate RMSE value for different models is determined. n_estimators The values are shown in Table 5.
[0060] 2. min_child_weightThis parameter defines the sum of sample weights for the smallest leaf node to prevent overfitting. A larger value can prevent the model from learning local special samples. An excessively high value can lead to underfitting. It can be changed within the range [0, 100]. min_child_weight Parameters. For example... Figure 4 As shown in section (b), when min_child_weight When the value exceeds a certain threshold, the RMSE value begins to increase. The values of this parameter in different models are determined by comprehensive consideration, as shown in Table 5.
[0061] 3. max_depth This parameter represents the maximum depth of the tree. A deeper tree results in a more complex tree model and a stronger fitting ability, but it also makes the model more prone to overfitting. It can be changed within the range [1, 50]. max_depth Parameters. For example... Figure 4 As shown in section (c), when max_depth When the value exceeds a certain threshold, the decrease in RMSE value becomes negligible. The values of this parameter in different models are determined by comprehensive consideration and are shown in Table 5. A maximum depth of 10 indicates that the model can have a maximum of 10 decision nodes to capture more complex relationships between features without the risk of overfitting.
[0062] 4. colsample_bytree This parameter represents the feature sampling rate for generating new trees, used to control the proportion of columns randomly sampled for each tree. It controls the feature extraction ratio for each tree, reducing the risk of overfitting. It can be changed within the range (0,1]. colsample_bytre The e parameter. For example... Figure 4 As shown in section (d), with colsample_bytre As the value of e increases, the RMSE value decreases. Taking all factors into account, the value of this parameter in different models is determined as shown in Table 5.
[0063] 5. subsample This parameter represents the sampling rate for all training samples. Decreasing this parameter can prevent the model from overfitting, but a value that is too small may lead to underfitting. It can be changed within the range (0,1]. subsample Parameters. For example... Figure 4 As shown in section (e), with subsample As the value of increases, the RMSE value decreases. subsample When the value exceeds a certain threshold, the RMSE value actually increases. The values of this parameter in different models are determined by comprehensive consideration and are shown in Table 5.
[0064] 6. learning_rate This parameter represents the learning rate. Reducing the weights at each step improves the model's robustness. It can be changed within the range [0,1]. learning_rate Parameters. For example... Figure 4 As shown in section (f), with learning rateAs the value of increases, the RMSE value decreases. learning_rate When the value exceeds a certain threshold, the change in RMSE becomes negligible. The values for this parameter in different models are determined by comprehensive consideration, as shown in Table 5. A learning rate of no more than 0.2 means that each new tree added to the model will contribute less than 20% to the final prediction. This value is generally considered a good starting point, striking a balance between training speed and model accuracy. A learning rate that is too low may lead to slow training, while a learning rate that is too high may lead to overfitting.
[0065] Table 5
[0066] Furthermore, to reflect the performance of the prediction model in the method provided by this invention, the measured values of flow velocities U (m / s), V (m / s), and W (m / s) were analyzed and compared with the model's predicted values. The results are as follows: Figure 5 , Figure 6 and Figure 7 As shown in the figure. The vertical and horizontal axes represent the predicted and measured values of the longitudinal velocity U (m / s), transverse velocity V (m / s), and vertical velocity W (m / s) at the watershed, respectively. Figure 5 Corresponding to longitudinal flow velocity, Figure 6 Corresponding to the lateral flow velocity, Figure 7 Corresponding vertical flow velocity.
[0067] The fitted line is represented by the linear equation y = C1x + C2. If the values of C1 and C2 are close to 0 and 1 respectively, it indicates that the model has good accuracy. Furthermore, if the fitted line is to the left of the 1:1 line, it indicates that the model overestimates the measured values; if the fitted line is to the right of the 1:1 line, it indicates that the model underestimates the measured values.
[0068] comprehensive R 2 As can be seen from the fitted curves, the XGBoost model exhibits good prediction performance for the local three-dimensional flow field structure prediction at the watershed. Specifically, for the prediction of longitudinal velocity U (m / s), the R² of the training set is 0.999, and the R² of the test set is 0.990; for the prediction of transverse velocity V (m / s), the R² of the training set is 0.991, and the R² of the test set is 0.985; for the prediction of vertical velocity W (m / s), the R² of the training set is 0.995, and the R² of the test set is 0.878. Different error indices were used to evaluate different models. Error analysis is shown in Table 6.
[0069] Table 6
[0070] Error analysis shows that the XGBoost-based prediction model in the method provided by this invention exhibits good performance on both the training and test datasets. For the prediction of longitudinal flow velocity U (m / s), the R, MAE, RMSE, and NSE values on the test set are 0.995, 0.0096, 0.0166, and 0.990, respectively. For the prediction of longitudinal flow velocity V (m / s), the R, MAE, RMSE, and NSE values on the test set are 0.992, 0.0029, 0.0047, and 0.985, respectively. For the prediction of longitudinal flow velocity W (m / s), the R, MAE, RMSE, and NSE values on the test set are 0.937, 0.0083, 0.0244, and 0.872, respectively. Based on the results obtained, it can be concluded that the method provided by the present invention, based on the XGBoost prediction model, has good prediction capabilities and can also provide good prediction values for predicting the complex three-dimensional flow field structure in the local area of the watershed, which can effectively improve the accuracy of the results of obtaining the local three-dimensional flow field structure in the watershed.
[0071] The following describes the local three-dimensional flow field prediction device for the watershed area provided by this invention. The local three-dimensional flow field prediction device for the watershed area described below can be referred to in correspondence with the local three-dimensional flow field prediction method for the watershed area described above. Figure 8 As shown, the local three-dimensional flow field prediction device for a watershed provided by the present invention includes an input data acquisition module 810 and a model prediction module 820. Wherein: The input data acquisition module 810 is used to acquire the physical parameter data of the local area of the water diversion point to be predicted. The physical parameter data includes at least the main channel flow rate, diversion ratio, water depth and location of the local area of the water diversion point to be predicted. The model prediction module 820 is used to input physical parameter data into the trained prediction model and obtain the three-dimensional flow field prediction results of the local area of the watershed to be predicted output by the prediction model. The three-dimensional flow field prediction results include longitudinal velocity, transverse velocity and vertical velocity. The prediction model is trained based on a sample set. Each training sample in the sample set includes sample physical parameter data and the corresponding three-dimensional flow field label.
[0072] Figure 9 An example is a schematic diagram of the physical structure of an electronic device, such as... Figure 9As shown, the electronic device may include: a processor 910, a communication interface 920, a memory 930, and a communication bus 940. The processor 910, communication interface 920, and memory 930 communicate with each other via the communication bus 940. The processor 910 can call logical instructions in the memory 930 to execute a method for predicting the local three-dimensional flow field of a watershed. This method includes: acquiring physical parameter data of the watershed area to be predicted, including at least the main channel inflow, splitting ratio, water depth, and location of the watershed area; inputting the physical parameter data into a trained prediction model to obtain the three-dimensional flow field prediction result of the watershed area output by the prediction model, including longitudinal velocity, transverse velocity, and vertical velocity; wherein the prediction model is trained based on a sample set, and each training sample in the sample set includes sample physical parameter data and a corresponding three-dimensional flow field label.
[0073] Furthermore, the logical instructions in the aforementioned memory 930 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0074] On the other hand, the present invention also provides a computer program product, which includes a computer program that can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the local three-dimensional flow field prediction method for the watershed area provided by the above methods. The local three-dimensional flow field prediction method for the watershed area includes: acquiring physical parameter data of the watershed area to be predicted, the physical parameter data including at least the main channel inflow, split ratio, water depth, and location of the watershed area to be predicted; inputting the physical parameter data into a trained prediction model, and obtaining the three-dimensional flow field prediction result of the watershed area to be predicted output by the prediction model, the three-dimensional flow field prediction result including longitudinal velocity, transverse velocity, and vertical velocity; wherein, the prediction model is trained based on a sample set, and each training sample in the sample set includes sample physical parameter data and a three-dimensional flow field label corresponding to the sample physical parameter data.
[0075] In another aspect, the present invention also provides a non-transitory computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the method for predicting the local three-dimensional flow field of a watershed area provided by the methods described above. This method for predicting the local three-dimensional flow field of a watershed area includes: acquiring physical parameter data of the watershed area to be predicted, the physical parameter data including at least the main channel inflow, split ratio, water depth, and location of the watershed area to be predicted; inputting the physical parameter data into a trained prediction model, and obtaining the three-dimensional flow field prediction result of the watershed area to be predicted output by the prediction model, the three-dimensional flow field prediction result including longitudinal velocity, transverse velocity, and vertical velocity; wherein the prediction model is trained based on a sample set, and each training sample in the sample set includes sample physical parameter data and a three-dimensional flow field label corresponding to the sample physical parameter data.
[0076] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.
[0077] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.
[0078] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for predicting the local three-dimensional flow field at a watershed, characterized in that, include: Obtain physical parameter data of the local area of the water diversion point to be predicted. The physical parameter data includes at least the main channel flow rate, diversion ratio, water depth and location of the local area of the water diversion point to be predicted in the channel where the water diversion point is located. The physical parameter data is input into the trained prediction model to obtain the three-dimensional flow field prediction result of the local area of the watershed to be predicted, which is output by the prediction model. The three-dimensional flow field prediction result includes longitudinal velocity, transverse velocity and vertical velocity. The prediction model is trained based on a sample set, and each training sample in the sample set includes sample physical parameter data and a three-dimensional flow field label corresponding to the sample physical parameter data.
2. The method for predicting the local three-dimensional flow field at the watershed according to claim 1, characterized in that, The prediction model is the XGBoost model.
3. The method for predicting the local three-dimensional flow field at the watershed according to claim 1, characterized in that, The training samples were obtained by filtering from the experimental dataset using the maximum difference algorithm.
4. The method for predicting the local three-dimensional flow field at the watershed according to claim 2, characterized in that, The prediction model includes a first prediction model, a second prediction model, and a third prediction model; the step of inputting the physical parameter data into the trained prediction model and obtaining the three-dimensional flow field prediction result of the watershed to be predicted output by the prediction model includes: The physical parameter data are respectively input into the first prediction model, the second prediction model, and the third prediction model; Obtain the longitudinal velocity output by the first prediction model, the transverse velocity output by the second prediction model, and the vertical velocity output by the third prediction model.
5. The method for predicting the local three-dimensional flow field at the watershed according to claim 4, characterized in that, The sample set includes a training set and a test set. Before training the prediction model, the hyperparameters of the prediction model are determined based on the root mean square error index corresponding to the test set.
6. The method for predicting the local three-dimensional flow field at the watershed according to claim 1, characterized in that... The physical parameter data also includes the angle of the water outlet, the width of the main channel, and the width of the side channel.
7. A device for predicting the local three-dimensional flow field at a water divider, characterized in that, include: The input data acquisition module is used to acquire physical parameter data of the local area of the water diversion point to be predicted. The physical parameter data includes at least the main channel flow rate, diversion ratio, water depth and location of the local area of the water diversion point to be predicted in the channel where the water diversion point is located. The model prediction module is used to input the physical parameter data into the trained prediction model and obtain the three-dimensional flow field prediction result of the local area of the watershed to be predicted output by the prediction model. The three-dimensional flow field prediction result includes longitudinal velocity, transverse velocity and vertical velocity. The prediction model is trained based on a sample set, and each training sample in the sample set includes sample physical parameter data and a three-dimensional flow field label corresponding to the sample physical parameter data.
8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that, When the processor executes the computer program, it implements the local three-dimensional flow field prediction method for the watershed as described in any one of claims 1 to 6.
9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the local three-dimensional flow field prediction method for the watershed as described in any one of claims 1 to 6.
10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the local three-dimensional flow field prediction method for the watershed as described in any one of claims 1 to 6.