Machine Learning-Assisted Prediction of Oil Production and CO 2 Storage Effect in CO 2 -Water-Alternating-Gas Injection (CO 2 -WAG)

: In recent years, CO 2 ﬂooding has emerged as an efﬁcient method for improving oil recovery. It also has the advantage of storing CO 2 underground. As one of the promising types of CO 2 enhanced oil recovery (CO 2 -EOR), CO 2 water-alternating-gas injection (CO 2 -WAG) can suppress CO 2 ﬁngering and early breakthrough problems that occur during oil recovery by CO 2 ﬂooding. However, the evaluation of CO 2 -WAG is strongly dependent on the injection parameters, which in turn renders numerical simulations computationally expensive. So, in this work, machine learning is used to help predict how well CO 2 -WAG will work when different injection parameters are used. A total of 216 models were built by using CMG numerical simulation software to represent CO 2 -WAG development scenarios of various injection parameters where 70% of them were used as training sets and 30% as testing sets. A random forest regression algorithm was used to predict CO 2 -WAG performance in terms of oil production, CO 2 storage amount, and CO 2 storage efﬁciency. The CO 2 -WAG period, CO 2 injection rate, and water–gas ratio were chosen as the three main characteristics of injection parameters. The prediction results showed that the predicted value of the test set was very close to the true value. The average absolute prediction deviations of cumulative oil production, CO 2 storage amount, and CO 2 storage efﬁciency were 1.10%, 3.04%, and 2.24%, respectively. Furthermore, it only takes about 10 s to predict the results of all 216 scenarios by using machine learning methods, while the CMG simulation method spends about 108 min. It demonstrated that the proposed machine-learning method can rapidly predict CO 2 -WAG performance with high accuracy and high computational efﬁciency under conditions of various injection parameters. This work gives more insights into the optimization of the injection parameters for CO 2 -EOR.


Introduction
With the continuous improvement of oil and gas exploration and development, the proportion of heterogeneous and low-permeability reservoirs in exploration and development is gradually increasing. Using conventional water injection to develop low-permeability reservoirs results in a low recovery factor [1]. Compared to water, CO 2 is less viscous and can enter into small pores more easily, which can reduce the viscosity of crude oil, expand the volume of crude oil, improve the mobility ratio, and thus increase the oil recovery factor [2,3]. Therefore, CO 2 -enhanced oil recovery (CO 2 -EOR) has great potential for developing low-permeability reservoirs. In addition to this, CO 2 -EOR can sequestrate CO 2 underground, which can help in achieving carbon neutrality [4]. However, in the CO 2 flooding method, during gas injection, the low viscosity of CO 2 may lead to a phenomenon referred to as viscous fingering. This results in an unfavorable mobility ratio, which seriously affects the improvement of swept volume [5]. Moreover, due to its low density, CO 2 The key reservoir parameters used in this work are selected based on the geological information of the Tuo 28 block in Shengli Oilfield [33,34], as shown in Table 1. The oil reservoir depth is 1800 m, and the reservoir pressure is 18 MPa due to the normal formation pressure coefficient of 1.0. The reservoir temperature is 85 °C . The porosity is 0.24, the initial oil saturation is 0.7934, the crude oil viscosity is 15.4495 cp, and the crude oil density is 760.9 kg/m 3 . Reservoir temperature °C 85 10 Initial reservoir pressure MPa 18 The permeability in the horizontal directions, for each layer from top to bottom, is 10 × 10 −3 μm 3 , 20 × 10 −3 μm 3 , 30 × 10 −3 μm 3 , 40 × 10 −3 μm 3 , 60 × 10 −3 μm 3 , 70 × 10 −3 μm 3 and 90 × 10 −3 μm 3 , as shown in Table 2, and the average permeability in horizontal directions is 50 The key reservoir parameters used in this work are selected based on the geological information of the Tuo 28 block in Shengli Oilfield [33,34], as shown in Table 1. The oil reservoir depth is 1800 m, and the reservoir pressure is 18 MPa due to the normal formation pressure coefficient of 1.0. The reservoir temperature is 85 • C. The porosity is 0.24, the initial oil saturation is 0.7934, the crude oil viscosity is 15.4495 cp, and the crude oil density is 760.9 kg/m 3 . Reservoir temperature • C 85 10 Initial reservoir pressure MPa 18 The permeability in the horizontal directions, for each layer from top to bottom, is 10 × 10 −3 µm 3 , 20 × 10 −3 µm 3 , 30 × 10 −3 µm 3 , 40 × 10 −3 µm 3 , 60 × 10 −3 µm 3 , 70 × 10 −3 µm 3 and 90 × 10 −3 µm 3 , as shown in Table 2, and the average permeability in horizontal directions is 50 × 10 −3 µm 3 . The permeability in the vertical direction is 0.1 times the horizontal permeability (K v /K h = 0.1) and the average permeability in the vertical direction is 5 × 10 −3 µm 3 , which is a typical non-homogeneous low permeability reservoir with a positive rhythm. The thickness of the whole reservoir is 27 m, with each layer measuring 3 m.

