A butterfly valve flow characteristic determination method based on opening correction coefficient and bayesian optimization and related device
Patent Information
- Application Number
- CN202610641778.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-05-11
- Publication Date
- 2026-08-18
AI Technical Summary
[0005]本发明的目的在于克服上述现有技术的缺点,提供一种基于开度修正系数与贝叶斯优化的蝶阀流量特性确定方法和相关装置,以解决流量系数建模方法中物理可解释性弱、模型优化效率低的技术问题
本发明公开了一种基于开度修正系数与贝叶斯优化的蝶阀流量特性确定方法,其核心步骤包括:将采集的参数首先通过开度修正系数预测模型获得预测开度修正系数,进而通过流量系数修正公式计算等效流量系数;最终将此等效流量系数输入理论流量模型,实现高精度的蝶阀流量计算,对理论模型进行非线性、多变量耦合的动态修正。本发明通过构造物理意义明确的开度修正系数作为统一表征机械传动误差与流体动力学误差的中间变量,将试验中蝶阀实际开度映射至等效开度,使得在该等效开度下理论流量计算值与试验质量流量值一致。该中间变量直接与阀门核心状态参数(开度)的物理偏差相关联,克服了现有技术中直接建模“流量系数偏差”导致的物理意义模糊、模型可解释性差的缺陷。该方法的开度修正系数预测模型了融合了随机森林回归预测模型与贝叶斯优化的方法对蝶阀流量特性计算,提高蝶阀流量特性模型的精度;过程中采用贝叶斯优化算法对所述随机森林回归预测模型的超参数进行自动化调优,提升了模型参数的优化速度和训练效率,采用十折交叉验证对随机森林回归预测模型训练结果的决定系数R2进行评价,提高了开度修正系数K值预测模型的准确性;解决工程中复杂工况下蝶阀流量计算难题,以及由于阀门内部复杂流动导致的理论流量模型计算精度不足的问题,经试验验证,本发明方法获得的等效流量系数最大相对误差由60%下降到13%。本发明有助于提高航空发动机空中飞行高度模拟的准确性,可有效满足试验舱蝶阀流量的准确计算的要求。
Smart Images

