NMR fluid analyzer applying to petroleum industry

Tremendous progress of developing nuclear magnetic resonance (NMR) fluid analyzer has been witnessed in the oil industry for last two decades. This device allows extensive and accurate exploration of fluid properties, such as its hydrogen content, composition, viscosity, hydrogen index (HI), mud filtrate invasion, gas to oil ratio, average velocity, velocity distribution etc., in the situations of in situ downhole or surface Petro-pipelines. In this review article, we focus on the design principle, manufacturing, implementation, methodology and applications of NMR fluid analyzer to oil and gas industry. A detailed description of the state-of-art NMR fluid analyzers was firstly given to exhibit their respective characteristics. With these experiences on hand, we introduced a series of NMR fluid analyzers designed by us at China University of Petroleum-Beijing with continuous optimizations, in terms of magnet construction, antenna layout, circuit design and operating surroundings. These systems discussed in this article have been demonstrated to achieve multiple NMR parameter acquisition when the fluid is in stationary or flowing state. In the end, a prototype was fabricated and validated considering a vast of engineering influences, such as variable temperatures in a large range, high pressure, limited volume, detection efficiency, etc. A particular emphasis of this paper is to expedite the measurement efficiency of the NMR fluid analyzer to reduce the operation costs. This dilemma can be Figured out by upgrading both pulse sequence and observational mode. For different fluid states, two rapid pulse sequences were proposed to sufficiently obtain the multi-dimensional NMR correlation map. Meanwhile, two observational modes were developed to take full advantage of the polarization time, during which the individual antenna was systematically switched. Another domain of interest in this review concerns the applications of this new tool. For stationary fluids case, accurate identification of fluid properties is of great value for scheme building in oil and gas exploration process. Particularly, it can acquire the fluid content by different NMR responses of different components. In addition, with Bloembergen theory and Stokes–Einstein equation, not only molecular dynamics and composition, but also oil viscosity can be readily evaluated. Moreover, HI information of crude oils will be speculated through partial least square regression. As for flowing fluids case, velocity is a significant parameter to understand the in situ fluid exploitation and therefore evaluate the productivity of certain oil wells or pipelines. Regarding to the unique magnet and antenna designs in our NMR fluid analyzer; this review adopts two distinct methods to obtain flow velocity at a wide rating scale. The first one is a time-of-flight method adaptive in a homogeneous magnetic field, which is suitable in the case of fluid at high flow velocity. The other one relies on the adjacent echo phase difference at a magnetic field with constant gradient, which is preferred for relatively low flow velocity. In the near future, this tool will be tested underground to offer individual fluid velocities by combining both the stationary and flowing analysis methods.