. Injection and Production Settings
The model simulates a total of forty years, with depletion development occurring during the first eight years and CO 2 -WAG production commencing in the ninth. Thus, the actual CO 2 -WAG development length is 32 years. In this case, to compare the production effects of each CO 2 -WAG scenario, it is necessary to carry out a period of depletion development first to exclude the natural energy disturbance. As shown in Figure 2, the pressure difference between the injection and production wells is less than 0.5 MPa after the first 8 years of depletion development. In addition, the production efficiency is low and no longer productive. Therefore, it is necessary to add energy, such as through CO 2 -WAG development. In the base model, CO 2 injection starts in January of the ninth year and water injection starts in July, so the cycle is set to 12 months, including 6 months of gas injection and 6 months of water injection. The water-gas ratio is set to 1:1, which implies that the CO 2 injection rate is equal to the water injection rate under reservoir conditions. The water injection rate is set at 90 m 3 /day and the CO 2 injection rate is set at 20,000 m 3 /day. The bottom hole pressure of the four production wells is set to 7 MPa. As shown in Figure 3, the water cut in the produced fluid is more than 80% by the fortieth year of production. Thus, this work assumes that production is stopped after 40 years of production. × 10 −3 μm 3 . The permeability in the vertical direction is 0.1 times the horizontal permeability (Kv/Kh = 0.1) and the average permeability in the vertical direction is 5 × 10 −3 μm 3 , which is a typical non-homogeneous low permeability reservoir with a positive rhythm. The thickness of the whole reservoir is 27 m, with each layer measuring 3 m.

. Injection and Production Settings
The model simulates a total of forty years, with depletion development occurring during the first eight years and CO2-WAG production commencing in the ninth. Thus, the actual CO2-WAG development length is 32 years. In this case, to compare the production effects of each CO2-WAG scenario, it is necessary to carry out a period of depletion development first to exclude the natural energy disturbance. As shown in Figure 2, the pressure difference between the injection and production wells is less than 0.5 MPa after the first 8 years of depletion development. In addition, the production efficiency is low and no longer productive. Therefore, it is necessary to add energy, such as through CO2-WAG development. In the base model, CO2 injection starts in January of the ninth year and water injection starts in July, so the cycle is set to 12 months, including 6 months of gas injection and 6 months of water injection. The water-gas ratio is set to 1:1, which implies that the CO2 injection rate is equal to the water injection rate under reservoir conditions. The water injection rate is set at 90 m 3 /day and the CO2 injection rate is set at 20,000 m 3 /day. The bottom hole pressure of the four production wells is set to 7 MPa. As shown in Figure  3, the water cut in the produced fluid is more than 80% by the fortieth year of production. Thus, this work assumes that production is stopped after 40 years of production.

