Short-Term Model-Based Production Optimization for a Gas Field in North Africa

This paper presents a model-based optimization solution suitable for short-term production optimization of large gas fields with wells producing into a common surface network into a shared gas treatment plant. The proposed methodology is applied to a field consisting of one dry gas reservoir with a CO2 content of 7.3% and one wet gas reservoir with a CO2 content of 2.8% and initial CGR of 15 stb/MMscf. 23 wells are producing, and all gas production is processed in a common gas treatment plant where condensates and CO2 are extracted from the reservoir gas. The final sales gas must honor compositional constraints (CO2 content and heating value). The proposed solution consists of a bi-level optimization algorithm. A Mixed Integer Linear Programming (MILP) formulation of the optimization problem is solved, assuming some key parameters in the gas plant to be constant. Hydraulic performances of the system, approximated using SOS2 piecewise linear models, and condensates and CO2 extraction, captured using simplified models, are included in the MILP. After solving the MILP, the values of the key parameters are calculated using a full simulation model of the gas plant and the new values are substituted in the MILP input data. This iterative procedure continues until convergence is achieved. Results show that the proposed methodology can find the optimum choke openings for all wells to maximize the total gas rate while honoring numerous surface constraints. The solution runs in 30 sec. and an average of 3-4 iterations is needed to achieve convergence. It is therefore a suitable solution for short-term production optimization and daily operations.


