CYBER-PHYSICAL SYSTEM FOR CONTROL THE HEAT AND MASS TRANSFER IN THE OIL RESERVOIR AND PRODUCING PUMPING WELL

A special cyber-physical system is developed to control transient heat and mass transfer during the commissioning of the unified oil production complex consisted of oil reservoir, producing well equipped with electric submersible centrifugal pump, well production tree and ground-based control station. Two main elements of cyber-physical system are following: – computer simulator of heat and mass transfer in virtual oil production complex based on mathematical and numerical models of such processes along with simultaneous visualization of computational results; – portable imitation hardware of real ground-based equipment which is realized as 3D-printed plastic model consisted of control elements (pipeline valves, drossel chamber, ground-based control station) and recording devices (manometers, level indicator, liquid sampler and control station itself). Mechanisms of these elements are replaced by Arduino microchips to simulate the operation of real devices. An important feature of the cyber-physical system is the data exchange and interaction between oil production computer simulator and microcontroller software. Data transfer is going through the COM-ports of computer and microcontroller. The simulator sends calculated working characteristics of oil production complex to the memory of microcontroller, which not only analyzes incoming data but also displays it on the recording devices and forms necessary control parameters, which are sent back to simulator and affect the further behavior of the whole complex. Different elements of the CPS provides the possibility to control and visualize the commissioning of the oil production complex under consideration and the whole system is oriented to simulate the real technological actions performing by specialists in oil production.


