CN-121997688-A - Method and device for calculating solid phase content of oil-based drilling fluid
Abstract
The invention provides a calculation method for solid phase content of oil-based drilling fluid, relates to the technical field of oil-based drilling fluid, and solves the problems of longer experimental detection period and complex operation flow in the traditional detection method for solid phase content of oil-based drilling fluid. The method comprises the following steps of S1, collecting a plurality of groups of on-site oil-based drilling fluid real drilling data, carrying out oil-based drilling fluid parameter correlation analysis, S2, establishing a neural network data set sample, dividing the data sample into a training set and a testing set, S3, constructing a BP neural network model, training the constructed BP neural network model, S4, integrating a genetic algorithm into the BP neural network, constructing the BP neural network integrated with the genetic algorithm, and S5, utilizing the trained BP neural network model, and establishing an oil-based drilling fluid solid phase content calculation method. The method has the advantages of short calculation period, simple operation flow and the like, can reduce the safety risk of experimental detection, and improves the maintenance efficiency of the oil-based drilling fluid on site.
Inventors
- LI HAODONG
- ZHU XIUYU
- SONG TAO
- ZHANG YANG
- ZHANG KUN
Assignees
- 大庆钻探工程有限公司
- 中国石油天然气集团有限公司
Dates
- Publication Date
- 20260508
- Application Date
- 20241104
Claims (13)
- 1. A calculation method for the solid phase content of oil-based drilling fluid is characterized by comprising the following steps: S1, acquiring a plurality of groups of on-site oil-based drilling fluid real drilling data, and carrying out oil-based drilling fluid parameter correlation analysis; s2, establishing a neural network data set sample, dividing the data sample into a training set and a testing set; s3, constructing a BP neural network model, and training the constructed BP neural network model; s4, blending a genetic algorithm into the BP neural network, and constructing the BP neural network blended with the genetic algorithm, so as to prevent the BP neural network from generating a local optimal condition in the training process; s5, establishing an oil-based drilling fluid solid phase content calculation method by using the trained BP neural network model.
- 2. The method for calculating the solid phase content of the oil-based drilling fluid according to claim 1, wherein the parameters with higher correlation with the solid phase content are funnel viscosity, initial cutting force, final cutting force, 600-rotation reading, 300-rotation reading, 200-rotation reading, 100-rotation reading, 6-rotation reading, 3-rotation reading, dynamic cutting force, plastic viscosity and demulsification voltage.
- 3. The method for calculating the solid phase content of the oil-based drilling fluid according to claim 1, wherein the S1-development oil-based drilling fluid parameter correlation analysis method is characterized in that software is used for analyzing the pearson correlation coefficient of the solid phase content and other drilling fluid parameters in the acquired real drilling data, and data with higher solid phase content correlation are screened out and taken as data samples for dividing an input set and an output set together with the solid phase content parameters.
- 4. The method for calculating the solid phase content of oil-based drilling fluid according to claim 3, wherein the software is SPSS analysis software.
- 5. The method of claim 1, wherein the training set is used to train the model in step S2 to establish a functional relationship between the input set and the output set, and the test set is used to detect the accuracy of the model.
- 6. The method for calculating the solid phase content of the oil-based drilling fluid according to claim 1, wherein the dividing ratio of the training set to the testing set in the step S2 is 3:1.
- 7. The method for calculating the solid phase content of the oil-based drilling fluid according to claim 1, wherein the step S3 of constructing the BP neural network model is as follows: Using software to import an input set and an output set, and setting a three-layer neural network structure comprising an input layer, a hidden layer and an output layer; Setting parameters such as the number of hidden nodes, the maximum iteration number, an error threshold value, a learning rate and the like, inputting the divided data set into a model, and carrying out pre-calculation by utilizing a training set and a testing set; and gradually perfecting the parameters of the optimized model according to the fitting result of the output set and the real data, so that the parameters such as the number of hidden nodes, the maximum iteration number, the error threshold value, the learning rate and the like reach the optimal values, and the BP neural network model is built.
- 8. The method for calculating the solid phase content of oil-based drilling fluid according to claim 7, wherein the software is matlab software.
- 9. The method for calculating the solid phase content of the oil-based drilling fluid according to claim 1, wherein the step S4 is characterized in that a genetic algorithm is integrated into the BP neural network, and the BP neural network integrated with the genetic algorithm is constructed, and the specific method comprises the following steps: S41, coding, namely coding weights and thresholds of the BP neural network by using binary codes to form individuals in a genetic algorithm, wherein the weights and the thresholds represent chromosomes in the individuals; S42, initializing a population, namely randomly generating a certain number of individuals serving as the initial population, wherein each individual represents a possible BP neural network weight and threshold combination; S43, evaluating the fitness by using the error of the BP neural network training set as a fitness function; S44, selecting, namely selecting according to the fitness value of the individual, wherein the individual with high fitness has higher probability of being selected to participate in subsequent crossing and mutation operations; S45, performing cross operation, namely simulating a gene recombination process of organisms, and exchanging partial chromosomes of two individuals to generate new individuals; s46, mutation operation, namely randomly changing some chromosomes in an individual, namely carrying out tiny random adjustment on weights and thresholds so as to increase diversity of population; and S47, generating a new population, namely forming the individuals generated after the selection, crossing and mutation operations into the new population, and replacing part or all of the individuals in the old population to finish the weight and threshold optimization of the BP neural network.
- 10. The method for calculating the solid phase content of oil-based drilling fluid according to claim 9, wherein the step S43 of evaluating the quality of each individual comprises the following steps: The method comprises the steps of judging the advantages and disadvantages of individuals in a population by using fitness values in a genetic algorithm, calculating the probability of each individual being selected by taking errors of BP neural network training sets as the fitness values of the individuals according to the fitness values of the individuals, wherein the probability of each individual being selected is random, but the higher the fitness values of the individuals are, the greater the probability of each individual being selected is, and the selected individuals can perform subsequent operations such as crossing, mutation and the like to form new individuals.
- 11. The method for calculating the solid phase content of the oil-based drilling fluid according to claim 1, wherein the step S5 is characterized in that the method for calculating the solid phase content of the oil-based drilling fluid is established by using a trained BP neural network model and comprises the following steps: the weight threshold value optimized by using the genetic algorithm is endowed to the BP neural network again, model training is carried out, if the fitting error calculated by the BP neural network model is larger than the preset error allowable maximum value, the weight threshold value is updated to continue iterative calculation, calculation is stopped until the error reaches the allowable range, and the solid phase content calculation model is built; and inputting parameters of the oil-based drilling fluid, and automatically calculating the corresponding solid phase content according to the mapping relation by the model.
- 12. The method for calculating the solid phase content of the oil-based drilling fluid according to claim 1, wherein the step S5 is characterized in that an operation interface design is completed by combining a trained BP neural network model, the model is packaged, model parameters are conveniently and repeatedly called, and calculation of the solid phase content of the oil-based drilling fluid is carried out.
- 13. An oil-based drilling fluid solid phase content calculation device, which is characterized by comprising: The acquisition unit is used for acquiring a plurality of groups of on-site oil-based drilling fluid real drilling data and carrying out oil-based drilling fluid parameter correlation analysis; The method comprises the steps of establishing a data set sample unit, dividing a neural network data set sample into a training set and a testing set, and establishing a neural network data set sample; The first construction unit is used for constructing a BP neural network model and training the constructed BP neural network model; The second construction unit is used for integrating the genetic algorithm into the BP neural network, constructing the BP neural network integrated with the genetic algorithm, and preventing the BP neural network from generating the local optimal condition in the training process; And establishing a solid phase content calculation unit for establishing an oil-based drilling fluid solid phase content calculation method by using the trained BP neural network model.
Description
Method and device for calculating solid phase content of oil-based drilling fluid Technical Field The invention relates to the technical field of oil-based drilling fluid, in particular to a method and a device for calculating solid phase content of oil-based drilling fluid. Background At present, the solid phase content of the oil-based drilling fluid is generally detected by using a solid phase content measuring instrument according to the method specified in the national standard GB/T16783.2 oil and gas industry drilling fluid field test part 2 oil-based drilling fluid, wherein the instrument is used for obtaining the solid phase content in the sample by heating an oil-based drilling fluid sample with a known volume in a distiller, evaporating the liquid phase component of the oil-based drilling fluid sample, condensing the liquid phase component and collecting the liquid phase component in a measuring cylinder to obtain the volume fraction of the liquid phase in the sample, and further calculating the solid phase content in the sample. The method has the defects of long experiment period, complex operation flow, high-temperature scalding risk in the experiment and the like. Disclosure of Invention The invention provides a calculation method for the solid phase content of oil-based drilling fluid, aiming at the problems of longer experimental detection period and complex operation flow of the traditional method for the solid phase content of oil-based drilling fluid in the background technology. The oil-based drilling fluid solid phase content calculating method has the advantages of short calculating period, simple and convenient operation flow and the like, can reduce the safety risk of experimental detection, and improves the maintenance efficiency of the on-site oil-based drilling fluid. The invention also provides a device for calculating the solid phase content of the oil-based drilling fluid. The invention solves the problems by the following technical proposal: the first object of the invention is to provide a method for calculating the solid phase content of oil-based drilling fluid, which comprises the following steps: S1, acquiring a plurality of groups of on-site oil-based drilling fluid real drilling data, and carrying out oil-based drilling fluid parameter correlation analysis; s2, establishing a neural network data set sample, dividing the sample into a training set and a testing set; s3, constructing a BP neural network model, and training the constructed BP neural network model; s4, blending a genetic algorithm into the BP neural network, and constructing the BP neural network blended with the genetic algorithm, so as to prevent the BP neural network from generating a local optimal condition in the training process; s5, establishing an oil-based drilling fluid solid phase content calculation method by using the trained BP neural network model. Further, the parameters with higher correlation to the solid phase content are funnel viscosity, initial cutting force, final cutting force, 600-turn reading, 300-turn reading, 200-turn reading, 100-turn reading, 6-turn reading, 3-turn reading, dynamic cutting force, plastic viscosity and demulsification voltage. Further, the S1 development oil-based drilling fluid parameter correlation analysis method comprises the steps of analyzing the pearson correlation coefficient of the solid phase content and other drilling fluid parameters in the acquired real drilling data by using software, screening out data with higher correlation with the solid phase content, and taking the data with the solid phase content as a data sample for dividing an input set and an output set in the next step. Further, the software used is SPSS analysis software. Further, in step S2, the training set is used to train the model to establish a functional relationship between the input set and the output set, and the test set is used to detect accuracy of the model. Further, the dividing ratio of the training set to the test set in the step S2 is 3:1. Further, the method for constructing the BP neural network model in the step S3 comprises the following steps: The method comprises the steps of importing an input set and an output set by using software, setting a three-layer neural network structure comprising an input layer, a hidden layer and an output layer, setting parameters such as the number of hidden nodes, the maximum iteration number, an error threshold value, a learning rate and the like, inputting the divided data set into a model, carrying out pre-calculation by using a training set and a testing set, gradually perfecting and optimizing model parameters according to a fitting result of the output set and real data, enabling the parameters such as the number of hidden nodes, the maximum iteration number, the error threshold value, the learning rate and the like to reach the optimal value, and improving the model accuracy as much as possible, wherein the BP neural netwo