A Study of On-site Shale Gas Detecting Device Based on Mass Spectroscopy

As unconventional gas preserved in organic-rich shale and the intercalary strata, shale gas cannot be effectively explored and developed effortlessly. Considering that gas content detecting is time consuming in shale gas exploitation process, an on-site detecting method was raised in this paper for shale gas components and concentrations. By software programming, online process control was achieved. In combination with a high-precision mass spectrometer, such a method can be used to fulfill the change from off-line detection to real-time automated measurement. In addition, a system prototype was developed by hardware design made based on the design flow. As proven by experiments, the entire set of experimental equipment completely satisfies industrial production requirements and its pressure-maintaining and explosion-proof function is applicable to various operating conditions, which fills in the gaps in shale gas component and concentration on-site detecting devices of China.


Research Purpose and Significance
As China's economy grows rapidly, there is an increasing demand for oil and gas resources. Due to dwindling of petroleum resources, more importance has been attached to geological research on unconventional oil and gas resources. Facilitating exploration and development of unconventional oil and gas resources can effectively compensate for insufficient conventional oil and gas resources, so as to meet China's ever-growing energy demands, ensure energy supply security and provide strong support to industrial development. Shale gas serves as a new energy source of natural gas considered being efficient and clean. It has been successfully developed in North America and Europe, etc.. Comparing with conventional gas, shale gas has a long exploitation life and a long production cycle on one hand; on the other hand, the gas bearing shale is widely distributed, greatly thick, and generally gas-bearing. On this basis, a shale gas well is capable of supplying shale gas steadily from the long run [1] .
China is a late starter in shale gas investigations. Besides, progress in shale gas exploration and development testing technique research is rather slow. Plus a large number of scholars engaged in relevant geological studies, China is short of a systematic shale gas database. Such a fact hinders further explorations into shale gas [2]. Hydrocarbone content in the shale strata directly determines whether the oil gas in the shale can be effectively exploited; moreover, regarding shale core acquired during drilling, oil gas inside the core keeps resolving and separated due to pressure change. Consequently, shale core data acquired from the ground cannot be used to accurately evaluate actual hydrocarbone content in the shale strata [3], which severely affects shale gas exploration and development decision-making as well as shale gas production evaluation.
Thus, an improvement upon shale gas exploration and development testing technique may directly turn shale gas into the primary energy on which China's industrial development depends. Through experimental testing, full consideration is given to geological conditions and shale gas occurrence law in China to investigate and develop techniques and devices that are critical to shale gas on-site detecting. This has important theoretical and practical meanings for accelerating shale gas exploration and development [4] .

Domestic and Overseas Research Status
Gas content in shale refers to the total amount of natural gas by converting the natural gas contained in each ton of shale under standard temperature and pressure, including free gas, adsorbed gas and solution gas. Gas content, as a parameter, is the key to assessing shale gas productivity and predicting shale gas resources. The prerequisite for such assessment and prediction is to investigate industrial practices and basic theories of gas content detecting methods [5] . By contrast to technologically mature countries such as America, China is still at a preliminary or intermediate stage in terms of shale gas exploration and development. Especially for experimental measurement of gas content, China has a dramatic deficiency of technology and only a few mature devices and methods are available here.
At present, gas content measurement and evaluation methods have been established preliminarily for shale gas both at home and abroad. Furthermore, gas content measurement is divided into direct measurement and indirect measurement.
In terms of the indirect measurement approach extensively applied in China and foreign countries, the total gas content in shale is achieved by measuring free gas, adsorbed gas and residual gas in shale based on different categories [6] . To measure the content of free gas, it should be firstly determined that the free gas contains water or oil; subsequently, gas saturation of the free gas can be defined according to water saturation or oil saturation confirmed by the shale core; and finally, a rockelectricity relation is established to ascertain free gas content by virtue of saturation logging. As for adsorbed gas, its measured content is obtained by rocking coring (including secondary coring), side well coring and debris desorption. However, as the adsorbed gas may be lost to a certain extent during desorption, the final measurement results should be determined by taking the influence of such a factor into account. The adsorbed gas content is usually defined by an isothermal adsorption simulation. Adsorption properties and adsorbing capacity of the shale samples collected are simulated by isothermal adsorption tests and described by the Langmuir model. Through such a test, isothermal adsorption curves of the samples are acquired to determine the maximum adsorbed gas content of different samples under diverse pressure values (depths). Alternatively, Langmuir equation parameters of the shale samples are determined by experiments to calculate the corresponding adsorbing capacity [7] .
Direct measurement means that drilling and coring are carried out for representative shale debris on the spot to measure the actual gas content [8] , involving pressure maintaining coring measurement and confined coring. With regard to the latter, a vast majority of the adsorbed gas and partial free gas can be preserved by coverage with sealing fluid. It has been widely believed by domestic and overseas researchers that indirect measurement generates a low precision. For this reason, the method of direct measurement is seldom adopted and the matched experimental devices are also rarely seen [9] .

