Realization of Accurate Modeling and Simulation of Oilfield Water Mixing Gathering and Transportation System

In order to solve the shortcomings that the simulation accuracy of oilfield water mixing gathering and transportation system is not high, the dual-process of mixing water and returning to the station cannot be realized at the same time, the system is accurately modeled, and the data structure and computer model suitable for calculation are established by reading static data. The design modeling software realizes the logical and data interface and realizes the display of the physical model on the computer. Based on the quasi-Newton loop iteration method, an online algorithm is proposed. Using the flow rate of each node of the system as the constraint condition, the water mixing process node and pipeline parameters are calculated. According to the calculation results and the oil well produced fluid parameters, the principle of mixed calorimetry is applied to construct the initial value and iterative formula of the return flow simulation. The temperature at the return station is consistent with the inlet temperature of the heating furnace at the joint station. It can dynamically reflect the production and operation status of the water mixing system, and provide a scientific basis for the control and operation of the water mixing system.


Introduction
Water gathering and transferring system is used to guarantee the smooth of crude oil transportation of large ground heating system, which plays an extremely important role in the whole oilfield gathering and transferring process.
However, water mixing system also has its own characteristics. With oil field compared to other systems such as water injection system or water supply system, it has a loop back and relatively high error rate. Water gathering and transferring system especially the high pour-point oil field water mixing system generally consists of water and oil return two process is completed. The hot water from the ICMSP 2020 Journal of Physics: Conference Series 1894 (2021) 012101 IOP Publishing doi: 10.1088/1742-6596/1894/1/012101 2 furnace heating station to the well wellhead complete water mixing process; With hot water extraction liquid come back to the process of joint station for oil return process. Water extraction liquid and back to stand down after dehydration process and do further process of water consistently. In addition, the temperature of each node in the water pipe network is not only related to the performance of the pipeline, but also related to the insulation performance. The use of a fixed number of years and maintenance can result in changes of the heat transfer coefficient of pipeline. It is difficult to guarantee the high precision [1] .
At present, there are many pipe network simulation algorithms are proposed at home and abroad. Quasi-newton method, Newton method, iterative method, etc. However, according to the target of system, the unit model is different and these algorithms require the different given information so that the calculation result is different too. The water system currently still uses the point-to-point recursion method for a single process. In this paper, the quasi Newton algorithm is introduced into the simulation of the temperature of the water system, based on the system overall stiffness matrix. The algorithm adopts loop iteration calculation method and hierarchical simulation, which make the water system of two processes to achieve unification. Using this algorithm can greatly decrease the error rate of traditional algorithm, in addition to other disadvantages of the simulation at the same time.

Model
At present, with the development of computer technology and satellite remote sensing technology, domestic onshore oil fields have adopted remote sensing surveying and mapping methods to determine the geodetic coordinates of each node of the water injection system. Make the most of this data to generate a special data structure for simulation calculation. Only then can the computer accurately simulate the operating conditions of the water injection system [2] , and optimize the scheduling and management of the water injection system. Graphic modeling is based on the topology theory, According to the geographical coordinates and pipeline connection of the stations and the pipe network connection point, to establish a pipe network topology model that is both practical and suitable for program calculations to realize the graphic simulation display of the entire oilfield water system and interoperate with man-machine. According to the principle of graph theory, the pipeline in the pipeline network is generalized into a line segment, as the edge of the graph. The valve is regarded as the auxiliary parameter of the pipeline. The pipeline with accessories is regarded as a special pipeline, and the continuous pipeline is discretized into a finite unit body. The pipe network diagram of the system is transformed into a network diagram composed of pipeline units and nodes [3] .The Graphical modeling of drainage system is shown in Figure 1  The programming process [4] is shown in Figure 2. Read through the data interface method. The read data is processed, redundant or useless intermediate nodes on the pipeline are deleted and simplified, and nodes and pipelines related to subsequent calculations or graphical modeling are retained. The processed data is divided into two types: node data and pipeline data. Since the location of the pipeline can be determined based on its two endpoints, so the geographic location of the pipeline does not need to be recorded. Finally, the above data conversion format is stored in the node library and pipeline library respectively.
The entire system is developed in C++builder language. The layer design, image output (including output to Autocad format DXF files and direct printing, etc.), pipe network search and other technologies involved in the system can all be through the corresponding programming technology and interface technology to achieve. The final modeling results of the entire system can be stored in only one node database CellData and one pipe database PipeData, and these two data files are stored on the company's Oracle data server. In the subsequent simulation and optimization calculation of the system, just read it directly [5] .

Voltage drop model
When the water temperature rises, The pressure loss of hot water in the pipeline decreases with the increase of temperature, The pressure drop model of the hot water line unit is based on the formula (1). Considering the temperature of correction factor t C , the expression is By linearizing the model,

Model of temperature drop
In the crude oil collector system, the hot water in the water supply line satisfies the sukhov formula, ,The quality of the hot water in the formula(6) is converted to volume flow The temperature drop model can be obtained by the hot water pipe.