Introduction
Oil & gas reserves are typically discovered by carrying out seismic surveys and drilling exploration wells.Some key parameters like oil in place, rock porosity and permeability, faults communication, reservoir fluid viscosity and phase behavior are estimated from these exploration campaigns.If the operator decides to develop the asset, a lot of choices regarding technology and development strategies must be made.Due to large financial investments, these decisions have a significant impact for the company.In addition, developing a field requires planning production on multiple horizons [1].The long-term production plan (typically, 3 to 20 years) includes strategic decisions for the choice of technology, export options and recovery strategies.The main objective is to maximize the Net Present Value (NPV) of the whole project and recover the investments [2].It also includes risk and uncertainty management.The mid-term horizon (from months to years) production plan aims at deciding the production and injection rates and the drilling program (well placement and completion).A reservoir simulator is usually a good tool for planning mid-term production.It must be updated with production data (history matching) and new surveys.On a short-term horizon (typically, days to weeks), both subsurface and surface are important.The existing installations (wells, pipelines, surface processing plants) are to be optimally used to maximize the profits.Decision variables include individual well production, valve openings, plant conditions and operational constraints usually include physical constraints (e.g.maximum production rate to avoid sand production) and equipment constraints (e.g.maximum capacity of gas compressor).
Oil & gas production systems are dynamically changing over time.These changes are consequences of reservoir depletion, recovery strategies and availability of critical equipment.Therefore, the optimal operating point is also dynamically changing over time and production engineers must take daily decisions to maintain production as high as possible.Without a decision support tool, a typical decision is taken based on (1) the field data (e.g.flow metering), (2) a limited number of parametric studies launched on simulators and (3) the production engineer experience [3].A decision support tool leads to a more informed and robust decision-making process and ultimately to higher revenues for the operators, since it can evaluate numerous alternatives that could not be simulated manually.The production engineer's experience still has a relative importance in the decision-making process: data validation, uncertainty management, exploring the operating envelope, instability control.Figure 1 shows how a short-term production optimization solution can be integrated in daily production operations: (1) data is acquired from the field, (2) production engineers validate the acquired data (3) models are updated to match field measurements, (4) the optimization algorithm is run iteratively by the operator (the operator can check the optimal solution against more detailed models and re-launch different optimization cases with more refined constraints) and ( 5) a decision is made and actions are finally taken on the production system [3].Figure 1.Production optimization loop (adapted from Hoffmann et al. [3]).
The challenge with such optimization tools come from the complexity of the production systems (relatively high number of decision variables and constraints) and the complexity and nonlinearity of the models used to predict the system performance (e.g.well production, pressure drop in flowlines, plant efficiency).An additional challenge occurs when wells can be routed into multiple manifolds or when disjunctive constraints are part of the optimization problems.A well-established technique to address this challenge is to use SOS2 piecewise linear models to approximate the nonlinear functions modeling well derivability and pressure drop in pipelines.The initial Mixed Integer Nonlinear Problem (MINLP) is then transformed into a Mixed Integer Linear Problem (MILP) that can be solved with well-known algorithms such as the simplex and the branch & cut.The advantage of this technique is (1) the relatively low runtime (compared to nonlinear solvers), (2) the guarantee to find the global optimum of the MILP and (3) the robust handling of integer (or binary) variables.
The work of Kosmidis et al. [4] is, to the author's knowledge, the first one to employ piecewise linear approximations for nonlinear functions in the petroleum engineering production problem.The same approach was used in the work of Bieker [5].Gunnerud and Foss [6] include well routing in their MILP formulation and apply it to the Troll field, in Norway.In addition, they present two decomposition methods to improve the computational efficiency.Codas et al. [7] develop a MILP framework for integrated production optimization of complex oil fields in Brazil with routing of wells, limited processing capacity, pressure constraints, wells with gas-coning behavior and wells sharing flowlines.The work of Codas and Camponogara [8], Silva and Camponogara [9], Hulse and Camponogara [10] and Silva et al. [11] are other examples of successful applications of piecewise linear approximations to oil & gas production optimization.More recently, Hoffmann and Stanko [12] apply this technique to optimize a large production network with ESP-boosted wells.
Typically, processing facilities are modelled as a constant pressure node with constraints on oil, gas and water processing capacity (Bieker et al. [13]).The model should be updated whenever the capacity changes.Optimizing across the processing facility is rarely addressed.Midthun [14] develops a MILP model for a gas processing plant including gas compressors and splitters.However, the physical phase behavior (condensation of heavy hydrocarbon components) and extraction of key components (CO2 and/or H2S) are not addressed.
In this paper, I present a modeling and optimization solution for a major gas field located in North Africa.The proposed solution consists of iteratively solving a Mixed Integer Linear Programming (MILP) formulation of the optimization problem.Hydraulic performances of the system, approximated using SOS2 piecewise linear models, and condensates and CO2 extraction, captured using simplified models, are included in the MILP.To reduce the runtime, some key parameters in the gas plant model are assumed constant in the MILP.After each iteration, new values for these key parameters are calculated using the optimal solution and a full process simulation model and fed back to the solver.This iterative procedure continues until convergence.
The field consists of 2 gas reservoirs.The largest reservoir is a dry gas reservoir with a Condensate-Gas Ratio (CGR) of 3 stb/MMscf and CO2 content of 7.3%.The other reservoir is producing wet gas with an initial CGR of 15 stb/MMscf and CO2 content of 2.8%.Both reservoirs are producing into a common surface processing facility which aims at treating the reservoir gas and producing two final sales products: condensates (light liquids extracted from the reservoir gas) and sales gas (dehydrated and sweetened reservoir gas).The dry gas reservoir is located only a few kilometers away from the gas plant, while the other reservoir is located between 35 and 45 km away from the plant, see Fig. 2. 19 wells are producing in the dry gas reservoir.The wells are arranged in 4 clusters.Each cluster is producing into a single 12-inch trunkline to the gas treatment plant (GTP).4 wells are producing in the wet gas reservoir.These wells are arranged in one cluster which is producing into a single 20-inch trunkline, see Fig.The Gas Treatment Plant (GTP) consists of several separator vessels (to extract condensates from the reservoir gas), a CO2 extraction plant (amine plant) and a dew point control system to ensure that the sales gas is within specifications, see Fig. 4. Dry gas wells are flowing towards the medium pressure (MP) separator and wet gas wells into the high pressure (HP) separator.Some condensates are extracted from those separators.The separator gas is then processed in the amine plant to remove CO2.After the amine plant, the gas is finally processed in the dew point control system.The gas is cooled down and the very last heavy components are extracted in the two separators.The final gas must honor the sales gas specifications in terms of CO2 content (maximum 2%), heating value and dew point pressure.The condensates extracted at the different points in the system are all passing in a stabilization tower ensuring that the sales liquid is stable and can be safely transported by trucks.

Production system modeling 2.1. Production well model
For all production wells, the gas production rate is given by: where   is the well gas rate and  ℎ is the wellhead pressure.ℱ is a nonlinear function depending on the well architecture (depth, trajectory, diameter), the fluid being produced (CGR and WC) and the reservoir conditions (reservoir pressure and inflow performance).If the fluid or the reservoir conditions change due to reservoir depletion, function ℱ must be updated (e.g. after a well flow test is performed).Figure 5 (a) gives an example of a well performance curve for well DG-9 producing in the dry gas reservoir.Each well is equipped with a choke valve to regulate the well production.Since choke valve models require a lot of data for calibration, the choke valve is modeled as a simple pressure drop in this paper: where   is the pressure after the choke valve.