Main Research Contents
According to the indirect measurement method widely applied in foreign countries, after the shale samples have been collected, the shale gas is extracted by virtue of a drilling system and then stored in a gas storage tank. Furthermore, it is sent to a professional laboratory where various complicated manual operations are conducted to generate detecting results. Such a process requires several days to be completed, which dramatically affects subsequent shale oil and gas collection efficiency. If such a duration can be shortened, both operating efficiency and productivity effect can be substantially improved.
A capture system capable of collecting 100% of oil gas drained from the core in-situ during drilling has been developed in Sinopec Group. This study focuses on developing, in combination with such a system, a set of devices making use of the direct measurement method to realize online real-time measurement of shale gas content. Currently, mass spectrometers are used to measure gas and liquid components offline in most cases. Without a doubt, transforming offline measurement to online realtime measurement by controlling experimental procedures is a key innovation point of this paper. In addition, workflow software programming was conducted to achieve the automatic flow control over pressure maintaining (under-pressure or over-pressure gas turned into those under normal pressure) and explosion proof, which satisfied the requirements of real-time measurement.
The device developed here is able to detect gas components automatically, measure gas components of H 2 , N 2 , O 2 , CO, CO 2 , H 2 O, CH 4 and C 2 H 4 , etc., output ion current intensity data and figure out percent concentrations in an online manner. Besides, applicable gaseous phase mass range is 1-200 amu. Detecting results displayed through a display control are expressed in multiple ways; and operating the system requires no professional knowledge related. Regarding its measurement accuracy, it is ±1%R for volume of liquid phase, ±0.5%FS for mass of liquid phase, and ±1%FS for volume of a gaseous phase. As measurement accuracy indexes, they are fully capable of directing industrial production.
Furthermore, the device is also integrated with an automated washing function to clean the device automatically after detecting, which enormously elevates feasibility of on-site operation. In addition, the device has a size making it possible to mount it on a moving vehicle and apply it to shale gas oil component detecting subjected to various conditions.

Mass Spectrometry Principle
Mass spectrometry is an analytical method used to analyze components of the measured sample by measuring its ion mass-to-charge ratio. Featured with a high response rate, high measurement accuracy, a wide scaling range and high stability, it is capable of performing multi-point multi-component detection, completely satisfying the quantitative detecting requirements for gas content of oil gas bearing shale [10] .
An online mass spectrum analyzer is composed of four parts, that is a sample injecting module, a mass analysis module, a vacuum module and a circuit module. To be specific, the mass analysis module serves as its main part, including an ion source, ion lens, a quadrupole rod mass analyzer and a detector. Samples are introduced into the ion source by virtue of the sample injecting module, so that gas molecules ionized into positive ions by electrons emitted from filament in the ion source can speed up and focalize based on the ion lens system, and then flow into the quadrupole mass analyzer. Furthermore, under the joint action of radio frequency and direct-current electric fields, the ions are separated according to their mass-tocharge ratios and enter the detector. Finally, the corresponding mass spectrum is obtained by processing the detection signals [11] . Figure 1 presents the design block diagram of the shale oil gas on-site detecting device. Main parts include an air collector, a vacuum pump, an air blower, a pressure balance tank, a filter unit, a cylinder pressurizing unit, a mass spectrum analyzer and an industrial control computer.

