A Digital Twin-Based Approach for Optimization and Prediction of Oil and Gas Production

*e Internet of things technology plays an important role in improving the efficiency of oil and gas production, of which digital twin technology is the most prominent. By effectively using data and organically combining them with a deep understanding of technicians, digital twin technology can improve the efficiency of oil and gas asset systems in the entire life cycle of an oilfield including design, operation control, optimization, etc. Starting with the concept of digital twinning, this paper analyzes the situation of digital twinning in various industries, then obtains the new connotation of digital twinning in oil and gas industry, and at last establishes an optimization model of oil and gas production. Based on the digital twinning of oil and gas and applying the Internet of things, real-time data, and AI, the paper optimizes the oil and gas production process control and applies it to the actual production. Actually, the digital twin technology of oil and gas production includes six parts: entity, model, data collection, intelligent algorithm, service, and interaction control. Meanwhile, each part is interspersed with various data perception and drive, and interactive feedback forms an organic iterative closed-loop control. Digital twin technology can effectively use data and organically combine the deep understanding of technical personnel, so that it can be used in design, operation control, optimization, and other aspects including the entire life cycle of the oilfield from concept to front-end design and out-of-service . And digital twin technology would improve the efficiency of oil and gas asset systems. *e example analysis shows that the system efficiency of the oil and gas production model based on digital twinning is improved by 3%. By analyzing the production status, optimizing the design, and fully grasping the production capacity, equipment capacity, and their working conditions of the oil layer, the digital twin-based approach can provide a basis for further formulating reasonable technical measures and make the equipment work normally at high efficiency to ensure high output and efficient production of oil wells.


Preface
With the middle-and late-stage development of oilfield, the buried depth of oil wells is getting deeper and deeper, and the geological conditions are more and more complex. ere are many doubts about the understanding of downhole wellbore, such as low production efficiency, high maintenance cost, and huge production fund consumption. e underground part of oil well production process scene and some dangerous scenes cannot be seen by human eyes, and some modern electronic measurement and control devices are difficult to secure or even unable to place. However, with the progress of science and technology and the development of information technology, some simulation techniques are adopted, such as the Research on oil and gas transmission digital twins. PetroChina Southwest pipeline branch [1] firstly collects, verifies, and aligns data through datum point survey, pipeline midline detection, aerial photogrammetry, 3D laser scanning, 3D terrain construction, oblique photography, digital 3D modeling, and other technologies and then recovers the data of design, procurement, construction, and part of operation period during pipeline construction. At last, the digital three-dimensional model of station and pipeline equipment and building is constructed to form pipeline line data asset library and station data asset library, and so the digital twin of China Myanmar oil and gas pipeline is constructed. e application of digital twin system in pipeline construction introduced by Hlady et al. [2] was described by abramkin, Sergey E. e joint simulation research on multi-body dynamics, CFD, and system simulation has been reported, such as Lanzhou University of Science and Technology [4]. For example, Southwest Petroleum University [5] has carried out research on transient flow numerical algorithm and response characteristics of wellbore multiphase flow; the computational fluid dynamics simulation technology is introduced by the Exploration and Development Research Institute of PetroChina Southwest Oil and gas field company and Chuanzhong oil and gas mine of PetroChina Southwest Oil and gas field company [6]. In this paper, the formation wellbore coupled flow model is established to simulate the fluid flow pattern in the wellbore. Leary, Peter et al. [7] introduced the prospect of rock flow stimulation in the basement of enhanced geothermal system (EGS) by using wellbore temperature data, and the effective modeling of wellbore backflow was introduced by Sharma et al. [8]. e related research on oil well pump simulation has been reported in literature, such as the simulation study of a double acting reciprocating oil well pump based on AMESim carried out by Wuhan Second Ship Design and Research Institute [9], and Northeast Petroleum University [10] has carried out numerical simulation calculation on the clearance flow and valve clearance flow model of oil well pump based on CFD technology, and the calculation results are visualized. e digital twin system of centrifugal pump disclosed by Siemens AG [11] of the United States patent right is established. Chang'an University [12] takes the front full hydraulic beam pumping unit as the analysis object and establishes the structural model of the pumping unit by using 3D design software SOLIDERWORKS with virtual prototype technology. e top-down design and joint simulation of a beam pumping unit are carried out in Southwest Petroleum University [13]. At present, the research is mainly aimed at a specific link. At the same time, the so-called digital twin is more about the establishment of 3D simulation model. It lacks the overall framework and the simulations of the whole process of oil and gas production, and it also lacks more indepth analysis of data to optimize the production process. At the same time, with the disjointed support of the existing Internet of things technology, real-time data, intelligent algorithm, and so on, it is difficult to implement the digital twin technology. erefore, it is urgent to construct a data-driven, service control interactive closed-loop intelligent control ecosystem based on digital twin, integrating new information technology and intelligent algorithm. It will give ideas for oil and gas production industry to improve new development and clear understanding of downhole operation and real-time accurate prediction of production parameters, give full play to the maximum production capacity of oil wells, maximize the saving of lifting costs, minimize the cost of workover operations, and extend the economic life of oil wells, which plays an important role in oil production.

