INTELLIGENT SYSTEM FOR THE TWO-PHASE FLOWS DIAGNOSIS AND CONTROL ON THE BASIS OF RAW 3D ECT DATA

In this paper the new intelligent system for two-phase flows diagnosis and control is presented. The authors developed a fuzzy inference system for two phase flows recognition based on the raw 3D ECT data statistical analysis and fuzzy classification which identify the flow structure in real-time mode. The non-invasive three-dimensional monitoring is possible to conduct even in non-transparent and non-accessible parts of the pipeline. Presented system is also equipped with the two phase gas-liquid flows installation control module based on fuzzy inference which includes the feedback information from the recognition module. The intelligent control module working in a feed-back loop keep the sets of required flow regime. Presented in this paper fuzzy algorithms allow to recognize the two phase processes similar to the human expert and to control the process in the same, very intuitively way. Using of the artificial intelligence in the industrial applications allows to avoid any random errors as well as breakdowns and human mistakes suffer from lack of objectivity. An additional feature of the system is a universal multi-touched monitoring-control panel which is an alternative for commercial solution and gives the opportunity to build user own virtual model of the flow rig to efficiently monitor and control the process.


Introduction
In this article the authors presents the new intelliFlowControl system for the intelligent two-phase flows diagnosis and control. In figure 1 the flow diagram of the system together with its modules and data flow directions are depicted. The authors developed a fuzzy inference algorithms for the two-phase flows recognition based on the raw 3D ECT data analysis and the fuzzy classification which identifies the flow structures in a real-time mode. The non-invasive three-dimensional monitoring is possible to conduct even in a non-transparent and non-accessible parts of the pipeline. Presented system is also equipped with the twophase gas-liquid flow installation control module based on the fuzzy inference which includes a feedback information from the recognition module. The intelligent control module works in a feed-back loop and keeps the sets of required flow regime. Presented in this paper fuzzy algorithms allow to recognize the two phase processes similar to the human expert and to control the process in the same, very intuitively way. The usage of the artificial intelligence in the industrial applications allows to avoid any random errors as well as breakdowns and human mistakes which suffer from a lack of objectivity. An additional feature of the system is the universal multi-touched monitoring-control panel which is an alternative for the commercial solutions and gives the opportunity to build user-own virtual model of the flow rig to efficiently monitor and control the process.

The two-phase gas-liquid mixtures flow
The two-phase gas-liquid flows belong to the most rapidly growing trend in fluid mechanics research. In recent years there has been significant, but still insufficient progress in the development of knowledge about these industrial processes. The two-phase flows arouse growing interest because of their great practical significance. They are closely related to the rapidly developing field of research in bioprocess engineering, biotechnology, environmental engineering, energy, and many other related areas. The two-phase gas-liquid flows are component of many industrial processes [4,18]. Some possibilities of the industrial applications for the developed system can be found, for example: aeration processes in chemical reactors, flotation processes, water and sewage aeration systems. The main IAPGOŚ 1/2017 p-ISSN 2083-0157, e-ISSN 2391-6761 task of aeration system is a production of proper fraction of aerated liquid and oxygen. Oxygen injection process is important due to the fact that liquid circulation has to be achieved. It helps intensifying a mass transfer process. One of the fundamental problems in this matter is a proper evaluation of the inter-phase surface -this is the crucial parameter from the mass transfer point of view.
The two-phase flow processes also occur in the bubble columns. Their purpose is to implement the various physical and chemical processes. Controlling the size of the interface often determines the intensity of these processes. For example, in the air-lift columns and ejectors [5] the movement of the liquid stream is forced by the gas stream. Such devices are commonly used in the extractive industries (e.g. flotation processes) or to precipitation of some fraction of the liquid in the sedimentation processes, such as degreasing where the size of bubbles is significant.