Workflow Design Experimental Contents of the Detecting Device
The air collector is used to gather oil gas in the shale strata as the measuring object. The air was pressurized into the pressure balance tank where the air was mixed uniformly; then, secondary filter was conducted to remove ashes and liquid in the air by a filter unit. In case that the air was under-pressurized, a piston of the cylinder pressurizing unit was adopted to push the air to be measured in the balance tank into the filter unit and the mass spectrum analyzer. Moreover, saturated NaHCO 3 solution in the filter unit was able to remove acid gas in the shale oil gas to protect the device from being corroded subsequently. The mass spectrum analyzer had the capability to monitor components of the gas input in an online and real-time manner and send the detection results to the industrial control computer. Through analysis and relevant processing, the results were eventually presented in a diagrammatic form. At the very beginning, the system was initialized in the first place to shut down all solenoid valves and obtain the readings indicated on a pressure meter of the pressure balance tank. In the event of 1 barometric pressure, the system started to run normally. Solenoid valves 6, 4, 8 and 11 together with the vacuum pump were activated; and they could not be closed until readings on the pressure meter remain unchanged for 3 seconds. Till this moment, system initialization was completed.
The pressure valve 3 located between the pressure balance tank and the air collector was open so that the gas to be measured was all pushed into this tank where it stood still for 5 minutes. In this way, the gas dissolved in the solution was sufficiently released and its flow direction was determined based on readings on the pressure meter.
(1) If the intensity of pressure inside the balance tank reaches 0.2MPa, procedures a-b, and f-j are implemented; (2) If the intensity of pressure is below 0.001 MPa (signifying that the gas inside the air collector is less than 3 liters in volume under standard atmosphere pressure), the measurement is ceased, and procedures f-h are implemented; (3) If the intensity of pressure is greater than 0.001 MPa, but less than 0.2MPa, the cylinder (pressurizing unit) is launched to execute procedures c-j.
a.Open solenoid valves 4 and 12. Under the circumstance that 3 liters of the gas are discharged from the balance tank and after atmosphere in the pipe behind the solenoid valve 12 is blew off, activate the mass spectrometer to detect for the first time; in this process, note down gas components and concentrations. b.Detect repeatedly with the mass spectrometer and record all data to acquire their mean values; thus, statistical results can be acquired in terms of gas components and concentrations. c.Open solenoid valves 4, 8 and 9, launch the vacuum pump and pump under-pressure or low vacuum gas in the balance tank; when the pressure intensity of the gas inside this balance tank is synchronously detected as being reduced by 3/300 (i.e., the cylinder piston is located close to the top of the cylinder; and the volume of the balance tank is 300 liters, while that of the cylinder is 3), shut down solenoid valves 4

Hardware Implementation
On the premise of meeting relevant measurement demands, hardware design should take the following actual application requirements into account: (1) Short online detecting time: Hardware facilities should be simplified to the greatest extent to reduce waiting time, considering that not only does the system adopt online quantitative detection to direct the next production phase according to detecting results, but the result accuracy required is not very high and the detecting duration cannot be excessively long.
(2) High device safety: Operating conditions on the site of shale oil gas production are evil. Furthermore, considering frequent vibrations and much dust there, too much exposure of the device to the outside world is inappropriate. It is also not suitable to ensure device reliability and durability by an excessive number of precise instruments.
(3) Easy to operate and move the device: As the device is used for industrial production detecting in which case workers do not master enough specialized knowledge, its operation cannot be too sophisticated; moreover, as it needs to be moved frequently, the device with a properly large dimension should be highly integrated and convenient for transport.
(4) Separating the measurement module from the collection module: Due to uncertainties of underground gas, there may exist toxic and highly corrosive gas; in this case, the collection system and the analysis system should be separated from each for integration, to prevent the hazardous gas from endangering workers or making an adverse effect on service life of detecting equipment.
(5) Other requirements: To meet the requirement of durability and make it convenient for device maintenance and repair, spare parts should be standardized, universalized and modularized. Please try your best to use those easy to buy on the market. Considering economical and energy-conservative requirements for the device, no assembly units dramatically energy consumptive can be selected.
With regard to the above demands, the device is composed of two parts. One is the master control system; and the other is an oil gas sampling system.

Master Control System
As shown in Figure 2, the master control system consists of a cabinet, an industrial control computer, a mass spectrometer and an emergency power supply. Assembly units of the system are connected to the industrial control computer via a PCI-1730 board card to control the indicator light, the air blower and the vacuum pump, etc. by relevant programs. The cabinet panel is not only integrated with a display, an indicator light and a power supply control switch, but also equipped with 2 USB2.0 interfaces to upload or download data through communication with the industrial control computer. Four indicator lights provided on the panel are used to indicate running status of the system and respectively function as follows.
Device self-detecting light: The system enters a selfdetecting state after the device has been initiated; at this moment, this indicator light is normally on.
Sample calibrating light, is a light indicating mass spectrometer calibration.
Device normal operation light: When the system runs normally, this indicator light is normally on.
Device failure light: When the system goes wrong during running, this indicator light becomes normally on and all devices stop running at the same time.
SHP8400PMS-L mass spectrometer manufactured by Shunyu Hengping is selected, where sensitivity values of its Faraday detector and electron multiplier detector are 100%~10ppm and 100%~10ppb respectively. Ion energy and electron emission current are adjustable system parameters fully satisfying measurement requirements. Being connected with a computer through a USB interface, it becomes convenient for information transmission. As for the industrial control computer, that with a model of IPC-610C manufactured by Advantech is utilized.