Introduction
Exploitation of the oil producing wells equipped with electrical submersible pumping systems (ESPs) is attended by the interconnected thermo-and hydrodynamic processes in the multiphase flows moving in the porous medium of the oil reservoir, tubes of well and channels of ESP. These processes become significantly non-steady during the commissioning into operation the wells after underground equipment repair or their transferring into the new quasi-stationary operating regime. In this case the problems of computer forecast of the interconnected heat and mass transfer in the object "oil reservoir -well -ESP" and controlling for its exploiting regime are actual.
In this paper we study the processes during the commissioning the producing well into operation after switching submersible electrical motor (SEM) on. There are three principal periods of these processes. At the first period the electric pump starts overpump the water filling the well for safe repair works. As water level comes down in borehole annulus, depression at the well bottom is increased and oil-water mixture flow from reservoir into the well is intensified and the reservoir fluids move along the well to the pump intake. This period ends when the multiphase mixture displaces the water in the well boring casing below the pump intake. Needs to say that during this period with decreasing of the pressure less than the bubble point pressure, gas dissolved in oil at reservoir conditions is liberated from the oil phase, and the three-phase oil-gas-water mixture is formed in the well.
At the second period three-phase mixture displaces water along the pump stages and moves to its outlet. The feature of transient process in the pump is simultaneous movement of three-phase mixture and water along its lower and upper stages respectively. Another moving boundary between mixture and water also arises there and goes up to the pump discharge, i.e. to the well tubes entrance. With increasing of the pressure in the pump stages an inverse process of the gas absorption into the oil phase takes place. The disappearance of the free gas in flow can occur in those pump stages where the pressure becomes higher than the bubble point pressure. It results in origination of the one more moving boundary separating water-oil-gas and water-oil flows. The head, efficiency and flow rate of the pump stages working on multiphase mixture become considerably lower in comparison with the same pump performance on water. Simultaneously the current intensity and the required power of motor are increased. The second period ends with the total displacement of the water by multiphase mixture inside the pumping channels.
At the third period water is displaced by mixture in the oil-well tubing above the pump. Analogically to the first period with decreasing of the pressure, gas liberation repeats again with forming of the oil-gas-water mixture. The change of the weight of the liquid in the oil-well tubing also affects the pump performance, current intensity and the required power of the motor.
The main goal of the paper is the presentation of the special cyber-physical system (CPS) developed for the increasing of demonstrativeness of computer-based models of transient heat and mass transfer during the commissioning into the operating regime the oil producing object that were proposed in above mentioned papers. The CPS consists of the simulator "OilRWP" and physical 3D-printed plastic manipulator that looks like real industrial ground-based equipment. Different elements of the CPS provide the possibility to control and visualize by analogy with [Bazhanov, 2018] the commissioning of the oil production complex under consideration.
2 Models Implemented in Simulator "OilRWP" Mathematical model of transient heat and mass transfer during the commissioning into the operating regime the oil producing object was developed in [Chekalin, 2009], [Diyashev, 2012] on the basis of [Barenblatt, 1984], [Ertekin, 2001] for the case of the layered-nonuniform reservoir. This model includes three groups of equations. Firstly, the equations governing two-phase filtration in the vertical cross-section D r = {0 < r < L r , 0 < z < H r } of the plane-radial reservoir: Here τ is the time; r and z are spatial coordinates of the filtration region D r ;P is the pressure; S is the water saturation; K * = K * 1 /µ 1 + K * 3 /µ 3 ; K * 3 and K * 1 are the functions of relative permeability of water and oil phases; V r , V z , V 3,r , V 3,z are the projections of the filtration velocity vectors V , V 3 of the water-oil mixture and water phase to axes Or and Oz; V 3,r = f V r ; V 3,z = f V z ; K(r, z) and m(r, z) are the absolute permeability and the dynamic porosity of the porous medium of the oil reservoir; f = f (S) is the fraction of water in the total two-phase flow (the Bacley-Leverett func- (1 − S); L r and H r are the length and the thickness of the reservoir; α T C and α * T i are the coefficients of elastic capacity of the porous medium and the medium saturated with the i-th phase; α T 1 and α T 3 are the similar parameters of oil and water.
The second group is presented by equations of the unsteady dispersed water-oil-gas flow in the producing well These equations are obtained in a framework of the model of Zuber-Findlay (see, e.g. [Bratland, 2010], [Konyukhov, 1990], [Salamatin, 1987], [Wallis, 1969], [Zuber, 1965]) for the case of three-phase mixture including such discrete components as the gas bubbles or drops of water (or oil) inside the continuous (oil or water) phase. In Eqs. (4) - (7) Oz is the vertical coordinate axis directed upwards the well from its beginning on the reservoir roof; P and T are the pressure and the temperature, identical for all phases; ρ is the mean multiphase mixture density; w is the overall mixture flow velocity; ρ i , w i and ϕ i are the density, the actual velocity, the volumetric concentration of the i-th phase, averaged over the well pipe cross-section f of radius r, i = 1, 2, 3; F 1−2 = χ 2 (w 1 −w 2 ); F (P, T ) is the relative gas factor which is defined as the ratio of the mass of gas released from the oil phase at certain (P, T )-conditions to the total amount of the initially dissolved gas; C s is the corresponding mass concentration of gas in the oil phase at P > P s , where P s is a saturation pressure; Q Σ = 2 (τ r w − q r ) /r + Q v − χ 2 L; L is latent heat of gas dissolution into oil; τ r and q r are the hydraulic friction and the heat flux density at the internal surface of the producing well; Q v is intensity of the external heat source distributed along the producing well; α pi and C pi are the coefficients of volumetric thermal expansion and volumetric elasticity of i-th phase; g is the gravity acceleration; d i /dτ = ∂/∂τ +w i ·∂/∂z.
The third group consists of the equations governing the thermal and hydrodynamic processes in the channels of the multi-stage pump D e = {0 < ξ ≤ L e }: Equations (8) --(11) were developed in , [Konyukhov, 2019] under the assumption that all the phases become highly-dispersed in the pump stages and move without slippage in result of the enormous rotation speed of their blades, i.e.w i = υ.
In these equations ξ is the vertical coordinate axis directed upwards the pump from its first stage; l s and f s are the length and an effective cross-section of the pump stage, respectively; L e is the total length of ESP; d/dτ = ∂/∂τ + υ·∂/∂ξ; H, η = gρHQ/N and N are the head, the efficiency factor and the power consumption of the pump stage. These characteristics depend on the volumetric flow rate Q = G/ρ and the effective viscosity µ of the three-phase mixture which can significantly decrease in the result of compression of phases and gas dissolution in oil as flow moves along the pump, where G is the overall debit of three-phase mixture.
We would like to note that this paper provides only some relationships which define the basic operating parameters of the pump stages and characteristics of multiphase flows in the pipes and in the porous medium of the oil reservoirs. A set of special constitutive relations to close the equations is too large and can be found in our publications (see, e.g. [Konyukhov, 1990], , [Konyukhov, 2019]). Formulation of the boundary, initial and conjugation conditions for the system of differential equations is also discussed in details in these papers.
As the most important results for the mathematical modeling, we formulate here only the boundary condition at the wellhead of the producing well and relationships simulating the control actions on the operation modes of the submersible pump and its electric motor by varying the frequency ω of the electric current with the use of the ground-based equipment [Konyukhov, 2019]: Here ς dr is local resistance coefficient of the regulating drossel which is the function of its variable diameter d dr ; P lin is the line pressure behind the drossel, which can be assumed as a constant; Q * w , H * w and N * w are the volumetric flow rate, head and useful capacity of a certain pump stage during its operation on water at the nominal conditions at ω * =50 Hz; N * M is the nominal consumed power of the motor at ω = ω * ; Q w , H w , N w and N M are the similar characteristics of the stage and motor at ω = ω * .
The unified model (1) -(14) was implemented in the computer simulator "OilRWP" using the C# programming language [Schildt, 2010], Task Parallel Library of the .NET Framework platform and sets of libraries NVIDIA CUDA and OpenCL oriented to parallel computing technologies.

Cyber-Physical System "OilRWP"
Computer simulator allows to compute the characteristics of transient processes in the unified object "oil reservoir -well -ESP" and simultaneously visualize the results on the display. The fig. 1 illustrates the graphical user interface for the plotting of 2D-maps (a) of characteristics of the filtration process in the oil reservoir, 1Ddistributions (c) of the three phase flow characteristics The graphical user interface ( fig. 1, b) provides the 3Dvisualization of the calculated dynamics parameters of the process which are registered on the telemetry sensors (manometers, level meter display, ground-based control station (GCS) display). The control elements of the system that allow user to affect on the process of commissioning the well into operating regime and accomplish other different functions are pipeline valves of the production tree, drossel chamber and the controller of the GCS.
All these elements of the ground-based equipment were modeled in the CAD-system with the aim of following 3D-printing in PLA-plastic and assembling with the use of electronic Arduino parts inside them, (see figs. 4, 3).
For example 4-digit Arduino-compatible indicators ( fig. 4, a) allow to imitate the displays of the highpressure manometers, the screens of level meter and ground-based control station.
Rotated resistor ( fig. 4, c) serves to simulate the change of the tube section in the well head, e.g., the full turn of the resistor's handle matches the full closing of the pipeline valve. It allows to test hydrodynamically the tightness of the oil-well tubing: if the pressure displayed on the buffer manometer rises to the value matching the pump head at zero flow rate, then there is no any damages of the surface of the oil-well tubing. In opposite case, if the pressure rises insufficiently, it means the lost of the movement impulse in oil-well tubing due to fluid  The work of the drossel chamber is imitated by analogy with the use of rotated resistor which allows to change the diameter of the section of tube in the well head due to the putting the drossel with given section. It results in the change of the coefficient of the local hydraulic resistance in the boundary condition (12) and to the restructuring of the whole operating regime of the unified object, respectively. Note that partial closure of the pipeline valves has the same effect.
A membrane keyboard ( 4, b) imitates the main function of the controller of GCS, namely the change of the current frequency in the motor circuit. Such influence allows significantly change the working characteristics of the submersible motor and the performance curves of the pump stages according to the empirical dependencies (13).
The microchip Arduino Mega 2560 ( fig. 4, d) is used for realization of the direct and back coupling between hardware and software elements of the cyber-physical system on the base of the data exchange and interaction between oil production computer simulator and microchip's software. Data transfer is going through the COM-ports of computer and microchip. The simulator sends calculated working characteristics of oil production complex to the memory of microchip, which not only analyzes incoming data but also displays it on the indicators. Moreover, it forms necessary regulating actions on the base of information replied from the control devices, which are sent back into the computer simulator and affect the further behavior of the processes within the whole unified object.

Conclusion
The special cyber-physical system is developed to simulate and control the real technological actions with the use of ground-based equipment on transient heat and mass transfer during the commissioning of the unified oil production object into operating regime.
Some principal results of the simulations can be briefly presented as follows. The features of transient nonstationary processes caused by origination, movement and disappearing of boundaries between gas-liquid mixture and water, and between water-in-oil emulsion and oil-water-gas flow in the tubes of well and in the channels of ESP are studied. Transient time between inaction and quasi-steady operation of the producing well depends on the well stream watering, filtration-capacitive parameters of oil reservoir, physical-chemical properties of phases and technical characteristics of submersible unit. These parameters influence on a count of the ESP shutoffs by the surface control station during the producing well is going into operation. For the large time solution of the non-stationary equations governing the non-steady processes is practically identical to the inverse quasi-stationary problem solution with the same initial data.
Such approach allows us to consider the developed CPS as the "digital twin".