Characteristics of the flow types
One of the main challenges in the two-phase flows is a possibility of a priori prediction of features and type of mixture flow on the basis of known apparent velocity values, the properties of individual phases and finally of the flow geometry (like diameter and inclination angle of the pipeline). Many various techniques have been developed to observe and understand mixture flow structures. They vary from the simplest visual observations by different photography techniques through the optoelectronic detectors to the newest methods of using the twoor three-dimensional computed tomography. One of the most commonly tool for the two-phase flow types classification is a flow map which in the form of a diagram represents the flow in term of important and useful parameters providing information about phases rate [5].
The observed structures of the gas-liquid mixture flow in the pipes of the vertical ascending movement are compatible with those presented by Nicklin and Davidson [16]. These structures often classify this type of flow. Five basic flow patterns are known like bubble flow, slug flow, foam flow, ring flow and dispersion flow. When the two-phase mixture is flowing from the top to bottom (counter-flow) the flow structures were defined by Oschinowo and Charles [17]. It is worth to note that these structures relate to a two-phase mixtures of liquids with high viscosity -not exceeding 100 mPa·s. For liquids with a higher viscosity the flow structures have to be defined differently. However, because of the volume constraints of this article the authors decided to indicate only the reference to the relevant publication [24].
Additionally, in case of the horizontal pipelines the distribution of the liquid is influenced by gravity that acts to stratify the liquid to the bottom of the tube and the gas to the top. Flow types for co-current flow of gas and liquid in a horizontal pipeline are categorized in [11] as dispersed, stratified, slug, plug, wavy and annular. It is worth mentioning that additional flow types may be observed which keep features of two (or more) basic flow types listed above. These flow types are called as transitional flows [3] and are dependent on the flow features of which they consist. Therefore, defining the transitional type it is required to add an additional information of its base component types. In figure 3 the reader may observe the crisp borders (blue lines) between the flow types as well as the transitional areas (red lines).
The common methods dedicated for flow identification applied so far can be generalized into three groups:  the methods based on the analysis of images acquired from a high-speed black and white or color CCD camera (100/200 frames per second) using standard techniques of filtering and edge detection. The classification of the flow structures is based on image segmentation. Also the neural networks with the elements of fuzzy logic [19] used to be applied for the image processing;  the methods based on the analysis of the measured signals acquired from facilities as flow meters and pressure gauges dedicated for flow monitoring. These signals are analyzed in the field of amplitude or frequency [5,12] and finally the local void fraction and the local volumetric interfacial area can be obtained as the result of fuzzy clustering or neural networks [10];  the methods based on the tomograms (e.g. capacitance, impedance tomography) analysis. A set of electrodes is placed around the pipe and then the cross-sectional 2D or spatial 3D image is reconstructed [1]. In the literature two main approaches can be found which either perform the 2D image reconstruction with its analysis [13,27,28] or direct analysis of the raw measurement data missing the reconstruction process [7,8].
The proposed novelty described in this article is based on the usage of raw tomographic measurement data (not images) obtained spatially from the Three-Dimensional Electrical Capacitance Tomography (3D ECT) sensor and their direct fuzzy analysis in the way of main structures and flow type recognition. The analysis of the tomographic raw measurement data is actually more effective (also in terms of processing time).