Oil Gas Sampling System
The oil gas sampling system presented in Figure 3 is composed of a filter unit, a vacuum pump, a cylinder, a pressure balance tank and a weighing unit.

Figure 3 Oil Gas Sampling System
The pressure balance tank was designed to have a maximum pressure resistance capacity of 5MPa and a volume of 0.28m 3 . 2XZ-15 rotary vane type vacuum pump manufactured by Lichen Tech was selected and its pumping speed was 15 L/S. As a 4-channel saturated NaHCO3 solution filter, the filter unit is provided with a capacity of 200mL. Such an oil gas sampling system made use of the cylinder to pressurize the under-pressure gas; moreover, capacity and length of the cylinder were selected to be 20L and 1m respectively. Liquid mass was weighed by a program control electronic scale with an RS-485 communication interface. While real-time measurement and calculation could be implemented by upper computer software, volume of the liquid should be read out manually.

Software Implementation
"shaleOAGD", control software of the experimental device, was developed in a QT creator development environment.
The software was designed to ensure normal operations in the entire course of the experiment. In addition to setting up parameters such as inlet period and purge time, system running status should be also selected. In detail, an operator can select to perform the purge process or not manually; and the system can automatically determine to proceed to the measurement step and pressurize the gas or not according to readings on the pressure meter. Additionally, the software has the ability to figure out relevant physical variables, as well as the total volume of gas inside the balance tank based on readings on the pressure and the temperature meters. The corresponding ideal gas state equation can be expressed as follows.
Where, P refers to pressure intensity of the gas, V to volume of the gas and n to the mol number of the gas; and R is a constant and T is temperature. Thus, the right part of this equation has a definite value, that is, Regarding the pressure balance tank, its volume V 1 is 300L, while pressure intensity P 1 and temperature T 1 are both measured by a pressure meter and a thermometer respectively. On the right side of the Equation (2), P 2 stands for a standard atmosphere pressure and T 2 is ambient temperature at 25℃. On this basis, volume V 2 of the gas is figured out.
When the software is needed, a port is selected prior to data path selection. After running, the present pressure and temperature values together with their curves of the pressure balance tank are displayed on its interface. In order to analyze the results, the software may extract detecting results obtained from the mass spectrometer. For the purpose of improving detecting automation capability and reduce manpower involvement, a vast majority of parameters are integrated in the backstage of the software to realize one-key measurement, keep the interface clear and tidy, and make it easy to operate without a requirement for any professional knowledge. A work log function is provided on the software interface to remind the operator of the present step, which makes it convenient for a metrology technician to master the measuring progress.

Experimental Procedures
The overall experimental procedures are described as follows. The automatic shale oil gas detecting device was initiated, so that the system entered into a self-inspection state and self-inspection light of the device became normally on. Since the completion of self-inspection, all solenoid valves were shut down, while equipment such as the vacuum pump and the air blower was all ready and the system also ran normally; in this case, the device normal light was normally on, but the self-inspection light was off.
Mass spectrometer software PMASS2009 was activated to set components and contents of the calibration gas. In order to set system parameters, process control software shaleOAGD was activated and the duration to send the gas from the air collector to the pressure balance tank was set at no less than 10 seconds. In order to ensure that gas adsorbed in the liquid could be released to a certain extent, the standing time should be set at no less than 10 seconds and the continuous purge time at no less than 20 seconds.
After selecting the port serial No., open the COM port and selecting a data path, the button START of the system was clicked and the device began to work simultaneously. The gas to be measured was pumped into the pressure balance tank by the vacuum pump; then, through opening or closing the solenoid valve of programmed automatic control, the air blower functioned to push the gas from the balance tank to the mass spectrometer via relevant pipes. On the interface, the current pressure and temperature values of the pressure balance tank were displayed together with their curves. Analysis results of the system include gas component detecting findings extracted from the mass spectrometer; together with other information such as the volume of the gas and the mass of the liquid, they were all displayed on the operation interface.

