A method for constructing physically constrained reservoir proxy models using coupled numerical simulators
By coupling a numerical simulator and the RU-Net neural network to construct a reservoir proxy model, and using mass residuals and Jacobian matrices to optimize the training process, the problems of high computational complexity and insufficient adaptability in existing technologies are solved, achieving efficient and accurate reservoir simulation.
Patent Information
- Application Number
- CN202510602757.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-12
- Publication Date
- 2025-09-19
- Estimated Expiration
- 2045-05-12
AI Technical Summary
Existing technologies have high computational complexity and difficulty in implementing physically constrained reservoir simulation proxy models, and are not adaptable enough to complex reservoir models, which limits their application in actual oil and gas field development.
A coupled numerical simulator is used to construct a physically constrained reservoir proxy model. The physical losses are calculated by fusing the mass residuals generated by the discrete difference process and the Jacobian matrix as constraints. The training process of the proxy model is optimized, and the RU-Net neural network is combined with the long short-term memory network to capture the spatial and temporal characteristics of the reservoir state.
It effectively reduces computational complexity, improves adaptability to complex reservoir models, reduces the need for training sample size, and improves prediction accuracy and computational efficiency.
Smart Images

Figure CN120124497B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of intelligent oil and gas field exploitation, and in particular to a method for constructing a physically constrained reservoir proxy model through coupling a numerical simulator. Background Art
[0002] Traditional reservoir simulation proxy model construction faces challenges such as high data acquisition costs, limited computing resources, and a lack of physical meaning in proxy model outputs. Existing approaches aim to reduce reliance on training data and enhance the physical consistency of proxy models. One approach is physics-informed neural networks (PINNs). By directly embedding physical constraints (such as partial differential equations) into the network structure, PINNs can construct physically consistent proxy models without requiring extensive training data. However, when dealing with complex real-world problems, PINNs are computationally complex, costly, and challenging to implement, as their loss function requires numerical solutions to partial differential equations. Another approach is theory-guided neural networks (TGNNs). This approach incorporates physical rules into the proxy model training process, combining physical and label losses. This approach improves the physical consistency and reliability of the proxy model while ensuring its accurate fit to the data.
[0003] Currently, building physically meaningful proxy models for reservoir simulation faces a common challenge: For each complex reservoir flow problem, constructing a physically constrained proxy model requires developing complex governing equations and implementing a challenging solution process to constrain the proxy model training. While this approach is theoretically feasible, it is generally difficult to scale in practice, especially for complex reservoir models, due to the complexity of the physical principles and computational difficulty. Current research focuses primarily on developing governing equations for simple problems, failing to fully leverage the advantages of numerical simulators, resulting in limited applicability to complex reservoir systems.
[0004] In summary, existing technical solutions generally have problems such as high computational complexity, difficulty in implementation, and insufficient adaptability to complex reservoir models when constructing physically constrained reservoir simulation proxy models. These defects limit the widespread application of physically constrained reservoir proxy models in actual oil and gas field development. Therefore, a more efficient and practical solution is urgently needed. Summary of the Invention
[0005] In order to solve the problems of high computational complexity, difficulty in embedding physical equations, and insufficient adaptability to complex reservoir models in existing reservoir simulation proxy model construction methods, the present invention discloses a method for constructing a physically constrained reservoir proxy model by coupling a numerical simulator. This method integrates the mass residual generated by the discrete difference process and the physical loss calculated by the Jacobian matrix as constraints in the proxy model training to optimize the proxy model training process.
[0006] To achieve the above object, the present invention adopts the following technical solutions:
[0007] A method for constructing a physically constrained reservoir proxy model by coupling a numerical simulator comprises the following steps:
[0008] S1. Establishing a reservoir model: Using a numerical simulator, a three-dimensional oil-water two-phase flow model is constructed. The governing equations are implicitly discretized in space and time and solved using the finite volume method.
[0009] S2, randomly perturb the injection and production parameters to generate an injection and production parameter data set;
[0010] S3. Input the injection-production parameter data set generated in step S2 into the reservoir model for simulation to obtain corresponding reservoir state parameters. The injection-production parameters and state parameters constitute a training data set, i.e., label data;
[0011] S4. Build the RU-Net neural network as a proxy model, including an input layer, an encoding module, a timing module, a decoding module, and an output layer. The encoding module extracts spatial features by downsampling through convolution operations. The timing module uses a long short-term memory network to capture temporal dependencies. The decoding module restores spatial dimensions through upsampling. The input layer receives the permeability field and the injection and production parameter field. The output layer couples and predicts the pressure field and saturation field.
[0012] S5, coupled numerical simulator to calculate mixing losses;
[0013] S6. Use mixed loss back propagation to update the proxy model network parameters and complete the training of the proxy model.
[0014] Optionally, in step S1, the control equation is:
[0015] ;
[0016] Where x, y, and z represent three-dimensional space coordinates, and the subscript l represents the fluid. represents the phase density, represents phase viscosity, k represents absolute permeability, represents relative permeability, p represents pressure, represents the phase saturation, represents the porosity, represents the flow rate of the first-phase fluid in the injection or production well, calculated using the Peaceman equation: ,in, represents the thickness of the grid, represents the effective radius of the well, represents the absolute permeability at the well location, represents the actual radius of the well, Indicates bottom hole pressure;
[0017] The control equation is simplified to:
[0018] ;
[0019] Where g represents the mass residual, A, F, and Q represent the accumulating phase, mobile phase, and source-sink phase, respectively; and Represent the reservoir status at time n+1 and time n, including the distribution of saturation and pressure; represents the injection and production parameters at time n+1. The numerical simulator can efficiently calculate the mass residual g based on the static reservoir model parameters, dynamic reservoir state parameters and injection and production parameters of the reservoir.
[0020] Optionally, in step S2, for different problem disturbance variable parameters, taking the agent model for production optimization as an example, the injection and production parameters of the time series are randomly disturbed to obtain different injection and production parameter data sets.
[0021] Optionally, in step S3, the injection and production parameters generated by the random perturbation in step S2 are input into the reservoir model. Simulations are then performed to obtain reservoir state parameters (distributions of the pressure field and water saturation field) under different injection and production parameters. A set of injection and production parameters corresponds to a set of state parameters, which together constitute the training dataset, or labeled data. The input features selected are the permeability distribution and the injection and production parameters set using a sparse matrix. During the injection and production parameter setting process, a sparse matrix is used, with positive well control values set for grids containing injection wells and negative well control values set for grids containing production wells. The predicted results are the state distributions of pressure and water saturation at different time steps under different injection and production parameters. Water saturation and pressure are selected as the state parameters. Because oil saturation can be derived from water saturation for a two-phase problem, all subsequent saturations refer to water saturation unless otherwise specified.
[0022] Optionally, in step S4, a corresponding RU-Net neural network is designed and constructed as a proxy model based on the training dataset generated in step S3. The proxy model utilizes a convolutional neural network (CNN) module to extract and process spatial feature information of the reservoir state; a long short-term memory (LSTM) module captures the temporal dependencies between injection and production parameters and state parameters; and a combination of the CNN and LSTM modules enables cyclical and continuous prediction of reservoir state under varying injection and production parameters. The proxy model is constructed using a coupled pressure and water saturation field solution strategy, reducing computational complexity through shared features and laying the foundation for subsequent coupled numerical simulation training.
[0023] In the input layer, the permeability field and injection-production parameter field, which are key to time-varying well-controlled reservoir state prediction, are selected as the main input features. In the injection-production parameter processing, a sparse matrix is used to assign positive injection parameters to locations containing production wells and negative injection-production parameters to locations containing production wells.
[0024] The encoding module uses convolution operation to downsample the input features, and compresses the spatial dimension through the convolution kernel with stride, thereby extracting more advanced feature representations and reducing the amount of calculation. C represents the number of input feature channels, H and D represent the height and width respectively, then the input feature , the convolution kernel is ,in, and represents the spatial size of the convolution kernel, Indicates the number of output channels, the output feature map at this time , and is the height and width after convolution, and the convolution operation process is:
[0025] ;
[0026] Where i, j and are the indices of the output feature map in height, width and channel respectively, Indicates that the output feature is The value at channel, i, j, is the bias term, s represents the stride, Indicates that the convolution kernel is Input channels and Output channel elements, the spatial dimensions of the output feature O are expressed as and ; When s=2 is set, the spatial size of the output features will be reduced by nearly half, achieving downsampling processing.
[0027] In the time series module, the encoded hidden features Along the time dimension F 1 ,F 2 ,……,F n Input to the input of each time step of the time series module one by one. This design can ensure that the proxy model captures the dynamic changes of the input sequence in time, so as to better understand and process time series data. The long short-term memory network LSTM is used in the time series module. LSTM can alleviate the gradient disappearance problem in traditional RNN through its unique gating mechanism. For the input sequence F={F 1 ,F 2 ,……,F n}, where F n Represents the input features of time step n, and the hidden state is h n , the cell state is c n , the calculation process of the long short-term memory network LSTM is:
[0028] ;
[0029] Where, Represents the overall calculation function of the LSTM unit; represents all gates and candidate states, represents the weight parameter of the forget gate, represents the weight parameter of the input gate, represents the weight parameter of the candidate cell, represents the weight parameter of the output gate, Represents the bias corresponding to the forget gate, input gate, candidate cell and output gate, and the output of the current time step and cell status By input and the state of the previous time step and Jointly decided, the calculation process is: , ,in, represents the cell state update function, represents the hidden state generating function.
[0030] In the decoding module, convolution operations are used to decode the features of each time step output by the timing module. The convolution process is similar to that of the encoding module. The difference is that s=1 is set during the convolution process, and interpolation is used to implement the upsampling process.
[0031] In the prediction results of the output layer, the pressure field and water saturation field are coupled and calculated, and the distribution of pressure and water saturation is output simultaneously, which reduces computing resources and increases the prediction accuracy of the proxy model.
[0032] Optionally, in step S5, the step of calculating the mixing loss by coupling the numerical simulator includes:
[0033] S51, proxy model initialization and data input, specifically: load the RU-Net neural network built in step S4 as a proxy model, input the training data set in step S3 into the proxy model, and set the hyperparameters required for training, including learning rate, batch size, and number of iterations.
[0034] S52. Calculating physical loss, specifically: first predicting state parameters through the surrogate model and inputting them into the numerical simulator; using the numerical simulator to solve the control equations of the discrete grid under the current state parameters, and calculating the corresponding residuals to obtain the physical loss; at the same time, retaining the Jacobian matrix in the numerical simulator and using it to calculate the gradient of the physical loss to improve the stability and computational efficiency of the optimization;
[0035] The formula for calculating physical loss is:
[0036] ,
[0037] Where, the gradient of physical loss to the prediction result is:
[0038] ;
[0039] Where, represents the total number of training samples, represents the simulation time step of a single sample, represents the total number of grids contained in the reservoir model, Represents the reservoir state predicted by the proxy model, including pressure p and water saturation The field distribution of and denote the reservoir states predicted by the proxy model at the nth and n+1th time steps, respectively. Represents the gradient information of physical loss for the prediction result, Represents the transpose of the gradient of the loss with respect to the residual during the chain derivation process, It represents the derivative of the residual with respect to the state parameter in the chain derivation process, that is, the Jacobian matrix J of the control equation.
[0040] S53. Calculate the label loss based on the label data. The loss gradient information at this time is automatically generated during the process of calculating the label loss. The calculation formula is:
[0041] ;
[0042] The gradient of the label loss with respect to the prediction result is:
[0043] ;
[0044] Where, Represents the gradient information of the label loss for the prediction result, which is used to update the network parameters during the training process of the proxy model. Represents the process of automatic differentiation to generate gradients during surrogate model training.
[0045] S54. Calculate the mixing loss using the following formula:
[0046] ;
[0047] Where L represents the mixing loss.
[0048] Optionally, in step S6, the proxy model completes the training process under the constraint of mixed loss. The permeability field and the injection and production parameter field are input into the proxy model as input features, and the proxy model predicts the reservoir state under different injection and production parameters. , calculate the label loss based on the label data And automatically generate the gradient information required for back propagation At the same time, the predicted state parameters are input into the numerical simulator to calculate the mass residual g of the control equation, and the gradient of the physical loss is expressed by the Jacobian matrix of the control equation. Finally, the mixed loss is used for back propagation, that is, the formula for updating the proxy model network parameters is:
[0049] ;
[0050] ;
[0051] Where, represents the adjustable parameters of the surrogate model, represents the parameter update process, represents the learning rate, Represents the gradient of the prediction result with respect to the network parameters, which is calculated by automatic differentiation;
[0052] Thus, the process of coupling numerical simulators to build physically constrained reservoir proxy models is completed.
[0053] The beneficial effect of the present invention is that, in response to the problems of high computational complexity, difficulty in embedding physical equations, and insufficient adaptability to complex reservoir models in existing physically constrained reservoir proxy model construction methods, the present invention aims to provide a method for constructing physically constrained reservoir proxy models by coupling numerical simulators. This method integrates the mass residuals and Jacobian matrices generated by the discrete difference process of the numerical simulator in the proxy model training to calculate physical losses as constraints, thereby optimizing the training process of the proxy model. The present invention combines the precise modeling capabilities of the numerical simulator with the efficient prediction advantages of the proxy model, effectively overcoming the problem of long computational time in the linear solution process of traditional simulators, while making up for the limitation that the proxy model is difficult to embed in complex physical equations, providing an innovative solution for intelligent numerical simulation of complex reservoirs. BRIEF DESCRIPTION OF THE DRAWINGS
[0054] Figure 1 A flow chart of a method for constructing a physically constrained reservoir proxy model using a coupled numerical simulator according to the present invention;
[0055] Figure 2 A permeability and well location distribution diagram showing an embodiment of the present invention;
[0056] Figure 3 Schematic diagram of the convolutional time series neural network for coupled prediction of pressure and water saturation of the present invention;
[0057] Figure 4A This is a trend diagram showing the change in water saturation prediction error with the number of samples when no physical constraints are imposed according to an embodiment of the present invention;
[0058] Figure 4B This is a trend diagram showing how the prediction error of pressure changes with the number of samples when no physical constraints are imposed according to an embodiment of the present invention;
[0059] Figure 5A This is a trend diagram showing how the prediction error of water saturation changes with the number of samples when physical constraints are applied according to an embodiment of the present invention;
[0060] Figure 5B This is a trend diagram showing how the prediction error of pressure changes with the number of samples when physical constraints are applied according to an embodiment of the present invention;
[0061] Figure 6A This is an example of an embodiment of the present invention showing the water saturation prediction at each time step of a proxy model trained with physical constraints in a coupled numerical simulator based on 50 sets of training data;
[0062] Figure 6B This is an example of an embodiment of the present invention showing the pressure prediction at each time step of a proxy model trained with physical constraints in a coupled numerical simulator based on 50 sets of training data;
[0063] Figure 7 The error distribution of water saturation and pressure at the final moment for a proxy model trained with and without physical constraints based on 50 sets of training data is shown in one embodiment of the present invention.
[0064] Figure 8A This is a comparison diagram of the error distribution of water saturation on 50 groups of random test samples using a proxy model with and without physical constraints, as shown in one embodiment of the present invention;
[0065] Figure 8B This is a comparison diagram of the error distribution of the agent model for pressure on 50 groups of random test samples with and without physical constraints, shown in one embodiment of the present invention. DETAILED DESCRIPTION
[0066] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention. Therefore, the following detailed description of the embodiments of the present invention provided in the drawings is not intended to limit the scope of the invention for which protection is sought, but merely represents selected embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0067] A method for coupling numerical simulators to construct physically constrained reservoir proxy models, such as Figure 1 As shown, the following steps are included:
[0068] S1. Establish a reservoir model: A three-dimensional oil-water two-phase flow model was constructed using a numerical simulator. The grid size of the reservoir model was 40×40×5, and the size of each grid was 25m×25m×10m. It contained one injection well and three production wells. All wells in the reservoir were controlled by bottom hole pressure. The initial oil saturation and water saturation of the reservoir were 0.8 and 0.2, respectively. The porosity was set to 0.15, the initial reservoir pressure was 20 MPa, and the distribution of permeability and well locations was as follows: Figure 2 As shown, the governing equations are implicitly discretized in space and time and solved by the finite volume method. The governing equations are:
[0069] ;
[0070] Where x, y and z represent three-dimensional space coordinates, subscript l represents the fluid, represents the phase density, represents phase viscosity, k represents absolute permeability, represents relative permeability, p represents pressure, represents the phase saturation, represents the porosity, represents the flow rate of the first-phase fluid in the injection or production well, calculated using the Peaceman equation: ,in, represents the thickness of the grid, represents the effective radius of the well, represents the absolute permeability at the well location, represents the actual radius of the well, Indicates bottom hole pressure;
[0071] S2. Randomly perturb the injection and production parameters to generate a dataset. The reservoir model was simulated for a total of 1080 days, divided into six time steps, each lasting 180 days. During the perturbation process, the bottomhole pressure in the injection wells was 25-30 MPa, and the pressure in the production wells was 13-18 MPa.
[0072] S3. The injection and production parameter dataset generated by the random perturbation in step S2 is input into the reservoir model. Simulations are performed to obtain reservoir state parameters (distributions of pressure and water saturation fields) under different injection and production parameters. A set of injection and production parameters corresponds to a set of state parameters, which together constitute the training dataset. The input features selected are the permeability distribution and the injection and production parameters set using a sparse matrix. During the injection and production parameter setting process, a sparse matrix is used, with positive well control values set for grids containing injection wells and negative well control values set for grids containing production wells. The predicted results are the pressure and water saturation distributions at different time steps under different injection and production parameters.
[0073] S4. According to the training data format generated in step S3, build the RU-Net neural network as the proxy model, such as Figure 3As shown, it includes an input layer, an encoding module, a timing module, a decoding module and an output layer. The encoding module extracts spatial features through downsampling by convolution operation, the timing module captures temporal dependencies by using a long short-term memory network, and the decoding module restores spatial dimensions through upsampling. The input layer receives the permeability field and the injection and production parameter field, and the output layer couples and predicts the pressure field and water saturation field. The RU-Net neural network uses the convolutional neural network (CNN) module to extract and process the spatial feature information of the reservoir state. The temporal dependencies between the injection and production parameters and the state parameters are captured through the long short-term memory (LSTM) network module. Combining the CNN and LSTM modules, the cyclic and continuous prediction of the reservoir state under different injection and production parameter conditions is realized. The proxy model is constructed by adopting the strategy of coupling the pressure field and the water saturation field to reduce the computational complexity by sharing features, laying the model foundation for subsequent coupled numerical simulation training.
[0074] In the input layer, the permeability field and injection-production parameter field, which are key to predicting time-varying well-controlled reservoir states, are selected as input features. A sparse matrix is used to process the injection-production parameters, assigning positive injection parameters to locations containing production wells and negative injection-production parameters to locations containing production wells.
[0075] The encoding module uses convolution operation to downsample the input features, and compresses the spatial dimension through the convolution kernel with stride, thereby extracting more advanced feature representations and reducing the amount of calculation. C represents the number of input feature channels, H and D represent the height and width respectively, then the input feature , the convolution kernel is ,in, and represents the spatial size of the convolution kernel, Indicates the number of output channels, the output feature map at this time , and is the height and width after convolution, and the convolution operation process is:
[0076] ;
[0077] Where i, j and are the indices of the output feature map in height, width and channel respectively, Indicates that the output feature is The value at channel, i, j, is the bias term, s represents the stride, Indicates that the convolution kernel is Input channels and Output channel elements, the spatial dimensions of the output feature O are expressed as and ; When s=2 is set, the spatial size of the output features will be reduced by nearly half, achieving downsampling processing.
[0078] In the time series module, the encoded hidden features Along the time dimension F 1 ,F 2 ……,F n Input to the input of each time step of the time series module one by one. This design can ensure that the proxy model captures the dynamic changes of the input sequence in time, so as to better understand and process time series data. The long short-term memory network LSTM is used in the time series module. LSTM can alleviate the gradient disappearance problem in traditional RNN through its unique gating mechanism. For the input sequence F={F 1 ,F 2 ,……,F n}, where F n Represents the input features of time step n, and the hidden state is h n , the cell state is c n , the calculation process of the long short-term memory network LSTM is:
[0079] ;
[0080] Where, Represents the overall calculation function of the LSTM unit; represents all gates and candidate states, represents the weight parameter of the forget gate, represents the weight parameter of the input gate, represents the weight parameter of the candidate cell, represents the weight parameter of the output gate, Indicates the bias corresponding to each part, the output of the current time step and cell status By input and the state of the previous time step and Jointly decided, the calculation process is: , ,in, represents the cell state update function, represents the hidden state generating function.
[0081] In the decoding module, convolution operations are used to decode the features of each time step output by the timing module. The convolution process is similar to that of the encoding module. The difference is that s=1 is set during the convolution process, and interpolation is used to implement the upsampling process.
[0082] In the prediction results of the output layer, the pressure field and water saturation field are coupled and calculated, and the distribution of pressure and water saturation is output simultaneously, which reduces computing resources and increases the prediction accuracy of the proxy model.
[0083] S5. Coupled numerical simulator to calculate mixing losses; including:
[0084] S51, proxy model initialization and data input, specifically: load the RU-Net neural network built in step S4 as the proxy model, input the training data set in step S3 into the network, and set the hyperparameters required for proxy model training, including learning rate, batch size, and number of iterations.
[0085] S52. Calculate the physical loss, specifically: first predict the state parameters through the proxy model and input them into the numerical simulator; under the current state parameters, use the numerical simulator to solve the control equations of the discrete grid and calculate the corresponding residuals to obtain the physical loss; at the same time, retain the Jacobian matrix in the numerical simulator and use it for the gradient calculation of the physical loss to improve the stability and computational efficiency of the optimization.
[0086] Taking three-dimensional oil-water two-phase flow as an example, the governing equation has been given in step S1, which can be simplified to: , where g represents the mass residual, A, F, and Q represent the accumulator phase, mobile phase, and source-sink phase, respectively. and Represent the reservoir status at time n+1 and time n, including the distribution of saturation and pressure; Represents the injection and production parameters at time n+1. The numerical simulator efficiently calculates the mass residual g based on the static parameters of the reservoir and the injection and production parameters, and then calculates Constrain the training of the proxy model. Therefore, the physical loss during the training of the proxy model is:
[0087] ;
[0088] Where, the gradient of physical loss to the prediction result is:
[0089] ;
[0090] Where, represents the total number of training samples, represents the simulation time step of a single sample, represents the total number of grids contained in the reservoir model, Represents the reservoir state predicted by the proxy model, including pressure p and water saturation The field distribution of and denote the reservoir states predicted by the proxy model at the nth and n+1th time steps, respectively. Represents the gradient information of physical loss for the prediction result, Represents the transpose of the gradient of the loss with respect to the residual during the chain derivation process, It represents the derivative of the residual with respect to the state parameter in the chain derivation process, that is, the Jacobian matrix J of the control equation.
[0091] The numerical simulator calculates the residual g and Jacobian matrix J of the governing equations, and can then efficiently calculate the physical losses to ensure that the coupled numerical simulator constructs a physically constrained reservoir proxy model with good applicability.
[0092] S53. Calculate the label loss based on the label data. The loss gradient information at this time is automatically generated during the process of calculating the label loss. The calculation formula is:
[0093] ;
[0094] The gradient of the label loss with respect to the prediction result is:
[0095] ;
[0096] Where, Represents the gradient information of the label loss for the prediction result, which is used to update the network parameters during the training process of the proxy model. Represents the process of automatic differentiation to generate gradients during surrogate model training.
[0097] S54. Calculate the mixing loss using the following formula:
[0098] ;
[0099] Where L represents the mixing loss.
[0100] Use a numerical simulator to build a reservoir model to provide a model basis for the proxy model training. Generate label data by randomly perturbing the injection and production parameters. Input the label data into the proxy model, and the proxy model will give the predicted reservoir state parameters. Calculate the label loss based on the label data , at this time the gradient of label loss In addition, the predicted reservoir state parameters are input into the numerical simulator to calculate the mass residual g and Jacobian matrix J of the governing equation under the current state. This completes the calculation of mixing loss.
[0101] S6. Use the gradient backpropagation of the hybrid loss to update the proxy model network parameters to complete the training of the proxy model. The proxy model completes the training process under the constraints of the hybrid loss. The formula for using the hybrid loss to constrain the proxy model network parameter update is:
[0102] ;
[0103] ;
[0104] Where, represents the adjustable parameters of the surrogate model, represents the parameter update process, represents the learning rate, Represents the gradient of the prediction result with respect to the network parameters, which is calculated by automatic differentiation;
[0105] Thus, the process of coupling numerical simulators to build physically constrained reservoir proxy models is completed.
[0106] Figure 4A 、 Figure 4B 、 Figure 5A 、 Figure 5B The prediction errors for water saturation and pressure for the unconstrained and constrained surrogate models, respectively, are shown as a function of the amount of training data. The figures clearly show that the prediction error of the surrogate model decreases with increasing training samples. After introducing physical constraints, only 50 training samples are required to complete the surrogate model training, and the prediction accuracy of the surrogate model approaches the accuracy of the unconstrained 200 training data sets. This indicates that constructing a physically constrained reservoir surrogate model based on a coupled numerical simulator can reduce the required training sample size by nearly 75%.
[0107] Figure 6A 、 Figure 6B The results of water saturation and pressure predictions for a random set of test samples using a proxy model trained with 50 sets of samples are shown in this example. The figure demonstrates that this method efficiently constructs high-precision proxy models, with prediction errors for water saturation generally less than 0.01 and for pressure generally less than 0.25 MPa. This demonstrates the applicability of this physically constrained reservoir proxy model method based on coupled numerical simulators for three-dimensional oil-water two-phase flow problems.
[0108] Figure 7 The distribution of pressure and water saturation errors at the last time step is shown when using the same 50 sets of training samples. It can be seen from the figure that the proposed method of introducing physical constraints to construct a proxy model can effectively improve the prediction accuracy of the proxy model. Figure 8A 、 Figure 8BThe prediction error distribution of the proxy models constructed with and without physical constraints on 50 groups of random test samples was further compared. The results showed that by adopting the proposed physical constraint method, while maintaining the same training cost, the mean prediction error of pressure was reduced from 1.24% to 0.95%, a reduction of about 25%; and the mean prediction error of water saturation was reduced from 2.98% to 0.87%, a reduction of about 70%.
[0109] 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 scope of protection of the present invention.
Claims
1. A method for constructing a physically constrained reservoir proxy model by coupling a numerical simulator, characterized in that: The steps include: S1. Establishing a reservoir model: Using a numerical simulator, a three-dimensional oil-water two-phase flow model is constructed. The governing equations are implicitly discretized in space and time and solved using the finite volume method. S2, randomly perturb the injection and production parameters to generate an injection and production parameter data set; S3. Input the injection-production parameter data set generated in step S2 into the reservoir model for simulation to obtain corresponding reservoir state parameters. The injection-production parameters and state parameters together constitute label data. S4. Build the RU-Net neural network as a proxy model, including an input layer, an encoding module, a timing module, a decoding module, and an output layer. The encoding module extracts spatial features by downsampling through convolution operations. The timing module uses a long short-term memory network to capture temporal dependencies. The decoding module restores spatial dimensions through upsampling. The input layer receives the permeability field and the injection and production parameter field. The output layer couples and predicts the pressure field and saturation field. S5, coupled numerical simulator to calculate mixing losses; S6. Use mixed loss back propagation to update the network parameters of the proxy model to complete the training of the proxy model; In step S4, the encoding module uses convolution operation to downsample the input features and compress the spatial dimension through the convolution kernel with stride. C represents the number of input feature channels, H and D represent the height and width respectively, then the input feature , the convolution kernel is ,in, and represents the spatial size of the convolution kernel, Indicates the number of output channels, the output feature map at this time , and is the height and width after convolution, and the convolution operation process is: ; Where i, j and are the indices of the output feature map in height, width and channel respectively, Indicates that the output feature is The value at channel, i, j, is the bias term, s represents the stride, Indicates that the convolution kernel is Input channels and Output channel elements, the spatial dimensions of the output feature O are expressed as and ; In the time series module, for the input sequence F={F 1 ,F 2 ,……,F n }, where F n Represents the input features of time step n, and the hidden state is h n , the cell state is c n , the calculation process of the long short-term memory network LSTM is: ; Where, Represents the overall computational function of the LSTM unit; represents all gates and candidate states, represents the weight parameter of the forget gate, represents the weight parameter of the input gate, represents the weight parameter of the candidate cells, represents the weight parameter of the output gate, Represents the bias corresponding to the forget gate, input gate, candidate cell and output gate, and the output of the current time step and cell status By input and the state of the previous time step and Jointly decided, the calculation process is: , ,in, represents the cell state update function, represents the hidden state generation function; In step S5, the steps of calculating the mixing loss by coupling the numerical simulator include: S51, proxy model initialization and data input, specifically: load the RU-Net neural network built in step S4 as the proxy model, input the label data in step S3 into the proxy model, and set the hyperparameters required for proxy model training, including learning rate, batch size, and number of iterations; S52. Calculating physical losses, specifically: first predicting state parameters using a proxy model and inputting them into a numerical simulator; using the numerical simulator to solve the governing equations of the discrete grid under the current state parameters, and calculating the corresponding residuals to obtain the physical losses; simultaneously, retaining the Jacobian matrix of the governing equations in the numerical simulator and using it to calculate the gradient of the physical losses; The formula for calculating physical loss is: ; Where, the gradient of physical loss to the prediction result is: ; Where, represents the total number of training samples, represents the simulation time step of a single sample, represents the total number of grids contained in the reservoir model, Represents the reservoir state predicted by the proxy model, including pressure p and water saturation The field distribution of and denote the reservoir states predicted by the proxy model at the nth and n+1th time steps, respectively. represents the reservoir state at time n, including the distribution of saturation and pressure; represents the injection and production parameters at time n+1, Represents the gradient information of physical loss for the prediction result, Indicates the gradient transpose of the loss with respect to the residual during the chain derivation process, Represents the derivative of the residual with respect to the state parameter in the chain derivation process, that is, the Jacobian matrix J of the control equation; S53. Calculate the label loss based on the label data. The calculation formula is: ; The gradient of the label loss with respect to the prediction result is: ; Where, Represents the gradient information of the label loss for the prediction result, which is used to update the network parameters during the training process of the proxy model. Represents the process of automatically differentiating and generating gradients during the training of the surrogate model; S54. Calculate the mixing loss using the following formula: ; Where, L represents mixing loss; In step S6, the formula for updating the proxy model network parameters with the hybrid loss constraint is: ; ; Where, represents the adjustable parameters of the surrogate model, represents the parameter update process, represents the learning rate, Represents the gradient of the prediction result with respect to the network parameters, which is calculated by automatic differentiation; Therefore, the physical loss and label loss jointly constrain the training process of the proxy model.
2. The method for constructing a physically constrained reservoir proxy model by coupling a numerical simulator according to claim 1, characterized in that: In step S1, the control equation is: ; Where x, y, and z represent three-dimensional space coordinates, and the subscript l represents the fluid. represents the phase density, represents phase viscosity, k represents absolute permeability, represents relative permeability, p represents pressure, represents the phase saturation, represents the porosity, represents the flow rate of the first-phase fluid in the injection or production well, calculated using the Peaceman equation: ,in, represents the thickness of the grid, represents the effective radius of the well, represents the absolute permeability at the well location, represents the actual radius of the well, represents the bottom hole pressure; the control equation is simplified to: ; Where g represents the mass residual, A, F, and Q represent the accumulating phase, mobile phase, and source-sink phase, respectively; and Represent the reservoir status at time n+1 and time n, including the distribution of saturation and pressure; Indicates the injection and production parameters at time n+1.
3. The method for constructing a physically constrained reservoir proxy model by coupling a numerical simulator according to claim 1, characterized in that: In step S3, the injection and production parameters in the label data are represented in a sparse matrix form, the well control value of the grid corresponding to the injection well is positive, and the well control value of the grid corresponding to the production well is negative.
Citation Information
Patent Citations
Well spacing optimization method based on knowledge embedded neural network agent model
CN116644662A
Water-drive reservoir production dynamic prediction method based on deep neural operator
CN118551290A
Construction method of recurrent neural network agent model for CO2 sequestration of deep saline water layer
CN118917355A