Main principles of ECT technique
Electrical Capacitance Tomography (ECT) is the measurement technique which has already been successfully applied for monitoring the two-phase industrial flows in which each of the phases differs with the dielectric permittivity [22,25]. State-ofthe-art concerning the applications of the tomographic techniques for the two-phase gas-liquid flow visualization can be found in many of conference proceedings from World Congresses on Industrial Process Tomography held continuously every 2 years, starting in Buxton, England in 1999. Knowing the relationship between the concentration of ρ and the dielectric permittivity ε it is possible to determine the liquid and gas phase distribution. This in turn allows the identification of the flow structure and measurement of the void fraction. This type of measurement technique seems, in fact, to be the most effective in applications for flows mainly because of its speed and non-destructive feature. The typical ECT system consists of a capacitance sensor, the measurement unit and finally PC computer. In the scientific works as [27,28,26,31] concerning the ECT applications for two-phase gas-liquid flows monitoring just the two-dimensional images were produced with the flow structures and the phase distribution. The two-dimensional image cannot fully reveal the information about the flow in the measuring area. It is created by averaging the signal across the electrodes ring, creating a cross-sectional image of the pipeline. In this case the spatial phenomena of the electromagnetic field distribution are neglected and additionally in the case of long electrodes this averaging prevents an accurate measurement. It was therefore necessary to develop the threedimensional capacitance tomography [13,22,25]. The information on the entire structure of the flow is obtained by 3D visualization of the material distribution. This type of imaging requires a specific deployment of the measuring electrodes as well as an appropriate measurement procedure.
The principle of ECT technique is based on measuring changes in electric capacitance between the electrodes as a result of changes in the dielectric object located between these electrodes. The dielectric object in this case is a liquid with gas bubbles. The measurement concept is as follow: once the positive potential on one of the electrodes (excited electrode) is set, while others are grounded. The measured values of capacitances are collected and then further electrodes are excited. Having 32 electrodes 3D ECT sensor it is possible to acquire 496 single measurements in one frame with the rate 12 frames/sec.

Fuzzy logic
Fuzzy logic is a multi-valued logic and a generalization of the classical two-valued approach. It was proposed by Lotfi Zadeh [29] and is closely related to his theory of fuzzy sets [30]. The fuzzy logic, in opposite to standard two-valued logic, between the state of 0 (false) and the state of 1 (true) extends a number of intermediate values that determine the degree of membership of the element to the investigated collections.
Fuzzy logic is proved to be useful in engineering applications where the classical logic of classifying (only by the criterion of true and false) cannot effectively deal with many ambiguities and contradictions [2]. There is a lot of applications [21] including electronic control systems (machines, vehicles etc.), data mining tasks, or in the construction of expert systems where the fuzzy logic and fuzzy logic based algorithms are in use.

The test flow rig
The experimental rig was built in Institute of Applied Computer Science at Lodz University of Technology. Each of the various sections (horizontal and vertical) is equipped with a measuring pipeline at three different internal diametersrespectively 34, 53.6 and 81.4 mm, which allow to test two-phase flow processes at different scales. The length of horizontal measuring section is approximately 7.5m, while the length of vertical one is approximately 4m. All measuring sections contain transparent pipes which allow to visually (e.g. by photo camera) observe a flow structures movement. Pipelines are made of polyvinyl chloride (PVC) and are equipped with valves made of the same material.
The flow facility can be supplied with a fluid by the system which consists of two storage tanks and multi-stage centrifugal pump. In one of the tanks there is a propeller stirrer equipment installed which allows to prepare the research liquid such the aqueous solutions of the various substances. Thanks to the installed electromagnetic flow meters it is possible to precisely designate the volumetric flow rate. The pump CRN's 45 made by Grundfoss company provide the maximum flow stream of the liquid (with a viscosity close to the viscosity of water) pumped into the pipeline at the level of 50m3/h. In addition, the applied screw compressor DMD 100CR allows to obtain the volume stream of air at 1000 l/min with pressure about 7bar. The mentioned conditions overall let to obtain all types of two-phase flows occurring in industrial environments -from the bubble to annular flow.

Flow recognition module
The flow recognition mechanism combining three types of processing was developed. The core of the proposed solution, reflecting the main features of the flow map, constitutes the similarity level of the observed flow to the reference one. A supplementary information on the gas and liquid flow streams are introduced for final classification of the given flow, making the whole mechanism more flexible. Since all used data are treated qualitatively the adequate linguistic variables are built using proper fuzzy sets.

