The Nuclear Magnetic Flowmeter for Monitoring the Consumption and Composition of Oil and Its Complex Mixtures in Real-Time

: The necessity of increasing the efﬁciency of primary oil puriﬁcation in a drilling station or an offshore platform has been substantiated. We consider the problems that arise during the primary processing of oil mixtures. Important conditions for increasing the efﬁciency of primary puriﬁcation (separation) of oil mixtures include measuring the consumption and determining the content of various impurities (water, undissolved particles) and air in them, with an error of no more than 2%. We analyzed the possibilities of using various designs of ﬂowmeters to measure the consumption of the oil mixture coming from a well. It is also necessary to use other measuring instruments to control the state of this mixture, which creates additional problems (searching for an appropriate locations to place them, providing the required operating conditions). Various designs of nuclear magnetic ﬂowmeters–relaxometers were considered, making it possible to measure the consumption of a liquid medium and its times of longitudinal T 1 and transverse T 2 relaxation with one device. The measured values of T 1 and T 2 determine the state of the medium. The design of the industrial nuclear magnetic ﬂowmeter–relaxometer M-Phase 5000, which is used to control the ﬂow and quality of oil and oil products, was considered in more detail. Problems were identiﬁed that did not allow using this design of a nuclear magnetic ﬂowmeter–relaxometer in a drilling rig or offshore platform. A new design of a nuclear magnetic ﬂowmeter–relaxometer was developed, implementing the methods for measuring q , T 1 , and T 2 . These methods and various technical solutions make it possible to use this device at a drilling station or offshore platform. The measurement errors of the consumption q , T 1 , and T 2 were determined. The results of various media studies are presented and compared with q , T 1 , and T 2 measurements on other devices and measured volume (to conﬁrm the adequacy of q measurements). The application scopes of the developed nuclear magnetic ﬂowmeter–relaxometer were determined, in addition to the systems of primary oil processing.