Result Analysis
On-site shale oil gas samples were investigated to define components and concentrations of the calibration gas for calibrating the mass spectrometer. Depending on a standard library generated through calibrations, samples of shale oil gas falling into the same category were precisely measured. In this study, two kinds of gas samples were adopted to test the device.

Common Air
Common air was pumped into the pressure balance tank by the vacuum pump. Experimental findings were eventually obtained by following an automatic shale oil gas detecting workflow. Some data were extracted and presented in Table 1 below. A box plot was acquired for various measured components based on relevant measuring data, as shown in Figure 4. As can be observed from this figure, measuring results of this system are rather stable in different periods; errors among their maximum, minimum and median values are almost equal to zero. Moreover, variance of each measured value is no more than 0.1‱. Such a fact indicates that such a system has favorable measuring stability. A broken line graph presented in Figure 5 was obtained according to the average measured values and the actual values of gas components. It signifies that the measured values of gas components are slightly deviated from their actual values. Especially for nitrogen content, its measured value substantially differs from its actual value of 78%, failing to meet a precision requirement of 1%. However, considering that gas components may vary from place to place and the measurement is conducted in a laboratory and the gas for experiment is not a sample of standard atmosphere, such a measurement error still falls within an acceptable range.

Mixed Standard Gas
The vacuum pump was utilized to pump 1/50 of the gas out of the pressure balance tank and then mix it with binary gas to reach one standard atmosphere pressure. In the binary gas, proportions taken by carbon dioxide and argon are 0.2% and 99.8% respectively. Subsequently, gas components and contents in the tank were calibrated by the mass spectrometer, which was followed by online real-time measurement based on an automatic shale oil gas detecting workflow. Finally, experimental data are achieved and some data are presented in Table 2.  Figure 6 as a box plot is obtained from measured values of various mixed gas components. As can be observed from this figure, measuring results in different periods have very stable values; and errors among the maximum, minimum and median values are almost equal to zero. Besides, variances of measured values of the components are all no more than 0.1‰. Through volume conversion, argon and carbon dioxide concentrations in the mixed gas rise to 4.5% and 1.5% respectively, while those of nitrogen and oxygen show a slight drop. Furthermore, Figure 7 as a broken line graph can be portrayed as follows in line with the average measured value and the theoretically calculated value of mixed gas components. It shows that the measured value is basically consistent with the theoretically calculated value, with an error below 1% as required.
Based on two experiments described above, it is clear that the system is applicable to online quantitative detecting of gas components, gas concentrations and liquid masses and its detecting accuracy reaches the required standard. Therefore, it can serve as a reliable device to measure gas content during shale gas exploration and development.

Conclusions
As clean and low-carbon energy transition accelerates and natural gas consumption in China rapidly grows, not only is the situation where security in natural gas supply should be guaranteed increasingly rigorous, but it is also urgent to step up efforts in natural gas resource development in China and improve productivity correspondingly. Strengthening development and exploitation of unconventional natural gas resources is a strategic choice to enhance the security in natural gas supply in China. Featured with large reserves and wide distribution, etc., shale gas gradually turns into a strong performer among such resources. Although shale gas exploration and development start rather late in China, it has made great progress and significant achievements in recent years. Without a doubt, shale gas becomes a critical source for increases in natural gas production and supply in China. Gas content in gas-bearing shale is the key to evaluating a degree of its enrichment and plays an essential role in its entire life cycle from shale gas exploration to its development. Hence, how to accurately and rapidly measure gas content in gas-bearing shale is a great subject that is urgently needed to be addressed at present. Specific to such a practical demand, an on-site online measuring method was investigated here. Based on a direct measurement method for gas content detecting, measuring workflow control software was written together with the hardware design to develop a complete shale oil gas on-site detecting system. In addition to achieving functions such as gas-liquid separation, pressure balance, gas filtration and automatic sampling, the system is featured with a sound hardware structure, a high integration level and complete functions, and satisfies multiphase medium measurement requirements of shale oil gas. The software system developed has the capability to control measuring workflow, and perform automatic pressure maintaining and explosion proof detecting procedures in any operating condition. To measure gas components, gas concentrations, liquid masses and liquid volumes, the operator only needs to press down one key, indicating that such software system is easy to operate. As demonstrated by results of online oil gas detecting experiments, the system operates normally to accurately fulfill a quantitative measurement of gas components and concentrations. Additionally, its detecting accuracy also meets evaluation indexes of project approval.