Numerical simulation and sensitivity analysis of automatic optimization of gas extraction well locations in abandoned mines

There are large numbers of abandoned mines in China and abroad, among of which stores relative abundant coal-bed gas. The gas extraction from abandoned mines can be used for power generation or industrial gas utilization. In this paper, the present situation of abandoned mines in China and abroad was studied, and the disadvantages of the common layout and optimization methods of gas extraction in abandoned mines were pointed out. Based on the analysing of reservoir conditions and physical property parameters, the finite element software COMSOL was used to do the numerical simulation of extraction well automatically optimize, and take shenbei coal mine as an example. Moreover, an automatic optimization APP of well location was developed based on the results of simulation. Finally, the parameter sensitivity of gas extraction is analysed. Through the study, it is found that the most basic and common method of gas extraction in abandoned mines is empirical method, which lacks of theoretic support and accuracy, thus causing unreasonable extraction and waste of resources. In this study, the COMSOL numerical simulation software was used to explore the numerical simulation method of automatic well position optimization combined with the optimization algorithm. The Nelder-Mead algorithm was selected as the optimization algorithm after comparing the advantages and disadvantages of various algorithms. The operation flow and type of Nelder-Mead algorithm were analysed, and the optimization parameters of numerical simulation were set. Through the numerical simulation, the function of automatically searching the high-gas production position near the preset well position was realized, and the automatic optimization APP for gas extraction in abandoned mines was developed. Finally, the sensitivity of parameters to gas production in different well locations under three different pumping conditions which are horizontal, vertical and bottom-hole negative pressure was analysed; and the simulation results were discussed.