Principle of the Random Forest Regression Algorithm
Multiple regression decision trees constitute the random forest regression algorithm. Based on the idea of integrated learning, the mean value of each regression decision tree is taken as the prediction result [35]. T is the number of regression decision trees.
As a machine learning algorithm based on statistical theory, the random forest regression algorithm introduces the bagging method and the random subspace method [36] to avoid the problem of single decision tree models, which tend to be overfitted and not accurate.
(1) The bagging method [37], also known as bootstrap aggregating, is a bootstrapbased statistical method. Based on repeatable random sampling, multiple predictors are formed by the bootstrap repetitive sampling method. Assuming that there are N samples in the original sample, N samples are repeatedly sampled to form new training samples. When N approaches infinity, the probability of not being sampled again for each sample is 36.8%. Nearly 36.8% of the original samples will not appear in the training samples of the same tree, and the samples that are not drawn are called out-of-bag data (OOB) [27]. The generation of locally optimal solutions for regression decision trees can be avoided by the bagging method.
(2) Stochastic subspace method. Random features need to be selected when constructing the regression decision tree. Selecting random features means picking x feature attributes at random from the whole set of attributes. Node splitting selects the optimal features based on the principle of minimum mean squared deviation so that each tree is not pruned to achieve maximum growth. A random sampling of training samples and a random selection of feature attributes can make sure that the regression decision trees have as much variety as possible [38].  Multiple regression decision trees constitute the random forest regression algorithm. Based on the idea of integrated learning, the mean value of each regression decision tree is taken as the prediction result [35].
where: f (x) is the model prediction result, f (x, θ t ) is the output based on x and θ t , x is the independent variable, θ t is the independent identically distributed random vector, and T is the number of regression decision trees. As a machine learning algorithm based on statistical theory, the random forest regression algorithm introduces the bagging method and the random subspace method [36] to avoid the problem of single decision tree models, which tend to be overfitted and not accurate.
(1) The bagging method [37], also known as bootstrap aggregating, is a bootstrapbased statistical method. Based on repeatable random sampling, multiple predictors are formed by the bootstrap repetitive sampling method. Assuming that there are N samples in the original sample, N samples are repeatedly sampled to form new training samples. When N approaches infinity, the probability of not being sampled again for each sample is 36.8%. Nearly 36.8% of the original samples will not appear in the training samples of the same tree, and the samples that are not drawn are called out-of-bag data (OOB) [27]. The generation of locally optimal solutions for regression decision trees can be avoided by the bagging method.
(2) Stochastic subspace method. Random features need to be selected when constructing the regression decision tree. Selecting random features means picking x feature attributes at random from the whole set of attributes. Node splitting selects the optimal features based on the principle of minimum mean squared deviation so that each tree is not pruned to achieve maximum growth. A random sampling of training samples and a random selection of feature attributes can make sure that the regression decision trees have as much variety as possible [38].

Randomized Regression Forest Algorithm Flow
The main flow of the randomized regression forest algorithm is presented in Figure 4 and described as follows: (1) Sampling: K sets of datasets are sampled from the training dataset S by using the bagging method. Each set of datasets is divided into 2 types: sampled data and un-sampled data (out-of-bag data), and they are trained to produce a decision tree.
(2) Growing: Each decision tree is trained by training data. In each branching node, M features are randomly selected from M feature attributes, and the best features are chosen based on the Gini index for full branching growth until no more growth is possible without pruning.
(3) Forming a forest: Repeat steps 1 and 2 to build multiple regression decision trees and maximize the growth of each tree to form a forest.
(4) Predicting: Using the chosen model, predictions are made about the new data set, and the final output is the average of all the predictions made by the decision trees.

Randomized Regression Forest Algorithm Flow
The main flow of the randomized regression forest algorithm is presented in Figure  4 and described as follows: (1) Sampling: K sets of datasets are sampled from the training dataset S by using the bagging method. Each set of datasets is divided into 2 types: sampled data and un-sampled data (out-of-bag data), and they are trained to produce a decision tree.
(2) Growing: Each decision tree is trained by training data. In each branching node, M features are randomly selected from M feature attributes, and the best features are chosen based on the Gini index for full branching growth until no more growth is possible without pruning.
(3) Forming a forest: Repeat steps 1 and 2 to build multiple regression decision trees and maximize the growth of each tree to form a forest.
(4) Predicting: Using the chosen model, predictions are made about the new data set, and the final output is the average of all the predictions made by the decision trees. This work first builds a series of numerical simulation models by adjusting the injection parameters and runs them to obtain simulation results for forming a test database. The train_test_split function from sklearn.model_selection is called to randomly divide the test database into two parts, one as a training set to train the regression prediction model and the other as a test set to compare with the results predicted by machine learning to verify the accuracy of the method. To make the results clearer and more intuitive, this work trains and predicts each of the three label variables separately with the random forest regression algorithm.
The CO2-WAG period, fluid injection rate, and water-gas ratio are important parameters for CO2-WAG optimization. Therefore, this work uses CO2-WAG period, CO2 injection rate and water-gas ratio as three features and cumulative oil production, CO2 storage amount, and CO2 storage efficiency as labels for regression prediction to realize fast prediction of program effects with the help of a random forest regression algorithm in machine learning.