e Concept of Digital Twins.
Digital twins are a simulation process that integrates multi-disciplinary, multiscale, and multi-probability by making full use of data such as physical model, sensor update, and operation history, and it completes mapping in virtual space, thus reflecting the whole life cycle process of corresponding physical equipment. From the perspective of simulation, it is generally believed that digital twin refers to the precise mapping relationship between virtual and real objects constructed in digital virtual space, which are similar in shape and behavior to those in physical entity space. e meaning of the two definitions is the same, both of which can be understood as follows: building corresponding virtual models for physical entities and simulating the behavior of physical entities in real environments. At present, most of the digital twin models follow the threedimensional model originally defined by Grieves and Vickers [14], namely, physical entity, virtual entity, and the connection between them.

Digital Twin of Oil and Gas
Production. e digital twin of oil and gas production is not only the three-dimensional model, physical entity, virtual entity, and their connection, but also the combination of new technology, considering different links and different businesses. So it comprehensively shows the dual drive of data and physical model, which means dual fusion as the main line, and flexible application of fractal thought to form a comprehensive digital twin of oil and gas production.
First of all, oil and gas production links are many and complex, involving a wide range of disciplines, so the corresponding dynamic multidimensional multitemporal scale model digital twin model is created according to different application objects and business needs; the model not only needs to build the geometric and physical dimensional model but also can reflect the geometry, physics, behavior, rules, and constraints of the physical entity ( Figure 1). At the same time, it describes the evolution process, real-time dynamic operation process, external environment, and interference influence of physical entities from different time scales and integrates different dimensions. A digital twin model of oil and gas production is the same spatial scale and different time scale model. Secondly, the physical layer of oil and gas production is constructed by deep integration of new information technology and virtual reality interconnection and integration based on Internet of things. Based on cloud mode digital twin data storage and sharing service, the transmission layer and data layer of digital twin of oil and gas production are formed. Based on data analysis, fusion and intelligent decision-making of big data and artificial intelligence, the intelligent PaaS of oil and gas production digital twin is built. Based on the virtual reality (VR) and augmented reality (AR) mapping and visualization display, supporting the service application layer, the integration of information physical system, the collection, transmission, and storage of multisource heterogeneous data can be realized, the integration of information physical data, the bidirectional connection, and realtime interaction of virtual and real time can be realized, and the real-time process simulation and optimization can be carried out to provide various on-demand applications and intelligent services. Finally, for data-driven fusion of physical information, data are regarded as the core driving force of digital twin, and digital twin emphasizes physical data fusion; in the process of oil and gas production, real-time operation status of equipment, sudden disturbance data, transient abnormal small data, and other physical real-time data are also indispensable parts of the system, reflecting the real state of physical equipment in the system operation. On the other hand, the real-time operational status of the equipment in the system is reflected. In general, the data of oil and gas production digital twin system include real-time dynamic production data, historical statistical data, some historical scheme design, experiment, test, and research data, and even some knowledge chain and knowledge base, which are constructed into large data of real significance, which can strongly support the analysis and decision making of oil and gas production. Finally, the information data and physical data are fully interactive and deeply integrated to improve the physical consistency and synchronization of information and improve the real-time accuracy of the results. In the operation stage of digital twin, how to realize the online parallel controlling in the cyber model and feed back the adjustment instruction to physical system is a key enabling technology.