Flow similarity
The set of patterns was built using the expert's opinions (see section 7 -Experimental results). The algorithm for flow similarity level determination was described in details in [6]. The similarity of a given flow to the reference one is determined by the fuzzy clustering of the raw ECT data. FCM (fuzzy c-means) classifier is the most popular classifier based on fuzzy logic. This mechanism allows the classification of a single object to more than one cluster (group) with varying degrees of belongingnessinstead of classic two valued logic based classification where an object fully belongs to the cluster or does not belong at all. A characteristic feature of the algorithm is a fact that the shape of each cluster in the feature space is the same and depends on the accepted standards.
Since the similarity can be considered as an inherently imprecise quantity the authors defined and depicted in fig. 2 the linguistic variable similarity level that describes the flow similarity using five linguistic terms: no similarity (dark blue line), low similarity (red line), medium similarity (green line), high similarity (purple line), identical (light blue line).

The gas and the liquid flow streams fuzzyfication
In order to describe the liquid and gas flow streams (precisely enough to distinguish the different flow types) the two linguistic variables were defined. Each variable is split into 4 terms:  Low gas/liquid flow stream;  Medium low gas/liquid flow stream;  Medium high gas/liquid flow stream;  High gas/liquid flow stream; The ranges and the shapes of the fuzzy sets representing the linguistic terms were determined during the clusterization of the test flows set and were adjusted due to the human expert opinion.
The base membership functions were determined in basis of the trapezoidal-shape functions in which the sections of the trapezoids sides (legs) were replaced with the exponential functions. Thanks to this the non-crisp nature of the border between any of the two-phase flows types is reflected more accurately and is better customizable to the subjective assessment of the user.
The input values of the gas and liquid flow streams were obtained from the research facility measuring system (i.e. flow meters). Due to the relatively low accuracy of the measuring system and its frequent oscillations, these values cannot be considered as crisp values. To reduce the impact of the mentioned factors for the final recognition results the authors decided to use the input values of the gas and liquid flow streams as fuzzy numbers [29]. were used as premises of the inference. The linguistic terms: slug, transitional and plug flow, were used in consequences. The set of designed fuzzy rules is presented in the table 1.