Base Case Analysis
The cumulative oil production, CO2 storage amount, and CO2 storage efficiency of the base model as a function of time are shown in Figures 5 and 6. The values of cumulative oil production, CO2 storage amount, and CO2 storage efficiency are derived as the three labels for machine learning. The CO2 storage amount is obtained by subtracting the cumulative CO2 production from the cumulative CO2 injection. The CO2 storage efficiency is expressed as the ratio of the CO2 storage amount to the CO2 injection. This work first builds a series of numerical simulation models by adjusting the injection parameters and runs them to obtain simulation results for forming a test database. The train_test_split function from sklearn.model_selection is called to randomly divide the test database into two parts, one as a training set to train the regression prediction model and the other as a test set to compare with the results predicted by machine learning to verify the accuracy of the method. To make the results clearer and more intuitive, this work trains and predicts each of the three label variables separately with the random forest regression algorithm.
The CO 2 -WAG period, fluid injection rate, and water-gas ratio are important parameters for CO 2 -WAG optimization. Therefore, this work uses CO 2 -WAG period, CO 2 injection rate and water-gas ratio as three features and cumulative oil production, CO 2 storage amount, and CO 2 storage efficiency as labels for regression prediction to realize fast prediction of program effects with the help of a random forest regression algorithm in machine learning.