Flowline model
There are two types of flowlines in the production model: (1) jumpers making the junction between wellheads and clusters and (2) trunkline making the junction between clusters and production separators in the GTP.
For each well, jumpers are modeled as follows: where ∆  is the pressure drop in the jumper,   is the gas rate passing through the jumper,   is the outlet pressure of the jumper and  is a nonlinear function depending on the jumper characterisitcs (length, diameter, difference of altitute, fluid type passing through it). Figure 5 shows an example of pressure drop for a jumper.Note that for a given well, we have: Since trunklines are producing into a production separator where pressure is held constant, the dependency on the outlet pressure is no longer needed and trunklines are modeled as follows: where ℋ is a nonlinear function depending on the architecture of the the trunkline, the fluid passing through it and the conditions at the outlet (pressure and temperature in the production separator).Figure 5 (b) shows the flow performance curves for trunklines of the dry gas reservoir.The pressure   at a given cluster c is given by: where   is the separator pressure at the outlet of the trunkline.

Gas treatment plant model
The MP and HP production separators are modeled using two sets of numerical factors to determine the separator gas and liquid rates.These numerical factors depend on (1) the fluid composition (wet gas or dry gas) and ( 2) the pressure and temperature conditions in the separator vessels.
For the MP separator, Note that the numerical factors    ,    ,    , and    have to be updated when the pressure and/or temperature conditions change in the MP or HP separator.In this paper, we assume that the fluid compositions coming from both reservoirs remains constant (no retrograde condensation at reservoir conditions).Table 1 gives the numerical values of thoses factors for the configuration of Fig. 4.These values are based on the equation of state and fluid compositions given in Appendix B. The amine plant is slightly more complex to model as the CO2 content must be tracked.The gas entering the amine plant is given by:    =  ,  +  ,  +    (11) where    is the gas rate coming from the stabilization tower, see Fig. 4. The quantity (in moles) of CO2 entering the amine plant is given by: where   2  ,   2  and   2  are respectively the molar fractions of CO2 in the dry gas, wet gas and gas coming from the stabilization tower and   is the molar volume of gas at standard conditions (  = 23.69sm 3 /kg-mole).Note that Eq. ( 13) and ( 14) assume that all the CO2 stays in the production separator gas phase.This assumption is relatively good given the properties of CO2 at low pressures.Since the amine plant has a maximum capacity, the operator may have to send some of the gas to a by-pass line, see Fig. 6: where    is the gas rate entering the amine unit and    is the gas rate by-passing the amine unit.The quantity of CO2 is split accordingly: To ensure consistency: where   2  is the molar fraction of CO2 in the mixture entering the gas plant: The CO2 removal is modeled as follows: where   2 = 0.975 is a numerial factor representing the amine unit efficiency.The CO2 gas rate being removed is then: The gas rate and quantity of CO2 entering the dew point system are given by: The dew point system is modeled as follows: where    is gas rate entering the dew point system, ̇  is the liquid mass rate extracted in the dew point system, and    is the sales gas rate at the outlet of the dew point system.   and    are numerical factors representing the condensation occuring in the dew point system.These two factors depend on the composition mixture entering the dew point system and the pressure and temperature conditions in the dew point system.
Figure 6.Sketch of the amine plant with the amine unit and the by-pass line.
The quantity of CO2 in the sales gas is simply given by: Eq. ( 26) assumes that a neglecable amount of CO2 (usually less than 1%) is condensed in the dew point sytem.