Production Optimization Based on Digital Twin
is study aims to understand the production capacity, equipment capacity, and their working conditions of the reservoir, provide the basis for further formulating reasonable technical measures, make the pumping capacity of the equipment adapt to the oil supply capacity of the reservoir, give full play to the reservoir potential, and make the equipment work normally under high efficiency, so as to ensure high production and high pump efficiency production of oil wells. e research of the relationships between supply and discharge module is mainly divided into four parts: data source, basic model, production analysis, and optimization design. It is shown below. e research module of supply and discharge relationship is mainly used to assist oil production engineers in oil well production analysis and design. e module provides accurate fluid physical properties, inflow performance, and multiphase pipe flow fitting calculation model, which lays the foundation for the analysis and design of production wells; it can analyze the nodes of oil and gas wells, find the problem nodes, and tap the production potential; it can optimize the design of various lifting methods of oil and gas wells and carry out the production potential and production potential through the bottom hole production flow pressure and production change trend.
e prediction of production parameters and production indexes can be used to compare and analyze the optimization design results of different oil recovery methods. Physical oil and gas production system Virtual oil and gas production system  e calculation of PVT, IPR, and multiphase pipe flow is the basis of oil well production calculation and analysis. Based on the PVT fitting method, IPR calculation method, and phase pipe flow calculation method, the most suitable calculation method can be found and the model or parameter can be modified by mutual verification of experimental data and simulation data, so as to obtain more accurate calculation and analysis results.

Analysis of Oil Well Pressure System (Node Analysis).
e dynamics of inflow and outflow under different production conditions were calculated, the production coordination point was automatically found out, and the curve of yield changing with sensitive parameters was drawn.

Optimization Design of Oil Well Production Parameters
Fixed Output Design. According to the design output and specified conditions, select rod pump, motor, and other equipment and optimize the design of stroke and motor, pump diameter, pump depth, rod tube combination, and other production programs.
Maximum Production Design. According to some constraint conditions (such as bottom hole flow pressure, maximum gas injection rate, maximum power consumption, and so on), the production parameters for maximum oil production are designed.

Prediction of Oil Well Production Potential.
According to the results of reservoir simulation and development design, the production capacity of oil wells with time is calculated dynamically. Different lifting methods can be selectively calculated and compared at the same time. is function can easily provide a very valuable basis for the selection of artificial lifting mode of oil production engineering scheme.

Prediction of Oil Well Production Index.
According to the results of reservoir engineering design, the production parameters such as wellhead pressure, temperature, and electric power consumption of ESP in different development time are calculated and predicted.

Data Model Design.
e supply and discharge relationship database mainly includes standard database and equipment library, among which the standard database mainly stores user information, achievement information, and equipment information; equipment resources include rod pump, motor, and other equipment combinations used by oil and gas production corresponding to the oil and gas production that customers need to analyze, which will be synchronized to the equipment library for equipment optimization and selection. e database information mainly includes oil well and production basic information, drilling and completion data, fluid model, inflow performance model, rod and tube data, process parameters, temperature model, multiphase flow model, sensitivity, and equipment library.

Optimization Method Design.
In the world of multidomain system simulation, the domain of 1D may be the most effective place for designing exploration technology. Whether it is used for design or verification, the system model can provide global parameter access, so it can directly affect the design decision. rough DOE and RSM, AME-Sim's optimization toolbox can assist users to explore fast experimental space and gain insight into possible design schemes. Test planning (DOE) allows parameter projection and helps determine the best set of tests in the design space to obtain the most system information with the lowest cost and the highest accuracy. e design response is evaluated and optimized by considering the deviation of the design input parameters of AMESim. AMESim provides a robust and reliable analysis method.
We take oil recovery efficiency (recovery rate) and maximum production as objectives, take fixed production, motor power, mechanism speed, and load limit as constraints, and take stroke, motor, pump diameter, pump depth, and rod pipe combination as design variables. By means of optimization, the optimal solution set is obtained in the optimization space. According to the actual production state, the optimal and feasible scheme is obtained.

Adjustment of Production Plan.
e production plan adjustment ( Figure 2) mainly includes three function nodes: (a) node analysis; (b) optimization design; (c) optimization scheme.
(a) Node Analysis. rough the node analysis function, the supply and discharge coordination relationship of oil wells can be analyzed, and on this basis, the parameter adjustment analysis of oil wells can be realized. e rod and tube data, fluid model data, and process data in the database are imported into the model for calculation, and the data needed for production analysis are obtained. (b) Optimization Design. ere are two main methods of optimization design: constant production design and constant minimum bottom flowing pressure (maximum production) design. e operation of fixed output design function and maximum output design function of the two methods is the same, and the input and output are similar. e parameters of zero scale analysis, such as stroke number and stroke, are defined. (c) Optimization Scheme. According to the results of optimization design and calculation, combined with the equipment library, the optimal equipment scheme and production scheme of the system are recommended.

