Abstract
This is a mathematic model for the optimal operation of the gathering pipeline network and its solution provides this gathering pipeline network having a triple-line heat-tracing process, a method for reducing the operational costs and increasing economic benefit. The model consists of an objective function, minimum total operation cost, and 3 constraints including water temperature constraint at pipe nodes, inlet oil temperature constraints, and outlet water temperature constraint. By using a sequential quadratic programming algorithm, the model can be solved and a set of optimal mass rate and the desired temperature of tracing water are attained. The method is here specifically applied to the optimal operation analysis of a gathering pipeline network in North China Oilfield. The result shows its operation cost can be reduced by 2076RMB/d, which demonstrates that this method contributes to the production cost reduction of old oilfields in their high water-cut stage.
1. Introduction
Triple-line process has been widely used in early oilfield development in China. With oilfields now entering the high water-cut stage, it has become more and more clear that the triple-line process has the disadvantages of high energy consumption and low efficiency. In the last twenty years, research has been mostly based on the optimal design of pipeline network [1–4] and the simulation of pipeline network [5–7], but seldom on optimal operation problems of triple-line process. On the condition that the triple-line process is not changed, research was carried out on optimizing the operation parameters of oilfield gathering and transportation system which had positive effects on cost reduction and economic benefit increases for those areas unsuited to the low-temperature gathering and transportation process.
2. Thermodynamic Calculation of Tracing Oil Pipelines
The cross-section of the tracing oil pipelines is divided into 5 parts [8] (Figure 1). S1 is the heat transfer surface between an oil pipeline and the soil, S2 is the heating surface between the pipes' interspace and the soil, S3 is the heat transfer surface between a water pipeline and the soil, S4 is the heat transfer surface between an oil pipeline and the pipes' interspace, andS5 is the heat transfer surface between a water pipeline and the pipes' interspace. By solving the pipe element thermodynamic differential equation [9], Oil/water temperature at the end of the oil/water pipeline can be obtained asshown in Figure 1, where S1 … S5 are the areas of 5 heat transfer surfaces of unit pipe length, m2 Consider.
whereT z is the liquid temperature at the end of the oil pipe, °C. t f is the average soil temperature at the depth of pipes,°C
where t z is the water temperature at the end of a tracing pipe, °C.

Cross-section diagram for tracing oil pipelines.
r1, r2,D1, andD2 are given by
where T q is the liquid temperature at the beginning of an oil pipe, °C. t q is the water temperature at the beginning of a tracing pipe, °C,
where co is the specific heat of an oil pipe liquid, J/(°C · kg) Consider
where c w is the specific heat of water, J/(°C · kg). g w is the mass rate of water, kg/s Consider
where K1 … K5 are the overall heat transfer coefficients of 5 heat transfer surfaces, W/(m2 ·°C),
3. Thermodynamic Calculation of Pipeline Network
3.1. Pipe Network Numbering Method
The oil wells, the metering stations, the transfer station, and the pipelines connecting them are ranked and numbered with the following rules. The transfer station is level 0 node, with no subscript; the metering station is level 1 node, with subscript i as its number; the oil well is level 2 node, with subscript ij as its number. A transfer station is the highest level, a metering station comes second, and an oil well is the lowest. The number of pipelines connecting two nodes follows the lower one. n is the total number of metering stations, and m i is the total number of oil wells connected with the metering station i. As shown in Figure 2, the transfer station has 2 metering stations, one of them has 3 wells and the other has 2.