Fuzzy regulator principles
In the fuzzy regulator dedicated for the two-phase type control a decomposition of the input signal into two classes and two methods of their fuzzyfication is performed. The first class includes two input signals which determines the current state of the process i.e. the quantity of the phases supplied to the process. These signals are given as a linguistic variables which values are described with the membership functions. In this class the linguistic variables are treated as the 5-elements set: where:  V -is the name of the variable e.g. liquid stream,  T -is the set of terms, verbal labels naming the values of the variable V e.g. small,  Dis the consideration domain in where the linguistic variable V is defined, which describes the areas of D e.g. D ∈ (0; 50) ,  G -is the syntactic rule, which grammar has a character which can generate the derivative terms -the T labels e.g. T(liquid stream) = {…, "middle small", "middle", "middle large", …}  M -is the semantic rule, which set to the each linguistic value named l the meaning M(l). Moreover, M(l) describes the fuzzy set defined in D. The example for l="Middle": where: SR is the fuzzy set defined with the membership function  RS in the domain D.
In this class the fuzzified signals are the measurement values retrieved from the measurement instruments of the flow rig.
There is a disadvantage with the fuzzyfying the input signals using the classic method because in this case the values fluctuation of the input signal during its analysis is not considered and in case of such dynamic process like two-phase gas-liquid flow it is not acceptable. The most common method for the preparation of the measurement data series for the fuzzyfication purpose is their averaging. Unfortunately, the mean value does not consider the dynamic changes of the measured signal what is very important determining the control parameters for the process. The next inconvenience applying the classic fuzzy regulator is the lack of possibility of changing the shape and/or the type of the membership function for the decomposition of the linguistic variables describing the input signal into the terms [14] In case of the described here linguistic variables it is not also considered the classic fuzzyfication module. When the inference (fuzzy) rules do not cover the linguistic variables which are describing the current state of the process, then their conclusions always are of the same character dependent only on the value of the linguistic variable (given type of the two-phase flow) The input signal in the regulator is therefore given in the form of the fuzzy number defined with the following membership function: where μ (x) is the value of the membership function for x ∈ d, where: d -is the measurements range, x -is the mean measurement value for the measurement data retrieved in time t, σ -is the standard abbreviation for the measurement data retrieved in time t. The function ( ) gets the character of the triangular function. Next, the given fuzzy number is once more fuzzified using classic principles according to the Zadeh's extension principle [20,29] (i.e. determining the intersection of two fuzzy sets). This approach, not used so far in similar issues, for the first class input signals fuzzyfication considers in the inference process not only the instantaneous or mean values of this signals but also the trend of their changes in the moment of measuring thus eliminating the inadequacy of the measurement system. An additional advantage is the amplifying the system sensitivity which is limited using the non-standard membership functions.
In the regulator there is the possibility of manipulating the shape of the membership function changing only one regulation parameter within the ten step regulation scale ∈< 1; 10 >. The base membership functions were determined in basis of the trapezoidal-shape functions in which the sections of the trapezoids sides (legs) were replaced with the exponential functions. Thanks to this the non-crisp nature of the border between any of the twophase flows types is reflected more accurately and is better customizable to the subjective assessment of the user. Below there is an example of the equation for defining one of the membership functions: where: In the second class of the input signals of the presented fuzzy regulator there are two linguistic variables which express the status about the flow type currently taking place in the rig as well as the flow type required by the user. The linguistic variables in this class differ significantly from those in the first class. The main difference is their decomposition into terms performed in this class using fuzzy relations. Each of the fuzzy relations is defined in the two-dimensional space which determines the dependencies between both phases supplied to the flow rig. It is done in exactly the same way as construction of the two-phase flow maps [23]. The membership functions which describe the given relations are based on the modified (crisp) between flows boundaries used in the classic flow maps adapted to the special flow rig and thereby define the two-phase flow type on the flow map as a fuzzy set. The both linguistic variables must have the same values set and the same membership functions which define the fuzzy relations in the values sets of those variables.
The fuzzy rules applied in the presented regulator are as follow: if (z 1 =t1 z1 ) and (z 2 =t1 z2 ) and (z 3 =t1 z3 ) and (z 4 =t1 z4 ) then (z 1 =t2 z1 ) and (z 2 =t2 z2 ), where:  z1, z2 -are the first class signals: the fuzzified value of gas stream and fuzzified values of the liquid stream,  z3, z4-are the second class signals: current flow type and required flow type,  tij-is the i-th values (term) of the j-th input signal.
Thanks to this it is possible to implement the "controlled" transitions between any of two flow types.
The extension premise of the fuzzy rules to the knowledge describing the flow rig state allows the two-phase flow type manipulation without the risk of the rig overloading e.g. to attain the required flow type within some inference cycles.
The inference process in turn is accomplished through the implementation of the modified fuzzified Mamdani-implication.
The outputs of the inference module are two fuzzy sets which represents expected, after finishing the control process, the flow rig state. These outputs actually are the sum of the signals which are the results of the inference rules conclusions.
The defuzzyfication process of the final fuzzy sets is performed in the presented regulator using the well-known Center of Sums Defuzzyfication [15] method.