Introduction
Coal mines are usually abandoned when they lose their extractable value, and each coal-rich country has abandoned underground mines. There are about 900 abandoned mines in UK, among of which there are about 400 wells exit the gas overflow phenomenon. There are also many abandoned coal mine in Europe other countries, Ukraine and Russia (Karacan and Zgen, 2015). In the late 1990s, the technology of gas exploitation in waste mine goaf is developed in the UK for commercial success (Kunz, 2004), then the United States, France, Finland, Germany, the Czech Republic, Poland and other countries carried out extensive research. The extracted gas can be used for power generation for the national grid or used as industrial gas (Liu et al., 2018).
The basic research of gas resource evaluation and experimental development in abandoned mines in China began at the beginning of this century. The development of coalbed gas in coal mine areas in China is mainly based on the extraction of gas from un-mined or decompressed coal seams in production mines for a long time. The development of gas in abandoned mines is still in the exploratory stage (Guo and Zhang, 2003;Zhou et al., 2015;Meng et al., 2016a;Liu et al., 2016;Yu et al., 2017b;Hu and Yan, 2018). At present, only a few waste mining areas with high gas content is doing the experimental exploration. The field test of surface drilling for gas extraction from abandoned long-wall goaf was carried out in Yangquan Coal Mine in 2013, Shanxi Province, China (Qin et al., 2015). Shanxi Lanyan Coalbed methane Group Co., Ltd. had drilled 17 waste gas extraction Wells in Jincheng mining area by 2016, 8 of which began to produce gas, with the maximum output per well reaching 7000 m 3 / day (Meng et al., 2016b). Wulan Coal Mine explored a new method of gas extraction using surface pressure-relief boreholes in 2016. There were 18 effective gas producing Wells connected to the negative pressure extraction system in goaf, with a gas production capacity of 40,000 m 3 / day by 2017 (Yu et al., 2017a).The present situation and utilization of waste gas indicates that the gas extraction and utilization in abandoned coal mines are feasible and have great economic and environmental benefits.
The Chinese government also attaches great importance to the development and utilization of abandoned mine gas. In the 13th "Five-year Plan" of coal bed gas development and utilization, it put forward clearly that to strengthen the gas extraction and utilization in abandoned mines, to construct the demonstration project of abandoned mine residual gas extraction (http://www.gov.cn/xinwen/2016-12/04/ content_5142853.htm, 2016). The Chinese Academy of Engineering also confirmed the development and utilization of coal bed gas in abandoned mines is an important research topic. Therefore, it is urgent to study the relevant theories and technical methods of coal bed gas extraction and make good use of the multiple benefits brought by the gas extraction in abandoned mines.
Meanwhile, Scholars in China and abroad have also done some simulation studies on gas extraction. The commonly use numerical simulation software includes CFD, COMSOL, FLUENT and so on. Zhao et al. (2011) used CFD software to simulate the gas flow in mined-out goaf and analysed its mechanism. Guo et al. (2012) compiled code and used CFD software to build 3D modelling for goaf airflow. Yuan et al. (2013) carried out numerical simulation research based on COSFLOW calculation program and CFD software, and proposed optimization Suggestions for well locations.  studied gas distribution characteristics in goaf with the help of COMSOL modelling software. However, many numerical simulations ignore the difference between crack gas pressure and matrix gas pressure, which is quite different from the actual situation. At the same time, these simulations are based on experience and the preliminary well layout has been determined, so lacking of the automatic optimization methods.
Previous literature research results show that domestic and foreign scholars have made important achievements in the study of reservoir area division, characteristics of gas storage and migration, and numerical simulation of gas extraction in abandoned coal mines (Qian and Liu, 1991;Liu, 2009;Wu, 2011;Qin et al., 2015;Meng et al., 2016a;Feng et al., 2016;Zhao, 2018;Gao, 2018). However, there are still some deficiencies and disadvantages. For example, the most basic and commonly methods of gas extraction in abandoned mines are mainly empirical methods, which lack of theoretic support and accuracy which resulting in the unreasonable extraction and waste of resources. In addition, there is also lack of systematic study of parameter sensitivity that affecting the gas production during the negative pressure extraction condition. It also lacks of the effective well pattern optimization method. Therefore, it has great academic and application value to further study the seepage law of waste gas, the influence of various parameters on production and the development of related APP.
Based on the analysing of reservoir conditions and physical property parameters, the finite element software COMSOL was used to do the numerical simulation of extraction well automatically optimize, taking Shenbei coal mine as an example. Aiming at solving the inaccurate and not scientific of the well location distribution which is preliminary selected by the experience, the automatic optimization method of well location is developed combined with the automatic optimization algorithm, to realize the automatic seeking of high gas content wells near the preset well locations, and also to develop the related APP. In addition, sensitivity analysis of gas extraction parameters is carried out in three different pumping conditions which are horizontal, vertical and bottom-hole negative pressure, so as to provide scientific theoretical basis for gas extraction in abandoned mines.

Common well location determination method
The most basic and common method of determining the well location in abandoned coal mines is mainly empirical method before using the numerical simulation method. It is commonly to determine the rough extraction location according to the working face, the distribution of the mined-out area, geological structure and drilling cost This method is usually lacking of accuracy and evidence so as to causing the waste of resources and unreasonable extraction.
Coal seam is often considered as a double porous media with matrix and cleats (Laubach et al., 1998;Wang et al., 2019). In coal matrix, gas desorb and diffuse with the pressure drawdown. The content of adsorbed gas in the matrix is expressed by Langmuir isothermal adsorption equation. While in the fractures or cleats, the gas flow satisfies Darcy's law. The quasi-steady flow model is often used to describe the gas transport in coal seam (Shi and Durucan, 2004;Chen et al., 2012). The mathematical equations are shown as follows: (1) The pseudo-steady state flow is adopted for the seepage flow in the matrix, and the equation is shown in Eq. (1) (Chen et al., 2012).
where, V is the amount of adsorbed gas (the variant in this equation), t is the time, τis the gas diffusion time, and V E is the equivalent gas volume in the natural fractures. The adsorption gas content was characterized by the Langmuir isotherm adsorption equation, and therefore the equivalent gas volume in natural fractures (V E ) can be calculated using the following equation: where, V L is the Langmuir volume constant, p L is the Langmuir pressure constant, and p is the gas pressure in the natural fractures.
(2) The law of conservation of gas mass is adopted in the natural fractures, and the mass conservation equation is as follows: where, ρ g is the gas density, ϕ is porosity, k is permeability, μis viscosity, and q d is the gas mass exchange volume between the matrix pores and the natural fractures. According to the gas equation of state the gas density is related to the gas pressure: where, M is the molecular weight of gas, R is the gas constant (8.314 J·K −1 ·mol −1 ), T is the temperature in Kelvin.
The gas mass exchange volume q d is calculated using the following equation: where ρ ga is the gas density under standard conditions, and ρ c is the density of coal. (

3) Initial and boundary conditions
The model established in this study describes the general mechanism of fluid movement under the condition of negative pressure pumping in surface drilling. For an unsteady flow, the initial condition is as follows.
p(x, y, z, t)| t=0 = f 0 (x, y, z) The Dirichlet boundary condition, specifying the value of the function at the boundary, is used. In this study, the boundary pressure is applied at the inner boundaries (constant bottom hole pressure in the simulation), and the equation is as follows: where, f (x, y, z, t) is the known function, and Γ is the boundary. The no flow condition is applied at the outer boundaries. The three-dimensional geological and geometric model of abandoned coal mine was constructed and evaluated based on the analysing of resource distribution, coal seam thickness, gas content, working face layout, land subsidence, surface water and other factors in the studied area. Trying to find the possible high gas production positions in the originally planned wells after the numerical simulation was carried out and observing the variation of adsorbed gas content after extraction for a period of time. The automatic optimization of well location and simulate verification of new adding wells will be proceed after analysing the three-dimensional field distribution flow and comparing the change of gas production after the change of well location.
However, the first thing to rely on is experience for most common numerical simulation methods during the initial well location design, the optimized layout and adding new well locations. In order to improve the efficiency and accuracy of the simulation, the automatic optimization numerical simulation method combining with the exploration well location optimization algorithm is needed to realize the automatic seeking of high gas place near the preset well locations and to develop the related APP. It is the most important issue need to be solved in this study.

Numerical simulation of automatic optimization and APP development
In this study, one coal mine of Shenbei Coalfield is taken as the research object. The size of this mine is 900,000 tons/year, and the mining depth is −260m ∼ −800m. Some coal bed gas cannot be fully exploited in the mining area affected by the pressure, porosity, desorption and other factors, so the geological gas well extraction is designed.

Optimization algorithm
The optimization algorithm is divided into gradient optimization algorithm and non-gradient optimization algorithm. In this study, the algorithm proposed by Nelder and Mead (Nelder and Mead, 1965) is selected as the optimization algorithm after comparing the characteristics of various algorithms (Table 1). This algorithm does not involve the derivation operation of complex objective function, it is relatively simple and its convergence is faster; meanwhile, this algorithm is more accurate for the extreme value of the equation with fewer unknown variables.
The main operation flow of Nelder-Mead algorithm is as follows: select initial data, renumber vertex, check termination criteria, seek reflection point, calculate extension point, reflect, shrink and shrink. The following five operations is contained for the Nelder-Mead algorithm: (1) Sorting: Sort the function values of each test point from small to large: (2) Reflection: Getting the centre of mass of the simplex with n vertices: (3) Contraction: If f(x n+2 )≥ F (x n−1 ), then bring each point closer to vertex x 0 to form a new vertex: where：θ∈(0∼1)is contraction coefficient; (4) Extension: If f(x n+2 ) < f(x n−1 ), x n+2 -x n+1 is the direction to reduce the function, an extension point should be taken on the line where x n+2 and x n+1 are located: where，γ(γ＞1)is extension coefficient; (5) Shrinkage: When f(x n+2 )≥ F (x n−1 ), the point with a small objective function value between x n +2 and x n can be denoted as x n , and the other point is denoted as x n+2 . A contraction point is taken near x n on the line where x n and x n+1 are located: Where, β(β∈(0∼1))is shrinkage coefficient.

Numerical simulation of well location automatic optimization
With the help of the COMSOL built-in optimization module, the overall situation equation which use the gas content as the objective function was established, combined with the two functions of "overall situation ordinary differential and differential algebraic equation" and "optimization". Select the appropriate optimization algorithm and optimization parameters to obtain better optimization results. Table 2 lists parameters used in the simulation (Table 2). Table 3 lists the optimization parameters of numerical simulation (Table 3). Figure 1 shows the reservoir pressure distribution of optimized well location at time t = 0 and extracted for 1 year. The gas in the area with high gas content is well pumped. Colour range: 0.2MPa-10MPa (Figure 1). The general interior point method based on continuous convex approximation, which is especially suitable for topology optimization problems.

Nelder-Mead
An algorithm for finding the extrema of a multidimensional function without using any derivatives. Approximation using polyhedrons. Fast convergence. COBYLA The algorithm of sampling the objective function and constrained variables constructs and controls the linear approximation of the objective within the moving confidence interval. BOBYQA The objective function sampling algorithm constructs and controls the quadratic approximation of the objective within the moving confidence interval.

Coordinate search
Continuous sampling along the control variable axis to find the optimal method, changing one control variable at a time. Figure 2 shows the change of well coordinates in the optimization process. The range of coordinate changes becomes smaller after 25 iterations, and the well coordinates change from (0, 0) to (−1.125, 11.25) (Figure 2). Figure 3 shows the change of total gas production in the optimization process. The output of the well position obtained through iteration is the maximum using the Nelder-Mead optimization algorithm, and this position is the optimal well position. In addition, the production capacity is close to but less than the optimal well location when pumping near the optimal well location, indicating that the algorithm is relatively reliable (Figure 3).

APP development of well location automatic optimization
In this study, an APP for automatic optimization model of gas extraction well location in abandoned mines is also developed for convenience (Figure 4). COMSOL software includes an "App Builder", The Method Editor provides a programming environment for writing code for operations not covered by the tools in the Model Builder. By using these two modules, app can be created conveniently and quickly. The APP mainly has the following functions :(1) Simulating the gas extraction process under different geological conditions, and drawing the pressure distribution diagram in each mining stage;(2) Drawing the change diagram of well coordinates in the process of automatic optimization and the change of the objective function (gas production) in each iteration;(3) Selecting different optimization algorithms for simulation.

Sensitivity analysis of gas extraction parameters
Aiming at the large permeability and gas content heterogeneity of abandoned mine reservoirs, this chapter conducts sensitivity analysis on selected reservoir parameters, studies the influence degree in different vertical and horizontal positions and different bottom-hole extraction pressures on gas production, and analyses the simulation results.
It is noted that the exploitation is affected by pressure, porosity, desorption and other factors. We mainly investigate the well locations as well as bottom-hole pressure, which are the main concern on site. The other parameters collected for Shenbei coal are assumed unchanged and the sensitivities of other factors are ignored in the current study. These influencing factors would be valuable to investigate once other coal mine data are collected and compared with this work.

Impact of different horizontal positions on gas production
In the horizontal direction, the abandoned mine reservoir can be divided into lateral fracture zone, O-shaped fracture zone, re-compaction zone and unmined zone, and different zones have wide distribution of pore and permeability. Figure 5 shows the distribution of reservoir pressure in different horizontal zones after extracting for one year. It can be seen from the figure that when wells are located in un-mined zone, the pumping efficiency is obviously low. When the well is located in the lateral fracture zone and the re-compacted fracture zone, the pumping conditions are similar. When the well is located in the "O" zone, the reservoir pressure drops the fastest The colour range is 0-8MPa ( Figure 5).

Impact of different vertical positions on gas production
Longitudinally, the abandoned mine goaf is divided into goaf, caving zone and fracture zone, and the porosity and permeability in different regions are quite different. In order to study the influence of the engineering parameters on gas production in the same well location and same condition, the single variable of well location is controlled to make the well depth at the centre of each longitudinal zone. Figure 6 shows reservoir pressure distribution for one year of extraction in different longitudinal zones. It can be seen from the figure that when the well is located in the goaf, the extraction efficiency is obviously low. When the well is located in the fracture zone, the reservoir pressure drops the fastest and the pumping efficiency is the highest The colour range is 0-8MPa ( Figure 6).

Impact of negative bottom-hole pressure on gas production
The bottom hole pumping pressure that can be controlled artificially also has a certain influence on gas production as an engineering parameter. The single variable of bottom-hole pressure is controlled to study the influence of the engineering parameters on gas production in the same well location and same condition. Figure 7 shows the distribution of reservoir pressure and gas flow rate for one year under different bottom-hole pressure. It shows that bottom-hole pressure has little influence on gas production. The colour range of pressure is 0-8MPa, and the colour range of flow rate is 0-2E-4m /s (Figure 7).

Discussion
In the sensitivity analysis of the influence of different positions in the transverse direction on gas production, the previous three-dimensional flow field study showed that the streamlines in the lateral fracture zone and the "O" shaped fracture zone were densely distributed and the gas flow rate was fast, so the drainage efficiency was high. The fracture zone was affected by re-compaction and the drainage efficiency became low. In this numerical simulation, the pumping efficiency of the fracture zone is close to that of the lateral fracture zone, the reason probably is the fracture zone is the centre of the high-concentration gas-rich zone. Figure 8 shows gas production for one year of extraction in different lateral zones. In the figure, the initial gas production of drilling and pumping in the "O" zone fracture zone is quite high, but the decline speed is very fast The reason is because it has well-developed fracture system in this area, the gas can be in a turbulent state. The gas production in the lateral fracture zone is consistent with that in the re-compacting-fracture zone. The gas production is quite low in the un-mined zone. However, the final gas production varies little since the three wells are close to each other and should be located in the same gas accumulation area (Figure 8).
It is found that the permeability and porosity increase gradually from bottom to top and the simulation results are consistent with the previous longitudinal zoning characteristic theory when  researching the influence in different vertical positions on gas production, because the selected goaf is relatively large which is seriously affected by the compaction of overlying strata. Figure 9 shows gas production map for one year of extraction in different longitudinal zones. It is found that the gas production in fracture zone and caving zone is similar. It should because the wells drilled into the same gas accumulation zone, and the stratigraphic fractures are well developed with good connectivity between fracture zone and caving zone. The overlying strata in the goaf are under great pressure and the collapsed rock blocks are re-compacted, so the gas is not easy to flow (Figure 9).
Finally, the automatic optimization of well position is implemented and the maximum output and optimal position is obtained using the Nelder-Mead optimization algorithm with 25 iterations of well position optimization. The production of wells near the optimal well location is also close to that of the optimal well location, which proves that the algorithm is very reliable.  However, since this method cannot avoid complex terrain such as ground subsidence area and water accumulation area, and the computational complexity of simultaneous optimization of multiple wells is greatly increased, it is not easy to converge. Therefore, further research and debugging considering more influencing factors is needed to further improve the accuracy and reliability of simulation.

Conclusions
The present situation of abandoned mines and gas extraction in China and abroad is studied in this paper, and the disadvantages of the common well layout and optimization methods is pointed out. The finite element software COMSOL is used to simulate the automatic optimization of the extraction well position, and the automatic optimization APP for gas extraction was developed according to the simulation results based on the analysis of the reservoir conditions and physical parameters of the abandoned mine. Moreover, the parameter sensitivity of gas extraction was analysed. The main conclusions are as follows: 1. There are many abandoned mines in China and abroad, it stores relatively large amount of coal-bed gas. The gas extraction from abandoned mines can be used for power generation or industrial gas utilization. 2. Scholars have made plenty of achievements on goaf reservoir division, gas enrichment and migration rules, extraction numerical simulation research. However, there are still some deficiencies and disadvantages. the most basic and commonly methods of gas extraction in abandoned mines are mainly empirical methods, which lack of theoretic support and accuracy which resulting in the unreasonable extraction and waste of resources. Meanwhile, it also lack of the effective well pattern optimization method and relative automatic optimizing APP. 3. The automatic optimization of well position is implemented and the maximum output and optimal position is obtained using the Nelder-Mead optimization algorithm with 25 iterations of well position optimization. The finite element software COMSOL combined with optimization algorithm is used to simulate the automatic optimization of the extraction well position. Though the study, it realize the purpose of automatic seeking the high gas area near the preset well position and developing the relative automatic optimizing APP. 4. Because of the large reservoir permeability and gas content heterogeneity in abandoned mines, the parameters sensitivity of gas extraction is analysed. The impact on gas production in three different positions which are horizontal, vertical and negative bottom-hole pressure positions is studied.