This paper applies the genetic algorithm to the optimization of production layer regrouping in oilfield development. The specific idea is as follows: comprehensively consider various factors that affect layers regrouping, such as the layer thickness, porosity, permeability, remaining oil saturation, recovery ratio, remaining reserves, comprehensive water cut, well section length, number of oil layers, etc., which form an N × r matrix (N is the total number of sub-layers and r is the number of influencing factors). First, randomly generate or artificially provide several sets of combination schemes as the initial population, with each combination scheme serving as an individual of the population. Then, calculate the comprehensive variance of each influencing factor for each individual (each combination scheme) as the fitness value of that combination scheme (see
Section 2.2.4 for details), Based on the fitness value, the advantageous schemes with higher fitness values are selected as the basis of the next generation. Then, crossover and mutation operations are performed on those advantageous schemes to generate new schemes. Through continuous selection and evolution, until the global optimal solution with the highest fitness value is found, the optimal combination scheme is determined. The flowchart is shown in
Figure 1, as follows:
2.2.1. Parameter Setting and Tuning
As mentioned above, this method considers various factors that affect the layer regrouping, such as layer thickness, porosity, permeability, remaining oil saturation, recovery ratio, remaining reserves, comprehensive water cut, well section length, number of oil layers, etc. These parameters form an N × r matrix (N is the total number of sub-layers and r is the number of influencing factors);
Figure 2 shows the schematic diagram of the parameter matrix.
Other parameters include the (1) population size G, which is the number of combination schemes within the population; (2) total number of layers series S; (3) total number of small layers N; (4) crossover probability Pc; (5) mutation probability Pm; and (6) maximum generations T, which is the maximum number of iterations.
Parameter tuning: The larger the value of G, the larger the population size, and the more solutions obtained during the calculation process; however, the computational complexity will also increase, leading to a slower calculation speed. On the premise of ensuring calculation speed, a larger G value can be set. The total number of layer groups S is determined based on the actual needs of the oilfield. N is the actual total number of layers. The crossover probability (Pc) directly affects the searching efficiency of the optimal solution. The mutation operations help increase population diversity. For optimization issues, low crossover probability and high mutation probability are usually required to maintain population diversity. Through actual testing, here, we set crossover probability Pc = 0.8 and mutation probability Pm = 0.005, which can better ensure the searching efficiency and convergence speed of the algorithm. Increasing the total iteration number T can improve the solution quality, but too many iterations will increase the computation time.
For the above parameters, for different oil fields, simply change the values of S and N in the program, and input the N × r matrix composed of the factors that affect the layer group division. If necessary, adjustments can be made to G, Pc, Pm, and T.
2.2.4. Calculation of the Fitness Value for Each Regrouping Scheme
The fitness in the genetic algorithm is an indicator of the superiority of an individual (that is, each combination scheme). According to the principle of layer grouping in oilfield development, layers with small differences in reservoir property parameters are suitable for combining in one group. Therefore, first, calculate the intra-group variance and inter-group variance of each influencing factor in each combination scheme. Smaller intra-group variance and larger inter-group variance of the influencing factors are expected as a reasonable combination scheme. Based on this idea, these two variances are then combined into a comprehensive variance (as described in Section (3)), defined as the fitness value of each layer combination scheme.
Calculate the fitness value of each combination scheme in population P(t) (t = 0, 1, 2, …, T) according to the following steps.
(1) Calculation of the intra-group variance of the influencing factor.
Assuming there are
r influencing factors, the intra-group variance
of the influencing factors of each layer group is calculated and then the average
of
for all layer groups is determined through the following formulas:
i, the i-th layer group (i = 1, 2, …, S);
j, the j-th layer in the i-th layer group (j = 1, 2, …, N);
q, the q-th influencing factor (q = 1, 2, …, r);
, the standard variance of the q-th influencing factor between each layer in the i-th layer group;
, the value of the q-th influencing factor in the j-th layer of the i-th layer group;
, the average value of the q-th influencing factor in the i-th layer group;
n, the number of layers in each layer group, could be different between groups;
, the average value of ;
S, total number of layer groups.
(2) Calculation of the inter-group variance of the influencing factors.
The inter-group variance
of the influencing factors is calculated through the following formulas. When calculating the variance of each influencing factor between layer group, set the average value of
of each influencing factor across all layers within the layer group as the value of that influencing factor in that layer group.
, the standard variance of the q-th influencing factor between layer groups (q = 1, 2, …, r).
, the average value of of all layer groups.
(3) Normalization of intra-group variance and inter-group variance and fitness value calculation for each regrouping scheme.
The two variances above are then normalized and combined into a comprehensive variance as the fitness value for each regrouping plan.
and
obtained above are normalized as follows:
, normalized value of ;
, the minimum value of ;
, the maximum value of ;
, normalized value of ;
, the minimum value of ;
, the maximum value of ;
and are then combined into as the fitness value of the layer regroup scheme.
, weight coefficients for intra-group variance and inter-group variance, . Should be assigned based on the experience of reservoir engineers.
, weight coefficient for the q-th influencing factor, . Should be assigned based on the experience of reservoir engineers.
, comprehensive variance, which is the fitness value for the combination scheme.
Notably, smaller intra-group variance and larger inter-group variance are expected based on the layer regrouping principle, so a smaller , a larger , a larger , and, consequently, a larger are expected for an ideal plan.
2.2.5. Genetic Calculation
(1) Selection.
Select schemes within the population based on the scheme fitness value. The superior schemes are chosen as the basis for the next calculation.
The roulette wheel selection method is used to define the probability of a scheme being selected [
23], as follows:
, the fitness value of the k-th scheme.
Schemes with higher fitness values have a higher probability of being selected. In this case, still select G schemes (the same scheme can be repeatedly selected) to maintain the population size.
(2) Crossover.
By utilizing the single-point crossover operator, perform random crossovers on the selected schemes obtained through the selection process mentioned above. Randomly select two groups within a scheme, choose a random crossover point, and then perform crossover at that position with the specified crossover probability .
(3) Mutation.
Perform random mutations for each scheme obtained above after crossover calculation. Randomly select one group within a scheme, choose a random mutation position (i.e., position of the layer), and generate a random number between [0,1] as a comparison probability. If this probability is less than the mutation probability , then the selected mutation position changes from 1 to 0 or from 0 to 1. However, it is important to note that the mutation method here is different from the conventional mutation method in the genetic algorithm. It is not a simple change from 1 to 0 or from 0 to 1. In this case, if a layer changes from 1 to 0, then in another group, the same layer must change from 0 to 1, and vice versa. This ensures that different groups do not contain the same layer.
The selection operation mentioned above allows the inheritance of superior schemes, while crossover and mutation operations aim to generate more diversified schemes.