Example results
The presented intelliFlowControl system was verified using the experimental rig that was built in Institute of Applied Computer Science at Lodz University of Technology. During the research reported herein, the authors focused on three types of flows observed in the horizontal pipeline of the diameter 60mm. The gas flow rate ranged from 0 to 50 m 3 /h while the liquid flow ranged from 3 m 3 /h to 9 m 3 /h. The data were obtained from the 30 test flows and were validated by the human expert which is experienced in the field of the two phase gas-liquid mixtures. The expert's recognition accuracy was verified with the flow map. Considering the comparison results shown in fig. 3 it can be noticed that the flows classified by the expert as the slug flows or the plug flows are placed correctly in the appropriate areas of the flow map. However, some flows were recognized as a transitional ones and placed in the boundary region between the above two flow types. Moreover, several flows classified by the expert as transitional flows were placed definitely in the slug flow area of the flow map.
The experiments were carried out within the following steps:  set the initial state,  set by expert the required flow type,  verification by the expert of the flow type after stabilization (i.e. after crisp regulation made by the regulator).
As a final result of each experiment the compatibility of the stabilized flow type with that set by the expert was checked. The table 2 includes the results of the experiments which cover all possible transitions between the three mentioned before flow types which were possible to observe in the given measurement range of the flow rig.  The description of the symbols used in table 2:  the notation T → T -is the transition from the flow type T to the flow type T , where:  P-is the plug flow,  S-is the slug flow,  T-is the transitional flow.
The time required for determining the crisp values of the control signals (the loop with the identification and regulator modules) was around 0.25 second and was negligible in comparison to the time needed for flow stabilization which was between 10 and 30 seconds and was highly dependent on the initial and target flow types. The computations were carried on using the PC computer equipped with the i7-3612QM CPU and 8GB under control of Windows 8.1 operating system. The system (identification and regulator modules) was implemented in the Microsoft .NET 4.5 environment using C# programming language. All the input signals were submitted to the system from the exterior measurement units (i.e. 3DECT device, the pump inverter, Brooks flow meters and pressure meters) using the Gigabit Ethernet network and the TCP/IP family protocols.

The universal multi-touched monitoring-control panel
An additional module of the system is the software for the multi-touched monitoring-control panel. It is an universal solution which can be easily adapted for any installation rig conditions. Thanks to the development of multi-touch gestures it is possible to control and monitor the process, to change i.e. the pipeline, the supply devices parameters like pump.
The applications provides the components library like bricks used in the installation rig model construction. It consists also of the GUI environment in which the users can develop their own components as the active or passive elements of the model. They can define the element style, functionality as well as the original graphical view assigned to its different state (i.e. opened/closed valve, identified flow regime, received measured value of the pressure).
The integral part of the software is the network module for the diagnostic and control commands multicast transmission. Each model component in the schema includes its ID and takes part in the dynamic data exchange. Thanks to this feature it can in a realtime mode change its appearance or label according to the state of the device that represents.
The new visualization environment designed considering the object-oriented aspects makes a universal good alternative for the expensive commercial solutions dedicated for the industrial processes monitoring and control.

Conclusions
The intelliFlowControl system with application of fuzzy methods for the purposes of the two phase gas-liquid flows identification and control has been developed. It has been demonstrated that the identification module can be a sufficient alternative to the methods commonly used in this field. A series of experiments have been completed using the test flow rig and the results (human expert contra fuzzy inference) were compared. Fuzzy sets and fuzzy inference supported with the non-invasive 3D ECT diagnosis have proved to be suitable for the identification process applied even for such dynamic phenomena as the two phase flows ensuring the accuracy as good as the human expert work. However, the proper preparation of the inference system mechanism guarantees the high quality of the recognition results.
The control module is characterized not only by the high operating speed but also by the universality of the application. It may support all the two-phase flow rigs where the precise of control is demanded. This precision is reached by the usage of the first class signals and the consideration in the inference process not only the current flow type and the flow type set by the user but also the current state of the flow rig (i.e. the current values of the control signal).Thanks to this approach it is possible to change the two-phase flow type changing only one control parameter about the minimum value which is required to achieve the set flow type and simultaneously without excessive overcharging the flow rig and the supply units.
The system is highly universal of use and easily adaptable to the work conditions by the maintenance stuff of the flow rig. It is because it shares the possibility of individual sets of the parameters as well as the intuitive inference rules. In addition, the innovative approach allows the user of the system to avoid the over-loop state in case when the algorithm would try to reach the unsupported or undesirable flow type.