Figure CN122595789A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of fluid control and valve characteristic identification technology, specifically relating to a method and related apparatus for determining the flow characteristics of a butterfly valve based on an opening correction coefficient and Bayesian optimization. Background Technology
[0002] In aero-engine in-flight environment simulation tests, the butterfly valve is a core actuator for precisely regulating exhaust flow and simulating different flight altitudes. Its flow characteristics are usually characterized by a flow coefficient, and the accuracy of this coefficient directly determines the accuracy of system flow calculations, affecting the precision of altitude conditions.
[0003] Currently, engineering applications primarily rely on theoretical formulas based on the assumption of isentropic flow of ideal gases to calculate this coefficient. However, under actual rapid transient conditions, two main sources of error exist: firstly, mechanical transmission errors, where deformation and clearance of the hydraulic actuator cause the actual opening of the butterfly valve to be systematically higher than the theoretical design opening (with a maximum difference of up to 2.94°); secondly, fluid dynamic errors, where viscous losses, boundary layer separation, and non-isentropic effects such as shock waves in actual flow cause the flow coefficient calculated by the theoretical model to be systematically higher than the experimental value, with a relative deviation of up to 60% at small openings. These complex and nonlinear errors render traditional theoretical models inadequate for high-precision simulations.
[0004] To improve accuracy, existing technologies typically employ data-driven methods, such as directly fitting the deviation between theoretical and experimental values using machine learning algorithms. However, these methods have significant limitations: First, directly modeling the "flow coefficient deviation" has a relatively vague physical meaning and fails to directly correlate it with the physical deviation of the valve's core state parameter (opening degree), resulting in poor model interpretability. Second, the performance of machine learning models such as random forests is highly dependent on hyperparameter settings; traditional grid search or empirical methods for parameter tuning are inefficient and struggle to obtain the global optimum, limiting further improvements in model accuracy. Summary of the Invention
[0005] The purpose of this invention is to overcome the shortcomings of the prior art and provide a method and related apparatus for determining the flow characteristics of a butterfly valve based on an opening correction coefficient and Bayesian optimization, thereby solving the technical problems of weak physical interpretability and low model optimization efficiency in flow coefficient modeling methods. This method constructs a physically meaningful "opening correction coefficient K" as an intermediate variable to uniformly characterize the deviation between mechanical and flow physics, and uses a Bayesian optimization algorithm to achieve automatic global optimization of the hyperparameters of the random forest model, thus establishing a high-precision, highly interpretable, and highly efficient flow characteristic prediction model.
[0006] To achieve the above objectives, the present invention employs the following technical solution: A method for determining the flow characteristics of a butterfly valve based on an opening correction coefficient and Bayesian optimization includes the following steps: S1, Collect independent variable parameters, including the actual opening degree of the butterfly valve, the static pressure before the valve, the temperature before the valve, the static pressure after the valve, and the mass flow rate; S2, input the independent variable parameters into the opening correction coefficient K value prediction model to obtain the opening correction coefficient, which is a proportional factor that maps the actual opening of the butterfly valve in the experiment to the equivalent opening. The opening correction coefficient K value prediction model is a random forest regression prediction model. During the training process of the random forest regression prediction model, the hyperparameters are tuned by Bayesian optimization algorithm, and the model training results are evaluated by the coefficient of determination of ten-fold cross-validation. S3, Substitute the opening correction coefficient into the flow coefficient correction formula to obtain the equivalent flow coefficient; S4. Input the equivalent flow coefficient into the butterfly valve theoretical flow characteristic calculation formula to obtain the butterfly valve flow rate.
[0007] A further improvement of the present invention is that: Preferably, in S2, the training process of the opening correction coefficient K value prediction model is as follows: S21, Obtain the dataset of independent variable parameters of the butterfly valve's historical operating conditions. The dataset of independent variable parameters includes the actual opening degree of the butterfly valve, the static pressure before the valve, the temperature before the valve, the static pressure after the valve, and the mass flow rate. S22, Substitute the independent variable parameters in the independent variable parameter dataset into the butterfly valve flow calculation formula, and calculate the theoretical opening degree of the butterfly valve corresponding to the mass flow rate; S23, For each set of historical operating condition data, calculate the opening correction coefficient for the actual opening degree of the butterfly valve and the theoretical opening degree. Under the equivalent opening degree, the theoretical flow rate is equal to the test mass flow rate. S24. Using the independent variable parameter as the independent variable and the butterfly valve opening correction coefficient as the dependent variable, a random forest regression prediction model is constructed. S25. A random forest regression prediction model is trained using the dataset of independent variable parameters and the corresponding opening correction coefficients. During the training process, the hyperparameters of the random forest regression prediction model are tuned using the Bayesian optimization algorithm, and the model training results are evaluated using the coefficient of determination of 10-fold cross-validation to obtain the opening correction coefficient prediction model.
[0008] Preferably, in S2, the centralized data of the independent variable parameters of the historical operating conditions covers the complete operating range of the butterfly valve from low opening to high opening, as well as different pressure ratio operating conditions.
[0009] Preferably, in S2, the formula for calculating the opening correction coefficient is: The formula for correcting the flow coefficient is: (2) in, This represents the actual opening degree of the butterfly valve. K represents the equivalent opening, and K is the opening correction factor.
[0010] Preferably, the independent variable parameters in the independent variable parameter dataset are subjected to multicollinearity processing before training.
[0011] Preferably, in the random forest regression prediction model, the number of decision trees is 10-20, the maximum depth of a single decision tree is 1-20, the maximum feature ratio when a node splits is 0.1-1.0, and the minimum number of samples for internal node splits is 2-20.
[0012] Preferably, the formula for calculating the theoretical flow characteristics of the butterfly valve is: (3) In the formula, The mass flow rate is the transient (at different times), expressed in kg / s. is the flow contraction coefficient, which is a fixed value for any butterfly valve; This is the relative flow area, a fixed value for any given butterfly valve; The pressure ratio is k1; the gas adiabatic index is k1; and the effective flow area is A0 (m²). 2 ρ1 is the air density upstream of the flow channel, kg / m³. 3 P1 is the static pressure upstream of the flow channel, Pa; P2 is the static pressure downstream of the flow channel, Pa. The following equation in formula (3) is defined as the flow coefficient of the butterfly valve. ,Right now: (4).
[0013] A device for determining the flow characteristics of a butterfly valve based on an opening correction coefficient and Bayesian optimization, comprising: The data acquisition module collects independent variable parameters, including the actual opening degree of the butterfly valve, the static pressure before the valve, the temperature before the valve, the static pressure after the valve, and the mass flow rate. The correction coefficient module inputs the independent variable parameters into the opening correction coefficient K value prediction model to obtain the opening correction coefficient, which is a proportional factor that maps the actual opening of the butterfly valve in the experiment to the equivalent opening. The opening correction coefficient K value prediction model is a random forest regression prediction model. During the training process of the random forest regression prediction model, the hyperparameters are tuned by Bayesian optimization algorithm, and the model training results are evaluated by the coefficient of determination of ten-fold cross-validation. The equivalent flow coefficient module substitutes the opening correction coefficient into the flow coefficient correction formula to obtain the equivalent flow coefficient; The butterfly valve flow module inputs the equivalent flow coefficient into the butterfly valve theoretical flow characteristic calculation formula to obtain the butterfly valve flow rate.
[0014] A computer device includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the computer program, implements the butterfly valve flow characteristic determination method based on opening correction coefficient and Bayesian optimization as described above.
[0015] A computer-readable storage medium storing a computer program that, when executed by a processor, implements the butterfly valve flow characteristic determination method based on opening correction coefficient and Bayesian optimization as described in any of the preceding claims.
[0016] Compared with the prior art, the present invention has the following beneficial effects: This invention discloses a method for determining the flow characteristics of a butterfly valve based on an opening correction coefficient and Bayesian optimization. The core steps include: first, obtaining a predicted opening correction coefficient from the collected parameters using an opening correction coefficient prediction model; then, calculating the equivalent flow coefficient using a flow coefficient correction formula; finally, inputting this equivalent flow coefficient into a theoretical flow model to achieve high-precision butterfly valve flow calculation and dynamically correcting the theoretical model using nonlinear, multivariable coupling. This invention constructs a physically meaningful opening correction coefficient as an intermediate variable to uniformly characterize mechanical transmission errors and fluid dynamic errors, mapping the actual butterfly valve opening in the experiment to an equivalent opening, ensuring that the theoretical flow calculation value and the experimental mass flow value are consistent under this equivalent opening. This intermediate variable is directly related to the physical deviation of the valve's core state parameter (opening), overcoming the shortcomings of existing technologies that directly model "flow coefficient deviation," resulting in ambiguous physical meaning and poor model interpretability. This method's opening correction coefficient prediction model integrates a random forest regression prediction model and a Bayesian optimization method to calculate the flow characteristics of butterfly valves, improving the accuracy of the butterfly valve flow characteristic model. During the process, a Bayesian optimization algorithm is used to automatically tune the hyperparameters of the random forest regression prediction model, improving the optimization speed and training efficiency. Ten-fold cross-validation is used to evaluate the coefficient of determination R0 of the training results of the random forest regression prediction model. 2The evaluation improved the accuracy of the opening correction coefficient K-value prediction model; it solved the problem of butterfly valve flow calculation under complex working conditions in engineering, and the problem of insufficient accuracy of theoretical flow model calculation due to complex internal flow of the valve. Experimental verification showed that the maximum relative error of the equivalent flow coefficient obtained by the method of this invention decreased from 60% to 13%. This invention helps improve the accuracy of flight altitude simulation of aero-engines and can effectively meet the requirements for accurate calculation of butterfly valve flow in test cabins.
[0017] Furthermore, by comparing the actual opening degree of the butterfly valve with the theoretical opening degree in historical operating data, a sample of the opening degree correction coefficient K is obtained, which improves the correlation between the theoretical model and actual engineering and enhances the interpretability of the model.
[0018] Furthermore, during the training process, the opening correction coefficient prediction model first acquires historical operating data of the butterfly valve under different opening degrees and pressure ratios. Secondly, based on the butterfly valve flow calculation formula, the theoretical opening degree corresponding to the actual flow rate is calculated, and the opening correction coefficient K is calculated accordingly. Then, using the actual butterfly valve opening degree, upstream / downstream pressure, temperature, and actual flow rate as independent variables, and the opening correction coefficient K as the dependent variable, a random forest regression prediction model is constructed after multicollinearity testing. Furthermore, a Bayesian optimization algorithm is used to automatically tune the model's hyperparameters, and the coefficient of determination R² of ten-fold cross-validation is used as the evaluation index to obtain a high-precision opening correction coefficient prediction model with strong generalization ability.
[0019] Furthermore, in this process, the actual opening degree of the butterfly valve, the upstream pressure P1, the upstream temperature T, the downstream pressure P2, and the experimental mass flow rate Q are used as independent variables, and the butterfly valve opening correction coefficient K is used as the dependent variable. This random forest regression prediction model has the ability to model the nonlinear coupling relationship between multiple variables. It can establish a high-precision prediction model across the entire operating condition range with relatively low data cost, significantly improving the modeling accuracy of the valve under complex dynamic operating conditions, while ensuring the interpretability and engineering applicability of the model. By using a data-driven approach to dynamically correct the nonlinear, multivariate coupling of the theoretical model, the accuracy and reliability of the butterfly valve flow characteristic calculation across the entire operating condition range are significantly improved. Attached Figure Description
[0020] Figure 1 This is a schematic diagram illustrating the calculation principle of the flow characteristics of a butterfly valve based on the opening correction coefficient and Bayesian optimization. Figure 2 A comparison chart of theoretical and experimental values of valve opening; Figure 3 A ranking chart of the importance of features affecting the flow coefficient; Figure 4 The graph shows the predicted flow coefficient and error curves under different opening degrees. Detailed Implementation
[0021] Hereinafter, the terms "first," "second," "third," and "fourth" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Therefore, a feature defined as "first," "second," "third," or "fourth" may explicitly or implicitly include one or more of that feature.
[0022] The method provided in this application can be applied to mobile phones, tablets, wearable devices, in-vehicle devices, augmented reality (AR) / virtual reality (VR) devices, laptops, and ultra-mobile personal computers. In this application, the specific type of terminal device is not limited to terminal devices such as mobile personal computers (UMPCs), netbooks, and personal digital assistants (PDAs).
[0023] It should be noted that the terms "first," "second," etc., used in the specification and drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0024] The first aspect of this invention discloses a method for determining the flow characteristics of a butterfly valve based on an opening correction coefficient and Bayesian optimization. The method includes the following steps: S1, Collect independent variable parameters, including the actual opening degree of the butterfly valve, the static pressure before the valve, the temperature before the valve, the static pressure after the valve, and the mass flow rate; S2, input the independent variable parameters into the opening correction coefficient K value prediction model to obtain the opening correction coefficient, which is a proportional factor that maps the actual opening of the butterfly valve in the experiment to the equivalent opening. The opening correction coefficient K value prediction model is a random forest regression prediction model. During the training process of the random forest regression prediction model, the hyperparameters are tuned by Bayesian optimization algorithm, and the model training results are evaluated by the coefficient of determination of ten-fold cross-validation. S3, Substitute the opening correction coefficient into the flow coefficient correction formula to obtain the equivalent flow coefficient; S4. Input the equivalent flow coefficient into the butterfly valve theoretical flow characteristic calculation formula to obtain the butterfly valve flow rate.
[0025] In some embodiments of the present invention, in S2, the expression for the random forest regression prediction model is: (1) in, P1 is the actual opening degree of the butterfly valve, T is the inlet static pressure, P2 is the outlet static pressure, and Q is the test mass flow rate. All of the above parameters are used as independent variables, and the butterfly valve opening correction coefficient K is the dependent variable.
[0026] In some embodiments of the present invention, in step S3, the predicted opening correction coefficient K is substituted into the flow coefficient correction formula to obtain the equivalent flow coefficient. .
[0027] The formula for correcting the flow coefficient is: (2) In the formula, the equivalent flow coefficient is obtained. With the test mass flow coefficient The relationship between them.
[0028] In some embodiments of the present invention, in S4, the equivalent flow coefficient is... As input parameters, the preset theoretical flow characteristic formula of the butterfly valve is updated to calculate the butterfly valve flow rate with high precision. The theoretical flow rate calculation formula for the butterfly valve is shown in equation (3) below. During the update, the... Substitute it into equation (4).
[0029] (3) In the formula, The mass flow rate is the transient (at different times), expressed in kg / s. The flow contraction coefficient is the ratio of the minimum cross-sectional area of the flow contraction to the effective flow area of the butterfly valve. When a specific butterfly valve is selected, it is a characteristic value of the butterfly valve itself and is a fixed value for any given butterfly valve. The relative flow area is a characteristic value of the specific butterfly valve when it is determined. It is a fixed value for any given butterfly valve. The pressure ratio is the ratio of downstream static pressure P2 to upstream static pressure P1; k1 is the gas adiabatic index; A0 is the effective flow area, in meters. 2 ρ1 is the air density upstream of the flow channel, kg / m³. 3 P1 is the static pressure upstream of the flow channel, Pa; P2 is the static pressure downstream of the flow channel, Pa. Let the flow coefficient of the butterfly valve be ,Right now: (4) In some embodiments of the present invention, the training process of the random forest regression prediction model is as follows: S21, Obtain the historical operating condition dataset of the butterfly valve during the test. The dataset includes the actual opening degree of the butterfly valve. The data should cover the opening range from low to high and different pressure ratio conditions, including inlet static pressure P1, inlet temperature T, outlet static pressure P2, and mass flow rate Q.
[0030] In a specific example, the historical operating data should cover the complete operating range of the butterfly valve from low to high opening (e.g., 0°~60° or 0°~90°) and different pressure ratio conditions (pressure ratio Pr = P2 / P1 in the range of 0.1~0.95) to ensure that the subsequent model has good generalization ability across the entire operating range.
[0031] S22, based on the pre-valve static pressure P1, pre-valve temperature T, post-valve static pressure P2, and mass flow rate Q in the historical operating condition dataset, substitute them into the butterfly valve flow calculation formula (3), where the mass flow rate Q is used as q in the above formula. m Obtain the theoretical opening degree of the butterfly valve corresponding to the mass flow rate Q. .
[0032] The formula for calculating the flow rate of a butterfly valve is as follows: (3) In the formula, The mass flow rate is the transient (at different times), expressed in kg / s. The flow contraction coefficient is the ratio of the minimum cross-sectional area of the flow contraction to the effective flow area of the butterfly valve. When a specific butterfly valve is selected, it is a characteristic value of the butterfly valve itself and is a fixed value for any given butterfly valve. The relative flow area is the ratio of the effective flow area of the butterfly valve to the cross-sectional area of the flow channel. It is determined by the valve's geometry and is a characteristic value of the specific butterfly valve when it is confirmed. It is a fixed value for any given butterfly valve. The pressure ratio is the ratio of downstream static pressure P2 to upstream static pressure P1; k1 is the gas adiabatic index; A0 is the effective flow area, in meters. 2 ρ1 is the air density upstream of the flow channel, kg / m³. 3 P1 is the static pressure upstream of the flow channel, in Pa; P2 is the static pressure downstream of the flow channel, in Pa.
[0033] Let the flow coefficient of the butterfly valve be ,Right now: (4) The formula for calculating the effective circulation area A0 is: (5) In the formula, d is the angle between the valve disc and the cross-section, i.e., the theoretical opening of the butterfly valve, in °; d is the inner diameter of the pipe, i.e., the diameter of the butterfly valve, in m.
[0034] S23, Sample Construction of Opening Correction Coefficient: For each set of historical operating data, the actual opening of the butterfly valve is... With theoretical opening Calculate a sample value of an opening correction factor K. The opening correction factor K is defined as: the actual opening degree of the butterfly valve during the experiment. Mapped to an equivalent opening The scaling factor, the equivalent opening value The theoretical flow rate calculated is consistent with the actual experimental mass flow rate.
[0035] In step S23, the opening correction coefficient is defined as the actual opening of the butterfly valve during the test. Mapped to an equivalent opening The scaling factor is calculated using the following formula: (6) in, This represents the actual opening degree of the butterfly valve. The equivalent opening is given by K, which is the opening correction coefficient. When K > 1, it means that the equivalent opening is greater than the actual opening; when K < 1, it means that the actual opening is greater than the equivalent opening.
[0036] S24, the actual opening degree of the butterfly valve Using the inlet pressure P1, inlet temperature T, outlet pressure P2, and test mass flow rate Q as independent variables, and the butterfly valve opening correction coefficient K as the dependent variable, a random forest regression prediction model is constructed after multicollinearity testing. The expression of the random forest regression prediction model is as follows: (1) in, P1 is the actual opening degree of the butterfly valve, T is the inlet static pressure, P2 is the outlet static pressure, and Q is the test mass flow rate. All of the above parameters are used as independent variables, and the butterfly valve opening correction coefficient K is the dependent variable.
[0037] Specifically, the multicollinearity test process involves performing a multicollinearity test on the actual butterfly valve opening, upstream static pressure, downstream static pressure, upstream temperature, and test mass flow rate for each data set. This is achieved by calculating the correlation coefficient (R0). 2The tolerance (1-R²) is obtained by calculating the variance inflation factor (VIF). A smaller Variance Inflation Factor (VIF) indicates a lower tolerance and more severe multicollinearity. Therefore, before inputting the data into the model, the independent and dependent variable data should be tested for multicollinearity. The Variance Inflation Factor (VIF) is equal to the reciprocal of the tolerance, i.e.: (7) When VIF>10, there is severe multicollinearity, and variables should be removed to avoid affecting the random forest model in evaluating variable importance and simulation.
[0038] S25, the hyperparameters of the random forest regression prediction model are automatically tuned using a Bayesian optimization algorithm, and the coefficient of determination R of the training results of the random forest regression prediction model is determined using ten-fold cross-validation. 2 An evaluation was conducted to obtain the final prediction model for the opening correction coefficient K.
[0039] In this invention, the Bayesian optimization algorithm is used to automatically find the optimal parameter combination of the random forest regression prediction model within a preset hyperparameter search space. Specifically, the hyperparameter range of the random forest model is first set, and the average coefficient of determination R obtained by 10-fold cross-validation is used. 2 The objective function is used as the initial parameter. Then, initial parameter combinations are selected in the parameter space for model training and validation to obtain initial performance evaluation results. Next, a surrogate model is built based on the evaluated parameter combinations and their performance metrics. The next set of parameters to be evaluated is selected using a collection function, and this parameter combination is then substituted into the random forest model for training and 10-fold cross-validation. The resulting performance results are fed back to the surrogate model to update the search strategy. This process is repeated until the preset number of iterations is reached or the performance improvement meets the stopping condition. Finally, the average coefficient of determination R is selected. 2 The highest parameter combination is taken as the optimal hyperparameter combination, and the final opening correction coefficient K value prediction model is obtained by training based on this parameter combination.
[0040] The hyperparameters and optimization range of the random forest regression prediction model include at least the following: the number of decision trees, with an optimization range of 10 to 200; the maximum depth of a single decision tree, with an optimization range of 1 to 20; the maximum feature ratio considered when splitting a node, with an optimization range of 0.1 to 1.0; and the minimum number of samples required for further splitting of internal nodes, with an optimization range of 2 to 20.
[0041] The ten-fold cross-validation process divides the dataset into ten mutually exclusive subsets. Nine subsets are used as the training set and the remaining subset is used as the test set for training and validation. The performance index is calculated by combining the results of the ten iterations to avoid model overfitting.
[0042] The ten-fold cross-validation process includes: randomly dividing the preprocessed sample dataset into ten mutually exclusive subsets, with each subset having a roughly equal number of samples; sequentially selecting one subset as the test set, merging the remaining nine subsets as the training set, training a random forest regression prediction model using the training set, and validating the trained model using the test set, calculating the determination coefficient R for each validation. 2 Repeat the above process ten times, using each subset as a test set, to obtain ten R values. 2 Evaluation results: Finally, the ten validation results are averaged to obtain the average coefficient of determination of the random forest regression prediction model under this hyperparameter combination. This average coefficient of determination serves as the evaluation value of the objective function of the Bayesian optimization algorithm, used to judge the merits of the current hyperparameter combination. Through the above cross-validation process, the model performance evaluation can avoid over-reliance on the results of a single data partitioning, improving the stability of the model evaluation and reducing the risk of overfitting.
[0043] A second aspect of the present invention discloses a device for determining the flow characteristics of a butterfly valve based on an opening correction coefficient and Bayesian optimization, comprising: The data acquisition module collects independent variable parameters, including the actual opening degree of the butterfly valve, the static pressure before the valve, the temperature before the valve, the static pressure after the valve, and the mass flow rate. The correction coefficient module inputs the independent variable parameters into the opening correction coefficient K value prediction model to obtain the opening correction coefficient, which is a proportional factor that maps the actual opening of the butterfly valve in the experiment to the equivalent opening. The opening correction coefficient K value prediction model is a random forest regression prediction model. During the training process of the random forest regression prediction model, the hyperparameters are tuned by Bayesian optimization algorithm, and the model training results are evaluated by the coefficient of determination of ten-fold cross-validation. The equivalent flow coefficient module substitutes the opening correction coefficient into the flow coefficient correction formula to obtain the equivalent flow coefficient; The butterfly valve flow module inputs the equivalent flow coefficient into the butterfly valve theoretical flow characteristic calculation formula to obtain the butterfly valve flow rate.
[0044] A third aspect of this invention discloses a computer device, which includes a processor and a memory. The memory stores a computer program, which includes program instructions. The processor executes the program instructions stored in the computer storage medium. The processor may be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. It is the computing and control core of the terminal, suitable for implementing one or more instructions, specifically suitable for loading and executing one or more instructions to implement a corresponding method flow or corresponding function. The processor described in this embodiment can be used to implement a method based on... The method for determining the flow characteristics of a butterfly valve using the opening correction coefficient and Bayesian optimization includes the following steps: S1, collecting independent variable parameters, including the actual opening degree of the butterfly valve, the pre-valve static pressure, the pre-valve temperature, the post-valve static pressure, and the mass flow rate; S2, inputting the independent variable parameters into the opening correction coefficient K-value prediction model to obtain the opening correction coefficient, which is a scaling factor that maps the actual opening degree of the butterfly valve in the experiment to the equivalent opening degree; the opening correction coefficient K-value prediction model is a random forest regression prediction model, and the hyperparameters of the random forest regression prediction model are tuned using a Bayesian optimization algorithm during training, and the model training results are evaluated using the coefficient of determination of 10-fold cross-validation; S3, substituting the opening correction coefficient into the flow coefficient correction formula to obtain the equivalent flow coefficient; S4, inputting the equivalent flow coefficient into the butterfly valve theoretical flow characteristic calculation formula to obtain the butterfly valve flow rate.
[0045] A fourth aspect of this invention discloses a storage medium, specifically a computer-readable storage medium (Memory), which is a memory device in a terminal device used to store programs and data. It is understood that the computer-readable storage medium here can include both the built-in storage medium in the terminal device and extended storage media supported by the terminal device. The computer-readable storage medium provides storage space that stores the terminal's operating system. Furthermore, the storage space also stores one or more instructions suitable for loading and execution by a processor, which can be one or more computer programs (including program code). It should be noted that the computer-readable storage medium here can be high-speed RAM or non-volatile memory, such as at least one disk storage device. One or more instructions stored in a computer-readable storage medium can be loaded and executed by a processor to implement a method for determining the flow characteristics of a butterfly valve based on an opening correction coefficient and Bayesian optimization as described in the above embodiments, comprising the following steps: S1, collecting independent variable parameters, including the actual opening degree of the butterfly valve, the static pressure before the valve, the temperature before the valve, the static pressure after the valve, and the mass flow rate; S2, inputting the independent variable parameters into the opening correction coefficient K-value prediction model to obtain the opening correction coefficient, wherein the opening correction coefficient is a scaling factor that maps the actual opening degree of the butterfly valve in the experiment to the equivalent opening degree; the opening correction coefficient K-value prediction model is a random forest regression prediction model, wherein the hyperparameters of the random forest regression prediction model are tuned by a Bayesian optimization algorithm during training, and the model training results are evaluated by the coefficient of determination of ten-fold cross-validation; S3, substituting the opening correction coefficient into the flow coefficient correction formula to obtain the equivalent flow coefficient; S4, inputting the equivalent flow coefficient into the butterfly valve theoretical flow characteristic calculation formula to obtain the butterfly valve flow rate.
[0046] The following is a further explanation using a specific embodiment.
[0047] Example Reference Figure 1 As shown in the figure, this embodiment provides a method for calculating the flow characteristics of a butterfly valve based on an opening correction coefficient and Bayesian optimization. The method includes the following steps: S1. Obtain the historical operating condition dataset of the butterfly valve in a certain test. The dataset includes the actual opening degree of the butterfly valve. The data includes inlet static pressure P1, inlet temperature T, outlet static pressure P2, and mass flow rate Q, covering the opening range from low to high and different pressure ratio conditions. S2. Based on the upstream static pressure P1, upstream temperature T, downstream static pressure P2, and mass flow rate Q from the historical operating condition dataset, substitute them into the butterfly valve flow calculation formula to obtain the theoretical opening degree of the butterfly valve. ; The formula for calculating the flow rate of a butterfly valve is: (3) In the formula, The mass flow rate is the transient (at different times), expressed in kg / s. The flow contraction coefficient is the ratio of the minimum cross-sectional area of the flow contraction to the effective flow area of the butterfly valve. The relative flow area is the ratio of the effective flow area of the butterfly valve to the cross-sectional area of the flow channel; Pr is the pressure ratio, which is the ratio of the downstream static pressure P2 to the upstream static pressure P1; k1 is the gas adiabatic index; A0 is the effective flow area, in meters. 2 ρ0 is the air density upstream of the flow channel, kg / m³. 3 P1 is the static pressure upstream of the flow channel, in Pa; P2 is the static pressure downstream of the flow channel, in Pa.
[0048] Let the flow coefficient of the butterfly valve be ,Right now: (4) The formula for calculating the effective circulation area A0 is: (5) In the formula, d is the angle between the valve disc and the cross-section, i.e., the opening degree of the butterfly valve, in °; d is the inner diameter of the pipe, i.e., the diameter of the butterfly valve, in m.
[0049] S3. Sample Construction of Opening Correction Coefficient: For each set of historical operating condition data, the actual opening of the butterfly valve is... With the theoretical opening described Calculate a sample value of an opening correction coefficient K; (6) in, This represents the actual opening degree of the butterfly valve. K represents the equivalent opening, and K is the opening correction factor.
[0050] S4. The actual opening degree of the butterfly valve is as described above. The valve inlet pressure P1, valve inlet temperature T, valve outlet pressure P2, and test mass flow rate Q are used as independent variables, and the butterfly valve opening correction coefficient K is used as the dependent variable. The random forest regression prediction model is constructed by training and evaluating the model using the ten-fold cross-validation method. The expression for the random forest regression prediction model is: (1) in, P1 is the actual opening degree of the butterfly valve, T is the inlet static pressure, P2 is the outlet static pressure, and Q is the test mass flow rate. All of the above parameters are used as independent variables, and the butterfly valve opening correction coefficient K is the dependent variable.
[0051] Before inputting the data into the model, the independent and dependent variable data should be tested for multicollinearity. The variance inflation factor (VIF) is equal to the reciprocal of the tolerance, i.e.: (7) When VIF > 10, it indicates severe multicollinearity, and variables should be removed to avoid affecting the random forest model in evaluating variable importance and simulation.
[0052] S5. The hyperparameters of the random forest regression prediction model are automatically tuned using the Bayesian optimization algorithm. After optimization, the optimal parameter combination is as follows: number of predictors (n_estimators) is 135, maximum depth (max_depth) is 12, best features (max_features) is 0.941, and minimum number of samples (min_sampes_split) is 7.
[0053] The coefficient of determination R of the training results of the random forest regression prediction model was determined using 10-fold cross-validation. 2 To evaluate the model, the dataset is divided into 10 groups, with 9 groups used as the training set and the remaining group as the test set. The dataset is then trained 10 times in turn, which can effectively avoid overfitting of the model.
[0054] After training, the correlation coefficient (R²) between the predicted and actual values is calculated. 2 The model's performance was evaluated. The correlation coefficient R of the optimized model was used to assess its effectiveness. 2 The correlation coefficient is 0.915 (the closer the correlation coefficient is to 1, the lower the root mean square error, and the higher the prediction accuracy of the model). Therefore, the final opening correction coefficient K value prediction model is determined.
[0055] Figure 2 The scatter plot shows the relative error between the predicted and measured opening values of the butterfly valve. The maximum relative error is about 9%, and the standard deviation is about 5%, indicating that the opening correction coefficient K value prediction model can be used to predict the butterfly valve opening correction coefficient.
[0056] S6. For new operating condition data, input it into the trained prediction model for the opening correction coefficient K value to obtain the predicted opening correction coefficient. .
[0057] S7. Correct the predicted opening degree coefficient. Substitute the values into the flow coefficient correction formula to obtain the equivalent flow coefficient. .
[0058] The equivalent opening degree and the flow coefficient of the butterfly valve under the actual opening degree are compared as follows: Figure 3As shown, a strong linear correlation exists in the low opening range (0°~10°), while a strong nonlinear correlation is observed in the high opening range (10°~60°). The flow coefficient correction formula determined through simulation analysis is as follows:
[0059] In the formula, the equivalent flow coefficient is obtained. With the test mass flow coefficient The relationship between them.
[0060] S8. The equivalent flow coefficient As input parameters, the preset formula for calculating the theoretical flow characteristics of the butterfly valve is updated to perform high-precision butterfly valve flow calculation.
[0061] Depend on Figure 4 It can be seen that the equivalent flow coefficients obtained by the method of the present invention are all within the acceptable error range, and the maximum relative error has decreased from 60% to 13%, which significantly reduces the error of the theoretical flow coefficient and improves the accuracy of butterfly valve flow calculation.
[0062] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0063] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0064] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1The steps of the function specified in one or more boxes.
[0065] 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 it. Although the present invention has been described in detail with reference to the above embodiments, those skilled in the art should understand that modifications or equivalent substitutions can still be made to the specific implementation of the present invention. Any modifications or equivalent substitutions that do not depart from the spirit and scope of the present invention should be covered within the scope of protection of the claims of the present invention.
Claims
1. A method for determining the flow characteristics of a butterfly valve based on an opening correction coefficient and Bayesian optimization, characterized in that, Includes the following steps: S1, Collect independent variable parameters, including the actual opening degree of the butterfly valve, the static pressure before the valve, the temperature before the valve, the static pressure after the valve, and the mass flow rate; S2, input the independent variable parameters into the opening correction coefficient K value prediction model to obtain the opening correction coefficient, which is a proportional factor that maps the actual opening of the butterfly valve in the experiment to the equivalent opening. The opening correction coefficient K value prediction model is a random forest regression prediction model. During the training process of the random forest regression prediction model, the hyperparameters are tuned by Bayesian optimization algorithm, and the model training results are evaluated by the coefficient of determination of ten-fold cross-validation. S3, Substitute the opening correction coefficient into the flow coefficient correction formula to obtain the equivalent flow coefficient; S4. Input the equivalent flow coefficient into the butterfly valve theoretical flow characteristic calculation formula to obtain the butterfly valve flow rate.
2. The method for determining the flow characteristics of a butterfly valve based on an opening correction coefficient and Bayesian optimization as described in claim 1, characterized in that, In S2, the training process of the opening correction coefficient K value prediction model is as follows: S21, Obtain the dataset of independent variable parameters of the butterfly valve's historical operating conditions. The dataset of independent variable parameters includes the actual opening degree of the butterfly valve, the static pressure before the valve, the temperature before the valve, the static pressure after the valve, and the mass flow rate. S22, Substitute the independent variable parameters in the independent variable parameter dataset into the butterfly valve flow calculation formula to back-calculate and obtain the theoretical opening degree of the butterfly valve corresponding to the mass flow rate; S23, For each set of historical operating condition data, calculate the opening correction coefficient for the actual opening degree of the butterfly valve and the theoretical opening degree. Under the equivalent opening degree, the theoretical flow rate is equal to the test mass flow rate. S24. Using the independent variable parameter as the independent variable and the butterfly valve opening correction coefficient as the dependent variable, a random forest regression prediction model is constructed. S25. A random forest regression prediction model is trained using the dataset of independent variable parameters and the corresponding opening correction coefficients. During the training process, the hyperparameters of the random forest regression prediction model are tuned using the Bayesian optimization algorithm, and the model training results are evaluated using the coefficient of determination of 10-fold cross-validation to obtain the opening correction coefficient prediction model.
3. The method for determining the flow characteristics of a butterfly valve based on an opening correction coefficient and Bayesian optimization according to claim 2, characterized in that, In S2, the centralized data of the independent variable parameters of the historical operating conditions covers the complete operating range of the butterfly valve from low opening to high opening, as well as different pressure ratio operating conditions.
4. The method for determining the flow characteristics of a butterfly valve based on an opening correction coefficient and Bayesian optimization according to claim 2, characterized in that, In S2, the formula for calculating the opening correction coefficient is: The formula for correcting the flow coefficient is: (2) in, This represents the actual opening degree of the butterfly valve. K represents the equivalent opening, and K is the opening correction factor.
5. The method for determining the flow characteristics of a butterfly valve based on an opening correction coefficient and Bayesian optimization according to claim 2, characterized in that, The independent variable parameters in the dataset are subjected to multicollinearity processing before training.
6. The method for determining the flow characteristics of a butterfly valve based on an opening correction coefficient and Bayesian optimization according to claim 1, characterized in that, In the random forest regression prediction model, the number of decision trees is 10-20, the maximum depth of a single decision tree is 1-20, the maximum feature ratio when a node splits is 0.1-1.0, and the minimum number of samples for internal node splits is 2-20.
7. The method for determining the flow characteristics of a butterfly valve based on an opening correction coefficient and Bayesian optimization according to claim 1, characterized in that, The formula for calculating the theoretical flow characteristics of the butterfly valve is as follows: (3) In the formula, The mass flow rate is the transient (at different times), expressed in kg / s. is the flow contraction coefficient, which is a fixed value for any butterfly valve; This is the relative flow area, a fixed value for any given butterfly valve; The pressure ratio is k1; the gas adiabatic index is k1; and the effective flow area is A0 (m²). 2 ; ρ1 is the air density upstream of the flow channel, kg / m³. 3 P1 is the static pressure upstream of the flow channel, Pa; P2 is the static pressure downstream of the flow channel, Pa. The following equation in formula (3) is defined as the flow coefficient of the butterfly valve. ,Right now: (4)。 8. A device for determining the flow characteristics of a butterfly valve based on an opening correction coefficient and Bayesian optimization, characterized in that, include: The data acquisition module collects independent variable parameters, including the actual opening degree of the butterfly valve, the static pressure before the valve, the temperature before the valve, the static pressure after the valve, and the mass flow rate. The correction coefficient module inputs the independent variable parameters into the opening correction coefficient K value prediction model to obtain the opening correction coefficient, which is a proportional factor that maps the actual opening of the butterfly valve in the experiment to the equivalent opening. The opening correction coefficient K value prediction model is a random forest regression prediction model. During the training process of the random forest regression prediction model, the hyperparameters are tuned by Bayesian optimization algorithm, and the model training results are evaluated by the coefficient of determination of ten-fold cross-validation. The equivalent flow coefficient module substitutes the opening correction coefficient into the flow coefficient correction formula to obtain the equivalent flow coefficient; The butterfly valve flow module inputs the equivalent flow coefficient into the butterfly valve theoretical flow characteristic calculation formula to obtain the butterfly valve flow rate.
9. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the butterfly valve flow characteristic determination method based on opening correction coefficient and Bayesian optimization as described in any one of claims 1 to 7.
10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the butterfly valve flow characteristic determination method based on opening correction coefficient and Bayesian optimization as described in any one of claims 1 to 7.