Base Case Analysis
The cumulative oil production, CO 2 storage amount, and CO 2 storage efficiency of the base model as a function of time are shown in Figures 5 and 6. The values of cumulative oil production, CO 2 storage amount, and CO 2 storage efficiency are derived as the three labels for machine learning. The CO 2 storage amount is obtained by subtracting the cumulative CO 2 production from the cumulative CO 2 injection. The CO 2 storage efficiency is expressed as the ratio of the CO 2 storage amount to the CO 2 injection.
As shown in Figure 5, at first, the oil production rate goes up quickly because there is enough energy in the reservoir. As the reservoir energy gradually depletes, the oil production curve begins to level off gradually in the fifth year. Then, the reservoir energy is replenished by the nineth year after the CO2-WAG started, and the oil production rate begins to increase rapidly. The oil production rate begins to decrease slowly from the twentieth year to the end of production. At the beginning of the CO2 injection, the CO2 storage amount is almost equal to the CO2 injection amount from the nineth year to the fifteenth year with little CO2 produced (Figure 6a). CO2 production begins in the fifteenth year and has a relatively stable rate. From the sixteenth year, the growth rate of CO2 storage starts to be lower than that of CO2 injection. With the increase in CO2 production, the CO2 storage amount nearly stopped increasing by the thirty-sixth year. Consequently, the CO2 storage efficiency is almost equal to 1 at the beginning and then gradually decreases, as shown in Figure 6b.  At the beginning of the CO2 injection, the CO2 storage amount is almost equal to the CO2 injection amount from the nineth year to the fifteenth year with little CO2 produced (Figure 6a). CO2 production begins in the fifteenth year and has a relatively stable rate. From the sixteenth year, the growth rate of CO2 storage starts to be lower than that of CO2 injection. With the increase in CO2 production, the CO2 storage amount nearly stopped increasing by the thirty-sixth year. Consequently, the CO2 storage efficiency is almost equal to 1 at the beginning and then gradually decreases, as shown in Figure 6b. As shown in Figure 7, the overall effects of oil production on both CO2 flooding and CO2-WAG are higher than those of water flooding. CO2 flooding has higher oil production in the early stages of development before the thirty-sixth year because CO2 is more mobile As shown in Figure 5, at first, the oil production rate goes up quickly because there is enough energy in the reservoir. As the reservoir energy gradually depletes, the oil production curve begins to level off gradually in the fifth year. Then, the reservoir energy is replenished by the nineth year after the CO 2 -WAG started, and the oil production rate begins to increase rapidly. The oil production rate begins to decrease slowly from the twentieth year to the end of production.
At the beginning of the CO 2 injection, the CO 2 storage amount is almost equal to the CO 2 injection amount from the nineth year to the fifteenth year with little CO 2 produced (Figure 6a). CO 2 production begins in the fifteenth year and has a relatively stable rate. From the sixteenth year, the growth rate of CO 2 storage starts to be lower than that of CO 2 injection. With the increase in CO 2 production, the CO 2 storage amount nearly stopped increasing by the thirty-sixth year. Consequently, the CO 2 storage efficiency is almost equal to 1 at the beginning and then gradually decreases, as shown in Figure 6b.
As shown in Figure 7, the overall effects of oil production on both CO 2 flooding and CO 2 -WAG are higher than those of water flooding. CO 2 flooding has higher oil production in the early stages of development before the thirty-sixth year because CO 2 is more mobile than water. CO 2 flooding produces oil at a higher rate than both water flooding and CO 2 -WAG at this stage. Due to the heterogeneity of the reservoir, the CO 2 injected into the formation tends to form a dominant channel. So, the CO 2 flooding method starts to produce more oil in a slow way around the twenty-second year of its late stage of development. The CO 2 -WAG method effectively combines the advantages of water flooding and CO 2 flooding and maintains a high oil production rate, especially after the thirty-sixth year, although the oil production rate is relatively lower than that of CO2 flooding before the thirty-sixth year. The overall oil production of CO 2 -WAG is better than that of water flooding and CO 2 flooding. As shown in Figure 7, the overall effects of oil production on both CO2 flooding and CO2-WAG are higher than those of water flooding. CO2 flooding has higher oil production in the early stages of development before the thirty-sixth year because CO2 is more mobile than water. CO2 flooding produces oil at a higher rate than both water flooding and CO2-WAG at this stage. Due to the heterogeneity of the reservoir, the CO2 injected into the formation tends to form a dominant channel. So, the CO2 flooding method starts to produce more oil in a slow way around the twenty-second year of its late stage of development. The CO2-WAG method effectively combines the advantages of water flooding and CO2 flooding and maintains a high oil production rate, especially after the thirty-sixth year, although the oil production rate is relatively lower than that of CO2 flooding before the thirty-sixth year. The overall oil production of CO2-WAG is better than that of water flooding and CO2 flooding.  For further analysis of the difference between the CO 2 -WAG method and the CO 2 flooding method, this work compares the gas-oil ratio of the produced flow. As shown in Figure 8, the gas production rate starts to increase from the twelfth year (4 years after CO 2 injection) in the CO 2 flooding method and rises sharply from the nineteenth year onwards. This can be explained by the fact that the injected CO 2 forms a dominant channel, and thus the injected CO 2 returns to the surface directly from the dominant channel as an output gas.

gas.
In the CO2-WAG method, the gas production rate is basically unchanged in the early stage of production and increases at a low rate in the late stage of production. Thus, the gas production volume is much smaller than that of CO2 flooding. It can be speculated that the injected water in the CO2-WAG method effectively hinders the breakthrough of CO2 and the formation of a CO2-dominant channel. Therefore, CO2-WAG can effectively slow down the rate of CO2 gas extraction compared to CO2 flooding. Currently, the treatment and separation of output gas to recover methane and reinjected carbon dioxide are priorities for many oilfields. Gas treatment stations in oilfields have a certain upper limit of gas that can be processed per day. In the CO2 flooding method, the gas output rate may be too high, especially in the final stages of development. It may lead to a risk that a large amount of methane gas and carbon dioxide cannot be captured and recovered in time, causing a great loss of economic benefits and more emissions of greenhouse gases. In contrast, according to the preceding analysis, the CO2-WAG method can solve the aforementioned issues by efficiently extracting crude oil and reducing the gas production rate, thereby allowing the gas treatment station sufficient time to capture and recover methane gas and reinject carbon dioxide.