Pipe network numbering method.
3.2. Node Parameters Calculation of Heat Tracing Pipelines
(1) Mass rate and specific heat of an oil pipe liquid at nodes:
where G i /G ij is the mass rate of an oil pipe's liquid i/ij, kg/s. ρ w is the water density, kg/m3. ρo is the crude density, kg/m3.Q ij is the volumetric flow rate of an oil pipe liquid ij, m3/s. w ij is the volumetric water cut of a well ij,
where c i o /c ij o is the specific heat of an oil pipe's liquid i/ij, J/(°C · kg).
(2) Temperature of an oil pipe liquid at nodes:
T i q is the resulting oil pipes' liquid temperature when mixed at their node i, °C. T ij z is the liquid temperature at the end of an oil pipe ij, °C.
(3) Temperature of a water pipe liquid at nodes
where t ij z is the water temperature at the end of a tracing pipe ij, °C. t i q is the resulting tracing pipes' water temperature when mixed at their node i, °C. g i w /g ij w is the mass rate of water distributed to a node i/ij, kg/s.
3.3. Node Parameters Calculation of Water Pipeline Network
Mass Rate of Water at the Nodes. The mass rate of water at a node is calculated serially from the lower level to the higher one:
Water Temperature at Nodes. Water temperature at a node is calculated by using the Sukhov Formula serially from the lower level to the higher one:
where t
i
Q
/t
ij
Q
is the water temperature at the beginning of a water pipe i/ij, °C.
4. Optimal Mathematic Model
4.1. Objective Function
With a water mass rate {g ij } and a water temperature {t ij } as decision variables and the minimum total operation cost, including heating cost and power cost, as the target, assuming that ΔH is a known quantity, the objective function is given by
where p r is the fuel price, RMB/kg. p d is the price of electricity RMB/J.t y is the water temperature before heated, °C. g is the acceleration of gravity, N/kg. ΔH is the water head of the pump, m. q r is the lower heating value, J/kg. η is the efficiency of heating furnace. η′ is the pump's efficiency.
4.2. Constraints Condition
Water Temperature Constraint at the Nodes. One node has multiple outlets. The water temperatures of these outlets are the same:
where Δt i is the commencing temperature difference between a water pipe i and a water pipe (i + 1),°C. Δt ij the commencing temperature difference between a water pipe ij and a water pipe i(j + 1),°C.
Inlet Oil Temperature Constraint. To ensure the safe operation of the pipeline, the minimum inlet temperature [10] is specified to be higher than the freezing point of crude oil:
where T i z is the transfer station's inlet temperature of an oil pipe i, °C. T n is the freezing point of crude oil, °C.Δt is the temperature allowance, °C.
Outlet Water Temperature Constraint. The outlet water temperature of the transfer station is usually (90 ~ 100)°C [11, 12]:
where t is the outlet water temperature of a transfer station, °C.
5. Model Solutions
There are n metering stations,
5.1. Sequential Quadratic Programming Algorithm
The main idea of the algorithm is to build a simple series of approximate optimization problems, namely, quadratic programming problems, using the information from the original nonlinear program. By solving these new problems, current iteration can be updated and gradually approximate the solution of the original nonlinear programming problem [15]. At the kth step, the approximate programming problem is asfollow:
where d is the difference between former and later iterations, named iteration direction; q(d) is the objective function of new programming; f(x)/c i (x) is the objective function/constraints of original programming; ∇ f(x)/ ∇ c i (x) is the gradient of f(x)/c i (x); B is Hessian matrix of f(x); E/I is the set of subscripts of equality/inequality constraints.
As shown in Figure 3, the algorithm mainly includes 3 steps: (a) solve the subproblem with active-set method to get d and Lagrange multiplier λ; (b) employ quadratic interpolation and linear search to get step length α; (c) update Hessian matrix B with BFGS (Broyden-Fletcher-Goldfarb-Shanno) method, where k is the number of iterations, s is the difference between former and later iterations, and e is the control error.

Main framework of the algorithm.
5.2. Active-Set Method
Subproblem (21) is a standard quadratic programming problem. The active-set method is the key to solving such problems. By swapping in/out the inequality constraints according to some rules, A convex quadratic programming (22) only with equality constraints is obtained:
where
Problem (22) converts the solution of d into the solution of the direction of d, named dd.
Figure 4 gives the steps of the solution of d.

Program chart of active set algorithm.
6. Example Analyses
As shown in Figure 5, the transfer station of North China Oilfield has 3 metering stations and 18 oil wells. The well effluent of each well has a mass rate of 10.5~53.6 t/d, a water cut of higher than 80%, and a temperature of 30~40°C.

Gathering and transferring pipe network's structure.
The model has 36 decision variables, 17 equality constraints, and 4 inequality constraints. It takes 114 iterations, about 4.24 seconds to get the optimal results, as shown in Table 1.
Optimal operational parameters.
Table 2 sets out the comparison between costs before and after optimization. It shows that the optimized heating cost and power cost decrease by 1925 RMB/d and 151 RMB/d, respectively, which means the total cost can be reduced by 2076 RMB/d in sum.
Comparison between costs before and after optimization.
7. Conclusions
A mathematic model of the gathering pipeline network optimal operation and its solution are given in this paper, which can provide optimal operation parameters for triple-line process.
Using a gathering pipeline network of North China Oilfield as an example, a mathematic model has been established. After comparing the optimal results with the actual operation data, it concludes that by using the new model, there is a considerable cost saving in accordance with the optimized parameters over that which exists at present.
