| Petroleum is one of the most important energy sources in China and plays an important role in the national economy.The accurate positions of oil-water interface in crude oil tanks play a key role in the petroleum storage,transportation and processing.It is of great significance to study the optimization methods of oil-water interface measurement process and to establish an oil-water interface detection system,which has important theoretical value and engineering application value in petrochemical process system engineering.There are many problems in the interface measurement of oil-water.For example,conventional crude oil emulsion particle size detection algorithms has the problems of low accuracy and complex calculation process;conventional oil-water interface data calculation methods are simple and inefficient;conventional oil-water interface measurement device design is unreasonable and the application scope is narrow;conventional oil-water interface information management level is insufficient and user experience is poor.In view of the above shortcomings,this thesis firstly summarizes the measurement and calculation methods of oil-water interface;secondly,proposes a connected-component-labeling based droplet size detection algorithm for crude oil emulsion;thirdly,proposes an clustering optimization algorithm with adaptive threshold for oil-water interface measurement process;finally,designs a new oil-water interface measuring device and simulation system,and develops an oil-water interface detection and managment system.The important contributions of this thesis are as follows.(1)In order to grasp the viscosity and stability of crude oil emulsion and to guide the process of demulsification and oil-water separation,it is very important to detect droplet sizes and observe droplet size distribution of crude oil emulsion in petrochemical process.Firstly,this thesis analyzes the types,identification methods and characteristics of crude oil emulsions of crude oil emulsions,and discusses conventional droplet size detection methods.Then,it proposes a connected-component-labeling based droplet size detection algorithm for crude oil emulsion,which consists of three main steps:Firstly,preprocessing the oil emulsion image by filtering and binarizing;Then,obtaining the labeled image by connected component labeling and equivalent label replacement processing;Finally,by analyzing the connected components in the labeled image,calculating the number of droplets,droplet sizes and particle size distribution.(2)The conventional classification algorithm needs to select typical values manually and the traditional K-means clustering algorithm also needs to select initial clustering centers manually,and the results might not be accurate and stable in oil-water interface measurement.This thesis proposes an adaptive threshold algorithm for oil-water interface detection,which is based on improved K-means clustering optimization algorithm.The proposed algorithm can eliminate abnormal data,calculate the best typical values automatically,and improves the conventional classification algorithm and the traditional K-means clustering algorithm.The proposed algorithm works as follows:first,obtain oil-water interface optimal data by using the median pretreatment algorithm,then find the typical values automatically by using an adaptive threshold searching algorithm,finally search the optimal points by using the improved K-means clustering optimization algorithm,and calculate the oil-water interface and the liquid level according to the optimal partition.(3)In order to improve the technology of oil-water interface measurement towards non-contact and multi-dimensional data calculation and to remedy the problem of insufficient data in the application of adaptive threshold clustering algorithm,this thesis designs a new water-oil interface measurement device and simulation system that can obtain more comprehensive two-dimensional oil-water interface data,and meet the needs of detection system testing and PC software development.The new oil-water interface measurement device utilizes the principle of light absorption,designs light source illumination array and sensing array,obtains distributed oil-water interface matrix data,calculates each group of oil-water interface data results using adaptive threshold clustering algorithm,and obtains the final results by averaging all the results.Moreover,the oil-water interface simulation system is designed based on the matrix data style and communication principle of the new oil-water interface measurement device.The simulation system includes framework design,instruction sending simulation program design,return data simulation program design,and acceptance data simulation program design.(4)Most of oil-water interface monitoring modes of crude oil storage tanks in some oil field united stations is still in the stage of manual management.Although some of oil field united stations realized monitoring automation by means of high-performance measuring instruments,there are some problems such as large measurement error of oil-water interface,poor compatibility of detection system,complex interaction of user interface.This thesis presents the design and development of oil-water interface detection system that adopts three-tier architecture design of bottom hardware measurement,middle-tier communication service and top-tier data display;establishes oil-water interface monitoring software design system through Web Service interface design,lower computer design,upper computer design and data access design;and builds oil-water interface monitoring software system by developing GPRS communication module of lower computer and information management platform of upper computer.The experimental and application results in different stages of oil-water interface measurement demonstrated that the methods optimization is very effective.Firstly,the proposed connected-component-labeling based droplet size detection algorithm for crude oil emulsion can effectively calculate droplet sizes and droplet size distribution in the oil emulsion,and has higher accuracy and needs less memory space than conventional algorithms.Secondly,compared with the conventional classification algorithm and the traditional K-means clustering calculation algorithm,the proposed adaptive threshold clustering algorithm does not need artificial selection,can eliminate abnormal data,and can guarantee the results correct.Moreover,the number of iterations and running time needed by our proposed algorithm are smaller than those needed by the traditional and other improved K-means clustering calculation algorithms.Then,the simulation system can achieve the purpose of testing system and improving the development efficiency of oil-water interface detection system,and provide simulation data support for the development of oil-water interface detection system.Finally,the oil-water interface detection system is easy to deploy,stable in operation,accurate in measurement,reliable and convenient in interface operation,and can provide technical guarantee for enhancing the level of automation,informatization and intelligent management of oil field enterprises in China. |