Analysis of Influence Factors on CO2-WAG
To analyze the principal influence factors of CO2-WAG, this work designs a series of scenarios of the CO2-WAG development method by modifying the CO2-WAG period, fluid injection rate, and water-gas ratio based on the above base model. Among them, six schemes of the period adjustment are set as 4 months, 6 months, 12 months, 24 months, 48 months, and 96 months, respectively. Six schemes of the fluid injection rate adjustment are set as: (1) water injection rate of 65 m 3 /day and CO2 injection rate of 12,000 m 3 /day; (2) water injection rate of 79 m 3 /day and CO2 injection rate of 16,000 m 3 /day; (3) water injection rate of 90 m 3 /day and CO2 injection rate of 20,000 m 3 /day; (4) water injection rate of In the CO 2 -WAG method, the gas production rate is basically unchanged in the early stage of production and increases at a low rate in the late stage of production. Thus, the gas production volume is much smaller than that of CO 2 flooding. It can be speculated that the injected water in the CO 2 -WAG method effectively hinders the breakthrough of CO 2 and the formation of a CO 2 -dominant channel. Therefore, CO 2 -WAG can effectively slow down the rate of CO 2 gas extraction compared to CO 2 flooding.
Currently, the treatment and separation of output gas to recover methane and reinjected carbon dioxide are priorities for many oilfields. Gas treatment stations in oilfields have a certain upper limit of gas that can be processed per day. In the CO 2 flooding method, the gas output rate may be too high, especially in the final stages of development. It may lead to a risk that a large amount of methane gas and carbon dioxide cannot be captured and recovered in time, causing a great loss of economic benefits and more emissions of greenhouse gases. In contrast, according to the preceding analysis, the CO 2 -WAG method can solve the aforementioned issues by efficiently extracting crude oil and reducing the gas production rate, thereby allowing the gas treatment station sufficient time to capture and recover methane gas and reinject carbon dioxide.

