An automated history matching method integrating geological modeling and numerical simulation proxy models
By constructing geological modeling and numerical simulation proxy models, a priori models covering actual data are generated, which solves the problem of traditional automatic history matching methods relying on the quality of prior models, improves fitting accuracy and stability, and ensures that simulation results are consistent with actual conditions. Data matches.
Patent Information
- Application Number
- CN202411087373.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-09
- Publication Date
- 2024-10-11
- Estimated Expiration
- 2044-08-09
AI Technical Summary
Traditional automatic history matching methods rely on a priori models, and the quality of the prior models determines the fitting effect. When geological understanding is insufficient, it is difficult to find the optimal solution, resulting in simulation results that are inconsistent with actual data and difficult to converge.
By constructing a geological modeling neural network and a numerical simulation surrogate model, using stochastic geological modeling and reservoir numerical simulation methods to form a sample data set, training the geological modeling neural network and numerical simulation surrogate model, and performing perturbation processing to generate a model covering the actual data. A priori model, combined with the ESMDA algorithm for history matching.
The accuracy and stability of automatic history matching are improved, ensuring that the simulation results can cover the actual production curve, providing guarantee for finding the optimal approximate solution.
Smart Images

Figure CN118643746B_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the field of petroleum engineering, and in particular relates to an automatic history matching method integrating geological modeling and numerical simulation proxy model. Background Art
[0002] The history matching method in reservoir engineering adjusts the parameters of the reservoir model to make the model-simulated dynamic data such as production and pressure consistent with the actual oil and water well production dynamic data as much as possible, thereby providing a reliable basis for subsequent measures such as production optimization, production prediction, and mining plan formulation. However, traditional history matching methods usually rely on manual adjustment of parameters, which is time-consuming, easily affected by human factors, and has low efficiency.
[0003] The automatic history matching method uses an optimization algorithm to automatically adjust the model parameters to reduce the error between the simulation results and the actual oil and water well production dynamic data, thereby improving the accuracy and speed of the history matching effect. However, the quality of the prior model determines the effect of automatic history matching. When the geological understanding is insufficient, the generated prior model is often quite different from the actual model, which is manifested in that the production curves simulated using these prior models cannot cover the actual production curves. When the algorithm updates the model parameters, it is difficult to search for possible parameter combinations outside the range of the prior model. The prior model mainly controls the range of changes in the parameters of the history matching model. If the range is unreasonable, it is very likely that the optimal solution will not be found. When using the current automatic history matching algorithm, such as the synchronous perturbation stochastic approximation algorithm (SPSA) or the ensemble smoothing algorithm (ESMDA) of multiple data assimilation, if the production dynamic curve calculated by the prior model cannot cover (wrap) the observed data, when using the SPSA algorithm, it is manifested as inaccurate gradient calculation, resulting in difficulty in convergence; when using the ESMDA algorithm, it is manifested as errors in the correlation of the ensemble estimate, which is difficult to converge and thus difficult to find the optimal solution.
[0004] In order to provide a high-quality prior model, a geological modeling neural network that takes geological constraints into account can be constructed, and the actual oil and water well production dynamic data can be perturbed multiple times. First, the production curve covering the actual oil and water well production dynamic data is obtained, and then the constructed geological modeling neural network is input to generate a high-quality prior model to improve the stability of automatic history fitting. The high-quality prior model is used as the initial set of the optimization algorithm, and the model parameters are iteratively updated. In order to solve the time-consuming problem caused by thousands of numerical simulations, a deep neural network can be used to construct a numerical simulation proxy model to replace the numerical simulation process and improve the efficiency of history fitting. Summary of the invention
[0005] In order to solve the problem that the effect of automatic history fitting method is highly dependent on prior models, the present invention proposes an automatic history fitting method integrating geological modeling and numerical simulation proxy model. First, a large number of geological models, namely prior models, are constructed by applying random geological modeling methods based on seismic, well logging, core and other data. Then, a reservoir numerical simulator is used to perform numerical simulation calculations on all prior models to obtain the production dynamics of oil and water wells corresponding to each model to form a sample data set. Next, a geological modeling neural network model is constructed based on denoised diffusion generative adversarial networks (DDGANs), and the production dynamic data of oil and water wells is used as input, and the corresponding prior model is used as output to train the geological modeling neural network model; at the same time, a numerical simulation proxy model is constructed based on the attention mechanism variant long short-term memory neural network (AMV-LSTM), and the prior model data is used as input, and the corresponding oil and water well production dynamic data is used as output to train the numerical simulation proxy model. Then, under the condition of ensuring the conservation of the oil and water production of each well, the actual production observation data is disturbed to obtain multiple sets of production dynamic data that can cover the observation data; these production dynamic data are input into the trained geological modeling neural network model to construct a geological model set, which is the optimized prior model. Finally, the ESMDA algorithm is combined for automatic history fitting, and the numerical simulation proxy model is used to improve the fitting speed during the iteration process. The present invention is an automatic history fitting method that integrates geological modeling and numerical simulation proxy models, which can improve the accuracy and stability of automatic history fitting.
[0006] The technical solution of the present invention is as follows:
[0007] An automatic history matching method integrating geological modeling and numerical simulation proxy model comprises the following steps:
[0008] Step 1: Obtain geological model data and constraint data at well point locations to establish a sample data set;
[0009] Step 2: construct a numerical simulation proxy model based on the attention mechanism variant long short-term memory neural network, and train the numerical simulation proxy model through a sample data set;
[0010] Step 3: construct a geological modeling neural network model based on the denoising diffusion generative adversarial network, and train the geological modeling neural network model through a sample data set;
[0011] Step 4: Under the condition of ensuring the conservation of the oil and water production of each well, the actual production observation data is disturbed, and the optimized prior model is obtained through the trained geological modeling neural network model;
[0012] Step 5: Use the optimized prior model and the ensemble smoothing algorithm of multiple data assimilation to perform historical fitting.
[0013] Furthermore, the specific process of step 1 is as follows:
[0014] Step 1.1, construct multiple geological models based on seismic, well logging and core data using stochastic geological modeling methods, where the geological model is the prior model;
[0015] Step 1.2, using a reservoir numerical simulator to perform numerical simulation calculations on all prior models, obtaining the oil and water well production dynamic data corresponding to each prior model, and constructing the prior model and its corresponding oil and water well production dynamic data into a model data set;
[0016] Step 1.3, construct the porosity and permeability field data interpreted from well logging and core data into a constraint data set at the well point location;
[0017] Step 1.4: The model data set and the constraint data set at the well point locations together constitute the sample data set.
[0018] Furthermore, in step 2, the numerical simulation agent model includes an attention mechanism layer, a variant long short-term memory neural network unit and an output layer, and the variant long short-term memory neural network unit includes a coupled forget gate, an input gate, a simple forget gate of a long-term cell state, and an output gate, and the updating of the temporal memory is realized by gradually updating the state of the current unit; the specific process of step 2 is:
[0019] Step 2.1, normalize the data of the sample data set;
[0020] The data in the sample data set are divided into an input sample set and an output sample set. The prior model and the constraint data set at the well point position constitute the input sample set, and the oil and water well production dynamic data constitute the output sample set. Suppose the input sample set is , It is Group input samples; is the total number of input sample groups; the output sample set is , It is Group output samples; is the total number of output sample groups, corresponding to Production dynamic data of oil and water wells;
[0021] The normalization method uses the following formula:
[0022] (1);
[0023] in, is the normalized input sample, and are the maximum and minimum values of the input samples respectively;
[0024] Step 2.2: Calculate the attention score and weight, and weight the input data. The calculation formula is as follows:
[0025] (2);
[0026] (3);
[0027] (4);
[0028] in, is the attention score; and are two learnable weight matrices, Mapping input data to hidden layers, Convert the calculation results into scores; is the attention weight; is the tanh activation function; is the current time step, is the input data of the current time step; is the bias vector; for Activation function; Represents element-wise multiplication; is the weighted input data;
[0029] Step 2.3: Update the hidden state through the variant long short-term memory neural network unit. The calculation formula is as follows:
[0030] (5);
[0031] (6);
[0032] (7);
[0033] (8);
[0034] (9);
[0035] (10);
[0036] in, is the previous time step; is the hidden state at the previous time step; , , are the activation values of the forget gate, input gate and output gate at the current time step, respectively. , , They are the weight matrices of the forget gate, input gate, and output gate corresponding to the input data; , , are the weight matrices of the hidden state of the previous time step corresponding to the forget gate, input gate, and output gate; , , They are the bias vectors of the forget gate, input gate, and output gate respectively; Represents the new candidate unit state at the current time step; , are the weight matrices corresponding to the input data and the hidden state of the previous time step respectively; is the bias vector; is the cell state at the current time step; is the hidden state of the current time step; is the Sigmoid activation function; is the cell state at the previous time step;
[0037] Step 2.4, initialize the network parameters, use the permeability field in the sample data set and the corresponding oil and water well production dynamic data to train the network, calculate the error between the predicted parameter value and the actual parameter value, modify the network parameters according to the error, and finally output the trained numerical simulation proxy model; use the mean square error and the coefficient of determination The loss function is used to represent the error between the predicted parameter value and the true parameter value. The calculation formula is as follows:
[0038] (11);
[0039] (12);
[0040] in, Indicates the serial number of the parameter value. Indicates the total number of parameter values; Indicates Prediction parameter values; For the True parameter values; Indicates parameter values, Indicates The predicted value corresponding to the parameter value; Represents the average parameter value, and the specific calculation formula is:
[0041] (13).
[0042] Furthermore, the specific process of step 3 is as follows:
[0043] Step 3.1: The constructed geological modeling neural network model includes a generator, a discriminator and a loss function; the generator Responsible for generating permeability fields based on oil and water well production dynamic data and constraint data at well point locations, discriminator Responsible for distinguishing the generated permeability field from the real permeability field; the calculation formula is as follows:
[0044] (14);
[0045] (15);
[0046] in, is the current time step The generated permeability field, is the current time step The true permeability field of It is the production dynamic data of oil and water wells; is the constraint data at the well point location; It represents the probability of judging it as the real permeability field;
[0047] The training of the geological modeling neural network model is carried out by optimizing the loss functions of the generator and the discriminator at the same time; the loss function expressions of the generator and the discriminator are as follows:
[0048] (16);
[0049] (17);
[0050] in, is the generator loss function; is the mean square error; is random noise that conforms to Gaussian distribution; is a Gaussian distribution; is the discriminator loss function; is the input sample set; is the true permeability field distribution;
[0051] Step 3.2: Train the geological modeling neural network model.
[0052] Furthermore, the specific process of step 3.2 is as follows:
[0053] Step 3.2.1, initialize network weights and training parameters; set the number of training rounds, batch size and the number of batches for each round; use Adam optimizer in both generator and discriminator;
[0054] Step 3.2.2: The generator generates high-quality samples through the denoising step. The process of generating high-quality samples is divided into multiple time steps, each of which contains a denoising step, which is divided into forward diffusion and reverse denoising process. In the forward diffusion process, the original data is gradually Add noise to form a series of intermediate states ,go through The final step of iteration forms completely noisy data. , the process is as follows:
[0055] (8);
[0056] in, Given in the diffusion model hour The probability distribution of is the current time step Input data; The previous time step Input data; is the current time step The amount of noise added; is a normal distribution; is the identity matrix;
[0057] The goal of the inverse denoising process is to transform the completely noisy data into Step by step denoising, restore to the original data , the process is as follows:
[0058] (19);
[0059] in, Given in the denoising model hour The probability distribution of is the mean of the generator predictions; is the current time step The noise variance of
[0060] To train the reverse denoising process, the loss function is defined so that the generator Can learn how to generate , the loss function of the reverse denoising process is:
[0061] (20);
[0062] (twenty one);
[0063] in, At the current time step The loss function of is the total loss function; is the generator at the current time step from The generated forecast values; is the added noise; is the total time step;
[0064] Step 3.2.3: Repeat the training of the network until the preset number of iterations is reached.
[0065] Furthermore, in step 3.2.3, the training process of each iteration is:
[0066] First, randomly select a batch of dynamic data and conditional data As a sample of the real permeability field , and generate a batch of pseudo permeability field samples through the generator :
[0067] (twenty two);
[0068] Secondly, we use the real permeability field samples and pseudo-permeability field samples Train the discriminator, the loss function is as follows:
[0069] (twenty three);
[0070] in, is the discriminator loss value; To sample in the true permeability field distribution; To sample from a Gaussian distribution;
[0071] The discriminator then trains the generator through the geological modeling neural network model, minimizing the generator's loss while outputting the loss of the current time step:
[0072] (twenty four);
[0073] in, is the generator loss value;
[0074] The above training process is executed repeatedly until the preset number of iterations is reached, and the start and end time of the training are recorded; after the training is completed, the trained geological modeling neural network model is output.
[0075] Furthermore, the specific process of step 4 is as follows:
[0076] Step 4.1, the production curve includes the oil production data and water production data of each well; under the condition of ensuring the conservation of the oil and water production injection volume of each well, the actual production observation data is disturbed to obtain multiple sets of production dynamic data that can cover the observation data;
[0077] For each time point, the standard deviation is generated as Gaussian noise; use a one-dimensional Gaussian filter to smooth the generated Gaussian noise and eliminate high-frequency fluctuations; add a trend-keeping term and apply the smoothed disturbance and trend-keeping term to the original data;
[0078] Calculate the production adjustment factor and apply it to the production dynamic data after disturbance; set the number of disturbances, perform cyclic disturbances on the actual production observation data, and the production dynamic data after disturbance constitute the disturbed oil and water well production dynamic data set;
[0079] Step 4.2: Input the obtained disturbed oil and water well production dynamic data set into the trained geological modeling neural network model to obtain a geological model set. The geological model set is an optimized prior model set. The geological model in the optimized prior model set is the optimized prior model.
[0080] Furthermore, the specific process of step 5 is: setting the number of iterations of the set smoothing algorithm to , the initial population set is updated and calculated by multiple small steps, so that the initial production set curve is constantly close to the actual oil and water well production dynamic data. The specific formula of the parameter update equation is:
[0081] (25);
[0082] in, is the updated parameter; is the parameter before updating; is the covariance matrix between model parameters and simulated data; is the model observation data covariance matrix; is the model observation data error covariance matrix; is the observation data; is the observation data error; It is a proxy model for numerical simulation; is the expansion factor, and the formula is:
[0083] (26);
[0084] At the same time, the expansion factor should satisfy:
[0085] (27);
[0086] in, is the number of iterations;
[0087] In each round of iteration, the updated permeability field is obtained through the parameter update equation, and the updated permeability field is input into the numerical simulation proxy model trained in step 2 to predict the oil and water well production dynamic data. The predicted oil and water well production dynamic data is used for the next round of iteration, and the fitted permeability field set is output after the iteration.
[0088] The beneficial technical effects brought about by the present invention are as follows.
[0089] In the automatic history fitting method, the quality of the prior model determines the final fitting effect. If the production curve simulated by the prior model cannot cover the actual production curve, the algorithm will find it difficult to search for possible parameter combinations outside the range of the prior model when updating the model parameters, and it is very likely that the optimal solution will not be found.
[0090] The present invention forms a sample data set through a random geological modeling method and a reservoir numerical simulation method, then constructs a geological modeling neural network model and a numerical simulation proxy model, and uses the sample data set to train the geological modeling neural network and the numerical simulation proxy model; then, under the condition of ensuring the conservation of the oil and water production injection volume of each well, the actual production observation data is disturbed to obtain multiple groups of production dynamic data that can cover the observation data; these production dynamic data are input into the trained geological modeling neural network model to construct a geological model set, which is the optimized prior model. In the present invention, the production curve obtained by simulating the optimized prior model can well cover the actual production curve, providing a guarantee for the automatic history fitting algorithm to find the optimal approximate solution, thereby improving the stability of the automatic history fitting method. BRIEF DESCRIPTION OF THE DRAWINGS
[0091] Figure 1 The present invention provides an overall design flow chart of an automatic history matching method integrating geological modeling and numerical simulation proxy model.
[0092] Figure 2 This is the true permeability field of the oil reservoir and the coordinate information diagram of the oil and water wells of the present invention.
[0093] Figure 3 It is the permeability field diagram of the real model in the embodiment of the present invention.
[0094] Figure 4 This is a permeability field diagram after historical fitting using the original prior model in an embodiment of the present invention.
[0095] Figure 5 This is a permeability field map after historical matching using the constructed prior model in an embodiment of the present invention.
[0096] Figure 6This is a diagram showing the uncovered situation of the initial set of the original prior model in an embodiment of the present invention.
[0097] Figure 7 This is a coverage diagram of the initial set of prior models constructed in an embodiment of the present invention.
[0098] Figure 8 This is a water production fitting curve diagram after the original priori model of production well 2 is fitted in an embodiment of the present invention.
[0099] Fig. 9 This is a water production fitting curve diagram after the prior model fitting is constructed for the production well 2 in the embodiment of the present invention.
[0100] Fig.10 It is a graph of the oil production fitting curve after the original priori model of the production well 2 is fitted in the embodiment of the present invention.
[0101] Fig.11 The oil production fitting curve diagram after the prior model fitting is constructed for the production well 2 in the embodiment of the present invention.
[0102] Fig.12 It is a water production fitting curve diagram after the original priori model of the production well 3 is fitted in the embodiment of the present invention.
[0103] Fig.13 This is a water production fitting curve diagram after the prior model fitting is constructed for the production well 3 in the embodiment of the present invention.
[0104] Fig.14 It is a graph of the oil production fitting curve after the original priori model of the production well 3 is fitted in the embodiment of the present invention.
[0105] Fig.15 The oil production fitting curve diagram after the prior model fitting is constructed for the production well 3 in the embodiment of the present invention.
[0106] Fig.16 This is a curve diagram of the change of the determination coefficient during the training of the geological modeling neural network model in an embodiment of the present invention. DETAILED DESCRIPTION
[0107] The present invention is further described in detail below with reference to the accompanying drawings and specific embodiments:
[0108] like Figure 1 As shown, an automatic history matching method integrating geological modeling and numerical simulation proxy model includes the following steps:
[0109] Step 1: Obtain geological model data and constraint data at well locations to establish a sample data set.
[0110] In the process of geological modeling, it is necessary to model based on the actual logging information. Therefore, the present invention uses the logging data as the constraint data at the well point location when studying the geological modeling method considering geological constraints. The specific process of step 1 is:
[0111] Step 1.1: Based on seismic, well logging, core and other data, a large number of geological models are constructed using random geological modeling methods. These geological models are the prior models used in the automatic history fitting method.
[0112] Step 1.2: Use a reservoir numerical simulator to perform numerical simulation calculations on all prior models, obtain the oil and water well production dynamic data corresponding to each prior model, and construct the prior model and its corresponding oil and water well production dynamic data into a model data set.
[0113] Step 1.3, the porosity and permeability field data interpreted from logging and core data are constructed as a constraint data set at the well point location;
[0114] Step 1.4: The model data set and the constraint data set at the well point locations together constitute the sample data set.
[0115] Step 2: Build a numerical simulation proxy model based on the attention mechanism variant long short-term memory neural network (AMV-LSTM), and train the numerical simulation proxy model through the sample data set; the specific process is as follows:
[0116] The numerical simulation agent model built based on AMV-LSTM consists of an attention mechanism layer, a variant LSTM unit and an output layer. The variant LSTM unit contains a coupled forget gate, an input gate, a simple forget gate for long-term cell states, and an output gate. The update of temporal memory is achieved by gradually updating the state of the current unit.
[0117] Step 2.1, normalize the data of the sample data set; data normalization can eliminate the impact of the dimensions of different influencing factors on prediction accuracy, and can improve the accuracy of the neural network prediction model.
[0118] The data in the sample data set is divided into an input sample set and an output sample set. The prior model and the constraint data set at the well point location constitute the input sample set, and the oil and water well production dynamic data constitute the output sample set. Suppose the input sample set is , It is Group input samples, is the total number of input sample groups; the output sample set is , It is Group output samples, is the total number of output sample groups, corresponding to The production dynamic data of oil and water wells, It is A group of output samples; the prior model in a group of input samples is a geological model, which includes parameters such as permeability, and a group of output samples only includes the production dynamic data of oil and water wells;
[0119] Since the size and dimension differences between different input parameters will affect the convergence speed of the network, the input sample set needs to be normalized before training so that the data differences of the input sample set fall within a small range. The last layer uses the sigmoid activation function to obtain the discrimination probability and normalize the input sample set. The normalization method uses the following formula:
[0120] (1);
[0121] in, is the normalized input sample, and are the maximum and minimum values of the input samples respectively;
[0122] Step 2.2: Calculate the attention score and weight, and weight the input data. The calculation formula is as follows:
[0123] (2);
[0124] (3);
[0125] (4);
[0126] in, is the attention score, which measures the importance of each part of the input data; and are two learnable weight matrices, Mapping input data to hidden layers, Convert the calculation results into scores; is the tanh activation function; is the current time step, is the input data of the current time step; is the bias vector; Activation Function Score the attention Convert to attention weight , whose sum is 1; Represents element-by-element multiplication, applying weights to input data The weighted input data is obtained , used in subsequent variant LSTM units.
[0127] Step 2.3: Update the hidden state through the variant LSTM unit. The calculation formula is as follows:
[0128] (5);
[0129] (6);
[0130] (7);
[0131] (8);
[0132] (9);
[0133] (10);
[0134] in, is the previous time step; is the hidden state at the previous time step; , , are the activation values of the forget gate, input gate and output gate at the current time step, respectively. , , They are the weight matrices of the forget gate, input gate, and output gate corresponding to the input data; , , are the weight matrices of the hidden state of the previous time step corresponding to the forget gate, input gate, and output gate; , , They are the bias vectors of the forget gate, input gate, and output gate respectively; Represents the new candidate unit state at the current time step; , are the weight matrices corresponding to the input data and the hidden state of the previous time step respectively; is the bias vector. The forget gate and the input gate are coupled by formula (10) to calculate the new candidate unit state at the current time step. , and then update the unit state of the current time step through formula (11) , combined with the unit state of the current time step through formula (13) and the output gate activation value of the current time step Update the hidden state at the current time step . is the Sigmoid activation function; is the cell state at the previous time step;
[0135] Step 2.4, initialize the network parameters, use the permeability field in the sample data set and the corresponding oil and water well production dynamic data to train the network, calculate the error between the predicted parameter value and the actual parameter value, and modify the network parameters according to the obtained error. and the coefficient of determination The loss function is used to represent the error between the predicted parameter value and the true parameter value. The calculation formula is as follows:
[0136] (11);
[0137] (12);
[0138] in, Indicates the serial number of the parameter value. Indicates the total number of parameter values; Indicates Prediction parameter values; For the True parameter values; Indicates parameter values, Indicates The predicted value corresponding to the parameter value; Represents the average parameter value, and the specific calculation formula is:
[0139] (13);
[0140] Observe the loss function and compare the error with the expected accuracy set manually. The closer it is to 0, the higher the coefficient of determination The closer it is to 1, the better the model training is, and the trained numerical simulation proxy model is output.
[0141] Step 3: Build a geological modeling neural network model based on denoising diffusion generative adversarial networks (DDGANs), consider geological constraints when building the model, and train the geological modeling neural network model through sample data sets; the specific process is as follows:
[0142] Step 3.1, the geological modeling neural network model constructed based on denoising diffusion generative adversarial network (DDGANs) mainly includes generator, discriminator and loss function;
[0143] Generator Responsible for generating permeability fields based on oil and water well production dynamic data and constraint data at well point locations, discriminator Responsible for distinguishing the generated permeability field from the real permeability field. The calculation formula is as follows:
[0144] (14);
[0145] (15);
[0146] Generator Accepting input data including oil and water well production performance data and constraint data at well point locations, a permeability field is generated by formula (14);
[0147] in, is the current time step The generated permeability field, is the current time step The true permeability field of It is the production dynamic data of oil and water wells; is the constraint data at the well point location; Represents the probability of judging it to be a true permeability field; discriminator Takes in a generated permeability field and a real permeability field and outputs whether they are real or generated.
[0148] The training of the DDGANs geological modeling neural network model is performed by optimizing the loss functions of the generator and the discriminator simultaneously. The goal of the generator is to minimize the difference between the generated permeability field and the true permeability field, while the goal of the discriminator is to maximize the ability to distinguish between the generated permeability field and the true permeability field. The loss function expressions of the generator and the discriminator are as follows:
[0149] (16);
[0150] (17);
[0151] in, is the generator loss function; is the mean square error; is random noise that conforms to Gaussian distribution; is a Gaussian distribution; is the discriminator loss function; is the input sample set; is the true permeability field distribution;
[0152] Step 3.2: Train the geological modeling neural network model based on DDGANs; the specific steps are as follows:
[0153] Step 3.2.1, initialize network weights and training parameters;
[0154] Set the number of training rounds (epochs), batch size (batch size) and the number of batches per epoch; each epoch represents a complete traversal of the training data set, and the batch size determines the number of data samples used in each training. and batch size Calculate the number of batches per epoch , Adam optimizer is used in both generator and discriminator.
[0155] Step 3.2.2, the generator generates high-quality samples through the denoising step;
[0156] The process of generating high-quality samples is divided into multiple time steps, each of which contains a denoising step, which is divided into forward diffusion and reverse denoising process. Add noise to form a series of intermediate states ,go through The final step of iteration forms completely noisy data. , this process is expressed by the following formula:
[0157] (18);
[0158] in, Given in the diffusion model hour The probability distribution of is the current time step Input data; The previous time step Input data; is the current time step The amount of noise added; is a normal distribution; is the identity matrix.
[0159] The goal of the inverse denoising process is to transform the completely noisy data into Step by step denoising, restore to the original data . This process is expressed by the following formula:
[0160] (19);
[0161] in, Given in the denoising model hour The probability distribution of is the mean of the generator predictions, is the current time step The noise variance.
[0162] To train the reverse denoising process, the loss function is defined so that the generator Be able to learn how to generate The loss function of the reverse denoising process is:
[0163] (20);
[0164] (twenty one);
[0165] in, At the current time step The loss function of is the total loss function; is the generator at the current time step from The generated forecast values; is the added noise; is the total time step. The total loss function is the sum of the losses of all time steps, that is, formula (21). Through the above generation steps, the generator can gradually generate high-quality permeability fields from noise.
[0166] Step 3.2.3, loop training the network until the preset number of iterations is reached;
[0167] The training process for each iteration is:
[0168] First, randomly select a batch of dynamic data and conditional data As a sample of the real permeability field , and generate a batch of pseudo permeability field samples through the generator :
[0169] (twenty two);
[0170] Secondly, we use the real permeability field samples and pseudo-permeability field samples Train the discriminator, the loss function includes real sample loss and fake sample loss:
[0171] (twenty three);
[0172] in, is the discriminator loss value; To sample in the true permeability field distribution; To sample from a Gaussian distribution;
[0173] The discriminator is a convolutional neural network that distinguishes between real and generated images. The input includes dynamic data , target image and conditional data The output is a scalar , represents the authenticity probability of the input image.
[0174] Then, the generator is trained through the DDGANs model to minimize the generator's loss and output the loss of the current time step:
[0175] (twenty four);
[0176] in, is the generator loss value;
[0177] DDGANs combines the generator and the discriminator to form a generative adversarial network. In this step, the weights of the discriminator are frozen so that only the weights of the generator are updated during the training process. After each step of training, the loss values of the discriminator and the generator are output. and , monitor the model performance during training.
[0178] Finally, the above training process is executed repeatedly until the preset number of iterations is reached, and the start and end time of the training is recorded to evaluate the efficiency of the training process. After the training is completed, the trained geological modeling neural network model is output.
[0179] Step 4: Under the condition of ensuring the conservation of oil and water production in each well, the actual production observation data is disturbed and the optimized prior model is obtained through the trained geological modeling neural network model.
[0180] The fitting effect of the traditional automatic history fitting method depends on the quality of the prior model. When the geological understanding is insufficient, the generated prior model is often quite different from the actual model, which is manifested in that the production curves simulated using these prior models cannot cover the actual production curves, and the true solution is outside the prior range, making it difficult to find the optimal approximate solution. Therefore, it is very important to construct a batch of high-quality prior models that conform to geological understanding.
[0181] Step 4.1: The production curve includes the oil production data and water production data of each well. Under the condition of ensuring the conservation of oil and water production of each well, the actual production observation data is disturbed to obtain multiple sets of production dynamic data that can cover the observation data.
[0182] For each time point, the standard deviation is generated as The Gaussian noise generated by the disturbance is removed; a one-dimensional Gaussian filter is used to smooth the generated Gaussian noise and eliminate high-frequency fluctuations; a trend-keeping item is added, and the smoothed disturbance and trend-keeping item are applied to the original data. The trend-keeping item ensures that the long-term trend of the data will not be lost due to disturbances; the range of the data after disturbance is limited according to the actual production observation data to avoid values that deviate from the actual value, such as negative values.
[0183] Calculate the production adjustment factor and apply it to the production dynamic data after disturbance to ensure the conservation of oil and water production injection of each well after disturbance. Set the number of disturbances, and perform disturbances on the actual production observation data according to the above steps. The production dynamic data after disturbance constitutes the disturbed oil and water well production dynamic data set.
[0184] Step 4.2: Input the obtained disturbed oil and water well production dynamic data set into the trained geological modeling neural network model to obtain a geological model set. The geological model set is an optimized prior model set. The geological model in the optimized prior model set is the optimized prior model.
[0185] Step 5: Use the optimized prior model and the ensemble smoothing algorithm (ESMDA) of multiple data assimilation to perform historical fitting.
[0186] The ensemble smoothing algorithm for multiple data assimilation (ESMDA) studies the distribution of data in the temporal and spatial dimensions, combines observation errors and model errors, and achieves optimization solutions by absorbing new actual observation data in the calculation process of the optimization model.
[0187] Use the ESMDA optimization algorithm and set the number of iterations of the ensemble smoothing algorithm to , the initial population set is updated and calculated by multiple small steps, so that the initial production set curve is constantly close to the actual oil and water well production dynamic data. The specific formula of the parameter update equation is:
[0188] (25);
[0189] in, is the updated parameter; is the parameter before updating; is the covariance matrix between model parameters and simulated data; is the model observation data covariance matrix; is the model observation data error covariance matrix; is the expansion factor; is the observation data; is the observation data error; It is a numerical simulation proxy model. Considering that the expansion factor can make the algorithm more stable in iterative operations, the present invention adopts the setting of the expansion factor in the standard ESMDA, namely:
[0190] (26);
[0191] At the same time, the expansion factor should satisfy:
[0192] (27);
[0193] in, It is the number of iterations; Usually 4 to 10.
[0194] In each round of iteration, the updated permeability field is obtained through the parameter update equation, and the updated permeability field is input into the numerical simulation proxy model trained in step 2 to predict the oil and water well production dynamic data. The predicted oil and water well production dynamic data is used for the next round of iteration, and the fitted permeability field set is output after the iteration.
[0195] In order to demonstrate the feasibility and superiority of the present invention, the following examples are given.
[0196] This example verifies the proposed method, conducts subsequent analysis and discussion, and then performs geological modeling according to the following steps. This example uses a two-dimensional reservoir model with a model grid system of 60 60 1. The parameters that need to be inverted for history matching mainly include the x-direction permeability field of each grid, a total of 3600, the true permeability field of the reservoir and the coordinate information of the oil and water wells, such as Figure 2 As shown in Figure 1, the model contains 9 production wells numbered 1-9 and 4 water injection wells numbered 1-4. The production time is 1500 days, divided into 50 time steps. The production dynamic data that need to be historically matched include the oil production rate (WOPR) and water production rate (WWPR) of the production wells. The permeability field of the real model is as follows: Figure 3 As shown in the figure, the original prior model and the constructed prior model are used for historical fitting respectively. The comparison results of the permeability field after the original prior model is fitted and the permeability field after the constructed prior model is fitted are shown in Figure 4 and Figure 5 shown.
[0197] Step 1, establish a sample data set. The permeability field samples and the corresponding oil and water well production dynamic data in the sample data set are constructed into 1000 samples according to the method mentioned in step 1 of the specific implementation method, and the constraint data at the well point location is constructed by performing Latin hypercube sampling on the reference permeability field and the permeability values at 24 grids;
[0198] Step 2: Construct and train the numerical simulation proxy model through AMV-LSTM. First, construct the structure of the AMV-LSTM network through programming, and use the permeability field in the sample data set and the corresponding oil and water well production dynamic data as the input and output parameters of AMV-LSTM respectively. Through this process, the training of the numerical simulation proxy model is completed;
[0199] Step 3: Construct and train the geological modeling neural network through DDGANs. First, the structure of the DDGANs network is constructed through programming, and the interface structure for inputting the constraint data at the well point location into the network is designed. The oil and water well production dynamic data in the sample database, the constraint data at the well point location (i.e., logging permeability) and the permeability field are used as the input and output parameters of DDGANs respectively. Through this process, the training of the geological modeling neural network is completed;
[0200] Step 4: Perturb the actual production curve 100 times to obtain 100 perturbed production curves covering the actual production curve, and obtain 100 permeability fields as the prior model through the trained DDGANs geological modeling neural network;
[0201] Step 5. Finally, the original prior model is compared with the constructed prior model, and the parameters are iteratively updated in combination with the ESMDA algorithm to complete automatic history fitting.
[0202] Figure 6 It is shown that when the original prior model is used for historical matching, the production dynamic data simulated by the initial prior model cannot cover the actual observed production dynamic data. Figure 7 It shows that when constructing a priori model for historical matching, the production dynamic data simulated by the initial priori model can well cover the actual observed production dynamic data. Figure 6 and Figure 7 It can be seen that the constructed prior model is of higher quality than the original prior model.
[0203] Figure 8-Figure 15 The figure shows a comparison of the water production and oil production fitting curves of the original prior model of production wells 2 and 3 and the constructed prior model after fitting. The production dynamic data simulated by the model after fitting in the figure is the production dynamic data after numerical simulation of the optimal model obtained by solving the optimization algorithm, and the actual observed production dynamic data in the figure is the real production dynamic data actually observed. Figure 8 and Fig. 9 Comparison of the water production fitting curves of the original prior model of production well 2 and after fitting the constructed prior model. Fig.10 and Fig.11 The oil production fitting curves of the original prior model of production well 2 and the one after fitting the constructed prior model are compared. Figure 8-Figure 11It can be seen that in terms of water production and oil production of production well 2, the fitting effect of the original prior model on the actual observation curve is not good, while the fitting accuracy of the actual observation curve is significantly improved by using the optimized prior model. Fig.12 and Fig.13 Comparison of the water production fitting curves of the original priori model of production well 3 and after fitting the constructed priori model. Fig.14 and Fig.15 The oil production fitting curves of the original prior model of production well 3 and the constructed prior model are compared. Figure 12-Figure 15 It can be seen that, no matter in the water production or oil production of production well 3, the fitting effect of the original prior model on the actual observation curve is not good, while the fitting accuracy of the actual observation curve is significantly improved by using the optimized prior model. This effectively verifies that the method of the present invention can improve the stability of the history fitting method. Fig.16 The variation curve of the determination coefficient (R2) of the geological modeling neural network model during training is shown. It can be seen that both the training set and the test set can eventually approach 1, indicating that the effect of model training is very good and has high prediction accuracy and reliability.
[0204] Of course, the above description is not a limitation of the present invention, and the present invention is not limited to the above examples. Changes, modifications, additions or substitutions made by technicians in this technical field within the essential scope of the present invention should also fall within the protection scope of the present invention.
Claims
1. An automatic history fitting method integrating geological modeling and numerical simulation proxy models, It is characterized in that The steps include: Step 1: Obtain geological model data and constraint data at well point locations to establish a sample data set; Step 2: construct a numerical simulation proxy model based on the attention mechanism variant long short-term memory neural network, and train the numerical simulation proxy model through a sample data set; In step 2, the numerical simulation agent model includes an attention mechanism layer, a variant long short-term memory neural network unit and an output layer. The variant long short-term memory neural network unit includes a coupled forget gate, an input gate, a simple forget gate of a long-term cell state, and an output gate. The updating of the temporal memory is realized by gradually updating the state of the current unit. The specific process of step 2 is: Step 2.1, normalize the data of the sample data set; The data in the sample data set are divided into an input sample set and an output sample set. The prior model and the constraint data set at the well point position constitute the input sample set, and the oil and water well production dynamic data constitute the output sample set. Suppose the input sample set is X = {x 1 ,x 2 ,…,x k ,…,x n }, x k is the kth group of input samples; n is the total number of input sample groups; the output sample set is Y = {y 1 ,y 2 ,…,y u ,…,y N },y u is the u-th group of output samples; N is the total number of output sample groups, corresponding to N oil and water well production dynamic data; The normalization method uses the following formula: Among them, x norm is the normalized input sample, x max and x min are the maximum and minimum values of the input samples respectively; Step 2.2: Calculate the attention score and weight, and weight the input data. The calculation formula is as follows: a t =V a ·tanh(W ax ·x t +b a ) (2); p t =Softmax(a t ) (3); Among them, a t is the attention score; V a and W ax are two learnable weight matrices, W ax Map the input data to the hidden layer, V a Convert the calculation result into a score; t is the attention weight; tanh(·) is the tanh activation function; t is the current time step, x t is the input data of the current time step; b a is the bias vector; Softmax(·) is the Softmax activation function; ⊙ represents element-by-element multiplication; is the weighted input data; Step 2.3: Update the hidden state through the variant long short-term memory neural network unit. The calculation formula is as follows: h t =o t ⊙tanh(c t ) (10); Among them, t-1 is the previous time step; h t-1 is the hidden state of the previous time step; f t 、i t , o t are the activation values of the forget gate, input gate and output gate at the current time step, respectively, xf , W xi , W xo are the weight matrices of the forget gate, input gate, and output gate corresponding to the input data; W hf , W hi , W ho are the weight matrices of the hidden state of the previous time step corresponding to the forget gate, input gate, and output gate; b f , b i , b o They are the bias vectors of the forget gate, input gate, and output gate respectively; Represents the new candidate unit state at the current time step; W xc , W hc are the weight matrices corresponding to the input data and the hidden state of the previous time step respectively; b c is the bias vector; c t is the unit state of the current time step; h t is the hidden state of the current time step; σ(·) is the Sigmoid activation function; c t-1 is the cell state at the previous time step; Step 2.4, initialize the network parameters, use the permeability field in the sample data set and the corresponding oil and water well production dynamic data to train the network, calculate the error between the predicted parameter value and the actual parameter value, modify the network parameters according to the error, and finally output the trained numerical simulation proxy model; use the mean square error E and determination coefficient R 2 The loss function is used to represent the error between the predicted parameter value and the true parameter value. The calculation formula is as follows: Where g represents the serial number of the parameter value, and G represents the total number of parameter values; g represents the g-th prediction parameter value; z g is the gth true parameter value; y i represents the i-th parameter value, f i Represents the predicted value corresponding to the i-th parameter value; Represents the average parameter value, and the specific calculation formula is: Step 3: Construct a geological modeling neural network model based on the denoising diffusion generative adversarial network, and train the geological modeling neural network model through the sample data set; the specific process is as follows: Step 3.1, the constructed geological modeling neural network model includes a generator, a discriminator and a loss function; the generator G is responsible for generating the permeability field according to the production dynamic data of oil and water wells and the constraint data at the well point location, and the discriminator D is responsible for distinguishing the generated permeability field from the real permeability field; the calculation formula is as follows: in, is the permeability field generated at the current time step t, X t is the true permeability field at the current time step t; S is the production dynamic data of oil and water wells; C is the constraint data at the well point location; J represents the probability of being determined as the true permeability field; The training of the geological modeling neural network model is carried out by optimizing the loss functions of the generator and the discriminator at the same time; the loss function expressions of the generator and the discriminator are as follows: Among them, L G is the generator loss function; E is the mean square error; Z is the random noise that conforms to the Gaussian distribution; p Z (z) is Gaussian distribution; L D is the discriminator loss function; X is the input sample set; p real (x) is the real permeability field distribution; Step 3.2, training the geological modeling neural network model; Step 4: Under the condition of ensuring the conservation of the oil and water production of each well, the actual production observation data is disturbed, and the optimized prior model is obtained through the trained geological modeling neural network model; Step 5: Use the optimized prior model and the ensemble smoothing algorithm of multiple data assimilation to perform historical fitting.
2. The automatic history fitting method of integrating geological modeling and numerical simulation proxy model according to claim 1, It is characterized in that The specific process of step 1 is as follows: Step 1.1, construct multiple geological models based on seismic, well logging and core data using stochastic geological modeling methods, where the geological model is the prior model; Step 1.2, using a reservoir numerical simulator to perform numerical simulation calculations on all prior models, obtaining the oil and water well production dynamic data corresponding to each prior model, and constructing the prior model and its corresponding oil and water well production dynamic data into a model data set; Step 1.3, construct the porosity and permeability field data interpreted from well logging and core data into a constraint data set at the well point location; Step 1.4: The model data set and the constraint data set at the well point locations together constitute the sample data set.
3. The automatic history matching method of integrating geological modeling and numerical simulation proxy model according to claim 1, It is characterized in that The specific process of step 3.2 is as follows: Step 3.2.1, initialize network weights and training parameters; set the number of training rounds, batch size and the number of batches for each round; use Adam optimizer in both generator and discriminator; Step 3.2.2: The generator generates high-quality samples through the denoising step. The process of generating high-quality samples is divided into multiple time steps, each of which contains a denoising step, which is divided into forward diffusion and reverse denoising process. In the forward diffusion process, the original data x is gradually 0 Add noise to form a series of intermediate states go through The final step of iteration forms completely noisy data. The process is as follows: Among them, q(x t |x t-1 ) is the given x in the diffusion model t-1 Time t The probability distribution of x t is the input data of the current time step t; x t-1 is the input data of the previous time step t-1; β t is the amount of noise added at the current time step t; is a normal distribution; I is the unit matrix; The goal of the inverse denoising process is to transform the completely noisy data into Step by step, denoising is performed to restore the original data x 0 , the process is as follows: Among them, p θ (x t |x t-1 ) is the given x in the denoising model t-1 Time t The probability distribution of θ (·) is the mean of the generator predictions; is the noise variance at the current time step t; In order to train the reverse denoising process, the loss function is defined so that the generator G can learn how to get from x t Generate x t-1 , the loss function of the reverse denoising process is: Among them, L t is the loss function at the current time step t; L is the total loss function; G(x t ,t) is the generator at the current time step t from x t The generated prediction value; ε is the added noise; is the total time step; Step 3.2.3: Repeat the training of the network until the preset number of iterations is reached.
4. The automatic history fitting method of integrating geological modeling and numerical simulation proxy model according to claim 3, It is characterized in that In step 3.2.3, the training process of each iteration is: First, randomly select a batch of dynamic data X d and conditional data X c As the real permeability field sample X r , and generate a batch of pseudo permeability field samples X through the generator g ′: X g ′=G(X d ,X c ,t) (22); Secondly, use the real permeability field sample X r and the pseudo permeability field sample X g 'Train the discriminator, the loss function is as follows: Among them, L D is the discriminator loss value; p data (X) is the sampling in the real permeability field distribution; p G (X) is sampling in Gaussian distribution; The discriminator then trains the generator through the geological modeling neural network model, minimizing the generator's loss while outputting the loss of the current time step: Among them, L G is the generator loss value; The above training process is executed repeatedly until the preset number of iterations is reached, and the start and end time of the training are recorded; after the training is completed, the trained geological modeling neural network model is output.
5. The automatic history matching method of integrating geological modeling and numerical simulation proxy model according to claim 4, It is characterized in that The specific process of step 4 is as follows: Step 4.1, the production curve includes the oil production data and water production data of each well; under the condition of ensuring the conservation of the oil and water production injection volume of each well, the actual production observation data is disturbed to obtain multiple sets of production dynamic data that can cover the observation data; For each time point, generate Gaussian noise with standard deviation σ; Use a one-dimensional Gaussian filter to smooth the generated Gaussian noise and eliminate high-frequency fluctuations; add a trend-keeping term and apply the smoothed disturbance and trend-keeping term to the original data; Calculate the production adjustment factor and apply it to the production dynamic data after the disturbance; Set the number of disturbances to perform cyclic disturbances on the actual production observation data, and the production dynamic data after disturbance constitutes the disturbed oil and water well production dynamic data set; Step 4.2: Input the obtained disturbed oil and water well production dynamic data set into the trained geological modeling neural network model to obtain a geological model set. The geological model set is an optimized prior model set. The geological model in the optimized prior model set is the optimized prior model.
6. The automatic history matching method for integrating geological modeling and numerical simulation proxy model according to claim 5, It is characterized in that The specific process of step 5 is: set the number of iterations of the set smoothing algorithm to N α , the initial population set is updated and calculated by multiple small steps, so that the initial production set curve is constantly close to the actual oil and water well production dynamic data. The specific formula of the parameter update equation is: in, is the updated parameter; is the parameter before updating; is the covariance matrix between model parameters and simulated data; is the covariance matrix of the model observation data; C D is the model observation data error covariance matrix; d obs is the observed data; ε j is the observation data error; It is a proxy model for numerical simulation; is the expansion factor, and the formula is: At the same time, the expansion factor should satisfy: in, is the number of iterations; In each round of iteration, the updated permeability field is obtained through the parameter update equation, and the updated permeability field is input into the numerical simulation proxy model trained in step 2 to predict the oil and water well production dynamic data. The predicted oil and water well production dynamic data is used for the next round of iteration, and the fitted permeability field set is output after the iteration.