System mathematical model
With different modeling mechanisms, the mathematical model of different types can be established [6] . There are several kinds of mathematical models, such as node equation model, ring equation model, pipeline equation model and so on [7] . From the equation of order, preparation work before computer and the speed of convergence of iterative calculation aspects of a comprehensive comparative analysis found that relatively most effective node equation model. Therefore, the simulation calculation method is adopted based on node equation model.
There are n nodes on a water pipe network of i, which at any moment and the time interval to the flow of the node must be flowed from the node flow, a certain balance between them. Flow into and out of the flow of a node up to three categories: with the nodes adjacent pipe flow qi; When the node for the well mixing water Qi; When the node to the node at the time of the water supply water source Ui. One of the following relationship between these quantities. The Ui and Qi for the node flow of node i. A water pipe network with n nodes, which has n equations, but due to any node pressure in the n equations can be obtained from the rest of the n -1 equations, so it only n -1 independent equation. Further considering the relationship between the flow and temperature drop pipe, the equation (9) into the equation (10) and can available n -1 independent node to another form as follows:

Algorithm research
According to the rules of fluid field judgment, a certain balance between the water network and the reflow station networks should be kept in the joint station. at the well, water and temperature will conform to the principle of mixed calorimetry [8] . Because there is no simple continuous relationship between them, a separate relationship between water source and users must be formed. Then set up their own network systems overall equation.
The nonlinear equations are mainly solved through iterative method [9,10] , Newton method and quasinewton method. Aiming at the large sparse matrix, we use the quasi Newton iteration method [11] . Due to the characteristics of the singular matrix, select a reference point in the calculation process. In the primary pipe network subsystem in multiple secondary pipe network subsystem, there is a certain temperature range of among the secondary pipe network subsystem of differences, and to reference point in the process of calculation and convergence, affect the convergence speed. In addition, the reference point selection also affect convergence speed. In the process of solving the general equations, it is necessary to make use of the formula each pair of models for 1 times, and need to do n2 times, then judge according to the characteristics of matrix i K ,only the node k and node j exist between the pipeline connection k ij is not zero. Therefore, when calculating the node temperature, there are a large number of zero elements involved in computing and save. To save computing time and avoid zero elements involved in calculation, calculation method can be taken: 1) set k n ×1, for all of its elements is zero, then calculate all pipe k i , on both ends of the nodes were j, k pipeline, order k j =k j +k i , k k =k k +k i, q j =q j -k i J j , q k =q k -k i J k , then order q i =J i k i , determine the precision requirement; 2) Using the formula J i =q i /k i, find the node temperature [12] .

Calculation method
The connection between the two pipe network systems is that the water temperature of the combined station of the mixing system depends on the temperature after the dehydration of the station; The initial temperature of the return flow is calculated according to the water temperature, water quantity and the produced fluid data [13] . First, the system simulates the watering process, and then calculates the results as the initial value of the back flow process. After that the temperature of the station to prepare for the next simulation is obtained.
The simulation methods of the system are as follows: 1) Make the network subsystem divided into multiple secondary subsystem; 2) Pre estimated one sets of initial node temperature J0i, the required accuracy requirements ε, the initial number of iterations A=0; 3) Establish system balance equation; 4) Calculating the value of k i and k i directly involved in the calculation; 5) Calculating the value of q i ; 6) Judgment accuracy requirement, if max |U k -Q k -q i | <ε( i = 1 ,2 ,3 , ⋯, n-1), the (9), otherwise turn (7); 7) Calculating the value of J i ; 8) Order J i +1=J i ,A=A+1,and turn(4); 9) To the selected reference node temperature as a benchmark, to calculate the temperature value of all nodes, and end of computing.
Need be put forward that between water and return to the station two process, one is divergence from the center to the periphery, one is from the edge to the center of convergence. Therefore, the coefficient matrix i K is a positive value, and a negative value.

Comparison and analysis of actual data and simulation results of water mixing system in an oilfield
Water mixing system node pressure compared with the measured data and the simulation are shown in table I;Water mixing system compared with the measured operation index and the simulation are shown in table II.

Causes of error
There are some errors in the structural parameters of the pipe network because the water mixing system is a large complex fluid network system with the oilfield production needs, pipe network renovation and expansion project every year. Therefore, it is difficult to determine the basic structure parameters of the pipe network. Pipeline heat transfer parameters error exists. After a long period operation of the water mixing system, there are many phenomena such as scaling, corrosion and perforation, thermal insulation and so on. All of these will lead to the change of heat transfer coefficient.
Human error exists in measured data.

Conclusion
This system is based on the simulation analysis of oil field water production process. It provides a simulation environment for the control and operation of oilfield water blending system, after oil field application and inspection, which proves: ①The water pipe network system is a large complex fluid network system based on the finite element theory. Use large system theory to establish the mathematical model of oilfield water mixing system, which can correctly reflect the actual production process. ② Provide management with a good system simulation environment. ③Dynamic reflect water system operation condition, which has a positive guiding significance in the water system control and operation. ④It can improve the understanding on the characteristics of the system and provide a scientific basis for the transformation and operation of the system.