Analysis of Influence Factors on CO 2 -WAG
To analyze the principal influence factors of CO 2 -WAG, this work designs a series of scenarios of the CO 2 -WAG development method by modifying the CO 2 -WAG period, fluid injection rate, and water-gas ratio based on the above base model. Among them, six schemes of the period adjustment are set as 4 months, 6 months, 12 months, 24 months, 48 months, and 96 months, respectively. Six schemes of the fluid injection rate adjustment are set as: (1) water injection rate of 65 m 3 /day and CO 2 injection rate of 12,000 m 3 /day; (2) water injection rate of 79 m 3 /day and CO 2 injection rate of 16,000 m 3 /day; (3) water injection rate of 90 m 3 /day and CO 2 injection rate of 20,000 m 3 /day; (4) water injection rate of 100 m 3 /day and CO 2 injection rate of 23,000 m 3 /day; (5) water injection rate of 110 m 3 /day and CO 2 injection rate of 27,000 m 3 /day; (6) water injection rate 120 m 3 /day and CO 2 injection rate of 31,000 m 3 /day. 6 schemes of the water-gas ratio adjustment are set as 0.33, 0.5, 1, 1.5, 2, and 3, respectively. Therefore, this work constructs a total of 6 × 6 × 6 = 216 scenarios. As the water injection rate varies simultaneously with the CO 2 injection rate, this work selects the CO 2 injection rate as one feature, and the period and water-gas ratio as the other two features.
The cumulative oil production, CO 2 storage amount, and CO 2 storage efficiency of the 216 scenarios are simulated by CMG, and the results are detailed in Supporting Information. To elucidate more clearly the influence of CO 2 -WAG parameters on production, the cumulative oil production, CO 2 storage amount, and CO 2 storage efficiency of different cycle schemes (#85, #97, #103), different fluid injection rate schemes (#49, #121, #193), and different water-gas ratio schemes (#85, #87, #89) are compared by the single variable method, and the results are shown in Figures 9-11.
As shown in Figure 9, the influence of the cycle on oil production is relatively small. When the CO 2 -WAG cycle is relatively shorter, the cumulative oil production is higher. When the cycle is 8 years, the cumulative oil production starts to decline significantly, because in this case, the frequency of alternating water and carbon dioxide is low, similar to a small period of water flooding and gas flooding. The influence of the cycle on CO 2 storage is relatively large, both in terms of CO 2 storage amount and CO 2 storage efficiency. Throughout the production process, CO 2 storage amount and CO 2 storage efficiency fluctuate due to the alternate injection of water and CO 2 . At the end of the process, the CO 2 storage amount and CO 2 storage efficiency decrease with the cycle.
As shown in Figure 10, the injection rate has a greater impact on oil production. As the injection rate increases, cumulative oil production also increases, but the CO 2 storage efficiency decreases. This is because more CO 2 will return to the surface from production wells as output gas when the CO 2 injection rate increases. Therefore, when optimizing the CO 2 -WAG extraction scheme in the oilfield, the injection rate cannot be increased arbitrarily. The processing capacity of gas treatment stations in the oilfield needs to be considered. When CO 2 output is too fast, some CO 2 will not be recovered and treated in time. CO 2 will escape into the atmosphere, which may cause environmental issues and aggravate the greenhouse effect. It also causes waste of CO 2 gas resources and economic loss to the oilfield. At the same time, an over-high injection rate will instantly increase the bottom hole pressure of the injection well. When it exceeds the fracture pressure of the formation, it will crush the formation, causing damage to the formation on the one hand. On the other hand, it may cause CO 2 to escape and pollute other formations.
The model in this study has a low reservoir pressure due to a period of depleted extraction in the early stage. In addition, the fluid injection rate is low, which means it cannot restore the reservoir pressure to the initial pressure. The simulated reservoir is a low-pressure reservoir. For this type of reservoir, as shown in Figure 11, the higher the water-gas ratio is, the better the oil production will be. In addition, when the injection rate and the reservoir pressure are high, a lower water-gas ratio has a higher oil recovery. A higher water-gas ratio results in less CO 2 being buried because the proportion of injected CO 2 is smaller, but the storage efficiency is higher. A lower water-gas ratio allows more CO 2 to be buried because the proportion of CO 2 in the injected fluid is larger. Moreover, more CO 2 will be produced from the production well, leading to lower storage efficiency. Appl. Sci. 2022, 12, x FOR PEER REVIEW 11 of 19

Analysis of Machine Learning Results
To compare the CMG numerical simulation results with the machine learning regres- Figure 11. Effect of water-gas ratio on (a) cumulative oil production, (b) CO 2 storage amount, and (c) CO 2 storage efficiency.

Analysis of Machine Learning Results
To compare the CMG numerical simulation results with the machine learning regression prediction results, this work builds a database of 216 CMG numerical simulation models, of which 70% are used as the training set and 30% as the test set. The numerical simulation results of the test set are employed as the true values for verifying the accuracy of the machine learning prediction. The result plots for the three labels of cumulative oil production, CO 2 storage amount, and CO 2 storage efficiency are shown in Figure 12. The predicted curve made by the random forest regression algorithm is very close to the true value curve in terms of cumulative oil production, CO 2 storage amount, and CO 2 storage efficiency. −11.93%, and 8.72%, respectively, the relative deviation for all other scenarios ranges from −6.31% to 4.55%. The average absolute relative deviation for predicting CO2 storage efficiency is 2.24%.
According to the curve between the predicted value and the true value, and their relative deviation, the random forest regression algorithm can accurately predict the CO2-WAG production. Therefore, the cumulative oil production, CO2 storage amount, and CO2 storage efficiency can be accurately estimated by this method for the cases of various periods, fluid injection rates, and water-gas ratios.
Moreover, compared to the simulation method, the machine learning-assisted prediction method can save the time of adjusting the CMG model and running data files. It takes about 30 s to run a case of the CMG model and 108 min for all of the 216 cases in this study. The machine learning method employed in this work only spends 10 s predicting all of the scenarios, which shows a big advantage in computational efficiency compared to the CMG simulation method. If the grid of the CMG model is refined, the timesaving advantage of the machine learning method will be much huger. Therefore, the machine learning-assisted method can greatly improve the prediction efficiency of CO2-WAG and will be suitable for injection parameter optimization.   The relative deviation of cumulative oil production, CO 2 storage amount, and CO 2 storage efficiency for each scheme are calculated and shown in Figure 13 for further discussion. The relative deviation of cumulative oil production between prediction and true values ranges from −4.76% to 2.51%, the maximum relative deviation is −4.76%, and the average absolute relative deviation is 1.10%. The maximum relative deviation of CO 2 storage amount between prediction and true values is −15.15%. Except for this, the relative deviation for all other scenarios ranges from −10.67% to 5.23%. The average absolute relative deviation for predicting CO 2 storage amount is 3.04%. For the prediction of CO 2 storage efficiency, except for three scenarios with large relative deviations of −13.35%, −11.93%, and 8.72%, respectively, the relative deviation for all other scenarios ranges from −6.31% to 4.55%. The average absolute relative deviation for predicting CO 2 storage efficiency is 2.24%.

Conclusions
For the application of CO2-WAG used in non-homogeneous, low-permeability reservoirs and the machine learning-assisted prediction method of CO2-WAG, some conclusions can be drawn from this work as follows: (1) Compared to water flooding and continuous CO2 flooding, CO2-WAG can effectively improve oil recovery. In addition, compared to CO2 flooding, CO2-WAG can reduce the CO2 production rate, which is conducive to the storage of CO2 for the reduction of greenhouse gas emissions.
(2) The CO2-WAG cycle time has a slight influence on oil production. Both CO2 storage amount and CO2 storage efficiency decrease with the cycle. On the premise that the reservoir formation is not fractured, the oil production increases but CO2 storage efficiency decreases with the fluid injection rate. For low-pressure reservoirs, the oil production increases with the water-gas ratio, but CO2 storage efficiency decreases with the water-gas ratio.
(3) The random forest regression algorithm in machine learning has better fitting accuracy in predicting the results of CO2-WAG development. Therefore, it can be used to According to the curve between the predicted value and the true value, and their relative deviation, the random forest regression algorithm can accurately predict the CO 2 -WAG production. Therefore, the cumulative oil production, CO 2 storage amount, and CO 2 storage efficiency can be accurately estimated by this method for the cases of various periods, fluid injection rates, and water-gas ratios.
Moreover, compared to the simulation method, the machine learning-assisted prediction method can save the time of adjusting the CMG model and running data files. It takes about 30 s to run a case of the CMG model and 108 min for all of the 216 cases in this study. The machine learning method employed in this work only spends 10 s predicting all of the scenarios, which shows a big advantage in computational efficiency compared to the CMG simulation method. If the grid of the CMG model is refined, the timesaving advantage of the machine learning method will be much huger. Therefore, the machine learning-assisted method can greatly improve the prediction efficiency of CO 2 -WAG and will be suitable for injection parameter optimization.

Conclusions
For the application of CO 2 -WAG used in non-homogeneous, low-permeability reservoirs and the machine learning-assisted prediction method of CO 2 -WAG, some conclusions can be drawn from this work as follows: (1) Compared to water flooding and continuous CO 2 flooding, CO 2 -WAG can effectively improve oil recovery. In addition, compared to CO 2 flooding, CO 2 -WAG can reduce the CO 2 production rate, which is conducive to the storage of CO 2 for the reduction of greenhouse gas emissions.
(2) The CO 2 -WAG cycle time has a slight influence on oil production. Both CO 2 storage amount and CO 2 storage efficiency decrease with the cycle. On the premise that the reservoir formation is not fractured, the oil production increases but CO 2 storage efficiency decreases with the fluid injection rate. For low-pressure reservoirs, the oil production increases with the water-gas ratio, but CO 2 storage efficiency decreases with the watergas ratio.
(3) The random forest regression algorithm in machine learning has better fitting accuracy in predicting the results of CO 2 -WAG development. Therefore, it can be used to predict the oil production and CO 2 storage results under different combinations of injection parameters.
(4) Compared to numerical simulations, using machine learning algorithms to predict results avoids the need to build models and run data files, which will save a lot of time for subsequent parameter optimization.