Introduction
Oil is currently one of the primary energy sources for the movement of various objects (vehicles, aircraft, helicopters, ships) [1][2][3][4][5]. In addition, mobile diesel power plants are often needed to solve many tasks (for example, work on the route of an oil pipeline to ensure the operation of a drilling platform) [6][7][8][9]. These and other factors make oil a strategic raw material that has a huge impact on the economy and politics in the world [9,10]. Despite the development of other energy sources [11][12][13][14][15][16], it is currently impossible to completely abandon the use of hydrocarbon fuels. The global demand for oil is growing (even a pandemic cannot stop this process). Oil reserves in easily accessible fields have significantly decreased. Many companies are forced to develop oil fields in difficult conditions (for example, in the Arctic regions or on the sea shelf using drilling platforms) [17][18][19][20][21][22][23]. In addition, the depth of the reservoir from which oil is extracted has increased, leading to cost increases of production and primary processing of oil. Fluctuations in market prices for oil has created large financial problems that affect profits (funds allocated for research and development in various sectors of the economy are reduced). Under such conditions, reducing the cost of oil production and processing becomes extremely important [24][25][26][27].
The solution to this problem includes several directions in scientific developments and the introduction of new technologies. Various groups of scientists and engineers have realized these directions.
One of these areas involves increasing the efficiency of primary oil treatment at drilling stations or platforms (its purification (separation) from water, associated gas (including oxygen), insoluble impurities, etc.).
It further determines the quality of energy sources produced from oil [5,[28][29][30][31][32][33][34][35][36][37]. The oil processing process should occur in an automatic (continuous) mode. Large volumes of high-pressure water are pumped into the reservoir in deep oil production, leading to the destruction of rocks and the appearance of additional impurities. It should be noted that, during the production process, the concentration of water, associated gas, and various solid impurities in the oil flow, are constantly changing.
To ensure high efficiency in the primary separation process (cleaning) of oil, in addition to the consumption of the oil flow (or flow rate), it is necessary to obtain information on the concentration of water, associated gas, and various impurities in it [37][38][39][40][41][42][43][44][45][46][47]. This information must be fed into the control system in real-time to adjust the separator's operation automatically. Further work on the oil preparation for its transportation through a pipeline or loading into a tanker depends on the effectiveness of the primary oil purification. If the control measurements in the oil show non-compliance with the standards, a second cleaning is performed, which requires additional funds and time. Cleaning a tanker's dirt, water emulsions, and other impurities, is very expensive. Rapid additional separation of the oil stream when loading it into a tanker, or before pumping it into the main pipeline, may not provide the requirements for oil quality after an inefficient first treatment.
Some difficulties arose while using these devices to determine the oil flow parameters that enter the primary treatment from the well. Ultrasonic flowmeters cannot be used at this stage of the technological cycle due to the presence of air in the oil stream. Therefore, they were replaced by flowmeters operating on the Coriolis force. These devices also have several significant drawbacks: large dimensions and weight, the strong influence of the temperature factor and vibrations on the measurement results, the small dynamic range of measurements, the viscosity of the medium should not exceed 1500 mPa·s, and the content of gas inclusions in the liquid should not exceed 5%. These limitations can lead to more than 5-10% or more measurement errors. In addition, to determine the presence of water, air, and impurities in oil, it is necessary to use other measuring instruments (mainly optical) [69,70,72,[101][102][103]. Gradually, the use of these flowmeters will be abandoned. These devices are being replaced by electromagnetic flowmeters. In these devices, a calibration dependence is used to determine the value of q, obtained at the enterprise manufactured device [54][55][56][57][58][104][105][106]: where E is the potential difference arising from the interaction of moving an electrically conductive liquid with a magnetic field and B is the magnetic induction. D is the distance between the ends of the electrodes (coincides with the inner diameter of the flowmeter pipeline made of a non-magnetic material), and k is a correction factor that depends on temperature T and the composition of the liquid medium (set by the enterprise when calibrating the device). The enterprise's electromagnetic flowmeters are not tested on oil media coming from the well for primary treatment. Standard model solutions and "clean" oil are used. In addition, no one exactly knows how much water, gas, or various impurities will be contained in the oil from the well. Therefore, the average value k is taken (considering the type of oil). It increases the consumption measurement error by at least 1.5% when using electromagnetic flowmeters for measurements in oil flows from wells.
Various coatings are applied to the electrodes to increase the service life in electromagnetic flowmeters [105][106][107]. The use of coatings on the electrodes do not allow electromagnetic flowmeters to measure the consumption of liquid media with ionic conductivity. They can only be used to measure consumption in liquid media with electronic conductivity, such as water or hydrocarbons [104][105][106]. The appearance of impurities with ionic conductivity in the current oil flow will decrease the measured value E. Following (1), q will decrease (in reality, the pipeline's oil flow rate or consumption does not change). The separator control system will receive false information about the value q, and the cleaning efficiency of the oil mixture will decrease.
In the presence of air or impurities with low electronic conductivity, the value E also decreases. It will decrease q as determined by (1). In reality, the oil flow rate through the pipeline does not change. The separator's automatic system is rebuilt for a new unreliable value of q, reducing the efficiency of cleaning the oil mixture.
The appearance of water in the oil flow, whose electronic conductivity is higher than that of oil, increases the value E. In accordance with (1), q increases. The separator control system will receive unreliable information about the value q, affecting the efficiency of cleaning the oil mixture.
It is necessary to use other measuring instruments (mainly optical) to determine the presence of water, air, and various impurities in the oil flow (as in the case of using mechanical flowmeters). If there are many undissolved impurities in it, the error in determining the amount of water in this flow with an optical device can exceed 15-20%.
In addition, in the current flow, impurities and air are unevenly distributed over the cross-section of the pipeline. This increases the scattering of optical radiation and creates interference from multiple reflections, increasing the measurement error. The concentration of impurities in such a situation is not determined (the level states only their presence: high, medium, and low).
For these reasons, in most cases, separation systems during the primary purification of the oil mixture are adjusted according to the average values of q, the content of water, air, and impurities. In this case, an electromagnetic flowmeter is necessary to control pumping this mixture out of the well (control of the production process by changes in the oil consumption). For these purposes, standard models of electromagnetic flowmeters with coatings on electrodes are used to measure the consumption of "clean" oil in pipelines. Therefore, to ensure the required oil quality, it is often necessary to use a second cycle of cleaning the oil mixture.
Considering the deterioration in the quality of crude oil from wells, this situation does not suit oil companies for the reasons noted earlier. Scientists are faced with new challenges in finding solutions to this problem. Various studies (their results are presented in the text of the article) have shown that modernization of the used systems for monitoring the parameters of crude oil in the flow from the well does not allow solving it.
In these designs, to measure the q and the longitudinal T 1 and transverse T 2 relaxation times, the pulse technique is mainly used (T 1 and T 2 are determined from the decay of the free induction signal, and the value of q is determined from the attenuation of the NMR signal amplitude over time). In several NMR flowmeter models for measurement q, calibration dependencies are used (for example, the amplitude change dependence of the NMR signal from the change of q).
In the industrial flowmeter, M-Phase 5000 for measurements are used pulse techniques; the measurement range of q is from 2 to 20 m 3 /h when the temperature of "clean" oil changes from 293 to 308 K [88,108,125,126] at pipeline diameters of 100-200 mm. The measurement error in determining q is about 2%. The error in measuring the times of longitudinal T 1 and transverse T 2 relaxation is about 1.5% (the state of the current medium is determined from their values). For the main pipeline diameter of 200 mm, the range of the measured oil flow rate by a nuclear magnetic flowmeter-relaxometer ranges from 5 to 110 mm/s.
In pipelines for primary treatment, the oil mixture flows at 100 to 800 mm/s. The pipeline diameter varies from 50 to 100 mm. Analyzing these parameters, we can conclude that the M-Phase 5000 industrial nuclear magnetic flowmeter-relaxometer can be effectively used at this stage of the oil refining process cycle. A more detailed analysis shows several problems that will arise when using this device. They are associated with using a pulse technique for measuring the consumption of a liquid flowing medium and its relaxation times T 1 and T 2 . For these measurements, we use the dependence constructed from the amplitude peaks during the decay of the NMR signal after exposure to a magnetized liquid of a π/2 pulse and a sequence of 7 π-pulses. It is necessary to provide a signal-to-noise ratio (S/N) greater than 3.0 in the registered NMR signal to perform measurements with an error of less than 2%. The current medium must be in the polarizing magnet (pre-polarization region [88,108,125,126]) for a time t p to do this, which is determined by the following relationship [91][92][93][94][95][96][97][98][99][100]124,[127][128][129][130]: If the liquid medium is in the polarizer magnet for a time less than t p = V p /q (V p is the volume of the polarizer), then this leads to its incomplete magnetization [91][92][93][94][95][96][97][98][99][100]124,[127][128][129][130]. The amplitude of the registered NMR signal decreases. The S/N ratio decreases. If the S/N ratio becomes less than 3.0, it is impossible to measure the q, T 1 , and T 2 values with a measurement error of no more than 2.0% [74,76,78,80,82,87,88,90-92,95,97,98,100,108-112, 114,115,117-123]. The measurement error of these quantities will increase to 3% or more.
In addition, a certain time interval must be provided between the pulses (π/2 and π) in the radiofrequency coils. Moreover, the interval between the moments of registration of the NMR signal in the receiving coils after each impact on the magnetization of the flowing liquid by a π-pulse should be provided. It is necessary to determine T 2 from the decay of the free induction signal. The magnetized liquid must be in the field of the magnet of the NMR signal detection system for a time greater than 3T 2 to do this. In addition, in this magnetic system, it is necessary to measure the values of q and T 1 from the decrease in magnetization due to relaxation processes (that requires additional time comparable to the T 1 value). The residence time of the current liquid in the magnet of the registration system t r must be greater than 3T 2 + T 1 . It requires a significant length of the straight section of the pipeline in the flowmeter.
Such requirements lead to the fact that the length of the M-Phase 5000 nuclear magnetic flowmeter-relaxometer is more than 3.6 m, and the device's weight exceeds 1150 kg. In the conditions of a drilling rig or an offshore platform, it will be difficult to place a device with such dimensions and weight.
In this technological cycle of cleaning the oil mixture, pipelines of a smaller diameter are used in oil transportation systems (the flow rate of the liquid mixture is four times higher). In this case, the times t p and t r must be quadrupled to ensure the process of measuring q and relaxation times with an error of less than 2%. In this case, the length of the device will increase to 15 m (weight can increase up to 4000 kg). These parameters need to be further increased by at least 20% since T 1 and T 2 for the oil mixture from the well are longer than for "clean" oil (therefore, t p and t r will change). It would be unrealistic to use a device with such dimensions and weight at a drilling station or offshore platform since there are severe restrictions on the placement space and weight of the measuring equipment.
Assume that we use two transitional connections with a length of more than 500 mm (for the transition from a pipeline with a diameter of 100 mm to a pipeline with 200 mm before the flowmeter and back after). Then, when measuring the parameters of the oil mixture, it will only be necessary to make changes to the design of the nuclear magnetic flowmeter-relaxometer M-Phase 5000 related to an increase in T 1 and T 2 . The flow rate of the oil mixture from the well through the pipeline υm in the nuclear magnetic flowmeterrelaxometer M-Phase 5000 will be the same as when measuring the parameters of "clean" oil (the diameter of the pipeline was changed from 100 to 200 mm with transitional connections, the value of υm decreased by four times). In this case, the length of the instrument's measuring structure will increase to 5.4 m (with weight up to 1450 kg). Difficulties with placing such a device on a drilling rig or an offshore platform will increase. In principle, they probably could have been solved if there was no other problem.
It is necessary to provide currents of the order of 10 A in the radio frequency coil at voltages of several kilovolts (pulse duration of 0.001 s is considered at a fill rate of 10 MHz) to form a forced precession of magnetic moments in a magnetized liquid using a π/2 pulse and a sequence of seven π-pulses for large pipeline diameters (for example, 200 mm). In the case of an increase in the duration of the pulses, it will be necessary to increase the size and dimensions of the nuclear magnetic flowmeter-relaxometer. On a drilling rig or an oil platform, the device is operated in conditions of high humidity (rain, snow, sea breeze). Working with such voltages and currents under these conditions will greatly endanger people. Possible measures to protect the device from humidity raise serious doubts about its practical effectiveness and feasibility. For these reasons, a nuclear magnetic flowmeter-relaxometer based on the M-Phase 5000 model is not currently used at this stage of the oil mixture purification process.
Therefore, developing new models of nuclear magnetic flowmeters-relaxometers to solve this complex problem and control the consumption and the state of "clean" oil and hydrocarbons with higher accuracy than other devices is critical. In our work, one of the possible solutions is presented.

The Design of a Nuclear Magnetic Flowmeter-Relaxometer for Monitoring the Parameters of the Flowing Medium
Determining the consumption (or flow rate) of flowing fluid in a pipeline and measuring relaxation times T 1 and T 2 have been considered in many works, since 1946. The first experiments using NMR for research on flowing liquid were conducted by Suryan [131], who found that the nuclear absorption signal changed in proportion to liquid velocity. The first industrial design of the NMR flowmeter was developed by Vander et al. [132] in the late 1960s. This design had very limited industrial applications. Further, in scientific publications and monographs, descriptions of various NMR spectrometers, flowmeters, and relaxometers appeared for studying and measuring the parameters of a flowing liq-  [74,76,78,80,82,87,88,[90][91][92]95,97,98,100,[108][109][110][111][112]114,115,[117][118][119][120][121][122][123]. Many of these works have greatly contributed to the development of the theory and technology of NMR in a flowing liquid, allowing scientists and engineers from the Krohne company to manufacture a multifunctional industrial NMR flowmeter-relaxometer [88,108,125,126]. Considering the results of various studies [74,76,78,80,82,87,88,[90][91][92]95,97,98,100,[108][109][110][111][112]114,115,[117][118][119][120][121][122][123][124][125][126][127][128][129][130][131][132], as well as data on the operation industrial NMR flowmeter-relaxometer M-Phase 5000 (Krohne company), we developed the design of a laboratory prototype of a nuclear magnetic flowmeter-relaxometer. The block diagram of the developed design is shown in Figure 1. experiments using NMR for research on flowing liquid were conducted by Suryan [131], who found that the nuclear absorption signal changed in proportion to liquid velocity. The first industrial design of the NMR flowmeter was developed by Vander et al. [132] in the late 1960s. This design had very limited industrial applications. Further, in scientific publications and monographs, descriptions of various NMR spectrometers, flowmeters, and relaxometers appeared for studying and measuring the parameters of a flowing liquid [74,76,78,80,82,87,88,[90][91][92]95,97,98,100,[108][109][110][111][112]114,115,[117][118][119][120][121][122][123]. Many of these works have greatly contributed to the development of the theory and technology of NMR in a flowing liquid, allowing scientists and engineers from the Krohne company to manufacture a multifunctional industrial NMR flowmeter-relaxometer [88,108,125,126]. Considering the results of various studies [74,76,78,80,82,87,88,[90][91][92]95,97,98,100,[108][109][110][111][112]114,115,[117][118][119][120][121][122][123][124][125][126][127][128][129][130][131][132], as well as data on the operation industrial NMR flowmeter-relaxometer M-Phase 5000 (Krohne company), we developed the design of a laboratory prototype of a nuclear magnetic flowmeter-relaxometer. The block diagram of the developed design is shown in Figure 1. The liquid flowing through the pipeline enters the magnetic system (magnet polarizer 1). This magnet creates a strong field between the poles with an induction Bp ≈ 1.532 T (inhomogeneity 0.02 cm −1 ). The section of the pipeline (polarizing vessel 2), which is located between the poles of the magnet 1, is made in the form of a spiral (this is necessary so that the liquid medium is under the action of the Bp field for more time). The volume of the polarizer vessel Vp is increased to ensure the fulfillment of condition from formula (2). Further, the magnetized liquid enters the nutation coil 4 through the connecting section of the pipeline with a diameter of 100 mm. In the nutation coil, under the influence of a resonant variable radio field H1, the orientation of the nuclear moment magnetization vector Mp changes. The complete inversion of the magnetization Mp-the rotation of the The liquid flowing through the pipeline enters the magnetic system (magnet polarizer 1). This magnet creates a strong field between the poles with an induction B p ≈ 1.532 T (inhomogeneity 0.02 cm −1 ). The section of the pipeline (polarizing vessel 2), which is located between the poles of the magnet 1, is made in the form of a spiral (this is necessary so that the liquid medium is under the action of the B p field for more time). The volume of the polarizer vessel V p is increased to ensure the fulfillment of condition from formula (2). Further, the magnetized liquid enters the nutation coil 4 through the connecting section of the pipeline with a diameter of 100 mm. In the nutation coil, under the influence of a resonant variable radio field H 1 , the orientation of the nuclear moment magnetization vector M p changes. The complete inversion of the magnetization M p -the rotation of the vector by the angle ϕ n = 180 • occurs relative to the direction of the constant magnetic field at the resonant frequency f n of the radio field H 1 . The frequency f n is related to the magnetic field B 0 in which the nutation coil 4 is located, as follows: where γ is the gyromagnetic ratio of the nuclei. The maximum S/N ratio of the recorded NMR signal from a liquid with magnetization inversion in the recording circuit 12 corresponds to a certain radio field amplitude H 1 in the nutation coil 4 with a frequency f n following (3). The automatic gain control (AGC) circuit located in the processing and control device 14 adjusts the amplitude of the H 1 field in the nutation coil 4 to the maximum S/N ratio. The processing and control device 14 also houses an automatic frequency control (AFC) circuit that adjusts the frequency f n of the nutation generator 16 to the maximum S/N ratio. After the liquid passes through the measuring section of pipeline 7, the magnetization value is recorded by coil 9, which is in the field B a of the analyzer magnet 8 (B a = 0.456 T, inhomogeneity 0.0005 cm −1 , d a = 218 mm), connected to a high-frequency generator of weak oscillations (autodyne), which is part of the recording circuit 12. A modulation technique is used to record the NMR signal [87,[94][95][96][97]114,115,133]. This technique makes it possible to reduce the time t r of the flowing liquid in the magnet analyzer 8, which is necessary for measuring q, T 1 , and T 2 , to a value of 2.5 T 2 . The vessel analyzer 10 is made in the form of a cylinder with a diameter of 200 mm in the area of the coil 9 to improve the S/N ratio. In addition, a two-fold increase in the diameter of the pipeline makes it possible to reduce the flow rate of the liquid in the registration coil 9 by four times. This makes it possible to reduce the linear dimensions (the length of the poles) of the analyzer magnet 8.
In the device developed by us, the NMR signal is recorded from all protons of crude oil that are in the volume of the registration coil 9. Since an autodyne detector (integrated device) is used to register the NMR signal, the distribution of protons over the volume of the registration coil 9 does not play any role (the total sum is taken from all magnetic moments from all protons). Optical radiation or light is not used in the instrument for measurements. The presence of impurities and air in crude oil is determined by the values of the relaxation times and the change in the amplitude of the registered NMR signal. It is one of the main advantages of the device developed by us compared to the use of a measuring complex of an electromagnetic flow meter and an optical analyzer to control the parameters of the flow of crude oil from a well. Mixing and heterogeneity of impurities and air in the crude oil stream can be anything (the signal-to-noise ratio of the registered NMR signal must be greater than 3).

The Results of Experimental Investigations and the Measuring Principle of the Consumption and the Relaxation Times T 1 and T 2 in Flowing Liquid
The conducted studies of the motion of the magnetization vector M z in the nutation coil 4 made it possible to obtain, in the device design developed by us, the shape of the NMR signal from the flowing medium necessary for measuring q, T 1 , and T 2 . Figures 2 and 3 show, as an example, the registered NMR signals from the feedwater (water that has been specially prepared for use in the second loop of a nuclear reactor) at 299.3 K.   If φn = 90° = 270°, the components of the magnetization vector Mz = Mx = My = 0; therefore, Us = 0 in the registration scheme. An analysis of the obtained results shows that the recorded NMR signal (Figures 3 and 4) has a high resolution (more than five damped peaks-"wiggles"). This makes it possible to measure T1 and T2 with an error of no more than 1% using the following methods. The dependence of the decay of the free induction signal is used to determine the value of T2 [133,134]. A curve is drawn along the maxima of the peaks of the recorded NMR signal from the feedwater (Figure 4-graph 1). Feedwater was chosen for experiments as a liquid medium because its relaxation times T 1 and T 2 are very close to the values of the relaxation times of oil mixtures coming from their wells (for example, mixtures in oil fields near the cities of Ukhta and Novy Urengoy (Russian Federation)). In these regions, mining is carried out in very difficult climatic conditions. The NMR waveform in Figure 2 corresponds to the rotation angle of the magnetization vector ϕ n = 0 • , and ϕ n = 180 • in Figure 3 (NMR signal with magnetization inversion in flowing liquid).
If ϕ n = 90 • = 270 • , the components of the magnetization vector M z = M x = M y = 0; therefore, U s = 0 in the registration scheme. An analysis of the obtained results shows that the recorded NMR signal (Figures 3 and 4) has a high resolution (more than five damped peaks-"wiggles"). This makes it possible to measure T 1 and T 2 with an error of no more than 1% using the following methods. The dependence of the decay of the free induction signal is used to determine the value of T 2 [133,134]. A curve is drawn along the maxima of the peaks of the recorded NMR signal from the feedwater (Figure 4-graph 1).  This curve can be approximated by the following function [80,81]: where a is the rate of change in the detuning of the magnetic field, T2 * is the effective time This curve can be approximated by the following function [80,81]: where a is the rate of change in the detuning of the magnetic field, T 2 * is the effective time of transverse relaxation, U 0 is the maximum value of the amplitude of the registered NMR signal.
The T 2 value of the flowing medium, in this case, is determined using the following formula [133,134]: where ∆B a is the inhomogeneity of the magnetic field in the area where the NMR signal registration coil is located.
In the case of small values of ∆B a , the contribution of this term to (6) in determining the value of T 2 is small and T 2 ≈ T 2 * . The transverse relaxation time can be immediately determined using the registered NMR signal. With an increase in the inhomogeneity of the magnetic field ∆B a , the number of peaks in the registered NMR signal (Figure 4) decreases. The error in determining T 2 * increases. Therefore, it is not always advisable to use our NMR flowmeter-relaxometer design for large pipeline diameters (only in the case of low liquid flow rates, when it is possible to reduce the pipeline diameter in the NMR signal registration zone).
To measure the value of T 1 in the design of the NMR flowmeter-relaxometer, we use the method developed by us using two modulation modes of the field B a [114,115]. This method is successfully used in NMR devices (developed by the authors of this article) for express control of the state of condensed media [87,135,136]. T 1 and T 2 measurements are carried out simultaneously using the same registered NMR signal.
The following technique is implemented to determine the value q in the developed design of the device. The moments of flowing liquid arrival with and without inversion of magnetization (Figures 2 and 3) to the registration coil 9 are recorded. For example, after the flow with the inversion of magnetization enters the registration coil 9, the control and processing unit 14 generates a pulse. This pulse opens one of the switches of system 15. The nutation coil 4 stops receiving the sinusoidal voltage from generator 16, and the magnetization inversion does not occur in it.
Further, the flowing liquid without magnetization inversion enters after some time into the registration coil 9. The NMR signal is registered (Figure 2), and a rectangular pulse is generated, which closes one of the switches 15. A sinusoidal voltage is supplied to the nutation coil 4 from generator 16, and the magnetization inversion is formed, etc. In this case, information about q is represented as a rectangular pulse, the duration τ n of which is equal to the time of the liquid medium flow from the nutation coil 4 to the registration coil 9 (Figure 1). The value q, in this case, is determined from the following relationship: where V c is the volume of the connecting section of the pipeline 7 between the nutation coil 3 and the registration coil 10.
The error ∆q in determining the consumption in the developed design will be determined by the stability of the comparator's operation levels in the control circuit (this error is less than 0.5%). Moreover, by the error in determining the volume V c (for all permissible errors in measuring the inner diameter of the pipeline and the distance between coils 3 and 10, this error will be less than 0.3%. This error will increase to 0.5%, considering the degradation of the pipeline during the operation of the device. Using the developed NMR flowmeter-relaxometer to control an oil mixture containing gas, water, and insoluble impurities, problems may arise with determining the trigger level of the comparator in the registered NMR signal from the flowing medium with magnetization inversion. This is because the amplitude of the registered NMR signal from a flowing liquid with magnetization inversion is smaller in absolute value than the amplitude of the registered NMR signal from a flowing liquid without magnetization inversion (Figures 2 and 3). The magnetization inversion in the flowing fluid is formed in the nutation coil 4. This process depends on the value of q and the presence of water, gas, and various impurities in the flowing medium. All these parameters can change rapidly in the flow of the oil mixture from the well. The trigger level of the comparator will constantly change. At some point, for example, when the q changes rapidly, a situation may arise when the magnetization inversion is not realized (the AFC and AGC systems will not have time to build the frequency f n and the field H 1 to obtain it). In coil 9, a classical NMR signal is recorded for the case of using the modulation technique ( Figure 3). Consumption measurement will be terminated, automatic control in the device will not be able to restore the q measurement without turning it off. The control of the technological process of cleaning the oil mixture will be violated. To exclude this case in this device design, we used an additional modulation of the field B 0 , in which the magnetization inversion was formed in the flowing liquid. Radio frequency coil 5 was placed between the poles of permanent magnet 6 to do this. The experiments performed showed that by changing the frequency f m and the amplitude B m of the modulation field, it is possible to obtain registration of an NMR signal from a flowing liquid with magnetization inversion at the noise level ( Figure 5) in a wide range of values q. In this case, the trigger level of the comparators can be set by half the amplitude of the recorded NMR signal Us from the flowing liquid without magnetization inversion. This level is easily determined and is the same for the two considered cases of triggering the comparators. In such a situation, information about the consumption of the current medium q is represented as a rectangular pulse (meander), the period of which Tn is equal to twice the time τn. The q value is calculated using the following formula: In Figure 6, as an example, the process of measuring q of feed water in a pipeline is shown. In this case, the trigger level of the comparators can be set by half the amplitude of the recorded NMR signal U s from the flowing liquid without magnetization inversion. This level is easily determined and is the same for the two considered cases of triggering the comparators. In such a situation, information about the consumption of the current medium q is represented as a rectangular pulse (meander), the period of which T n is equal to twice the time τ n . The q value is calculated using the following formula: In Figure 6, as an example, the process of measuring q of feed water in a pipeline is shown. to twice the time τn. The q value is calculated using the following formula: In Figure 6, as an example, the process of measuring q of feed water in a pipeline is shown. In fact, the device implements a frequency measurement of the q value since the meander period is measured. In this case, the error of the trigger levels of the comparators becomes irrelevant. A delay error appears, which is associated with an uneven distribution of gas or impurities in the oil mixture, in which there are no magnetic moments. As a result, in the recording coil 9 at different times, NMR signals are recorded that differ from each other in amplitude. This can introduce an additional error of no more than 0.3% into the measurements of q.
It is also necessary to note one of the advantages in the NMR flowmeter-relaxometer developed by us in comparison with other flowmeters, for example, electromagnetic. In the developed design of the flowmeter, the consumption q is directly measured using (1) Figure 6. The sequence of control pulses on the electronic key 15. In fact, the device implements a frequency measurement of the q value since the meander period is measured. In this case, the error of the trigger levels of the comparators becomes irrelevant. A delay error appears, which is associated with an uneven distribution of gas or impurities in the oil mixture, in which there are no magnetic moments. As a result, in the recording coil 9 at different times, NMR signals are recorded that differ from each other in amplitude. This can introduce an additional error of no more than 0.3% into the measurements of q.
It is also necessary to note one of the advantages in the NMR flowmeter-relaxometer developed by us in comparison with other flowmeters, for example, electromagnetic. In the developed design of the flowmeter, the consumption q is directly measured using (1) in real-time (τ n is measured with high accuracy since this is the duration of the meander). Graduation, in this case, is not required for the flowmeter. After manufacturing, the device must be checked or calibrated to determine the validity of the q measurement results. It is not necessary to calibrate the device before installation on the pipeline. The value of volume V c of the pipeline section is included in the unit design of the device and does not change during the transportation of the device. Verifying the device during operation for a long time is not required since the value of V c (straight section of the pipeline) changes insignificantly. Processes of contamination of the pipeline walls are slow (fast liquid flow and straight pipe). The measurement error changes insignificantly.
To verify the reliability of the developed methods for measuring q, we compared the results of measuring the consumption of a liquid mixture made from feedwater with air bubbles and insoluble particles (with ionic conductivity (polymer) and electronic conductivity (bitumen)) using a device developed by us with the results of flow measurements performed by using electromagnetic flowmeter OPTIFLUX 4030 (KROHNE, Germany).
This device is designed to measure oil flow in various situations. The measurement error of the OPTIFLUX 4030 at the initial stage of its operation for pure liquids is ±0.3%. During the operation of the device, as well as in the case of contamination of the flowing liquid with various impurities, the measurement error increases. For the liquid mixture we used, when checking the reliability of the developed NMR flowmeter-relaxometer, the error in measuring ∆q of the OPTIFLUX 4030 electromagnetic flowmeter was less than 1.0%.
Additionally, a measured volume was used to control the consumption q of the manufactured liquid mixture. Ten measurements of the volumetric consumption of the liquid mixture were performed over 10 s. The average consumption value and measurement error were calculated (then these data were converted to m 3 /h). The results of comparing the results for both devices and the measuring volume are presented in Table 1. Table 1. The results of measuring the consumption q (m 3 /h) of a liquid mixture of feedwater with air bubbles and insoluble particles (with ionic conductivity (polymer) and electronic conductivity (bitumen)) at a temperature of T = 324.6 K in the pipeline of the experimental stand using various devices and a measured volume. Measurements at consumption values of more than 23.07 m 3 /h were not carried out because the circulation pump reached its maximum power on the experimental bench under difficult operating conditions (liquid mixture with air and impurities).

Measurement
Using the NMR flowmeter-relaxometer design developed by us, we measured the relaxation times T 1 and T 2 of a liquid mixture of feedwater with air bubbles and insoluble particles (with ionic conductivity (polymer) and electronic conductivity (bitumen)) for various temperatures T. We compared them with the results of measurements on an industrial NMR relaxometer Minispec mq 20M (BRUKER, Rheinstetten, Germany). A comparison of the obtained results is presented in Table 2. Table 2. The results of measuring the consumption q (m 3 /h) of a liquid mixture of feedwater with air bubbles and insoluble particles (with ionic conductivity (polymer) and electronic conductivity (bitumen)) at a temperature of T = 324.6 K in the pipeline of the experimental stand using various devices and a measured volume. In various fields, the temperatures of oil mixtures that come from wells for primary processing differ by several tens of degrees (this depends on the production method and other factors). Therefore, in our work, we tried to measure T 1 and T 2 at the highest temperature that could be obtained on an experimental bench for pumping liquid media. The capabilities of our stand were limited by a temperature of 351.1 K. Therefore, the measurements of T 1 and T 2 were carried out up to a temperature of 349.5 K.
It should be noted that, in the developed device, the process of measuring q, T 1 , and T 2 does not depend on the turbidity and viscosity of the medium, which makes it possible to measure various grades of "clean" oil in pipelines of small diameters (up to 150 mm) or Energies 2022, 15,3259 13 of 20 at their low flow rate. Figure 7 shows, as an example, an NMR signal recorded from heavy grades of TAT Oil [5,113,116]. It should be noted that, in the developed device, the process of measuring q, T1, and T2 does not depend on the turbidity and viscosity of the medium, which makes it possible to measure various grades of "clean" oil in pipelines of small diameters (up to 150 mm) or at their low flow rate. Figure 7 shows, as an example, an NMR signal recorded from heavy grades of TAT Oil [5,113,116].

Discussion
An analysis of the results obtained in Figures 5 and 6 showed that the amplitude U s of the registered NMR signal will be at the noise level in a wide range of changes in the q value of the current mixture (of the order of ±q/2, provided that the frequency f n and field H 1 are initially adjusted when measuring q to the center nutation lines). With this setting, the q measurement mode in the flowmeter will be violated only in a few cases. For example, if an emergency occurred (the oil mixture stopped flowing into the pipeline). In another situation-the pressure in the wellbore increased sharply, and the flow rate of the mixture increased sharply. The developed NMR flowmeter-relaxometer at some point in time will give information about a sharp increase in the q value of the oil mixture and stop measurements if it exceeds 3q/2.
An important parameter, in this case, is the rate of change dq/dt. For the device we developed, it was found that if dq/dt is greater than q/4 per second (when the consumption changes by more than q/2), the AFC and AGC systems will not have time to adjust the parameters of sinusoidal oscillations on nutation coil 4 and modulation 5 (Figure 1) under the conditions for generating an NMR signal with magnetization inversion (there will be no rectangular pulse at the output of the control and processing unit 14).
It should be noted that such a sharp change in the value of q during oil production is also considered an emergency, for the elimination of which there are special means and measures. The operation of the oil mixture purification system, in this case, is stopped.
The studies carried out made it possible to establish that a change in the temperature T of the flowing mixture within 20-25 K has an insignificant effect on the amplitude U s of the registered NMR signal. In these cases, the value of U s will also be at the noise level. The error in measuring consumption of the oil mixture ∆q will not change.
The declared error in measuring the flow rate ∆q of the oil mixture is confirmed by the data presented in Table 1. We used an industrial electromagnetic flowmeter with a measurement error no higher than the device we developed to compare the measurement results. The results of measuring q by the two instruments coincided with the limits of the measurement error. The electromagnetic flowmeter measured a lower value of q (accordingly, the flow rate was less than the real one) since air and impurities were in the liquid medium. The results of measuring q of the liquid mixture using the measured volume confirmed that the two instruments used make reliable measurements of q. For a measured volume, q is greater than that for an electromagnetic flowmeter (as the air escapes into the atmosphere, while impurities remain in the liquid medium).
An analysis of the results of measurements of the relaxation times T 1 and T 2 , presented in Table 2, shows that they coincide with the measurement error. The error in measuring T 1 and T 2 in an industrial NMR Minispec mq 20M relaxometer is less than 0.3% for such mixtures. This is several times less than in the NMR flowmeter-relaxometer developed by us. This fact once again confirms the validity of the use of the methods proposed by us for measuring the values of T 1 and T 2 in the developed design of the NMR flowmeter-relaxometer.
It should be noted that the measurement error of q, T 1 , and T 2 depends on the value of S/N, which depends on the number of protons per unit volume in the oil mixture and the relaxation times themselves. More impurities and air in the mixture-fewer protons. The S/N ratio decreases. In case of values S/N = 3 and below, the device developed by us will work, but the measurement error of q, T 1 , and T 2 will increase. By registering the change in the amplitude of the NMR signal and measuring the values of the relaxation times of T 1 and T 2 , it is possible to establish the appearance of an additional amount of water, air, and impurities in the oil mixture.
Any appearance of salt in crude oil leads to a decrease in the values of T 1 and T 2 . Pure oil has the highest values of T 1 and T 2 . In the device, all magnetization processes for the current flow, and also the registration of NMR signal are set to the maximum values of T 1 and T 2 . Therefore, a decrease in the values of T 1 and T 2 , for this reason, which is often found in oil production, will not have a significant effect on the process and the measurement errors of q, T 1 , and T 2 .
In the device's developed design, to measure T 1 , T 2 , and q of the oil mixture, it is necessary that its investigated segment is in the registration coil 9 of the order 2.5 T 2 . At a maximum flow rate of the oil mixture in the NMR signal detection system of about 200 mm/s, the length of the magnetic system for recording the NMR signal with coil 9 (its length is about 60 cm) is no more than 90 cm. The total length of the design of the NMR flowmeter-relaxometer we developed is about 189 cm. This is almost two times less than the industrial nuclear magnetic flowmeter-relaxometer M-Phase 5000.

Conclusions
The data obtained show the reliability of the design of the NMR flowmeter-relaxometer developed by us for monitoring the flow and state (by the measured values of T 1 and T 2 and the amplitude of the recorded NMR signal) of the current flow of the oil mixture.
The research results and their analyses with comparisons with other types of flowmeters (including nuclear magnetic ones, including industrial NMR flowmeter-relaxometer) confirm the promising nature of the device design that we developed. This is because the device's developed design can be used without changing it to control the flow and quality of oil, for example, when it is loaded into a tanker or injected into the main pipeline. The instrument can monitor the flow and quality of refined petroleum products (e.g., gasoline, diesel fuel, engine oil) and hazardous chemicals (e.g., acids and alkalis). In principle, the flowmeter-relaxometer developed by NMR can be used to control the flow rate and the state of any liquid medium containing protons. However, this is not always economically feasible. It should be noted that almost 99% of liquid media contain protons.
Unlike the M-Phase 5000 industrial NMR flowmeter-relaxometer, which is used after separation to control the oil flow parameters, the device developed by us has several advantages. Its dimensions and weight will be at least several times less than that of the modernized design of the M-Phase 5000 NMR flowmeter-relaxometer for parameter control of the oil mixture from the well. In the NMR flowmeter-relaxometer developed by us, the maximum usable voltage is 220 V (standard power supply). The working currents do not exceed 2 A. These are typical voltages and currents for measuring equipment on an offshore oil platform and drilling rig, for which moisture protection measures are successfully applied. It should also be noted that in the industrial NMR flowmeter M-Phase 5000, the measuring error of the consumption q is about 2%. The error in measuring the times of longitudinal T 1 and transverse T 2 relaxation is about 1.5% (using these values determined the flowing oil state). This estimate is for pure oil measurements. For a crude oil mixture from a well, measurement errors of this device will be higher. In the NMR flowmeter-relaxometer developed by us, the error in measuring the q, T 1 , T 2 for a model solution of an oil mixture is about 1.5%. For pure oil, it does not exceed 1%.
According to various estimates by experts, the cost of secondary purification (separation) of oil at a drilling station or offshore platform ranges from USD 0.4 to 1.00 per barrel. In addition, additional time is spent on this process, which is very difficult to evaluate in financial terms. The use of the device developed by us allows us to reduce these costs.