Introduction
As an efficient, non-destructive detective technology, nuclear magnetic resonance (NMR) has been extensively used and becomes one of critical methods for fluid identification and quantification in oil and gas reservoir evaluation (Abragam 1961;Coates et al. 1999;Dunn et al. 2002;Blümich 2000; Edited by Jie Hao and Xiu-Qiu Peng * Guang-Zhi Liao liaoguangzhi@cup.edu.cn Extended author information available on the last page of the article Haacke et al. 1999). Considering the design concepts, the NMR instruments can be divided into two categories. The first one is based on "inside-out" theory and measures the formation fluids in the external magnetic field generated by permanent magnets. The well-known logging service companies, such as Schlumberger, Halliburton and Baker Hughes, push this type of NMR instrument into petroleum industry. Their representative products are: CMR, MRIL-P and MREX (Cooper and Jackson 1980;Burnett and Jackson 1980;Jackson et al. 1980;Prammer et al. 1998;Kleinberg et al. 1992;Chen et al. 2003). However, the obtained fluid properties are affected by many formation factors, such as lithology, pore structure, the paramagnetic mineral, etc The other one is the NMR fluid analyzer, which adopts the "outside-in" design and generates a magnetic field inside the instrument. It can obtain accurate fluid properties by measuring the samples directly, the sketch map is shown in Fig. 1b. In petroleum industry, including exploration, exploitation, transportation, refining activities, as shown in Fig. 1a, it is of great value by knowing the exact fluid properties to make the production scheme related to the above activities. When the system is used in subsurface environment, the analyzer can act as a module of formation sensor and analyze the fluid extracted from the reservoir formation by the tester. The obtained NMR information is far away from the influence of the formation. When the system is used in surface environment, the system can conduct the NMR analysis when the fluid is pumped into the instrument. Then, the NMR characteristics of the sample, like T 1 , T 2 relaxation time distribution, T 1 -T 2 , T 2 -D correlation and T 1 -T 2 -D map, can be obtained as shown in Fig. 1c. Through those NMR responses, the fluid type, content, composition, viscosity, hydrogen index, gas-to-oil ratio, mud filtrate invasion degree, flow velocity and its distribution and flow regime can be calculated, some representative information is shown in Fig. 1d (Akkurt et al. 2004;Dong et al. 2005;Hirasaki et al. 2003a, b). Nowadays, some commercial companies and scientific research institutions, including Schlumberger, Halliburton, Atlas, Shell Oil Company and University of Western Australia, have developed distinct fluid analyzers. In all of them, Schlumberger proposed an optical fluid analyzer for recognizing fluid properties by measuring the absorption spectrum (Dong et al. 2008). By this means, the GOR, pH value of formation water and composition of the hydrocarbons etc., can be extracted. However, the recognition Sketch map of the system, permanent magnets generate a homogeneous magnetic field inside the instrument. Incorporated with the circuit, the system gets the NMR responses shown in c. d Some representative properties from the measurement results effect is relatively poor, especially in oil-based drilling fluids or mixed oil-water reservoir fluids. The other instruments utilize NMR technique to obtain fluid properties. In 2000, Atlas proposed a fluid analysis system to determine the fluid properties by using NMR spectroscopy (Michaels et al. 1995;Edwards et al. 2000;Edwards and Chen 2017). When fluid flows through the sample tube, the system can measure the 13 C signal. Followed by Fourier Transform, the detailed fluid compositions can be identified from chemical shift spectrum. Almost at the same time, Halliburton developed an analyzer which can measure relaxation time (T 1 , T 2 ) and diffusion coefficient (D) of the fluids. With the obtained NMR information, one can get the fluid type, content, hydrogen index (HI), GOR, et al. by interpreting these parameter distributions (Blades and Prammer 2000;Prammer et al. 2001;Akkurt et al. 2001;Prammer et al. 2004;Prammer et al. 2007). In 2011, Shell Oil Company designed a fluid analysis system for ground fluid analysis. This system uses a multi-layer Halbach magnet structure and can easily measure multi-phase flow (Hogendoorn et al. 2013;Appel et al. 2011;Hogendoorn et al. 2014). When fluid flows through the system, the flow velocity and its content can be recorded. In 2013, Schlumberger also developed a compact high performance low-field NMR apparatus for measurement on fluids at high pressure and temperature, through which the fluid properties such as viscosity, density, compressibility, molecular composition, GOR and saturate, aromatic, resin and asphaltene (SARA) can be obtained with good accuracy (Freedman et al. 2013(Freedman et al. , 2014. In 2014, the University of Western Australia demonstrated an instrument using the Earth magnetic field to study the velocity distribution and flow regime by free induction decay signal (FID). Meanwhile, by the relaxation parameters T 1 , T 2 and the total NMR signal in flow state, it can also be used to early nondestructive detection of active biofouling of a commercial spiral wound reverse osmosis membrane module (Fridjonsson et al. 2014;O'Neill et al. 2016;Fridjonsson et al. 2015). In order to accommodate the NMR device in a different geological atmosphere, the NMR Laboratory of CUPB began the study of NMR fluid analyzer since 2010. With continuously optimization, three prototypes were gradually released ). Among them, the first generation can only measure the NMR parameters of stationary fluid. As a further step, the second system fulfills the measurements even for flow fluid. Based on the design experiences of the first two equipment, the last system is an engineering prototype with the characteristics of reliable B 0 homogeneity, high polarization efficiency and high measurement efficiency. Therefore, it can measure multiple NMR parameters no matter the fluid is in stationary or flow state. Measurement efficiency is crucial for economic evaluation as well as wide application of NMR fluid analyzer. The paper improves the dilemma by designing adoptive pulse sequences and observational modes. Meanwhile, compared to one-dimensional NMR measurements, two-dimensional NMR techniques, such as T 2 -D, T 1 -T 2 , T 2 -G measurement methods, have been successfully used to study the intrinsic properties of fluids as well as its behaviors in porous materials due to the advantages in fluid recognition and content calculation Hürlimann and Venkataramanan 2002;Song et al. 2002;Dunn 2002, 2005). However, the applications are limited due to its long measurement time. In order to improve the efficiency, many researchers developed a variety of rapid measurement pulse sequences, among which YQ Song collected echoes of different coherent pathways which could quickly measure diffusion coefficient, flow velocity and NMR imaging, but with low signal to noise ratio (Song and Tang 2004;Song et al. 2003;Song and Scheven 2005;Cho et al. 2006). Mitchell et al. (2009) proposed a rapid T 1 -T 2 pulse sequence-DECPMG pulse sequence, which could obtain T 1 -T 2 distribution by only two scans. On the basis of the previous work, two types of rapid measurement pulse sequences are developed, one is DE sequence, which can realize T 1 -T 2 rapid measurement when the fluid is in stationary state; the other sequence is DEFSR (DEFIR) pulse sequence, which can obtain its T 1 -T 2 information even for flowing fluid. On the other hand, in a conventional measurement, the observational mode consists two parts: the first one is the polarization process, the other one is the acquisition process. It leads to low measurement efficiency due to that the system does not work in polarization process. In the paper, according to the special design of the antenna system and the corresponding circuit module, two observational modes are optimized. By upgrading this, it can readily enhance the measurement efficiency of the system twice by taking advantage of the polarization time.
It is well known that the fluid in oil industry is multiphase which contains oil, water, gas, etc. Water and oil contents determination assists the evaluation of oil production output. Methods for measuring oil and water contents include infrared absorption spectroscopy, gravimetric method, gas chromatography-frame ionization detection (GC-FID) (Yang 2001), etc. Infrared absorption spectroscopy and gravimetric methods do not provide details of fluid compositions. As for GC-FID method, it is only suitable for lab use. In recent years, NMR becomes a popular method for water and oil contents calculation with the characteristics of rapidity, repeatability and the adaptation at harsh environment (Allsopp et al. 2000). In the paper, the fluid analyzer was used to obtain the water and oil contents by NMR characteristic parameter distribution.
Oil is a super complex mixture with a wide range of molecular type and size. The detection of oil composition is very important for oil industry as the physical and chemical properties are closely related to its compositions. Gas chromatography and mass spectrometry are two traditional means to analyze oil compositions (Grob and Barry 2004;Marshall 2000). For gas chromatography, heavy components of crude oil are firstly transferred into gas phase. Afterward, according to the adsorption capacity, solubility, hysteresis, etc., oil component contents can be obtained. However, if the carbon chain length of the component is longer than 36, it is difficult to be gasified (Freed and Hürlimann 2010). While in mass spectrometry technique, the oil molecules are firstly ionized and then the components are separated by electromagnetic field. Mass spectroscopy can probe the presence of a particular molecule, but it is not a quantitative technique. For fluid with a wide range of molecular sizes, e.g., crude oil, both methods are difficult to gain the quantitative composition for heavy components. Besides, high field NMR spectroscopy is another choice to obtain the chemical compositions and molecular structure of pure fluid. However, the results from crude oils are difficult to explain due to the superposition of the spectra from different molecules (Ernst et al. 1987). In this paper, low-field NMR is applied to analyze the effects by the compositions (saturates, aromatics, resin, asphaltene) to the relaxation correlation map. Furthermore, it can also act as an indicator to obtain oil molecular dynamics by calculating the rotational correlation time distribution.
In general, viscosity is the intrinsic fluid friction and represents the fluid flow ability. NMR is a downhole unique method to obtain oil viscosity. As early as 1948, Bloembergen et al. proposed that NMR relaxation time was related to oil viscosity and established the theoretical model (Bloembergen et al. 1978, Brown (1961 analyzed the T 1 relaxation of a large quantity of oil samples under different temperatures and pressures and obtained a general expression relating viscosity to T 1 . Then, Morris and Vinegar carried out an analysis on T 2 data of degassed oil and established the relationship between viscosity and T 2 . Since these experimental samples were not deoxygenated, the dissolved oxygen would affect the measurement accuracy as a paramagnetic substance (Morriss et al. 1994;Kleinberg and Vinegar 1996). Afterward, Zega et al. and Zhang et al. measured pure deoxygenated alkanes and alkane mixtures. A linear relationship between T 1, 2 and viscosity was established (Zega et al. 1989;Zhang et al. 1998). Latorraca et al. (1999) measured highly viscous crude oils at 2 MHz. It was found that at large echo time, the measured T 2 was significantly longer than the expected value due to the signal loss of heavy components. To address this problem, a correction method was proposed considering different echo times (Latorraca et al. 1999;Dunn et al. 1998). Zhang et al. (2002) put forward a method for viscosity prediction from the T 1 /T 2 ratio. In 2006, Benjamin et al. investigated the relation between T 2 and viscosity based on Bloembergen theory. These results applied well to moderately and highly viscous oils and are very successful at predicting the ultra-highly viscous oils. Cheng et al. (2009) established a relationship between the viscosity and relaxation time for heterogeneous fluids based on the Kohlrausch-Williams-Watts function. Korb et al. (2015) proposed a theory relating the longitudinal relaxation time T 1 and transverse relaxation time T 2 to the viscosity η of bulk heavy crude oils with different asphaltene concentrations. This theory is fully consistent with the universally observed behaviors for heavy crude oils which shows that T 2 ( ) = T 1 ( ) ∝ 1∕ for low viscosity and T 2 ( ) ∝ 1 � √ with a weak Larmor frequency dependence and viscosity independence but strong Larmor frequency dependence T 1 ∝ 1 � √ 0 for high viscosity (Korb et al. 2015). In this paper, a new method is presented for rapid viscosity determination. This method requires no correction in case of highly viscous fluid. Moreover, it may allow online rapid flowing fluid measurement.
Hydrogen index (HI) is the ratio of the hydrogen amounts in the targeting sample to those of the same volume water at the ambient conditions. It is of great value for determining the oil type and its combustion efficiency. Meanwhile, the fluid is always a mixture containing water, oil, gas, etc. An accurate assessment of HI is useful to determine individual fluid saturation. Gaymard and Poupon (1968) analyzed a large quantity of alkane samples and found that HI was related to sample density. It did not apply to heavy oil because the presence of significant aromatic and polyaromatic contents. Vinegar et al. (1991) proposed the relationship between HI and API gravity. However, the correlation did not consider the influence GOR and condensate. Zhang et al. (1998) used fluid density and hydrocarbon ratio to predict HI which was adaptable to live oil. NMR is also an effective method to calculate HI. The more fluid hydrogen content, the higher the NMR signals of the same volume sample. All the above methods rely on access to other parameters, such as sample density, API, volume and so on. In the paper, the HI value was calculated by partial least squares regression (PLSR) method with NMR spectrum distribution only.
Flowing velocity determination is an important application since the discovery of NMR technology. In general, the NMR methods for obtaining the flow rate can be divided into two types. One is dependent on a fixed gradient field or a radio frequency gradient field (Gladden and Alexander 1996;Caprihan and Fukushima 1990;Fukushima 1999;Gladden and Sederman 2013). The essential idea originates from the work of Hahn, Stejskal and Tanner, which relies on static or pulsed magnetic field gradient to create phase shift of NMR signal which is proportional to the velocity (Hahn1950; Stejskal and Tanner 1965). However, this method needs a separate scan as a comparison, thus is time-consuming. Furthermore, it is only useful to measure flow velocity under the conditions that flowing velocity profile is constant or changes slowly. The other one is a time-of-flight method, in which a flowing element is tagged and its Larmor frequency is interrogated after a time delay as the tagged element moves in a static magnetic field gradient. It was brought into use by Suryan for the first time (Suryan 1951). He observed the continuous wave (CW) NMR signal increases when partially saturated spins are replaced by unsaturated flowing spins. However, this method is only valid when the flowing velocity is small. Afterward, Singer, Hirschel and Libello quantify the relationship between the signal and the flow rate (Singer 1959;Hirschel and Libelo 1962). For time-limited industry applications, fast measurement of flow rates is required (Gladden and Alexander 1996). For such applications, Song et al. present a one-scan method for determining mean flow velocities in the presence of a static magnetic field gradient and without the need of multiple scans, which makes use of the Multiple Modulation Multiple Echoes technique (MMME) to produce a series of coherence pathways (Song and Scheven 2005). Galvosas and Callaghan demonstrate a technique called soft-pulse-quadrature-cycled PGSE-RARE (SPQC-PGSE-RARE) to measure flow at velocities on the order of 1 m/s (Galvosas and Callaghan 2006). Osán et al. (2011) used the attenuation rate of CPMG pulse sequence to effectively measure the high flow speed, and the theory was quickly used on the fluid analyzer of Shell Oil Company. Deng et al. (2014a, b) investigated the influence of flow velocity to the obtained NMR signal and built a model to calibrate this effect. In this paper, two methods were proposed to obtain the flowing velocity on the engineering prototype. The first one can be used in a homogeneous field for high flow velocity determination and the other one is used in a gradient field for low flow velocity determination. Then, with the obtained flow velocity, it is possible to calibrate the obtained NMR signals of flow fluid to the exact value. This paper follows five parts. Chapter 2 gives the principle and application of previous NMR fluid setups. Chapter 3 briefly introduced the necessary theory of NMR and system design considerations related to NMR fluid analyzer. Chapter 4 presents the design and implementation of the system hardware. Then, according to the requirements in time-limited fluid analysis process, two rapid T 1 -T 2 measurement pulse sequences and two rapid observational modes were developed in Chapter 5. Finally, in Chapter 6, the system was applied to fluid measurements, from which the fluid content, viscosity, composition, flow rate, HI and other critical properties can be obtained.

Previous NMR fluid analyzer
Depending on different measuring objects, NMR fluid analyzer can be divided into two categories: one is at underground condition, the other one is operated on the ground surface. In the application process, both types of the systems will face with different challenges, as depicted in Fig. 2. For downhole applications, the fluid analyzer is typically used in conjunction with formation tester, which can suck the formation fluids into the system. In the wellbore environment, the size of the instrument is severely restricted. The designed system needs to get a suitable magnetic field strength and distribution in this limited volume. On the other hand, as the location of the instrument is constantly changing during the measurement, the temperature and pressure around the instrument also changes. Thus, one need to select some special materials and structure to adapt to the harsh environment. For the permanent magnet system, the environmental temperature change will influent the magnetic field strength, which is proportional to the Larmor frequency. As a result, the designed antenna system should cover a wide frequency band of pulse excitation to accommodate the frequency shift. Moreover, it is well known that NMR measurement, especially for multi-dimensional NMR, is a time-consuming process. Therefore, the economy efficiency can be improved by accelerating the measurement speed. For surface applications, NMR signals can be detected directly as the fluid flows into the interior of the detector. Compared with downhole equipment, the structure of the surface system is more complex and larger to provide a more homogeneous magnetic field, thus the measurement precision is also higher. If the system is equipped with high temperature and pressure devices, the obtained results can be used to calibrate the downhole results at similar hash environment. When multiphase fluids with high-speed flow across the system, it is also challengeable to accurately obtain fluid flow velocity, content and flow regime.

Downhole NMR fluid analyzer
For downhole applications, NMR fluid analyzer offers abundant information, for instance the fluid type, content, constituent, viscosity, hydrogen index, gas-to-oil ratio, filtrate invasion degree, etc. Faced with the challenges shown in Fig. 2, Halliburton and Baker Atlas have designed and developed two distinct systems.
The NMR fluid analyzer developed by Halliburton can provide in situ data of formation fluids at in situ reservoir conditions (Prammer et al. 2001(Prammer et al. , 2004. The apparatus is compatible with the wireline Reservoir Description Tool (RDT), which can achieve a variety of sampling functions, testing and monitoring purposes. Figure 3 shows the schematic diagram of the device. When pumped fluids were extracted from the formation and flow through the analyzer, it can acquire the NMR response simultaneously. From Fig. 3, it can be found that the instrument has a three-stage magnet structure. The first two segments, A and B, are pre-polarized section, and the third one is the measurement section C. The pre-polarized magnet A is an over-polarized magnet with a Halbach structure. It can produce a homogeneous field with 2000-2500 Gauss field strength which is much higher than the field intensity at the section C. Therefore, the fluid can be rapidly polarized as the fluid flows into this part. The prepolarized magnet B is an under-polarized magnet with a ringshaped structure. The structure can generate a homogeneous magnetic field about 850 Gauss which is less than the field intensity of the measured area. It allows the over-polarized fluids quickly approach close to the target magnetization. The measurement magnets are also ring-shaped with 1000 Gauss field intensity, at which the Larmor frequency of proton is about 4.3 MHz. Considering that the instrument works in downhole environment, changes of the ambient temperature will severely affect the field intensity. Therefore, samarium cobalt material with a small temperature coefficient is selected to reduce the temperature influence. A double antenna structure is located in the measurement area. The longer antenna is solenoid structure for transmitting signals and the shorter one is for receiving signals. On account of this special design, the obtained signal is free from the influence of flow velocity lower than 10 cm/s. Different NMR information of the fluid can be obtained by using different pulse sequences. When the fluid is in flowing state, the instrument can obtain the T 1 relaxation time of the sample through the saturation recovery (SR) pulse sequence. In comparison, T 2 is more sensitive to fluid flow and the magnetic field strength variation. As a result, T 2 relaxation time can only be obtained for stationary fluid. On the other hand, the measurement area along the cross-section plane can be divided into two parts, the middle cylindrical area is a homogeneous magnetic field, and the outer ring is a gradient magnetic field, the volume of this part occupies about 1/3 of the detection area. In order to get the diffusion coefficient of the sample, a steady gradient spin echo (SGSE) pulse sequence is used. This sequence includes two CPMG scans with different echo times. The first one utilizes the shortest echo time as allows in the spectrometer, in which the signal attenuation due to diffusion relaxation can be ignored. The other one has a longer echo time, in which the signal attenuation is greatly influenced by the molecular diffusion in the field with a calibrated gradient.
Based on the obtained NMR information, different fluid properties can be identified. The hydrogen index (HI) of the fluid can be obtained by dividing the signal of the same volume of water at ambient conditions. In principle, different pure fluids have their unique relaxation time values. The longer the relaxation time is, the faster the molecular moves and the lower the fluid viscosity is. By establishing the appropriate model, NMR relaxation time or diffusion coefficient can also be used to calibrate the fluid viscosity. Furthermore, live oil containing a certain amount of gas has different NMR response of dead oil. With this contrast, NMR relaxation time can be used to predict GOR. When the formation tester continues sucking formation fluids into the analyzer, the system can determine the mud filtrate invasion degree in real time based on the correlation between relaxation time distribution and pump-out time.
The NMR fluid analyzer designed by Baker Atlas is also combined with a formation tester (Edwards et al. 2000 Fig. 3 The NMR fluid analyzer of Halliburton version perform 13 C NMR spectroscopy as the fluids were drawn into the formation tester. Compared with the relaxation time measurements, NMR spectroscopy measurements require a higher magnetic field homogeneity, which can reach up to a few tens or even several ppm in harsh underground environment. The cross-section of the system is shown in Fig. 4. The instrument has a C-shaped magnet structure with two pieces of magnet fastened on a cylindrical yoke. To build up a highlevel homogeneous magnetic field, some pole pieces were added to improve the field distribution, and a field with good homogeneity perpendicular to the axial direction is generated. The field intensity is 5708 Gauss, and the Larmor frequency is 6.12 MHz for carbon element. The probe is made of samarium cobalt material to decrease the effects due to temperature changes in downhole detection. Simultaneously, a shim coil is added between the two magnets, which can produce a supplementary static magnetic field for compensating changes of the magnetic field. By this means, the instrument can keep the total field intensity stable. The antenna in this system is a combined structure. All the three antennas are solenoid arranged along the axial direction. The generated radio frequency (RF) field is perpendicular to the static magnetic field generated by the C-shaped magnets. Moreover, by an antenna selection circuit, it is possible to trigger the operation of the antennas at different locations. Therefore, this mode can enhance the operating efficiency a lot.
Due to the small gyromagnetic ratio, the NMR signal sensitivity of 13 C is very low. Thus, in the acquisition process, CPMG pulse sequence is used to collect multiple full echo information. Then, all the signals are added to improve the signal to noise ratio (SNR). For pure water, it does not contain carbon atom and the obtained result shows no signal. For crude oil, multiple composition information can be inferred after Fourier transform. The component at 130 ppm is the aromatic component, and the component at 30 ppm is the aliphatic component. With the use of gradient coils, the instrument can also measure the correlation spectrum between diffusion coefficient and chemical shift. In addition to 13 C, the instrument can still measure the NMR signal of sodium element to determine the mineralization degree. Compared with the carbon element, the gyromagnetic ratio of the sodium element changes and its RF frequency needs to be adjusted to 6.41 MHz to match with its Larmor frequency.

Surface NMR fluid analyzer
For surface applications, Schlumberger, Shell, the University of Western Australia, have developed their NMR fluid analyzers, through which viscosity, density, compressibility, molecular composition, GOR, SARA, flow velocity and content for multi-phase flow, flow regime, etc., can be obtained.
The Schlumberger instrument can conduct high-performance laboratory measurements of fluid samples at the high temperature up to 175 °C and pressure up to 25,000 psi, which are common in many oil and gas reservoirs (Freedman et al. 2013(Freedman et al. , 2014. It can determine what fluid properties can be predicted from NMR measurements as well as the prediction accuracy. Combined with the measurement results from optical instrument, the system can acquire a database of different fluid properties at different temperature and pressure conditions. Figure 5 shows the sketch of the high-performance lowfield NMR apparatus. The magnet assembly contains two spatially separated parallel plates made from non-magnetic stainless steel. The C-shaped magnets made by samarium cobalt material are situated on the plates. In addition, the magnetic field distribution in the measurement region between the plates are smoothed by magnetic pole pieces situated below and adjacent to each plate. This structure can produce a homogeneous field perpendicular to the axial direction with a 535 Gauss field intensity at room temperature. Due to fabrication precision, there will be an average magnetic field gradient in the NMR sensitive region less than 1 G/cm for all temperatures. The RF antenna of the instrument is solenoid structure wound on a non-magnetic titanium frame inside a metallic sample holder. It can produce a homogeneous RF field perpendicular to the static magnetic field. About 80 percent of the NMR signal comes from the fluid inside of the RF coil and the remainder from the fluid in the annular region between the coil and the sample holder. This design results in an NMR fill factor greater than 1 which greatly enhances the SNR. In order to measure the diffusion coefficient, a pair of gradient coils are provided consist of an elliptically shaped Maxwell pair embedded in two PEEK fixtures. The gradient coil can generate a gradient up to 50 G/cm. The NMR system includes a fully programmable pulse sequencer and is capable of performing all the standard lowfield NMR relaxation time and diffusion measurements at different temperatures and pressures. T 2 distributions of the targeting sample can be acquired by the CPMG pulse sequence, and T 1 information is obtained by SR pulse sequence. Meanwhile, bipolar pulsed field gradient (PFG) pulse sequence is used to obtain diffusion coefficient. Furthermore, multidimensional correlation maps can be obtained by this system. SR-CPMG pulse sequence is used to obtain T 1 -T 2 information and bipolar PFG-CPMG pulse sequence is used to provide T 2 -D information. It is worth noting that bipolar PFG pulse sequence can provide more accurate results of diffusion coefficient in the presence of static gradient.
Crude oil is a complex mixture consisting of dissolved gases and various other hydrocarbon and inorganic molecules of unknown sizes, shapes and types. The physics of such complex mixtures cannot be accurately described by simple idealized models. With a Gaussian radial basis functions (RBF) method proposed by Freedman, the obtained NMR spectrum distribution by the system is able to predict fluid properties such as viscosity, density, compressibility, molecular composition, GOR and SARA with good accuracy. The only needed information is the NMR results, pressure and temperature.
Nowadays, no single well head meter available on the market can satisfy the customer's need for accuracy across a broad range of produced volumes and hydrocarbon properties, operational robustness, with low cost hurdle. Insufficient metering may result in suboptimal reservoir management and uncertainty in allocation of co-mingled. The multi-phase NMR fluid analyzer designed by Shell can tackle the above problems (Hogendoorn et al. 2013;Appel et al. 2011).
The structure of the multi-phase NMR fluid analyzer is shown in Fig. 6. The magnet comprises two sections, one is the pre-polarized magnets, and the other one is the measured magnets. Both the polarized and measured magnets use Halbach structure with samarium cobalt material. The pre-polarized section consists of two concentric rings: an inner and outer ring. The outer ring can rotate around the inner ring with an electro-motors. By putting both rings in the upward direction (+/+), full magnetic field strength is obtained. By rotating the outer ring by 180° (±) the magnetic field is canceled out. By this means, the system can adjust the polarization efficiency. The main magnet is a multi-ring Halbach structure, which can produce a high homogeneous magnetic field. By this design, the magnetic field strength outside the meter housing is less than 0.5 mT. The completed system is about 2 meters long and 800 kg weight. It can work in the environment where the temperature is from − 40 to 65 °C, and the suffered pressure can reach up to 1200 psi. In between the main magnet and the sample pipe, the solenoid coil is located. In addition, a gradient coil between the RF coil and the magnet can generate a gradient filed along the direction of the static magnetic field. It makes it possible to excite fluids in different regions by applying RF pulse with different frequencies.
Generally, water has a longer relaxation time than crude oil. Therefore, the polarization efficiency is different when water and oil flow through the analyzer simultaneously. As shown in Fig. 6, the polarized magnets can generate two different field intensities by rotating the outer ring magnets. By the signal intensity ratio of those two scans, oil and water contents can be acquired. In the flow condition, both the bulk relaxation and the flow velocity will affect the signal decay rates. When flow velocity is large enough, the signal attenuation due to bulk relaxation can be ignored. Then, the flow velocity can be obtained. When gas is present in the fluid, gas will hold up the top position of the pipe due to gravity. By applying the selective gradient pulse, the slice only containing gas can be chosen to obtain the gas velocity. The instrument has a good effect on mixed fluids with different oil, gas, water contents, especially for high water content (Water Liquid Ratio above 85%) and low gas content (gas volume fraction below 75%).
The NMR fluid analyzer developed by the University of Western Australia is based on the Earth's field (ET) (Fridjonsson et al. 2014(Fridjonsson et al. , 2015. When the fluid flows through the detector, the instrument can not only obtain the average fluid flow velocity but also obtain the velocity probability distribution.
The whole system is shown in Fig. 7. Its magnet structure consists of two sections, a pre-polarized magnet and a measured magnet. The pre-polarized magnet is a Halbach array structure with the field intensity about 0.3 T. It is used to excite the flowing fluids to a detectable degree. The measured magnet is a commercially available EF NMR system, and it is placed in a Faraday cage to decrease the background noise.
When fluid flows in the pipeline, it firstly passes through the polarized magnet. The polarization efficiency is related to fluid flow velocity, the length of polarized magnets and the T 1 relaxation time. Then, the signal will attenuate as T 1 relaxation time when the fluid flows out the polarized area. Finally, the fluid arrives at the measured section. At this time, one pulse sequence was used to get its FID signal. The signal decay rate is correlated with both the field non-homogeneity and flow velocity. The signal attenuation as caused by field non-homogeneity can be eliminated by proper calibrations. Then, the flow velocity or the velocity probability can be calculated from the obtained signals by a regularization method. When the fluid flows in two pipes, the system also has the ability to quantify multi-modal velocity distributions. In addition, this instrument can also retrieve T 1 , T 2 information of the fluid and provide early non-destructive detection of active biofouling.  possess either an odd number of protons, neutrons, or both protons and neutrons, for example 1 H, 13 C, 15 N, 19 F, 31 P, etc. (Mitchell et al. 2014).

NMR fundamentals
In oil industry, hydrogen nucleus is one basic element due to its natural abundancy. It can be easily detected by NMR. When hydrogen nucleus presents in a static magnetic field with B 0 field strength. B 0 will exert a torque on the nucleus and leads the spinning hydrogen moves perpendicular to the torque. This motion is called precession. The precession frequency (f), known as the Larmor frequency, is related to the field strength: where γ is the gyromagnetic ratio, for hydrogen nucleus, γ/2π = 42.58 MHz/T. According to quantum mechanics, when a proton is in an external magnetic field, the proton can be forced into one of two energy states. The energy state of a particular proton depends on the relationship between the orientation of the precession axis and the direction of external field. When the precession axis is parallel to B 0 , the proton is in its low energy state. On the contrary, the proton is in the high energy state. If there are a large number of protons, more spins are precessing parallel to B 0 than anti-parallel. This difference can provide the macroscopic magnetization M 0 . For the case of N nuclei per unit volume, the magnetization is given by Curie's Law: where k is Boltzman's constant, T is absolute temperature, h is Planck's constant, I is spin quantum number of the nucleus. Before observing the NMR signal, the magnetization needs to be tipped from the longitudinal direction to the transverse plane. This is accomplished by applying an oscillating magnetic field (B 1 ) perpendicular to the static magnetic field. For effective tipping, the frequency of B 1 must equal to the Larmor frequency of the protons calculated by Eq. (1). The tipped angle is given by: where θ is the tip angle, B 1 is amplitude of the oscillating field, τ is the duration over which the oscillating field is applied. When a series of pulses are applied, called pulse sequence, the system can generate different signals. With relevant pulse sequences, longitudinal relaxation time, transverse relaxation time, diffusion coefficient and other correlation information of the sample can be observed. This part will be described in Chapter 5.1 in detail. (

System design consideration
The magnetic field required for NMR can be produced by a current through a superconducting or resistive wire. In comparison, permanent magnets are compact with low maintenance and low cost. Despite their field instabilities with temperature, they are the most suitable designs for low-field NMR instruments below 1 Tesla (T).
To design a magnet system, material selection is an important segment. Different materials are usually evaluated by a hysteresis loop as shown in Fig. 8. The hysteresis loop curve characterizes a magnetic material as it is brought to saturation by applying an external field. The curve 0-a is the initial magnetization curve when the material is at the external magnetic field, the magnetic induction-B of which will increase gradually with the increases of the external magnetic field strength-H. After removing the external magnetic field, the magnetic induction strength will reduce to B r , known as the remanence of the magnetic induction. In the Figure, coercivity (H cb ) is the intensity of the applied magnetic field that is required to reduce the magnetization of the material to zero, whereas, intrinsic coercivity (H cj ) is the required field to reduce the intrinsic induction to zero.
Examples of representative magnetic materials for permanent magnets are shown in Table 1 (Demas and Prado 2009). High remanence, coercivity and magnetic energy product are desired as they produce a higher field per unit volume of a magnetic material. The Curie temperature is the temperature above which a ferromagnet loses its ferromagnetic abilities The magnetic hysteresis loop, B m is the maximum magnetic induction intensity saturated in an external magnetic field, B r is the residual magnetic induction strength after removing the external magnetic field, H cb is the coercivity, H cj is the intrinsic coercivity and becomes paramagnetic. Hence, the maximum operation temperature should be well below this temperature. Furthermore, a low temperature coefficient is required due to that it will lead little drifts of Larmor frequency when temperature changes.
In the process for magnet simulation, Maxwell equations are utilized to describe the temporal and spatial variations of the magnetic field. The best design of magnet structure can then be chosen by comparing the simulated variations.
In an NMR fluid analyzer system, RF antenna is used to generate an electromagnetic field to excite the hydrogen and receive the NMR signal with specific information of the sample. The designed antenna must satisfy the following requirements: (1) the generated RF field by the antenna is perpendicular to the magnetic field, which is the premise for NMR phenomenon (2) the generated RF field needs to be homogeneous to ensure a maximum NMR signal under the complicated underground geological conditions. After selecting the antenna structure, the antenna should be connected to a tuning circuit to match the Larmor frequency. Usually, the antenna system uses the basic RLC resonance circuit, the electrical parameters of which include the resonant impedance Z, the internal resistance r, the inductance L and the quality factor Q. The resonant impedance is the impeding capacity to the current of the circuit. The internal resistance determines the self-loss of the antenna. The Q value determines the emission efficiency of the RF energy. Basic theoretical resonant circuits are shown in Fig. 9 (Kodibagkar and Conradi 2000).
A prerequisite of the system at an operating status is to ensure the resonant frequency of the antenna equal to the Larmor frequency, and the resonant frequency of the four circuit structures satisfy the following equations: where ω 0 is the resonant frequency multiply by 2π. On the other hand, the impedance should match with the electronic circuit so that the electronic instrument achieves the best emission efficiency. The impendences of the above four tuning circuits are shown in Eq. (5), respectively, Among the four structures, the series circuit is mainly used for voltage amplification, and the parallel resonant circuit is used for current amplification. They are usually used in downhole applications for its adaptiveness to the harsh

Fig. 9
Illustration of basic resonance circuit a in serial c in parallel b and d in hybrid tuning circuits. L is the inductance, C is capacity, r is the internal resistance 1 3 environment. The hybrid tuning circuit is a combination of both series resonant structure and parallel resonant circuit. It can adjust the impedance and the resonance frequency by change the ratio between C 1 and C 2 . The functions of the two capacities are different, one is mainly for tuning the resonant frequency, and the other is for matching the impendence. It is normally used in laboratory instruments due to its maneuverability.
In the fabrication process, solenoid antenna is a usual choice which satisfies the above requirements. Firstly, the antenna inductance needs to be estimated related to the number of turns, antenna length, antenna diameter and screw spacing. Then, according to the inductance, the parasitic capacity, quality factor and the impendence of the system, the required capacity can be calculated based on the designed antenna structure.
The circuit design is another important issue for fluid analyzer. Firstly, it should satisfy the basic functions of highpower excitation and weak signal acquisition. On the other hand, according to different probe designs, some special modules should be supplemented to achieve the best match between different probes and their corresponding circuits.
The details of the system design are shown in Sect. 4. For the probe design, the materials for magnet and antenna are firstly selected by considering the electrical or magnetic properties. Then, different structures of the magnet and antenna should be proposed. Finally, the electromagnetic field of different antenna and magnet structures can be calculated via Maxwell equations and the finite element simulation method. By comparison, the best project will be accepted to reach the design requirements. Same as the probe design, the circuit design should also experience several stages: starting from the design of whole circuit and every single module, then fabrication of the circuit board, single board debugging and ending up with the whole circuit debugging. The probe can generate a magnetic field, and the circuit can transmit an electronic field orthogonal to the magnetic field. If there are some sample containing hydrogen atoms in the area where the two filed exists, the NMR signal can be obtained as the descriptions shown in Chapter 3.1.

System design
Since 2010, the NMR lab of CUPB led by Prof. L. Z. Xiao has started to design and manufacture NMR fluid analyzer (Wu 2012;Zhao 2014). With the continuous optimization of the system design, a total of three sets of NMR fluid analyzers were fabricated, as shown in Fig. 10. The first system fabricated in 2012 is a laboratory prototype which uses a ring-shaped magnet structure to ensure the homogeneity of the magnetic field. The system can only be used to perform NMR measurements of the stationary fluids with the cooperation of formation tester. The second laboratory prototype fabricated in 2014 incorporates pre-polarized sections (A and B shown in the Figure) in the axial direction and uses a discrete antenna structure to do the measurements for flow fluid. The last set developed in 2017 is an engineering prototype system considering the high pressure and high temperature environment. The field homogeneity and polarization efficiency have greatly improved. The system takes a combined antenna structure. Each antenna is used to achieve different NMR measurement. The system can choose appropriate antenna to work through a switching circuit. The system is used for measuring stationary fluid as well as for measuring fluid flow with the three polarization sections (A, B and C shown in the Figure). Meanwhile, the system is applicable both in downhole and surface environments.

Probe design
The system design includes the probe design and the circuit design. In the probe design, the magnet and the antenna are two major components, of which the magnet generates a static magnetic field and the antenna generates a RF field orthogonal to the magnetic field (Edwards et al. 2000;Prammer et al. 2004;Appel et al. 2011;Freedman et al. 2014;Fridjonsson et al. 2014).
In the process of magnet design, the samarium cobalt material is selected due to its high intensity magnetic field in case of limited volume and little temperature dependency on magnetic field strength. The properties of samarium cobalt is shown in Table 1 (Demas and Prado 2009). To evaluate the magnet design, homogeneity of the magnetic field is an important indicator. Therefore, it is necessary to select a suitable design from a large number of magnet structures. Among them, the square magnet structure, the fan-shaped magnet structure, the ring magnet structure and the Halbach magnet structure are shown in Fig. 11. All the magnets are wrapped with a ring-shaped high permeability shell, which improves the field homogeneity and ensure no leakage outside the probe.
The obtained field homogeneities of a center circle in the cross-section with 20 mm diameter are given in Table 2. It can be seen that the field of the ring magnet is most homogeneous. Meanwhile, the structure is easy to fabricate. Therefore, ring magnet is chosen as the magnet structure.
Furthermore, the fabricated magnets are small rings. To assemble an NMR fluid analyzer, a set of magnet blocks should stick to each other in an organized way. The completed assembly is shown as the first system in Fig. 10.
The antenna system is another part of the probe system. Solenoid antenna is the better choice as it is well known that the RF field of solenoid antenna is homogeneous and orthogonal to B 0 field among a variety of antenna designs, such as solenoid structure, saddle shaped structure, birdcage structure, etc. Then, the first set of fluid analyzer was designed and fabricated according to the above design, the length of which is only 20 cm. It can be used as a module of the formation tester. When the fluid is at a stationary state, the system is able to measure the relaxation time of the fluid. Meanwhile, the diffusion coefficient can be obtained by taking advantages of the magnetic gradient at the edge of the cross-section. However, it is worth noting that this version is limited in measuring flowing fluids due to the short-polarized magnets.
If the measurement can be performed when the fluid is at flowing state, more information can be obtained, and it could be more efficient. However, there poses new challenges, of which the most prominences are the pre-polarization efficiency and the signal loss during acquisition. To tackle this, the new design adds pre-polarized magnets to the magnet system to improve the polarization efficiency and adopts a separate antenna structure to reduce signal loss during acquisition.
This version uses a three-stage magnet structure, as the second system shown in Fig. 10. Segments A and B are named as pre-polarized magnets, section C is the measured area and produces the target B 0 field. Among them, Fig. 11 Magnet design a square magnet structure b 45° fan-shaped magnet structure c ring magnet structure d Halbach magnet structure the field strength of part A is much stronger than the target field strength. The role of this part is to rapidly polarize the sample. As a result, the magnetization is higher than the target magnetization when sample flows out section A. The field strength of part B is lower than the field strength of region C, by which the magnetization can be rapidly "pulled down". Thus, when the sample arrives at the measured area, the magnetization can get close to the target magnetization. After the fluid flows over the pre-polarized magnets, the magnetization is expressed as Eq. (6): where M is the magnetization of the fluid flowing into the measuring area, M A is the magnetization when fluid in prepolarized magnet A gets into equilibration, M B is the magnetization when fluid in pre-polarized magnet B gets into equilibration, t is the time for the fluid flows through the prepolarized magnets, t A is the time for the fluid flows through the pre-polarized magnet A. Generally, T 1 values of most fluids are between 0.1 and 4 s, and the flow velocity is set between 0 and 4 cm/s. Thus, the new system should ensure that those fluids can reach the target magnetization after the fluid flows through the pre-polarized magnets. By performing continuous simulation, the optimized polarization efficiency of three-stage probe is obtained by Eq. (6) and shown in Fig. 12. It can be seen that the polarization efficiency can get to 94%-106% of the target magnetization after the fluid flows over the prepolarized magnet. Furthermore, the system is equipped with a separate antenna structure, as shown in Fig. 13, in which two separate antennas undertake pulse emission and signal reception functions, separately. The solenoid antenna is only used as an emitting antenna, the length of which is A 1 . The saddle coil is just used as receiving antenna, with the length of A 2 . Two different coil structures avoid the coupling in signal acquisition, which is conducive to improve the SNR. The tail ends of the two antennas are aligned. In this way, the emitted pulse will excite the fluid within region A 1 . The received signal is only from the fluid within region A 2 . With the fluid flowing along the sample chamber, some unexcited fluid will flow into the A 2 region while some excited fluid will flow out. However, as long as the distance that the fluid flowing pathway does not exceed the length of A 1 -A 2 during signal acquisition period, the signal attenuation due to flow velocity would be neglected.
Based on the above descriptions, it is known that this version of system can measure the fluids at flowing state. However, by using this antenna, the transmit antenna excites more fluid than that contributed to the receive antenna, which will cause great energy loss if the fluid in stationary state. On the other hand, when ring-shaped magnets are stick to each other, it is easy to twist in the assembly process between the adjacent magnets which will result in field non-homogeneity.
From the above presentations, the first two sets of fluid analyzer assemble a number of ring-shaped magnets along the fluid flow direction. In order to produce a homogeneous B 0 field, the magnetization direction of each magnet must be consistent. However, in the assembly process, the adjacent two ring magnets are prone to twist, resulting in field non-homogeneity. To effectively avoid the twist between the magnetic blocks, a special ring-shaped structure was utilized by cutting part of the ring out as a card slot, which can be fastened in a high permeability material. The optimization is shown in Fig. 14. Figure 14a is the original ring-shaped structure. Figure 14b is the optimized ring-shaped structure, The pre-polarization efficiency of the three-stage magnets Fig. 13 The separate antenna structure, the long antenna is solenoid structure for pulse emitting, the short antenna is saddle structure for signal receiving 1 3 which ensures the magnetic field in the same direction. On the other hand, the field strength will not greatly be affected by the structure optimization. The results are shown in Fig. 14c and d.
In order to enhance the polarization efficiency, the magnet structure was also modified by adding a new stabilization section C to the pre-polarized magnets which means that the fluid needs to flow through the three-stage pre-polarized magnets before the fluids reaches the measurement area D, as the third system shown in Fig. 10. Figure 15 demonstrates that the polarization efficiency can increase to 99%-101% of the target magnetization when fluid flows through the fourstage magnet structure.
According to the design, the completed engineering prototype is shown in Fig. 16a. The engineering prototype can be operated either in laboratory or in testing wells with tens of meters depth. Figure 16b is the field distribution tested by a 3D automatic Gauss meter (CH-1600, Beijing Cuihai Electronics Company). In Fig. 16b, the right part is the field distribution of section A, the middle part is the field distribution of section B, and the left part is the field distribution of section C and D. On the edge of the section D, there is a stray field with a gradient which can be used for fluid diffusion measurements.
To perform multi-parameter measurement, the system uses a combined antenna structure according to the measured field distribution, as shown in Fig. 16b. Antenna 1 is placed on the edge of section D, where a constant gradient field is present to be utilized for the diffusion coefficient measurement. Antenna 2 is placed in the middle of section D, which is the most homogeneous area. This part is used to measure the relaxation time. Antenna 3 is located on the other edge of section D, which has the longest length of available B 0 field and is designed to measure the NMR parameters during fluid flows. With the combined antenna structure, the system is capable to measure T 1 , T 2 , D of the fluid. Furthermore, multi-dimensional correlation maps including T 1 -T 2 , T 2 -D, T 1 -D information can be obtained. All the three antennas are solenoid structure, which is relatively easy to fabricate. In addition, it can generate a homogeneous RF magnetic field perpendicular to the magnetic field. Thus, the maximum signal quality is guaranteed. From Fig. 16b, it can be found that the three antennas are spatially independent, which avoids the coupling effects between neighboring coils. Compared with the aforementioned system, the new system has several upgrades: (1) due to more linear magnetic field in Antenna 1, the measured diffusion coefficient values would be more accurate. In comparison, the first two systems use the gradient in the edge of the probe cross-section, the measured signal incorporate the contribution of the fluid in the center of the probe cross-section. (2) The new prototype is more energy saving while measuring fluid at stationary condition. As aforementioned, if the fluid is in the stationary state, only antenna 1 and antenna 2 will be used and not much fluids need to be excited. (3) The new prototype is more effective to obtain multiple NMR parameters. From Fig. 16b, it can be found that the three antennas are independent. When the fluid locates in one antenna during the polarization state, the system can still switch to the other antennas and perform the NMR measurements during the polarization time slot. This part will described in details in Chapter 5.3.

Circuit design
The electronic circuit is an important component of the NMR fluid analyzer. The technical difficulties of circuit design are summarized as follows: (1) ultra-high power transmission; (2) weak signal detection; (3) rapid release of antenna energy; and (4) antenna switch. Moreover, the circuit has the ability to be applied in downhole environment. Thus, the designed circuit should take the limited volume, the high temperature and pressure into consideration.
The designed circuit mainly consists of main controller, power amplifier circuit, decoupler circuit, digital acquisition system, antenna control circuit, antenna tuning circuit, capacitor circuit and power supply circuit. The schematic diagram of the circuit with key parts is shown in Fig. 17 (Yu et al. 2011;Mansfield and Powles 1963;Clark 1964;Karlicek and Lowe 1978;Reddy and Reddy 1982;Griffin et al. 1993;Li et al. 2001;Xiao et al. 2015).
In the circuit system, the main controller is the core part. According to the received commands from PC, it generates all the timing and control signals including the emission control signal, the antenna control signal, the decoupler control signal, the sampling clock, the gating control signal, etc. Among them, the generated emission control signal is a sinusoidal signal with a specific frequency. After amplification by the power amplifier circuit, the emission signal becomes a high power RF pulse greater than 300 W. Afterward, the energy will be transferred to the antenna and excite the hydrogen nucleus in the static magnetic field to produce NMR phenomenon. Compared to the intensity of the emission pulse, the generated NMR signal intensity is just μV or nV level. Hence, it should be promised that the  Fig. 16 a The engineering prototype of the fluid analyzer, the fabricated probe was wrapped in a titanium steel shell in order to enhance the mechanical strength. It can be connected with the circuit with an air head. By this design, the system can be operated in testing wells tens of meters deep. b The field distribution tested by a 3D automatic Gauss meter made by Beijing Cuihai Electronics Company. The right part is the field distribution of section A, the middle part is the field distribution of section B, the left part is the field distribution of section C and D. On the edge of the section D, there is a stray field with a gradient emitted pulses and the acquired signals are not disturbed with each other. To do this, two means were taken. One is the improvement in antenna tuning circuit, a low resistance and two diodes in parallel back-to-back were added help to decrease the Q value of the solenoid coil system which can quickly discharge the residual emitted energy. The other one is the decoupler circuit, which can protect the circuit system by isolating the emitted pulse and the receiving signal. Thereafter, the received signal needs to go through the pre-amplification module to amplify the signals, the filter circuit to decrease the noise level, finally arrive at the digital acquisition system. By the analysis of the main controller, the signal amplitude and phase containing a wealth of fluid information can be obtained. In this process, the capacity circuit provides energy for the power amplifier circuit when the pulse is emitted, and the power supply circuit can provide power to other parts of the system. In the system, the specific parts are the antenna control circuit and the antenna tuning circuit due to the combined antenna structure. As mentioned above, different antennas have their specific functions. Thus, an antenna control circuit was designed to choose the appropriate working antenna. Meanwhile, a tuning circuit was designed to tune three antennas in one circuit board, which facilitates the best match between the magnets and the respective antenna.

Conventional measurement method
The most common NMR properties used in the study of petroleum targets are transverse relaxation time, longitudinal relaxation time and diffusion coefficient. Transverse relaxation time-T 2 , also known as spin-spin relaxation time, is related to internal energy exchange of the spin system. It characterizes the decay of magnetization in the transverse plane during the dephasing process of the spins. In 1948, Bloch described the relationship between the transverse magnetization vector M xy with the decay time (Bloembergen et al. 1948) where M xy is the magnetization in the transverse plane. The solution of the above function is the exponentially decaying processes as follows: where M(t) is the magnetization of decay time t. T 2 is an usual parameter to predict fluid and petrophysical properties. It can be measured by CPMG pulse sequence, as shown in Fig. 18. In this sequence, a 90° (π/2) pulse firstly pulls the magnetization into xy plane. At this time, the magnetization began to gradually dephase due to the field inhomogeneity and dipole-dipole interaction between the spins. Then, a 180° (π) pulse reverses the dephased magnetization and the dispersed magnetization will gradually reunite to form an echo. If a train of consecutive 180° pulse is used, a serial of signals with decreased amplitudes can be recorded and a decay curve can be obtained. In the process, the signal loss due to the dipole-dipole interaction cannot be reunited. Longitudinal relaxation time − T 1 , also known as spin-lattice relaxation time, is related to the energy exchange between the spin system and the external environment. It reflects the energy exchange efficiency between the spin system and the external environment. When T 1 is large, the system gets to the equilibrium state slowly. When T 1 is small, it needs less time for the spin system to reach to a balance. In 1948, Bloch described the relationship between the longitudinal magnetization vector M z with the recovery time (Bloembergen et al. 1948), the relationship is: where M z is the magnetization in the longitudinal axial. The solution of the above equation would be an exponential function: where TW is the recovery time. Since spin lattice relaxation occurs in the longitudinal axis while one must measure signal in the transverse plane. It can be measured by inversion recovery (IR) pulse sequence, as shown in Fig. 19. In the sequence, a 180° pulse will firstly reverse the initial magnetization. Then, a 90° pulse will take the magnetization into xy plane after waiting for a recovery delay TW. At this time, an NMR signal can be obtained. The signal intensity is related to the recovery delay TW and T 1 .
In the measurement process, the magnetization should be firstly ensured to get to the equilibrium state, which requires that the time between the adjacent two scans need to be greater than 5 × T 1 . Therefore, T 1 measurement is more time-consuming as compared to T 2 measurement. Furthermore, the SNR is not good enough during low magnetic field measurements. Thus, when collecting NMR signals, the SNR can be improved by superimposing the amplitude of multiple echoes of CPMG pulse sequence.
Diffusion coefficient reflects the Brownian motion intensity of fluid molecules. Since molecular diffusion is a random motion, the diffusion propagation function after a certain time is in accordance with the Gaussian distribution. When the molecules diffuse in a gradient magnetic field, the signal attenuation during a certain time is related to the average diffusion displacement of molecules. Thus, the self-diffusion coefficient of the molecule can be calculated according to this rule. Torrey (1956) descried the magnetization decay due to spin-bearing molecular diffusion where D is the diffusion coefficient of the observed molecules. It can be measured by the pulse sequence shown in Fig. 20. In this sequence, a 90° pulse tips the magnetization into the transverse plane. Then the magnetization will dephase in the gradient field. After a 180° pulse, the dephased magnetization would be reunited. During this process, the phase due to spin displacement cannot be fully reunited. The additional magnetization attenuation by diffusion relaxation is as follows: where g is the static magnetic field gradient, δ is the halfecho interval, γ is the proton rotation ratio. From Eq. (12), it can be concluded that by increasing the echo time (2δ), the signal intensity will be systematically attenuated. Then, the diffusion coefficient D of the fluid can be obtained according to this equation.
In recent years, multi-dimensional correlation methods for measuring T 1 -T 2 and T 2 -D joint distribution are becoming increasingly important in porous materials and complex fluid analysis Song et al. 2002). The techniques have advantages in fluid recognition and content calculation as compared to one-dimensional method and therefore play important roles in laboratory and downhole measurements. Among those methods, the pulse sequences for measuring T 1 -T 2 and T 2 -D correlation map are shown in Fig. 21. From the Figure, it can be seen that multi-dimensional NMR is an effective combination of one-dimensional NMR methods. In Pulse sequences for self-diffusion coefficients measurements. δ is the half-echo interval, g it the gradient value of the magnetic field the pulse sequence for T 1 -T 2 measurement, the first part is a conventional IR pulse sequence used to encode for T 1 relaxation. The experiment loops through different delay times are used to encode for different amounts of T 1 relaxation. The second part is a CPMG sequence used to encode for T 2 relaxation. In this paper, it is also known as IRCPMG pulse sequence. In the pulse sequence for T 2 -D map, the first part is for D by measuring the signal amplitude under different echo times,the second part is for T 2 relaxation by CPMG pulse sequence. Compared to one-dimensional measurement method, multi-dimensional NMR can obtain more information of the sample. As a sacrifice, the measurement time is 10 times longer than the sequence to measure T 2 relaxation time. Thus, it is necessary to improve the measurement efficiency for promoting its application range.

Driven equilibrium pulse sequence-DE
Compared to one-dimensional NMR, the applications of multi-dimensional NMR are restricted in time-limited experiments due to its long measurement time. In the paper, driven equilibrium (DE) pulse sequence was used to measure T 1 -T 2 relaxation distribution after only two scans. The details of the sequence (Chen et al. 2016) is shown in Fig. 22.
DE pulse sequence consists of two parts: the first one is τ 2 period, during which the magnetization vector is affected by T 2 relaxation. In this part, a 90° pulse tips the magnetization into xy plane, the signal is acquired after the first 180° pulse. Then a second 180° pulse is applied to reunites the dephased magnetization, and a − 90° pulse is used to rotate the magnetization back to z-axis. The other one is τ 1 period, during this interval, the magnetization vector along z-axis is affected by T 1 relaxation. Thus, each echo acquired in DE pulse sequence is subjected to T 1 and T 2 relaxation. From nth echo to (n + 1)th echo, the magnetization vector experiences several processes 0-1-2-0, as shown in Fig. 22. The magnetization evolution is as follows: where M n,0 , M n,1 , M n,2 represents the magnetization vector of time 0, time 1 and time 2 in nth echo, M n+1,0 is the magnetization of time 0 in (n + 1) th echo. During τ 2 period, the magnetization decays due to T 2 relaxation. During τ 1 period, the magnetization recovers due to T 1 relaxation. When the process repeats x times shown in Fig. 22, the magnetization will come to an equilibrium value determined by T 1 , T 2 , τ 1 , τ 2 : By applying a global inversion method (Sun and Dunn 2005), the coupling kernel functions can be written in a single kernel function: . 21 a IRCPMG pulse sequence, also known as T 1 editing pulse sequence, for T 1 -T 2 correlation. b Diffusion-editing pulse sequence for T 2 -D correlation /2 π 2 τ 1 τ /2 π π π DE (Repeat x times) Fig. 22 DE pulse sequence. In τ 2 period, the magnetization is affected by T 2 relaxation. In τ 1 period, the magnetization is affected by T 1 relaxation. Then, the magnetization will come to a drive-equilibrium value after repeating many times where K is the kernel function, i, j represents different component of the sample. Then, we can get the T 1 -T 2 distribution f i,j by the following equation: Based on this theory, DE pulse sequence was used to measure a copper sulfate solution and an oil sample. Meanwhile, the samples were measured by IRCPMG pulse sequence as a comparison. In the experiment, the sequence is executed by varying a number of TW in 20 steps from 0 to 5 times T 1 value of the measured sample. For CPMG part, the echo time is T E = 0.2 ms. The echo number N = 3000. When DE pulse sequence is used to measure the samples, τ 2 is fixed at 1 ms and τ 1 changes at 0.8, 1.5 ms in succession. The echo number N DE ≫ (τ 1 /T 1 + τ 2 /T 2 ) −1 . In the process, the (16) ∑ ij K i,j,n f i,j = M n contribution to signal attenuation by T 1 and T 2 relaxation is changing, which will lead to a new magnetization revolution. Then, T 1 -T 2 distribution can be obtained down to two onedimensional scans (Sun and Dunn 2005).
The T 1 -T 2 spectrum of a copper sulfate solution by IRCPMG is shown in Fig. 23a. In the Figure, both T 1 value and T 2 value are about 200 ms. Figure 23b is the correlation map by double-shot DE scans. The Figure displays that T 2 relaxation time and T 1 relaxation time are in similar position as the result by IRCPMG pulse sequence. Similarly, the result by IRCPMG pulse sequence of an oil sample is shown in Fig. 23c. From the Figure, T 2 value is about 105 ms and T 1 value is about 110 ms. Furthermore, the correlation map can help us to identify various components of the oil sample. Figure 23d is the result by double-shot DE scans which keeps a good consistency to the results by IRCPMG pulse sequence. Fig. 23 The experimental results. a T 1 -T 2 spectrum by IRCPMG pulse sequence of a copper sulfate solution b T 1 -T 2 spectrum by double-shot DE measurements of a copper sulfate solution c T 1 -T 2 spectrum by IRCPMG pulse sequence of an oil sample d T 1 -T 2 spectrum by double-shot DE measurements of an oil sample However, from the results, it can be found that the spectrum resolution of DE pulse sequence is not so good as the results by IRCPMG pulse sequence. The reason is that the echo time of DE pulse sequence is τ 1 plus τ 2 which is longer than T E . Another reason is that the dynamic range of the magnetization (0-M 0 ) is smaller than the range of IRCPMG pulse sequence (-M 0 -M 0 ). The spectrum resolution of DE pulse sequence can be enhanced by increasing the scan numbers. The sequence can be used in time-limited observation to increase the measurement efficiency.

Online measurement pulse sequence-DEFSR, DEFIR
In order to explore the molecular diffusion at flow status, a new T 1 -T 2 measurement pulse sequence, so-called Driven Equilibrium Fast Saturation Recovery pulse sequence (DEFSR), based on T 1 was proposed and shown in Fig. 24 (Deng et al. 2014a, b). It consists of one DE sequence, which is immediately followed by the fast saturation recovery (FSR) sequence. The FSR pulse sequence is a combination of the DE pulse sequence to the conventional saturation recovery. It tips the magnetization vector back to the longitudinal direction after each echo acquisition. The T 1 /T 2 -T 1 distribution can be obtained by two scans with DEFSR sequence: the first one is FSR sequence, and the other one is DEFSR sequence. Using the second version of fluid analyzer with a separate antenna structure, it is possible to apply this technique even for flowing fluid.
As the mathematical derivation by Deng et al. (2014a, b), T 1 -T 2 distribution can be obtained by two scans (Torrey 1956) where A DEFSR (logT 1 ) and A FSR (logT 1 ) are the amplitude of inversion T 1 distribution from the DEFSR and FSR scans, respectively.
By using DEFSR pulse sequence, it is theoretically feasible to obtain the T 1 -T 2 distribution with only double-shot scans even for flow fluid. To demonstrate the accuracy and (17) practicability of DEFSR pulse sequence, the experiments for flow fluid are carried out using the second version of the downhole NMR fluid analysis systems with distilled water and CuSO 4 solution. The results are shown in Fig. 25. The experimental parameters are: TW FSR arranged from 0.5 to 1000 ms, v = 1 cm/s, x = 10, y = 30, t 1 = t 2 = 500 ms for the distilled water and t 1 = t 2 = 50 ms for the CuSO 4 solution. According to the results, the T 1 /T 2 distribution measured with the DEFSR sequence shows good consistency with that measured by IRCPMG sequence. For fluid with the longer relaxation time, it takes longer time for DE pulse sequence to drive the magnetization to the equilibrium value.
DEFIR pulse sequence is an optimization of the DEFSR pulse sequence (Deng 2014). It replaces the FSR part of DEFSR pulse sequence into FIR sequence. Meanwhile, it also needs two scans to obtain the two-dimensional T 1 -T 2 distribution. Compared with DEFSR pulse sequence, the magnetization range of DEFIR sequence is larger, and the result is less influenced by frequency offset between the RF and the Larmor frequency (Mitchell et al. 2009;Torrey1956).

Rapid observational mode
In conventional NMR measurements, the system has only one antenna to fulfill the multi-functional NMR parameter acquisition. The usual observational mode is shown in Fig. 26a. It consists two parts: the first one is the polarization process. In this part, it is necessary to bring the magnetization to a fully polarized state, which takes a long time, at least 3-5 T 1 . The other one is the acquisition process. In this part, a 90° pulse is applied to flip the fully polarized magnetization to the transverse plane and acquire the NMR signals. Due to the polarization time during each measurement, the measurement efficiency is low at this observational mode.
One effective way to accelerate the measurement is to squeeze the polarization time. In the field of biological application, the small angle tipping in NMR imaging can speed up the imaging efficiency. However, in low-field NMR measurements, since the low SNR, the fluid needs to be fully polarized to improve the signal strength, which results in a /2 π /2 π π π /2 /2 In the third version of the NMR fluid analyzer, the combined antenna structure is used as shown in Fig. 16b. It can be seen that different antenna is at different region which leads little coupling effect between the antennas. Through the antenna control circuit, the system can choose to working antenna in order to achieve different functions. According to the designed combined antenna structure, the optimized observational mode is shown in Fig. 26b. It can be seen that when antenna B works, the fluid under antenna A is in its polarization state. Afterward, the antenna control circuit triggers the antenna A to perform NMR measurements. At this time, the fluid under antenna B is in its polarization state. By using this means, it can largely increase the measurement efficiency of the entire system. The optimized observational mode 1 is shown in Fig. 27. The new mode combines antenna 1 and antenna 3 for measuring the properties of flowing fluid. Antenna 1 adopts the CPMG pulse sequence. Since it is in a gradient magnetic field, there is a phase difference between the odd and even echoes when the fluid is flowing, and the phase difference is related to fluid flow velocity. In this principle, the flowing velocity of the fluids can be obtained, and it will be discussed in detail in Chapter 6.2. Antenna 3 uses CPMG or the IR pulse sequence to obtain T 2 and T 1 information of the sample. Since the fluid is in a flowing state, the measured T 2 or T 1 spectrum will shift toward to short relaxation time. However, by the obtained velocity information of antenna 1, the spectrum distribution measured by antenna 3 can be corrected to the value free from the influence of flow velocity. Through the cooperation of the above two antennas, it can double the efficiency of the system.
In NMR acquisition, one-dimensional T 1 , D measurements or two-dimensional T 2 -D, T 1 -T 2 measurements are time-consuming because it needs to alter the waiting time or echo time with multiple repetitions to calibrate the T 1 or D information. In order to shorten the acquisition, a new optimized observational mode 2 was designed, as shown in Fig. 28. This mode is applicable to the measurement of stationary fluids, including a combination of two antennas. Antenna 1 is used to measure the D and T 2 -D information of the fluids. Antenna 2 is used to measure the T 1 and T 1 -T 2 information of the sample. This means doubles the measurement efficiency.

Fluid content
Determination of fluid content in mixed fluids system has always been important through multiple processes in oil industry. For example, in oil extraction process, the composition of oil determines the oil production. In oil transportation, water contamination may cause severe issues with pipelines. For refined oils, water can corrode the machinery components. Understanding of fluid contents helps to tackle this problem scientifically (Yang 2011;Pal 1994). NMR is conventionally used to determine the fluid contents noninvasively. The relaxation time and diffusion coefficient of oil components are different from water. Thus, fluid contents can be calculated from NMR spectrum distribution by integrating the signal in their own regions 3 (Robertson and Morrison 1979). The experiment used 11 water and oil mixed samples, the water contents of which vary from 0% to 50%. All the samples were measured by CPMG and IRCPMG pulse sequence in homogenous region of the probe. For CPMG pulse sequence, the echo time is 400 us and echo number is 25,000. For IRCPMG pulse sequence, the recovery time is logarithmically distributed in 30 steps from 0 to 10 s. The T 2 and T 1 -T 2 maps of a mixed sample are shown in Fig. 29a, b, respectively. From the Figure, it can be seen that the oil and water are well separated on NMR spectrum. The T 1 and T 2 value of the water component in this sample is longer than 1 s while the relaxation time of oil is shorter than 1 s. Then, fluid contents can be calculated by integrating both the oil and water peaks.
The calculated water contents by NMR T 2 and T 1 -T 2 relaxation map are shown in Fig. 29c and d. The horizontal axis is the water content calculated by weighing. The vertical axis is the calculated water content from the NMR data. The red lines are the error limit with 5%. It should be noted that the contents calculated by NMR are calibrated due to the different signals of the same weight oil and water Song et al. 2002).
For a more complex sample, the T 1 and T 2 spectra of water and oil could be mixed, for instance, if some paramagnetic ions were added to the sample. As a result, the fluid contents cannot be calculated directly by T 2 spectrum or T 1 -T 2 relaxation map, as shown in Fig. 30a and b. Nevertheless, according to the diffusion coefficient D measured by diffusion-editing pulse sequence (Fig. 21b), the fluid contents can be well defined, as shown in Fig. 30c. The water peak is on the water line where the D value is 2.36 × 10 −9 m 2 /s as the green line shows. The oil peak is on the oil line as the red line shows. In the experiment, 8 sample were allocated with the water content from 0 to 45 percent. The calculated water content by D-T 2 correlation map is shown in Fig. 30d, the results are well matched with the water content by weighing.

Oil molecular dynamics and composition
Oil is a complex mixture composed of hydrocarbons with a wide range of molecule size distribution including saturates, aromatics, resin, asphaltene (Freed and Hürlimann 2010;Kowalewski and Mäler 2006;Hirasaki et al. 2003a, b). It is critical to conduct a comprehensive understanding of the components and molecular dynamics to optimize the project for recovery, refining and transportation procedures (Mullins 2008;Mullins et al. 2007;Groenzin and Mullins 2000;Price 2009). As far as our knowledge, small molecules move faster than large molecules. The relationship between NMR relaxation time and Brownian motion of the molecules can be explained by Bloembergen theory (Bloembergen et al. 1978).
where τ c is the rotational correlation time, ћ is the Planck constant divided by 2π, μ 0 is the magnetic permeability of free space, b is the distance between two adjacent 1 H on the same molecule. From Eq. (18), the relationship between relaxation time, and τ c is obtained. If the molecules are in fast motion limit, T 1 and T 2 relaxation both decrease as τ c increases. However, if the molecules in slow motion limit, T 2 decreases as τ c increases, T 1 increases as τ c increases, and T 1 is normally longer than T 2 .
In our experiment, 9 crude oil samples were tested. The samples were all dehydrated and reserved under conditions of ambient pressure and room temperature for long time. Therefore, their volatile components were removed. Figure 31 shows the results of T 1 -T 2 distribution of these samples. As shown in Fig. 31, the correlation maps can be divided into three classes that correspond to three columns. The distributions of class I and class II share general properties: T 1 -T 2 distributions locate closely to and distribute along the diagonal line. The relaxation time of class I oils is longer than that of class II oils. In comparison, the results for class III oils are not centered on the diagonal lines. The T 1 /T 2 ratio is significantly larger than 1. On the other hand, there is no asphaltene presence from the SARA component results in class I and class II oils. Class I oils are rich in saturation. Class II oils are rich in aromatics. Generally, the saturation and aromatic molecules are small molecules which are in the fast motion limit. All the samples in class III contain asphaltene and an amount of resin. For oil containing asphaltene, it is easier to generate molecular aggregation and super molecule. The size of the molecular aggregation and super molecule are larger than that of the separated molecule. They slow down the rotational motion of maltene molecules when they are in close proximity. At this moment, the oil molecules are in slow motion limit.
These results demonstrate that T 1 -T 2 distribution is related to the chemical composition of crude oil. It also indicates that asphaltene is a relaxation-contrast agent both to T 2 relaxation and T 1 relaxation for all maltene molecules. However, the influence on T 2 relaxation is much greaterthan T 1 relaxation. Asphalteneeasily aggregates with other molecules to produce a supramolecular structure. This aggregate will slow down molecular motion, which can be detected by measuring T 1 -T 2 distribution (Jia et al. 2016). By combining the two formulas in Eq. (18), the τ c distribution which indicates molecular dynamics properties can be obtained by T 1 /T 2 ratio: With the measured T 1 and T 2 distributions, the τ c distributions of three different class crude oils can be obtained by Eq. (19), as shown in Fig. 32. The results are analyzed to reveal the differences of molecular dynamics in crude oil. Oil 1 is a light crude oil with 32.4° API gravity and 21.0 cp viscosity. Oil 2 and oil 3 are heavy oils, with viscosity values of nearly 2000 cp and API gravity values of 12.8°. The rotational correlation time of the molecules in oil 1 is much smaller than those in oils 2 and oil 3. According to the SARA component of crude oils, oil 2 has numbers of aromatic rings. Given that some aromatic components are not flexible, the rotational correlation time is increased as the τ c distribution of oil 2. Resin and asphaltene are large molecules and strongly affect relaxation behavior which lead the tumbling rates slower as the τ c distribution of oil 3.

Oil viscosity
Knowing the viscosity of a crude oil as early as possible is vital to petroleum industry. As shown in Eq. (18), Bloembergen theory describes the relationship between NMR relaxation times and Brownian motion of molecules which offers the chance to obtain the relationship between NMR relaxation time and η through the link between τ c and η. Suppose the molecule of a pure fluid with viscosity η is a small sphere, the radius of which is a, the link between τ c and η can be described by Stokes-Einstein equation (Miller 1924). They found that regardless of the complexity of the molecular structure or the saturation of hydrocarbon molecules, the measured a value tends toward a constant value of a = 430 pm. Therefore, it can be concluded that when Stokes-Einstein equation is applied to large molecular compounds, the Brownian motion is only part of the motion in large molecule, in other words, the local motion of a segment of the long chain molecule. DEFIR pulse sequence was developed to rapidly obtain the T 1 distribution and two-dimensional T 1 /T 2 -T 1 Fig. 31 T 1 -T 2 distributions of nine crude oil samples. The correlation maps can be divided into three classes that correspond to three columns. Class I oils in the first column are rich in saturation, the relaxation time of which are longer than the class II oils which are rich in aromatics. All the samples in class III contain asphaltene and an amount of resin. In each panel, the dashed line is the T 1 = T 2 line. The shapes of relaxation distributions can be used as an indicator of the oil components distribution of the sample by only two scans (Deng et al. 2014a, b). Here, two methods are introduced for viscosity prediction. One method is to combine the longitudinal relaxation rate in Eqs. (18) and (20). The T 1 distribution is directly measured for viscosity prediction. It can be seen from Fig. 33a that the T 1 relaxation time of the measured fluid first decreases and then increases as the viscosity increases. Such a trend will give rise to a problem, that is, one T 1 value may correspond to two different viscosity values (points A′ and B′ in Fig. 33b correspond to the same T 1 value but have two different viscosity values). Considering that T 2 always decreases with the increase of viscosity, the inferred T 2 distribution (point A or B in Fig. 33b) by DEFIR pulse sequence can be used as an auxiliary parameter to determine the viscosity. One reason why T 2 is not directly used for viscosity prediction is that for a highly viscous fluid, T 2 distribution approaches to a constant, which makes it difficult to predict oil viscosity. The second method for viscosity prediction is to use T 1 /T 2 ratio which is even simpler. By combining Eqs. (19) and (20), the relationship between viscosity and measured T 1 /T 2 distribution can be obtained. With the viscosity increases, the T 1 /T 2 value also increases, the predicted relationship is the red line shown in Fig. 34b.
These two methods have their own strengths and weaknesses. The first method applies to high-viscosity crude oils. Since the parameter b of the reservoir fluid varies within a certain range, what is predicted is the range of viscosity. The viscosity predicted by the second method is a specific value, but with considerable error for extreme low-viscosity and high-viscosity fluids.
The experiment was carried out in the laboratory using 18 crude oil samples. According to the viscosities measured by the HAAKE RS600 rheometer, the samples can be divided into two groups. The samples in group A were the low-viscosity oils with viscosities less than 1000 cp. The samples in group B had viscosities higher than 1000 cp. During the measurements, the samples were placed in the detection area of the fluid analysis system. The DEFIR pulse sequence was used for this viscosity measurement, τ DE = τ FIR = 0.2 ms, x = y=30. The TW FIR values were selected in the range of 0.5-1500 ms logarithmically. Figure 34a and b depicted the predicted viscosities by using aforementioned methods. The experimental results show that if the viscosity of the sample is larger than 100 cP, it is more accurate to predict the viscosity using T 1 /T 2 data. But if the samples have very low viscosity, the accuracy of the second method is greatly reduced, because that T 1 and T 2 values are almost identical when the viscosity is low. It also shows the comparison between the measured viscosity results and the NMR predicted results using T 1 or T 2 data.
As b is an uncertain parameter, a range of possible values are predicted, rather than a specific value. This is also the reason that we choose 2D data to predict the viscosity.

Hydrogen index
Hydrogen index (HI) is an important parameter to differentiate oil type and its combustion efficiency. Since different oil component has different HI value and corresponds to different relaxation times, the relaxation time distribution can act as an indicator to determine the HI value of the sample.
Partial least squares regression (PLSR) is a multivariate statistical analysis method (Helland 2014). It combines the characteristics of principal component analysis method, typical correlation analysis method and linear regression analysis method which can provide a more reasonable regression model. The process of PLSR method includes: principal component analysis, model establishment and model evaluation. By using principal component analysis, it will obtain typical variables of imported data. Afterward, the model can be obtained by constant iteration with the typical variables. Finally, the effectiveness of the model will be validated by using cross validation. In this work, PLSR method was used to determine HI value from NMR relaxation time distribution.
The experiment used 24 crude oil samples with different viscosities. All the samples were divided into two groups: the experimental group measured by NMR method and interpreted with the PLSR method and the control group. CPMG pulse sequence was used in this experiment. The echo time is 0.2 ms and the echo number is 15,000. T 2 relaxation time distributions were obtained by processing the acquired signals.
When using the PLSR method, 15 oil samples were used to build the prediction model and the other 9 oil samples to testify the accuracy of this model. The results are shown in Fig. 35a. The x-axis is the HI value, which is obtained from the ratio of oil sample signal intensity divided by the signal of the same volume water. The y-axis is the predicted HI by the established model. The green stars are the established model with NMR spectrum distribution by PLSR method. It can be observed that the predicted HI values are fluctuated along the diagonal line, which demonstrates that the predicted HI values of the established model are in agreement with the measured values. The two dotted lines are the error lines and the error limit is 0.05. As previously mentioned, cross validation is used to prove the suitableness of the model. In this process, the spectrum distribution of one sample will be removed, then PLSR method is used to build up a prediction model from the relaxation time distribution of the remaining samples. Finally, the mathematical basis of using this model to calculate the HI value of the removed sample Squares of the error-PRESS is as follows: where j is the sample number, y j is the measured HI, yy j is the predicted HI of the removed sample. The smaller the PRESS is, the more accurate the result would be. In addition, the model can be further validated from standardized residuals. Standardized residuals are the differences between predicted values and measured values. In principal, standardized residuals behave random distribution around zero value. The validation results are shown in Fig. 35b, c. Figure 35b shows the PRESS values and Fig. 35c shows the standardized residuals. From the Figure, it can be seen that the standardized residuals are randomly distributed which proves the effectiveness of the proposed model. With the established model, the predicted HI of the other 9 samples are shown as the red dots in Fig. 35a. It can be seen that all the predicted HI values are distributed between the two error lines which proves the efficiency of the established model.

Flowing fluid property
NMR is an effective technique to measure the flowing fluids. However, flow velocity will have a great effect on NMR response (Caprihan and Fukushima 1990;Fukushima 1999;Gladden and Sederman 2013). Here, the third version of the NMR fluid analyzer was used to determine the flow velocity by using two methods. The first one can be used in homogeneous field for high flow velocity determination and the other one is applied in gradient field for low flow velocity determination. Furthermore, with the obtained flow velocities, it is possible to calibrate the NMR relaxation signals of flow fluids to more reasonable values.

High flow velocity determination in homogeneous field
As discussed in Chapter 5.1, if the stationary fluid is in a homogeneous field, the signal attenuation of CPMG pulse sequence is just from bulk relaxation. When fluid flows, the situation will be more complicated. Some certain part of the sample not tipped by the first 90° pulse will enter into the antenna, in contrast, the equal amount of fluids tipped by 90° pulse will flow out of the antenna. Meanwhile, the polarization efficiency will decrease as flow velocity increases. Thus, three mechanisms including bulk relaxation, polarization efficiency and excited fluid volume contributed to the signal, influence the signal intensity when fluid flows (Osán et al. 2011). And the signal attenuation can be described as Eq. (22): where M 0 is the initial magnetization of the fluid, v is the fluid flow rate, L is the effective length of the antenna, l is the length for polarization magnets, β is the pre-polarization efficiency and t is the attenuation time. If the condition v/L ≪ 1/T 2 is fulfilled, Eq. (23) can be simplified as: In this situation, it can be inferred that the signal attenuation can be replaced by a linear fitting, which is M(v, t) = A + Bt, where A = βM 0 , B = − v/LβM 0 . Then, the ratio B/A = v/L. Thus, the fluid flow velocity can be obtained by CPMG attenuation (Osán et al. 2011).
Tank Pump Fig. 36 The experimental set-up, the fluid is draw out from the tank by the pump. Afterward, the fluid flows across the probe and the flowmeter and reserve to the tank. In this device, the flowmeter is used to control the flow velocity The schematic diagram of the experimental devices is shown in Fig. 36. It includes a tank for reserving fluid, a flowmeter for calculating flow velocities, a pump for driving the fluid flow and the fluid analyzer for generating and obtaining the NMR signals of the sample.
In this experiment, the tap water was used and its flow velocity is controlled at a range of 7-60 cm/s. The calculated value of v/L satisfies Eq. (23). During the CPMG acquisition, the echo time T E is 0.4 ms and the echo number is 3000. The normalized echo trains with different velocities were shown in Fig. 37. In this Figure, the horizontal axis is the attenuation time, and the vertical axis is the normalized signal amplitude. As the flow rate increases, the signal attenuation becomes faster and the SNR is lower. The reason is that the recovered magnetization gets smaller due to lower polarization efficiency when fluid flows through the polarization magnets. The inset illustrates the signals in 0-0.08 s. It is readily to observe that those signals attenuate in a linear pattern. According to Eq. (23), the flow velocities can be obtained.
The obtained fluid flow velocity is shown in Fig. 38. The horizontal axis is the fluid flow rate calculated from the glass rotor flowmeter with a measurement error of 4%. The vertical axis is the flow velocity calculated from obtained CPMG data. It can be seen that the fluid velocity calculated by CPMG is in excellent agreement with the velocity calculated from the glass rotor flowmeter when flow velocity is high. However, when the flow velocity is small, some weak deviation shows up and the above correspondence begins to fail. This is majorly caused by signal attenuation due to the non-negligible bulk relaxation. Furthermore, when different fluids flow across the system, it will result in different NMR signals due to different relaxation time, flow velocity, as the Eq. (22) shows. Thus, it is possible for the system to acquire the contents of different phase in multi-phase flow by good calibration for every single fluid (Osán et al. 2011).

Low flow velocity determination in gradient field
From the basic principles of magnetic resonance imaging (MRI), it was known that the observed signal is related to its position. The relationship can be described as: where φ is the phase accumulation of the signal. In a constant gradient field, B off equals to gr, r is the sample position, g is the gradient intensity of the magnetic field along the sample chamber. When sample flows, its position will change as time goes by, then r = r 0 + v * t, where r 0 is the initial position of the sample. Therefore, the accumulated phase of the NMR signal is: where k contains fluid position information and q v contains flow velocity information. For CPMG pulse sequence, the accumulated phase of the first echo can be integrated as:

Fig. 37
The echo train attenuations with different fluid velocities between 7 cm/s (pink color) to 60 cm/s (brown color). As seen from the curves, the higher the fluid flow velocity, the faster the signal decays and the smaller the apparent relaxation rate It can be calculated that the accumulated phase of term k is zero while the accumulated phase of q v is not for the first echo. For the second echo, the accumulated phase is: The accumulated phase of term k and q v are both zero for the second echo. Furthermore, it can also be calculated that the accumulated phase of term k is zero for all the CPMG echoes, while the accumulated phase of term q v is zero only for even echoes. Moreover, the phase difference between the odd echoes and even echoes is related to the flow velocity, which is: From Eq. (27), it needs to calculate the phase difference φ before flow velocity determination. The cosine value of the phase difference can be determined by signal amplitude ratio of the odd echoes and even echoes of CPMG pulse sequence: where A odd is the signal amplitude of the odd echoes, A even is the signal amplitude of the subsequent even echoes. Equation (28) only holds for laminar flow and plug flow, when it comes to turbulence flow, it will introduce higher order motion moments and the accumulated phase of even echoes is no longer zero. In such cases, a phase difference is not an adequate indicator for accurate flow velocity determination.
In this experiment, tap water is used as the targeting sample and CPMG pulse sequence is conducted from the antenna 1 of the third version fluid analyzer. The echo time (29) cos = A odd ∕A even T E was 1 ms and the echo number was 40. The same experimental set-up shown in zero. When it comes to flow fluid, there is an obvious phase differences related to flow velocity between the adjacent echoes. However, it is surprising that the calculated phase

Fig. 41
Effects of flow velocity on NMR measurement differences between odd echoes and even echoes are not the same. This can be attributed to two reasons. The first one is the low SNR in low-field NMR measurements. The measured signal intensities are the signal values plus the random noises. The other reason is that the flow pattern generated by the pump is in cluster, not the exact laminar flow pattern. In this case, the error can be suppressed by summing all the even echoes and all the odd echoes, separately. Then, the φ value is calculated by the sum values (except for the first and the second echo due to different coherence pathways).
The obtained fluid velocities are shown in Fig. 40. The horizontal axis is the fluid flow rate calculated from the glass rotor flowmeter and the vertical axis is the fluid flow velocity calculated from the phase differences of adjacent NMR signals. The two red lines are the error lines which are 0.005 m/s. The tested flow velocities are from 0-0.06 cm/s. It can be found that the fluid velocity calculated from the phase difference of NMR signal is in good agreement with the velocity calculated by the glass rotor flowmeter. The accuracy can be further enhanced by increasing scan numbers.

Relaxation time distribution correction for flowing fluids
Compared with the measurement of stationary fluids, the measurement of flowing fluid is also affected by two additional factors related to flow velocity: fluid volume contributed to the signal and polarization efficiency (Deng e al 2013). Moreover, the flowing fluid will experience an inhomogeneity field, which will shift T 2 relaxation time distribution toward shorter values while posing no influence to T 1 relaxation time. Thus, as long as the flow velocity is known, it is possible to calibrate T 1 relaxation time.
For IR pulse sequence, the effects of flow velocity of plug flow on NMR measurement is shown in Fig. 41. The rectangular region is the sensitive area of the NMR probe. The obtained signal contains two sources, one is the magnetization initially tipped to the transvers plane as the yellow region in the Figure. The magnetization of this part will recovery gradually. As the fluid flows, the volume of this part will decrease. The other one is the magnetization of the fluids entering the sensitive region after the first pulse. As the fluid flows, the volume of this part will increase. On the other hand, the flow velocity has effect on the polarization efficiency. The obtained signal is shown as follows: According to the description in Chapter 4.1, it is no need to consider the effect of polarization efficiency to the measured signal if the velocity is below 4 cm/s for the third version of the NMR fluid analyzer. At this moment, the obtained signal can be simplified: If the flow velocity is known, it is possible to calibrate the IR signal free from velocity and get a more accurate T 1 distribution to identify fluid properties. When the flow pattern is laminar flow, it just needs to integrate the influence of all the region according to the flow velocity distribution in the pipe (Chen et al. 2016).
In the experiment, the sample was a doped water. Antenna 3 was used to measure the IR signals of the static and flow fluid at different velocities, respectively. With the method discussed in previous Chapter 6.2.2, antenna 1 can be used to measure low flow velocities. By combined the two antennas together, the IR signals and the corresponding T 1 spectrum can be calibrated free from flow velocities, as shown in Fig. 42. Figure 42a is the measured IR signals at different velocities. As the flow velocities increases, the IR curve can recover more quickly. Figure 42b is the inversion T 1 spectrum. The T 1 peak will shift toward a smaller value when flow velocity increases, therefore it will lead to incorrect interpretation of fluid type and content. After the calibration vt ≥ L by using the obtained flow velocities from antenna 1, the IR curve and the corresponding T 1 relaxation time distribution are shown in Fig. 42c and d. It can be seen that both the IR curve and the corresponding T 1 distribution can be corrected to the exact value when fluid is in stationary state. The calibration precision will be only affected by the measurement error of the obtained velocities.

Summary
NMR fluid analyzer has been acting as an effective tool for fluid evaluation in downhole, wellhead, laboratory and other operational sites. In this review, three levels of knowledge on NMR fluid analyzer are delivered. Firstly, the structures of existing NMR fluid analyzers from different companies and institutes were introduced. Subsequently, different NMR parameters of stationary and flowing fluids, such as total signal intensity, relaxation time, diffusion coefficient, free induction decay signal, chemical shift, can be obtained by those systems. Finally, more geophysical and geochemical properties, i.e., the fluid type, component, content, hydrogen index, viscosity, flow velocity, velocity distribution and the mud filtrate invasion degree can be speculated with the acquired NMR information. Learnt from the above experience, three sets of NMR fluid analyzer were designed and implemented by CUPB. The first prototype measures the NMR parameters when the fluid is in stationary state. Thereafter, pre-polarized magnets were added to the magnet system to improve the polarization efficiency and discrete antenna structure was designed to reduce the loss of acquired signals when the fluids are flowing. Finally, an engineering prototype was fabricated. The magnet system adopts four-stage magnet structure with Fig. 42 IR recovery curve and the corresponding T 1 spectrum before and after calibration. a and b are the measured IR recovery curve and the corresponding T 1 spectrum under different velocities, respectively. c and d are the calibrated IR recovery curve and the corresponding T 1 spectrum, respectively special ring-shaped blocks, which can largely improve field homogeneity and polarization efficiency. The antenna system uses a combined antenna structure which can fulfill multiparameter (T 1 , T 2 , D) and multi-functional measurements. As for circuit system, an antenna control module was added which allows to switch between different working antennas.
With the demand for rapid measurements, two pulse sequences and two observational modes were developed to accelerate the acquisition. DE pulse sequence can obtain the T 1 -T 2 information of stationary fluid by double-shot measurements. When fluid flows, the NMR response mechanism becomes more complicated. Thereafter, two online measurement pulse sequences, DEFSR and DEFIR, were proposed. Both the two sequences are based on the measurement of T 1 relaxation time, which reduce the effect of flow on signal attenuation. Then, the T 1 -T 2 correlation map can be acquired by only two scans. Furthermore, based on the combined antenna system, two observational modes are optimized. One can be used in stationary fluid, and can obtain the T 1 -T 2 and T 2 -D correlation map at the same time. The other one can be applied to flow fluid, and can simultaneously obtain the flow velocity and spectrum distribution. The two observational modes make the most use of the polarization time and double the measurement efficiency.
Finally, the designed system is applied to fluid sample with different geophysical and geochemical properties. According to the measured NMR distributions, the fluid content can be obtained. From the Bloembergen theory and the Stokes-Einstein equation, the relationship between the relaxation time and the properties of the crude oil is established. It can then be obtained not only the oil components and the rotational correlation time distribution, but also the oil viscosity. Meanwhile, a new model by PLSR method to predict the HI value is proposed and validated by experimental results. Furthermore, the system obtains the fluid flow velocity using two different methods. The first one is by signal intensity attenuation of CPMG pulse sequence, which is adaptive for high fluid flow velocity. The other one is based on signal phase difference between the adjacent echoes, in which case, the system is still capable to obtain the fluid velocity while the flow rate is low.
From the above descriptions, it can be concluded that the NMR fluid analyzer by CUPB is applicable in both downhole and surface environments. The obtained NMR parameters by the system accurately evaluate the fluid properties in oil exploitation, transportation and refining processes. In future, this tool will serve better in oil industry, in aspects like product monitoring, online reaction, etc.