Application and Analysis Based on Digital Twinning
e accuracy of the digital twinning model is verified by the laboratory results, and for the purpose of pumping system efficiency, the model is optimized and controlled intelligently and remotely.

Influence of Oil and Casing Pressure on System Efficiency.
Oil and casing pressure has little effect on system efficiency. e higher the oil pressure is, the lower the system efficiency is; the higher the casing pressure is, the higher the system efficiency is (Figure 3).

Effect of Oil-Gas Ratio and Viscosity on System Efficiency.
With the increase of gas content, the pump efficiency decreases and the system efficiency decreases. When the gas content increases, the efficiency of stroke loss changes little, and the stroke loss is mainly determined by the elasticity of oil rod (Figure 4). e influence of oil-gas ratio and viscosity on the system efficiency can be seen from Figure 4: the more the gas, the smaller its filling coefficient, and the lower the pump efficiency, the smaller the oil well output; at the same time, the smaller the effective power of the system, the lower the system efficiency.
With the increase of the viscosity of crude oil, the friction of liquid increases, so the maximum load increases and the minimum load decreases, which leads to the range of load changes and the area of indicator diagram increases, and at last, the power consumption increases, which leads to the decrease of the system efficiency.

Simulation Study.
e simulation software is used to optimize the effect of the gas on the work diagram ( Figure 5). When the pumping unit stroke and stroke times are constant, the maximum and minimum loads are constant, and as the gas increases, the shape of the work diagram changes from "parallelogram" to "knife handle," resulting in less fluid production, less pump efficiency, and less system efficiency. e simulation result is consistent with the experiment. When the pressure between pump bottom and the fixed chamber is smaller, the liquid into pump is more, so it leads to higher pump efficiency and system efficiency. When fixed valve opening range is reduced, the pump into the liquid is reduced, so the pump efficiency and the efficiency of the downhole system is smaller (Figure 6).

Field Test.
On November 27, 2017, the digital twin control technology was applied to 35 wells in the oilfield and achieved good effect. e average daily power consumption of the test well is reduced by 48.12 kWh, the power factor is increased from 0.55 to 0.66, the system efficiency is increased from 11.02% to 16.43%, and the energy consumption of 100 meters per ton liquid is reduced by 0.61 kWh/(100 mt) ( Figure 7).

Conclusion
(1) e system integrates the links of oil and gas production, underground reservoir, wellbore technology, surface production, and gathering and transportation metering and operates in a coordinated and unified way. rough real-time information interaction and bidirectional real mapping between the physical production system and the virtual oil and gas production system, the system can realize the whole life cycle, all elements and the whole industry of physical production system, virtual production system, production design, optimization and prediction integration, and fusion of business data.
(2) e system can access the data of Internet of things of oil and gas production, equipment operation data, and production operation real-time data and realize the real-time monitoring, optimization, feedback, and other data-driven real-time closed-loop control ecosystem of underground reservoir production. (3) rough the deep integration of real-time data and model, the production system, design scheme, operation performance, and geological reservoir calculation can be verified in the specific scene operation, which can provide decision support for major planning, construction, and operation of oil and gas production and operation. (4) By combining the analysis of underground seepage, wellbore fluid, and solid and multibody motion model in the whole process of oil and gas production system and installing various software sensors in the places where sensors cannot be installed in actual production, the interfaces between key models in the whole process of oil and gas production are configured to realize joint simulation. e multi-body dynamics and CFD joint system simulation are used to build the digital twin of the whole process from reservoir, wellbore, to surface assembly integrated of oil and gas production. (5) e digital twin oil and gas production intelligent system plays an important role in understanding the downhole operation mode and real-time accurate prediction of production parameters, giving full play to the maximum production capacity of the oil well, saving the lifting cost to the maximum extent, reducing the workover operation cost to the maximum extent, and prolonging the economic life of the oil well.

Data Availability
e data used to support the findings of this study are available from the corresponding author upon request.  Mathematical Problems in Engineering 7