Evaluation index and performance structure optimization of magnetic field uniformity of complex multiphase flow electromagnetic flowmeter

The uniformity of the excitation magnetic field is an important factor affecting the measurement accuracy of the electromagnetic flowmeter and its adaptability to different flow states of the complex multiphase flow. The main purpose of this paper is to improve the measurement accuracy of electromagnetic flowmeter by improving the uniformity of magnetic field excitation of electromagnetic flowmeter sensor. Firstly, an evaluation index system based on area weight magnetic field deviation degree is established, and the concept of flow state adaptability is put forward. According to this evaluation system, the excitation structure of the conventional electromagnetic flowmeter sensor is improved and optimized, and an excitation model with high uniformity is designed. Meanwhile, the ANSYS software is used for numerical simulation, and normalized standard deviation is used to compare between the new and the traditional electromagnetic flowmeter models. Finally, according to the requirements of the index function, the magnetic pole detection angle of the improved excitation model is simulated and analyzed, and the optimal magnetic pole detection angle is determined to be 45°. On this basis, a new electromagnetic flowmeter is designed for complex multiphase flow at oil wellhead. The field test proves that the measurement error of this flowmeter can reach less than 5%. Compared with the traditional electromagnetic flowmeter, the measurement accuracy has been greatly improved.


Introduction
Electromagnetic flowmeter is a new type of flowmeasuring instrument for measuring the volume flow of the conductive fluid. Electromagnetic flowmeters can be used only if the liquid is conductive and cannot fall below a lower limit. It is based on Faraday's law of electromagnetic induction, and it developed rapidly with the advancement of science and technology in the middle of the 20th century. Hence, research on the basic theories and principles of the electromagnetic flowmeters has been a hotspot for years, attracting much attention from scholars and technical researchers, with a handful of papers, patents, and monographs presented. The measuring principle of the electromagnetic flowmeter proposed by this paper is the same as that of the traditional electromagnetic flowmeter. Shercliff et al. 1  In recent years, with the increasing application of electromagnetic flowmeter in industrial and agricultural production, the demand for its accuracy is becoming higher and higher. Wang 4 compared and analyzed the performance of electromagnetic flowmeter with common ultrasonic flowmeter and open channel flowmeter in sewage measurement. The results showed that electromagnetic flowmeter was more suitable for sewage flow measurement. In Ref. 5, Michalski presented a study which derived a numerical flow generator, called the moving stream method, which estimated the measurement error for electromagnetic flowmeters. Yang 6 analyzed the causes of the measurement errors of the electromagnetic flowmeter and the corresponding treatment strategies, and she believed that the errors should be eliminated from the aspects of ensuring the stability of the conductivity of the liquid, reducing the bubbles in the liquid, and reducing the electromagnetic interference.
In this regard, many scholars have improved the structure and measurement accuracy of electromagnetic flowmeter. Slavik et al. 7 focused on optimization of magnetic circuit of flow meter sensor based on electromagnetic principle. Theoretical description was followed by analysis of magnetic field in flow profile on 3D model of electromagnetic sensor by using software packages ANSYS and COMSOL Multiphysics, and the validity of the model was proved. In Ref. 8, 2D and 3D models of the open channel electromagnetic flow sensor were investigated by means of numerical simulations, and it was shown that the 3-D model must be used for optimal design of the excitation coil. Xu et al. 9,10 presented a method to optimize the excitation coils in the electromagnetic flowmeters. The optimized coil size was obtained by minimizing the standard deviation of the induced voltage for different asymmetrical flow profiles, and a model of electromagnetic flowmeters with diameter of 150 mm was established. It was concluded that the electromagnetic flowmeters composed of the optimized coils were less sensitive to the flow profiles than those composed of un-optimized coils. Zhou et al. 11 aimed at the low measurement accuracy of the existing conductivity measurement method of electromagnetic flowmeter. A method of measuring the conductivity of electromagnetic flowmeter with parallel excitation was proposed. The excitation circuit adopted a single highfrequency square wave capacitive coupling method, which improved the conductivity measurement accuracy and stability. Shao 12 designed a double-coil electromagnetic flowmeter, which greatly improved the anti-interference ability and application range of the electromagnetic flowmeter. It is noticeable that most of the current magnetic field simulation studies of electromagnetic flowmeters are carried out on nonuniform magnetic field electromagnetic flowmeters. For example, Huang et al. 13 performed calculation and analysis of the magnetic field of a non-uniform magnetic field electromagnetic flowmeter. However, the electromagnetic flowmeter is not sensitive to magnetic field uniformity when it is used for conventional fluid measurement, so most studies always ignore the effect of the magnetic field uniformity. Therefore, there are few relevant studies. Wyatt et al. 14 discussed the behavior of point-electrode electromagnetic flowmeter with uniform field with two-phase flow.
It can be seen from the literature 6 that when bubbles were contained in the fluid, the measurement accuracy of electromagnetic flowmeter will be greatly affected. Many scholars have also made some studies on this issue. In 2020, Liu 15 proposed a gas-liquid two-phase measurement method based on electromagnetic flowmeter in the two-phase separation state in the pipe. Through the phase separation in the pipe, the two-phase fluid can be transformed into two singlephase fluid streams flowing in parallel in the pipe under various flow patterns. The interface between the two phases was relatively clear and can maintain a long enough distance. Using air-water two-phase flow as medium, the experimental results showed that the relative error of the liquid phase measurement of the electromagnetic flowmeter was within ±5% under the condition of phase separation in the tube. Wang 16 proposed the electromagnetic correlation method to measure the flow rate of oil, gas, and water multiphase flow, which provided a new solution and method for the measurement of oil, gas, and water multiphase flow. The proposed method was mainly aimed at the problem of flow measurement of oil-gas and water-multiphase flow in the narrow space environment of oil production logging. The application of this measuring model would expand the range of oil-gas holdup and increase the flow measurement range in production logging. Du 17 proposed a new method based on the related electromagnetic flow sensor array, the array electromagnetic flow sensor related structure model was established, and put forward a kind of based on multi-scale principal component analysis and adaptive weighted array sensor data fusion method in terms of the well underground water three phase flow of oil and gas flow measurement. Through the experiment, when the moisture content was more than 50% and the flow rate was greater than 70 m 3 /d, the measurement accuracy was about 5%, but when the flow rate was low, the measurement error was large. Wang 18 put forward a kind of based on electromagnetic flow and related flow related method of multiphase flow electromagnetic flow measurement model, the best shape of internal excitation coil sensor was analyzed. He measured the experimental data of different velocity of mixed fluid in the case of different content of gas-water and different content of oil-gas-water multiphase flow, and the relative error of the measured results was within 15%. It can be seen that, at present, there are still large errors and many limitations in the study of measuring accuracy of complex multiphase flow electromagnetic flowmeter.
Due to the magnetic field homogeneity of the excitation has great influence on the measuring accuracy of electromagnetic flowmeter, this paper establishes an evaluation index system based on area of weight deviation and puts forward the concept of flow state adaptability. Based on the evaluation system, the excitation structure of electromagnetic flowmeter sensor is optimized and improved. The designed excitation magnetic field is more conform to the requirements of the magnetic field uniformity. Compared with the traditional electromagnetic flowmeter, the accuracy of the electromagnetic flowmeter designed in this paper is obviously improved when measuring the complex multiphase flow containing gas, and it has the advantages of reliable operation and easy signal detection. By using ANSYS (17.0) software, the detection angle of magnetic pole of the new model is optimized and simulated, and the detection angle of magnetic pole conforming to the magnetic field uniformity is found. Based on the detection angle of magnetic pole conforming to the magnetic field uniformity, a new electromagnetic flowmeter is designed for the flow measurement of complex multiphase flow at the wellhead of oil field. Field experiments are performed on oilfield wellheads with typical complex multiphase flow measurement. The experimental results show that the measurement accuracy of the electromagnetic flowmeter designed in this paper is about 5% for the measurement of complex multiphase flow with a small amount of oil and gas. In Daqing Oil Field, the measurement error of complex multiphase flow measured by field technicians with traditional standard electromagnetic flowmeter is more than 20%. Therefore, volumetric method is mainly used for measurement at present, that is, the well fluid from multiple wells is first collected into an oil tank, and the measurement begins after the gas discharged. Obviously, this method cannot measure real-time production and cumulative production individually for each well. In addition, the literature 18 proposed an electromagnetic flow measurement method for measuring oil-gas-water multiphase flow, and its measurement error reached 15%. Therefore, the error of the traditional standard electromagnetic flowmeter for the measurement of complex multiphase flow is very large. The improvements made in this paper are of great theoretical and practical value to improve the adaptability of electromagnetic flowmeter to complex multiphase flow and to solve the measurement accuracy and stability of industrial complex multiphase fluid.
Principle of magnetic field of electromagnetic flowmeter and influence of its distribution uniformity The differential form of Maxwell's equations 19 where H is the magnetic field strength vector, the unit being A/m; J is the conduction current density vector; E is the electric field strength vector, the unit being V/m; B is the magnetic induction vector (or the magnetic flux density vector), the unit being Wb/m 2 ; D is the electric displacement vector in C/m 2 ; ρ is the free charge body density, the unit being C/m 3 .
It can be seen from the first formula that the current is the source of the magnetic field, and the electric field that changes with time is also the source of the magnetic field. It can be seen from the second formula that the magnetic field and the electric charge that change with time can generate an electric field. It is the field source of the electric field.
According to the above analysis and the relationship between electromagnetics, the variables have the following relationship 8 > > < > > : where ε is the permittivity of the medium, the unit being F/m; μ is the permeability of the medium, the unit being H/m; γ is the conductivity of the medium, the unit being S/m.
The basic differential equation of electromagnetic flowmeter can be obtained from the Maxwell equations, as follows where v ! refers to the velocity vector, B ! is the magnetic flux density vector, = is the Hamilton operator, and U is the induced electric potential. The formula (3) is solved by means of a helper function (Green's function) G, which needs to satisfy The boundary condition of the electromagnetic flowmeter at positions other than the ends of the electrodes is ∂G=∂n ¼ 0. When the medium is isotropic, the basic differential equation (3) is solved where ΔU denotes the voltage difference between two electrodes when the measured fluid flows through the measuring tube; η ¼ πr, r is the flowmeter measurement pipeline radius, l is the measure half of the axial length of the tube. =G is called a "weight function" and can also be written as W, that is, =G ¼ W. The integral is taken over the pipe volume V. It can be seen from the calculation that if the excitation magnetic field B of the electromagnetic flowmeter is constant and the conductive fluid to be measured is axisymmetric, the weight function has no influence on the measurement result, that is, W=1. The measuring signal of the electromagnetic flowmeter is proportional to the average velocity of the measured medium, so v is regarded as a constant in (6). Then, when the measured fluid flows through the measuring tube, the voltage difference between the two detecting electrodes is Formula (6) satisfies Faraday's law of electromagnetic induction. The electromagnetic flowmeter is a kind of meter for measuring the volume flow of the conductive fluid based on Faraday's law of electromagnetic induction. It can be seen from the above formula that if the diameter of the pipe is constant, the inductive electromotive measured between the two electrodes of the flowmeter is proportional to the magnitude of the magnetic induction intensity B and the flow velocity v, and thus the uniformity of the magnetic induction B determines the measurement accuracy of the meter.
In the measurement area, the unevenness of the magnetic induction intensity B leads to the generation of eddy currents, which causes loss of power. On the one hand, the eddy current loss increases the temperature of the fluid and the pipe. On the other hand, it also reduces the strength of the electromagnetic field inside the measuring tube, and weakens the inductive signal.
The main purpose of this paper is to improve the uniformity of the magnetic induction intensity B of the domain field in the area under test, to improve the adaptability of the instrument to the flow state of the measured fluid.
Establishment of magnetic field uniformity index based on area weight magnetic field deviation degree The discrimination and optimization of the magnetic field uniformity in the measured area is the first problem to be considered when building the excitation part of the electromagnetic flowmeter. Therefore, an index function for judging the uniformity of magnetic field is proposed where S i denotes the area of each unit in the measured area and B i is the average value of the magnetic field on each small area where B pi refers to the extent to which each small unit deviates from the average of the overall magnetic induction where B s denotes the standard deviation of magnetic induction strength in the overall range of the measurement area where B cv denotes the overall normalized standard deviation (coefficient of variation), its value being the ratio of the standard deviation and the mean. B avg is a physical quantity that characterizes the magnitude of magnetic induction strength; the larger the value, the stronger the magnetic induction. The smaller the B pi , the smaller the deviation of each unit from the average value, the more desirable the uniformity of flux density in the measured area. The smaller the value of B s and B cv , the more desirable the uniformity of flux density in the measured area.
The average value calculation formula for general indicators can be written as Formula for calculating standard deviation can be written as Generally, traditional indices take the nodes as sample data, and the influence of the weight coefficient is not taken into consideration. Besides, the description of some indicators is ambiguous and is unable to accurately reflect the uniformity of the whole area under test. In the new indicator, all calculations are based on each unit and consider all points in the measured area. For example, the average value of the magnetic flux density B is based on each unit. The product of the area and the average flux density of each unit are taken as a basic item, the basic items of all the units are summed, and then quotient calculation is carried out given the total area of the area under test. The weight coefficient of each unit is considered, which essentially reflects the uniformity of the area under test.

Comparison of simulation and evaluation of standard electromagnetic flowmeter models
Based on the evaluation indicators proposed above, two traditional electromagnetic flowmeter excitation systems are modeled and simulated by ANSYS. The traditional electromagnetic flowmeter models are shown in Figures 1 to 3.
Considering the simple structure of the above model and the regular geometric shape of each part, intelligent grid division was carried out, and the level of division was set as the first level, as shown in Figures 4 and 5.
By using ANSYS simulation software to simulate Model 1 and Model 2 in the same way, the equivalent maps of the magnetic flux density B in the measured areas are obtained, as shown in Figures 6 and 7.
It can be seen in the color contour bar of Figure 6 and Figure 7 that the magnetic flux density of the model 2 is more concentrated. By using the evaluation index system based on area weight magnetic field deviation degree, the magnetic field uniformity of the two traditional electromagnetic flowmeter models is calculated and analyzed, and compared with the results of calculation and analysis using general evaluation indexes. The results are shown in Table 1.
It can be seen in Table 1 that compared with the general index, the results obtained by the new index tend to be more ideal for the uniformity of the magnetic field, and the calculation results are more concentrated. It proves that the new evaluation index system proposed in this paper is feasible.

Structural improvement and simulation optimization based on area weight magnetic field deviation degree
Based on traditional electromagnetic flowmeter, a new excitation model of electromagnetic flowmeter is proposed. Its purpose is to improve the uniformity of the magnetic field of the measured region by reducing the deviation degree of the magnetic field of the area weight, and reduce the influence of the eddy current caused by the uneven magnetic field on the measurement results. Meanwhile, the adaptability of the electromagnetic flowmeter excitation system to the flow pattern is enhanced.

Simulation analysis of improved electromagnetic flowmeter excitation model
The new electromagnetic flowmeter excitation structure model proposed is shown in Figure 8. θ is the "Magnetic Pole Detection Angle". This model improves the excitation part of the electromagnetic flowmeter. Based on the traditional rectangular magnetic poles, part of the arcshaped magnetic poles is protruded close to the measuring tube, and the magnetic field uniformity of the measured area is improved by making the direction of the magnetic field lines more concentrated in the measuring area. At the same time, the coil position of the traditional electromagnetic flowmeter is also modified, and the excitation coil away from the magnetic pole is pressed close to the sides of the magnetic pole to reduce the crosssectional area of the coil. When the magnetic flux is the same, the smaller the cross-sectional area, the greater the magnetic flux density.
The improved electromagnetic flowmeter excitation model is simulated by ANSYS simulation software.
All internal regions are represented by PLANE13 and PLANE53. Low carbon steel is used as the magnetic pole material, the relative magnetic permeability is set to be μ ¼ 2000, and the static analysis type is defined and the model is solved. The measured area as well as the unit attached to the surface is selected, and the equivalent map diagram of the magnetic flux density B in the area under test is shown in Figure 9.
It can be seen in Figure 9 that the magnetic flux density of most regions in the middle of the new model is very close, while greater deviations of the magnetic flux density are seen only in small areas at the edge. It proves that the magnetic field distribution of the new model designed in this paper is very uniform.
All areas are selected, and the overall magnetic field strength vector diagram is shown in Figure 10, and the overall    Figure 11. It can be seen from Figures 10 and 11 that the magnetic vector of the improved electromagnetic flow sensor model is more evenly distributed in the measuring tube region.
When the applied current density and material properties are kept constant, the cell area and the cell average value can be derived from Figures 6, 7, and 9. The mean value, standard deviation, and normalized standard deviation of the magnetic flux density B of each model are calculated and compared, as shown in Table 2.
It can be seen in Table 2 that compared to the two conventional models, the difference between the maximum and minimum values of the improved model flux density is obviously smaller, and the flux density is more concentrated. Its average value is larger than those of the other two models, and the standard deviation and normalized standard deviation are much smaller. Therefore, the index function shows that the improvement efforts made by this paper are feasible.
Simulation analysis of the optimal magnetic pole detection angle of the improved magnetic field model It can be seen from above that the improved model proposed is proven to be better than the traditional electromagnetic flowmeter excitation models. Next, numerical simulation will be used to determine the detection angle of magnetic pole satisfying the optimal magnetic field uniformity of the improved excitation model.     The magnetic poles have different angles of detection, and the induced magnetic fields show different distributions of intensity. In order to determine the optimal magnetic pole probing angle, the detection angle of magnetic pole from 30°to 60°is simulated every 2°, and a map of the magnetic field distribution at each angle is obtained. Since variations in the magnetic field distribution are more prominent between 40°and 50°, simulations are carried out every 1°in this range.
A model is established under the global Cartesian coordinate system. The current density J s ¼ 9 × 10 6 A/m 2 and the degree of freedom AZ = 0 are applied, and the analysis type is set to static analysis. The results are extracted for each angle, and the corresponding mean standard deviation and normalized standard deviation are calculated for further processing and interpretation.

Influence of magnetic pole detection angle on magnetic field distribution
Based on the index function, the data obtained in the previous section is analyzed and processed. We can get the influence of different detection angle of the magnetic pole on the magnetic field distribution in the measured area of the electromagnetic flowmeter and the optimal detection angle of the magnetic pole. The results are shown in Table 3.
A variation curve of each variable with the value of the magnetic pole detection angle a is obtained to facilitate the comparison of the results, as shown in Figures 12 to 14.     Figure 12 that the average magnetic flux density is generally in a downward trend. In Figures 13  and 14, the standard deviation and the normalized standard deviation in a decreasing trend when the magnetic pole detection angle is 30°-45°, but it is an upward trend when the magnetic pole detection angle is 45°-60°. Therefore, according to the index function, it can be inferred that the magnetic field of the measured area has the highest degree of uniformity when the magnetic pole is detected at an angle of 45°.
Further calculate the magnetic field deviation when the magnetic pole is detected at an angle of 45°B (13) The result meets the second indicator. In the new model, the evaluation index of the deviation degree of the area weight magnetic field is used to determine the magnetic field uniformity of the model. When the magnetic pole detection angle is 45°, the mean magnetic flux density value B avg is not the highest, but the standard deviation of the magnetic flux density, B s , and the overall normalized standard deviation, B cv , are the smallest. Therefore, the evaluation index system established in this paper can determine that the optimal value of the angle of magnetic pole detection is 45°.
Based on the simulation results, a new type of electromagnetic flowmeter for complex multiphase flow metering in oilfield wellheads is designed. This electromagnetic flowmeter refers to an electromagnetic flowmeter that measures the situation of multiphase flow with a small amount of gas mixed in the pipeline. It is known that the composition of the fluid tested in the experiment includes water: 93.09%; gas: 2%; oil: 4.41%; solid particles: < 0.5%.
The photo of the prototype test site is shown in Figure 15.
The measured inductive voltage of the electrode is shown in Figure 16. It can be seen from the Figure 16 that the detection signal is stable and reliable, and the flow velocity characteristics are obvious.
After the gas phase interference is eliminated by gasliquid separation, the liquid production amount measured    by the volumetric method is taken as the actual value of the flow rate and then compared and analyzed. Considering the flow data fluctuation of complex multiphase flow, the prototype takes 24 h as the measurement time unit and is continuously tested in the field, and the results of the comparison between the test output and the actual output are shown in Table 4.
It can be seen in the Table 4 that the average error between the test output and the actual output is about 5% when the prototype works for a day. Compared with the traditional electromagnetic flowmeters used in Daqing Oil Field in China, which have an error rate of more than 20%, the flow detection accuracy of the complex multiphase flow flowmeter designed in this paper is greatly higher.

Conclusion
An evaluation index system based on area weight field deviation degree is proposed, and a new excitation model of electromagnetic flowmeter is established. Compared with the traditional electromagnetic flowmeter excitation model, the following conclusions are drawn: 1. The evaluation index system based on area weight magnetic field deviation degree is established. On this basis, a new electromagnetic flowmeter excitation model is designed, so that the magnetic lines are more concentrated in the measured area, and the uniformity of excitation magnetic field in the measured area is greatly improved. 2. The influence of excitation magnetic field on the accuracy of flowmeter is solved in the new model. The concept of fluid flow adaptability of electromagnetic flowmeter is proposed, and its influence on measurement results is analyzed. The evaluation index based on area weight deviation degree is used to guide the design of this new model and to solve the problem. 3. According to the index function, optimization analysis and numerical simulation of the magnetic poles of the improved excitation model are carried out, and the optimal value of the magnetic pole angle is determined to be 45°. Based on this, a new type of complex multiphase flow flowmeter for complex multiphase flow metering in oilfield wellhead is designed.
Comparing the test output with the actual output, it can be seen from the comparison that the measurement accuracy of the electromagnetic flowmeter designed in this paper is about 5% for the measurement of complex multiphase flow with a small amount of oil and gas. Among them, the minimum detection error can reach 4.26%.
In future, based on the new electromagnetic flowmeter designed in this paper, we can introduce capacitance imaging technology to measure the area occupied by bubbles in the cross section of the pipe that flows through the electrode of the electromagnetic flowmeter at every moment. Then the measurement results of electromagnetic flowmeter are corrected in real time, which can further improve the measurement accuracy. That is, the effective fluid area is obtained by subtracting the bubble area at each moment from the cross-sectional area of the pipe. A more accurate flow rate can be obtained by multiplying the effective fluid area by the average flow velocity measured by the electrode at that time.