Mixed integer linear programming formulation
In this paper, all nonlinear functions (ℱ, , ℋ) are piecewise linearized and included in a MILP using SOS2 models, see Beale and Forrest [15] and Silva and Camponogara [9] for more details.All notations used in the MILP formulation are given in Appendix A.
The objective function is to maximize the sales gas rate: where  represents all variables of the problem (see Tab. A. Note that Eq. ( 62) ensures that the CO2 content in the sales gas is lower than the maximum value authorized by the sales gas specifications.Some additional sales gas specifications (dew point, gas heating value) are ignored in this paper, as those are usually not a bottleneck for production.

MILP solving
The MILP formulation is solved with a commercial linear solver implementing the simplex algorithm together with the branch & cut algorithm.Default solver settings are being used.The MIP gap is set to 1E-10.Note that scaling of gas rates (expressed in millions of m 3 instead of m 3 ) is performed to reduce the range of matrix coefficients and avoid potential errors with the solver.This operation significantly improves the solver runtime and stability.

Proposed bi-level optimization solution
The proposed iterative bi-level optimization workflow is shown in Fig. 7.As mentioned in the previous sections, to simplify the formulation some variables are assumed to be constant parameters.This approximation allows to reduce significantly the runtime, since Eq. ( 19) is relatively costly to linearize.The other quantities    ,   2  ,    , and    would also be relatively costly to estimate within the MILP.They are therefore assumed constant in the MILP.These estimated values can come from a previous run for example.The MILP is then solved, assuming these parameters to be constant.The optimal solution is fed to a full gas plant simulation model and new values of the paramters are computed.These new parameter values can be compard to the estimates used to solve the MILP.If the difference  with the initial values is too high, the parameter values are substituted by the computed values and the MILP is solved again.This procedure is repeated until convergence is achieved ( < , with  being some pre-defined convergence criteron).

Base case
The proposed solution is run with the base case constraint values given in Tab. 2.

%
Results are shown in Fig. 8 and 9.We can see in Fig. 8 that some wells are producing at full potential (zero pressure drop across the choke valve) while other wells are being choked.In particular, wells from the wet gas reservoir are producing at maximum capacity, since their relatively low CO2-content can dilute the gas produced by the dry gas reservoir.Figure 9 shows the effect of the network on the results.The separator back pressure can be quite different from the separator pressure.This is particularly true for wells of the wet gas reservoir located 30-45 km away from the GTP.The pressure at the wellhead of wet gas wells can be 5 to 10 bar higher than the HP pressure (95 bar), affecting significantly the well production of those wells and therefore the entire operations of the field.Table 3 compares the optimal process parameter values with the constraints imposed by the system.It is clear that the limiting criterion is the maximum CO2 rate that can be removed, followed by the capacity of the amine plant.Solution to de-bottleneck the system include (1) upgrading the amine plant or (2) lowering the pressure of the separtor producing the wet gas (this would involve installing a compressor to compress the separator gas).Both options lead to higher production but also involve expensive CAPEX.This economical analysis is not conducted in this paper.
The proposed solution takes 3-5 iterations to converge.The execution time for a single iteration is ranging from 10 to 13 sec.on an Intel© Core™ i7-5600 @ 2.60 GHz. Figure 10 shows the detail of the execution time.The convergence of the proposed bi-level optimization solution is studied and results are shown in Fig. 11 for three different starting points (i.e.set of estimated parameter values).Figure 11 shows that even extremly bad starting point do not affect the convergence of the solution.The error is lower than 0.1 % after 4 iterations and lower than 0.001 % after 5 iterations.The objevtice converges even faster.After 3 iterations, the optimal value is reached, even for very bad starting point.

What-if scenarios
In this section, the proposed solution is used to react to planned or unplanned events (e.g.compressor shutdown, maintenance of critical processes, etc.).These events can be translated into a reduced capacity or additional constraint for the optimization.Table 4 summarizes the different what-if scenarios studied in this paper.

Conclusion
This paper presents a bi-level optimization solution suitable for short-term production optimization of gas fields with wells arranged in surface production network and producing into a common processing facility.A MILP, including hydraulic performances of the system, approximated using SOS2 piecewise linear models, and a simplified gas treatment plant model, is solved iteratively.Some key parameter in the gas plant are assumed constant and are calculated after solving the MILP using a full process simulation model.If different from the estimated values, the new values of the parameters are substituted in the MILP input data and the MILP is solved again.This process is repeated until convergence is achieved.
The solution is applied to a gas field located in North Africa.The proposed solution successfully finds the optimal operations for a base case scenario and a set of what-if scenarios simulating planned and unplanned events.The runtime of the solution ranges from 30 sec. to 1 minute, making the proposed solution suitable for short-term production optimization and operational decision support.
A study of the convergence and stability of the proposed solution is also conducted.It shows that the first estimated values of the process parameters have no influence on the convergence of the solution.After 3-4 iterations, the convergence error is lower than 0.1 %.

Figure 4 .
Figure 4. Simplified flow diagram of the gas treatment plant.

Figure 5 .
Figure 5. Example of hydraulic performance curves used in this paper.

Figure 7 .
Figure 7. Proposed iterative workflow to solve the optimization problem.

Figure 8 .
Figure 8. Optimal gas rates and choke setting for all production wells.

Figure 9 .
Figure 9. Optimal gas rates and pressue drops in clusters.

Figure 11 .
Figure 11.Convergence of the proposed solution for three different starting points.

Table 4 .Figure 12 .
Figure 12.Well production rates for the base case and the three what-if scenarios (WIS) of Tab. 4.

Table 1 .
Numerical values of the gas and oil formation factors in the production separators.
Note that { |  ∈ } is the subset of wells producing in the wet gas reservoir and { |  ∈ } is the subset of wells producing in the dry gas reservoir.Some operational constraints have to be honored in the gas plant:

Table 2 .
Numerical values of constraints used in the base case.

Table 3 .
Optimal values of the process parameters.
Figure 10.Runtime of each stage of the proposed optimization workflow.

Table A .
5. Nonlinear and piecewise linear functions.Table A.6.Set of breakpoints used in the SOS2 models.Table B.2. Gas compositions used in this paper.
Set of outlet pressure breakpoints for jumper j    Set of gas rate breakpoints for trunkline c