Prediction Method for Groundwater Solute Dispersion Coefficient and Migration Velocity Based on Transformer Network

By combining the lattice Boltzmann method, particle tracking method and Transformer network, the image features of porous media are extracted and processed, and the rapid and accurate prediction of the longitudinal diffusion coefficient and migration speed of groundwater solute is achieved, and the problem of long-term use of existing methods is solved.

CN116680570BActive Publication Date: 2025-07-01NANJING UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310736821.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-06-21
Publication Date
2025-07-01
Estimated Expiration
2043-06-21

AI Technical Summary

Technical Problem

When the existing numerical calculation and computer simulation methods are used to estimate the longitudinal diffusion coefficient and migration speed of groundwater solute, it takes a long time and is difficult to meet the demand for rapid prediction in contaminated hydrogeological processes.

Method used

Combining the lattice Boltzmann method, particle tracking method and deep learning neural network, especially using the Transformer network, we extract the image features of porous media containing physical parameter information, and process the sequence correlation of image features to achieve simultaneous prediction of longitudinal diffusion coefficient and migration speed.

Benefits of technology

While maintaining high prediction accuracy, it significantly improves the calculation efficiency, solves the problem of time-consuming estimation parameters, and becomes an effective tool for numerical simulation of porous media in the field of groundwater research.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116680570B_ABST
    Figure CN116680570B_ABST
Patent Text Reader

Abstract

The present invention discloses a method for predicting the solute dispersion coefficient and migration velocity of groundwater based on the Transformer network. The specific steps are as follows: First, a three-dimensional porous medium needs to be generated. The lattice Boltzmann method (LBM) is used to simulate the flow field in the porous medium, and the particle tracking method is used to simulate the solute transport process and obtain the breakthrough curve; the longitudinal dispersion coefficient D of groundwater solute is inverted through the analytical solution of the one-dimensional migration equation of pollutants and the SciPy optimization algorithm L and the migration velocity u; a parameter matrix of the molecular diffusion coefficient D m and the average pore velocity u′ is constructed and added to the grayscale image of the porous medium, and thus, together with the inverted parameter longitudinal dispersion coefficient D L and the migration velocity u, an input-output sample pair data set is formed; the data set is divided into a training set, a validation set, and a test set and is applied to the PhyCNN-Transformer multi-output regression model in sequence to achieve accurate prediction of the inverted parameters.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of contaminated hydrogeology, and particularly to a method for predicting the longitudinal dispersion coefficient and migration velocity of groundwater solutes based on a Transformer network. Background Art

[0002] The longitudinal dispersion coefficient D of groundwater solutes L , [L 2 T -1 , is the most important parameter in the hydrodynamic dispersion process, and is a parameter characterizing the hydrodynamic dispersion ability of pollutant solutes in the pore space of the underground porous medium aquifer along the longitudinal direction (parallel to the total direction of water flow movement). The larger the longitudinal dispersion coefficient, the stronger the dispersion ability of pollutants in the medium, and thus, within the same time, the farther the pollutants migrate. The longitudinal dispersion coefficient is affected by factors such as the pore structure of the porous medium, the properties of pollutants, and the properties of fluids. In the fields of environmental protection, soil pollution control, water resource management, etc., studying the longitudinal dispersion coefficient is crucial. Determining the longitudinal dispersion coefficient helps to understand the migration rate and distribution of pollutants in the underground porous medium aquifer, thereby deepening the understanding and prediction of processes such as the transport, transformation, and biodegradation of pollutants.

[0003] The solute migration velocity u, [LT -1 , that is, the flow velocity of the fluid in the effective pores of the porous medium, reflects the motion state of the fluid in the medium, and is closely related to factors such as the effective porosity, permeability, and pressure gradient of the porous medium. During the migration process of pollutants, the larger this flow velocity value, the greater the influence of mechanical dispersion on pollutants, and the farther the pollutants migrate along the water flow movement direction per unit time. Therefore, the solute migration velocity is of great significance for the prediction and control of pollutant migration models, helps to accurately predict the diffusion range of pollutants in water bodies, and thus provides a scientific basis for pollution prevention and control and water resource protection.

[0004] Currently, using pore-scale imaging and simulation methods to numerically calculate and computer-simulate the hydrodynamic dispersion process in fluid flow has become one of the main methods for studying the hydrodynamic dispersion phenomenon in porous media. For example, the lattice Boltzmann method (LBM) is used to calculate and solve the Navier-Stokes equation in the pore space, and the particle tracking method is used to simulate the solute transport process in the flow field, and many research progresses have been made, including the solution calculation of the longitudinal dispersion coefficient D L and the solute migration velocity u. However, it is very time-consuming to estimate parameters using the above methods. Considering the importance of D L and u for the contaminated hydrogeological process, it is extremely important to develop a fast and accurate parameter estimation method.

[0005] Therefore, the present invention proposes a new method that combines the lattice Boltzmann method (LBM), the particle tracking method, and a deep learning neural network to achieve the simultaneous prediction of D L and u, while maintaining extremely high prediction accuracy and significantly improving the calculation efficiency. Summary of the Invention

[0006] The purpose of the present invention is to provide a method for predicting the longitudinal dispersion coefficient and migration velocity of groundwater solutes based on the Transformer network, in order to solve the problem of extremely time-consuming estimation parameters in the existing technology of numerical calculation and computer simulation of the hydrodynamic dispersion process in fluid flow.

[0007] To solve the above technical problems, the present invention provides the following technical solution: A method for predicting the longitudinal dispersion coefficient and migration velocity of groundwater solutes based on the Transformer network, and the prediction steps are as follows:

[0008] Construct a three-dimensional porous medium with solid sphere particle packing through the precipitation generation method, use LBM to simulate the flow field in the porous medium, and use the particle tracking method to simulate the solute transport process and obtain the breakthrough curve, that is, the relationship between the solute concentration C at the outlet of the porous medium and time t;

[0009] Invert and calculate the longitudinal dispersion coefficient D L and the solute migration velocity u according to the analytical solution of the pollutant migration equation and the SciPy optimization algorithm;

[0010] Regard the three-dimensional porous medium along the water flow simulation direction as a two-dimensional grayscale image that is continuous in space, and respectively construct parameter matrices of the molecular diffusion coefficient D m and the average pore flow velocity u' and add them to the image to obtain a three-channel porous medium image containing physical information;

[0011] Combine the above porous medium image with the physical parameter information with the inverted parameters of the longitudinal dispersion coefficient D L , the solute migration velocity u to form a dataset with input-output sample pairs, and further divide it into a training set, a validation set, and a test set, train the PhyCNN-Transformer neural network multi-output regression model, and evaluate the prediction performance and generalization ability; the proportion of the division of the training set, validation set, and test set is determined according to the actual situation.

[0012] Among them, the LBM describes physical phenomena at the macroscopic scale by tracking the migration, collision, etc. of the particle probability density function at discrete lattice points at the mesoscopic scale. It is a stable and accurate fluid flow simulation method and can finely simulate the flow field in the porous medium through large-scale parallel computing;

[0013] In addition, the Lattice Boltzmann Method (LBM) uses reflective boundaries to handle complex boundary conditions, reducing the research difficulty. Moreover, this method is easy to implement through programming. Therefore, LBM is one of the most commonly used methods for simulating the flow field of porous media with complex geometric boundaries at present. In this invention, the most widely used LBM model, namely the Lattice Bhatnagar-Gross-Krook (LBGK) D3Q19 model (a three-dimensional model with 19 discrete velocity directions), is selected to solve the Navier-Stokes equations and simulate the fine flow field of pores in three-dimensional porous media.

[0014] The precipitation generation method is adopted to construct the porous media. The LBM and particle tracking method are used to simulate the flow field of the porous media and the solute transport process in sequence. By setting two Darcy flow velocity values v1 and v2, and four molecular diffusion coefficient values D m,1 、D m,2 、D m,3 and D m,4 , four breakthrough curves C1(t), C2(t), C3(t), and C4(t) at the outlet of the porous media are obtained. Then, according to the analytical solution of the pollutant concentration and the SciPy optimization inversion algorithm, the longitudinal dispersion coefficients D L,1 、D L,2 、D L,3 and D L,4 , as well as the migration velocities u1, u2, u3, and u4 are obtained.

[0015] According to the above technical solution, the precipitation generation method is implemented by the FORTRAN 77 programming language, and a three-dimensional porous media composed of solid spherical particles is constructed. Its structure is extremely similar to the structures of granular porous media such as soil and pore aquifers, so it is widely used in the simulation research of solute transport in pore-scale soil and pore aquifers. The precipitation generation method can maintain the topological structure of the porous media. The steps of constructing the porous media by stacking solid spherical particles are as follows:

[0016] L1. Generate a solid particle, determine its particle size according to a pre-set probability density function or uniform particle size value, and randomly determine its initial position at the top of the simulation area;

[0017] L2. The newly generated solid particle continuously settles from the initial position until there are three solid particles supporting it below or it reaches the bottom of the simulation area; at the end of the settlement process, the solid particle reaches the lowest point of its potential energy;

[0018] L3. Repeat steps L1 and L2 until the solid particles and the pores between them fill the entire simulation area.

[0019] According to the above technical solution, the particle tracking method generalizes the process of groundwater solute transport into a process where a large number of solute particles move randomly with time in the flow field. Each particle represents a certain amount of solute and is assigned an initial position.

[0020] A large number of studies have shown that the particle tracking method can accurately depict the time behavior of solute transport in porous media, and the calculation process can be greatly accelerated through parallel technology. When the boundary condition between pores and solid particles is set as a reflection boundary and the rest are periodic boundaries, the breakthrough curve is represented by the probability distribution of the cumulative first breakthrough time of solute particles.

[0021] According to the above technical solution, the assumed conditions for the pollutant migration equation are as follows: the research domain is a semi-infinite long porous medium column, the medium is homogeneous and isotropic; the flow field is a uniform flow with a constant velocity, and the migration velocity u of the pollutant (solute) is a constant; the convective dispersion of the pollutant is one-dimensional; there is no requirement for whether the research domain contains pollutants at the initial moment;

[0022] When there is no source-sink effect and no chemical reaction, the mathematical model for the migration of pollutants under the given flux boundary condition is:

[0023]

[0024] Among them, R d represents the retardation factor, C0 represents the initial concentration of the injected pollutant, x represents the migration length of the pollutant, u represents the migration velocity of the pollutant (solute), D L represents the longitudinal dispersion coefficient, and C represents the pollutant concentration.

[0025] If the pollutant is conservative and no adsorption occurs, the solution of this model is:

[0026]

[0027] Among them, R d represents the retardation factor, C0 represents the initial concentration of the injected pollutant, x represents the migration length of the pollutant, u represents the migration velocity of the pollutant (solute), D L represents the longitudinal dispersion coefficient, and C represents the pollutant concentration.

[0028] As an open-source Python mathematical library, SciPy uses non-linear least squares fitting for optimization inversion. By minimizing the sum of squared residuals, the parameter values that make the predicted concentration value at the outlet of the porous medium closest to the observed concentration value C(t) are obtained, that is, the optimal longitudinal dispersion coefficient D of the solute LThe SciPy optimization inversion effect is illustrated by the fitting degree between the breakthrough curve BTC obtained from particle tracking simulation and the Advection Diffusion Equation (ADE), and is characterized by the coefficient of determination R 2 and the Root Mean Squared Error (RMSE).

[0029] According to the above technical solution, the three-dimensional porous medium image is regarded as a spatially continuous two-dimensional single-channel (gray-scale) image sequence along the water flow simulation direction, where the length of the three-dimensional porous medium image in the water flow simulation direction is the length of the two-dimensional single-channel image sequence, and the thickness of the two-dimensional single-channel image is equal to the pixel size.

[0030] According to the above technical solution, the steps for constructing the three-channel image containing physical information are as follows:

[0031] For each two-dimensional single-channel image in the two-dimensional single-channel image sequence, a two-dimensional parameter matrix of the molecular diffusion coefficient D m and the average pore velocity u′ is constructed;

[0032] The two-dimensional parameter matrix is expanded to the same size as the original two-dimensional image, and the two-dimensional parameter matrix of the molecular diffusion coefficient D m and the average pore velocity u′ is spliced with the original image to form a three-channel image containing physical information.

[0033] According to the above technical solution, the two-dimensional parameter matrix of the average pore velocity u′:

[0034] M i = u′ i *ones(s, t)

[0035] The two-dimensional parameter matrix of the molecular diffusion coefficient D m is as follows:

[0036] N i = D m *ones(s, t)

[0037] where M i represents the two-dimensional parameter matrix of the average pore velocity u′ corresponding to the i-th two-dimensional single-channel image of the porous medium, and N i represents the two-dimensional parameter matrix of the molecular diffusion coefficient D m corresponding to the i-th two-dimensional single-channel image of the porous medium, and s and t respectively represent the length and width of the two-dimensional single-channel image.

[0038] According to the above technical solution, the orders of magnitude of the average pore velocity u′ and the solute migration velocity u are 10 -5~10 -4 , the molecular diffusion coefficient D m and the longitudinal dispersion coefficient D L are on the order of 10 -10 ~10 -7 . Before training the neural network, the above range needs to be converted, and its conversion formula is:

[0039]

[0040] where i represents the ordinal number of the two-dimensional single-channel image of the porous medium, represents the porosity of the i-th two-dimensional single-channel image of the porous medium, and v represents the Darcy flow velocity value.

[0041] According to the above technical solution, the neural network training process involves an image data augmentation method, including three operations: vertical flipping, horizontal flipping, and diagonal flipping. Since the porous medium structure remains unchanged during the image enhancement process, 4 images (original image and enhanced images) of 1 type of porous medium can be combined with the simulation setting parameters Darcy flow velocity v, molecular diffusion coefficient D m , and the inversion parameter longitudinal dispersion coefficient D L , and the solute migration velocity u to establish a mapping relationship, so that the input (porous medium image, simulation setting parameters)-output (inversion parameter) sample pair data volume is tripled.

[0042] The mapping relationship means that any porous medium can obtain 4 breakthrough curves through LBM and particle tracking simulation, and 4 longitudinal dispersion coefficients D L and the solute migration velocity u can be obtained after inversion. Through the image data augmentation method, the porous medium structure remains unchanged, and its images are tripled. Then each porous medium image corresponds to 1 longitudinal dispersion coefficient value and 1 solute migration velocity value. This method can provide more image samples for the neural network, increase the sample volume of the dataset, and prevent the model from overfitting.

[0043] According to the above technical solution, the PhyCNN-Transformer neural network multi-output regression model: uses CNN to extract the three-channel image features containing physical information, uses the Transformer network to process the sequence correlation of the image features, and then realizes the simultaneous prediction of the longitudinal dispersion coefficient D L and the solute migration velocity u through the fully connected layer. To distinguish it from other CNN models, the CNN model used in the present invention is named PhyCNN.

[0044] Specific structure of the neural network: The CNN model includes 4 convolutional layers with two-dimensional convolutional kernels of different sizes or numbers, generating multi-channel feature maps to represent the high-dimensional deep information of the two-dimensional single-channel image of the porous medium. After each convolutional layer, batch normalization (Batch Norm) and ReLU activation function are added to enhance the non-linear representation ability of the network.

[0045] After the 4 convolutional layers, a fully connected layer follows, which compresses the multi-channel feature maps into feature vectors of a fixed dimension. Thus, the three-dimensional porous medium image is transformed into a sequence composed of a series of feature vectors, and this sequence can be passed as input to the Transformer network for further processing.

[0046] The Transformer network includes 6 identical encoding layers, and each encoding layer contains two sub-layers. The first sub-layer is the multi-head self-attention layer, which is responsible for capturing the relationships between elements in the sequence; the second sub-layer is the feed-forward fully connected layer, which is used to further extract features. There are residual connections and regularization operations between the sub-layers to improve the generalization ability and training stability of the network. The Transformer network adopts sinusoidal position encoding and adds it to the input sequence, enabling the model to capture the relative position information of elements in the sequence.

[0047] After processing the input sequence, the output of the Transformer network is averaged in the "sequence length" dimension and compressed into a vector of a fixed size. Then, this vector is used as the input of the fully connected layer, and finally, the regression prediction of the longitudinal dispersion coefficient D L and the actual water flow velocity u is realized.

[0048] The above process is implemented in the Transformer network through Query vectors, Key vectors, and Value vectors. The Query vector is the query vector, representing the current attention target and used to determine the degree of attention of the current query element to other elements in the sequence; the Key vector is the key vector, representing each element in the sequence that receives attention and indicating the degree of attention of this element to the current query element; the Value vector is the value vector, representing the value of each element in the sequence. The Query vector and the Key vector are used to calculate the attention weights to represent their similarity, and then multiplied by the Value vector as weights, thus obtaining the output of self-attention. The self-attention mechanism repeats the processes of querying, attention calculation, and combination for all elements in the input sequence, enabling the Transformer network to capture the relationships between different elements in the sequence. In fact, when calculating the attention function with a group of Query vectors at the same time, the Query vectors, Key vectors, and Value vectors of the input sequence are respectively packed into matrices Q, K, and V, so there is an attention calculation formula:

[0049]

[0050] Among them, Q is the Query vector matrix, K is the Key vector matrix, V is the Value vector matrix, and d k = d model / h, representing the dimensions of Q and K in h subspaces (i.e., the heads of self-attention), and K T is the transpose matrix of the Value vector matrix.

[0051] The multi-head attention mechanism linearly projects the Q, K, and V matrices h times, projecting them to d k , d k and d v dimensions respectively. The output of each subspace (head) is concatenated and projected again to generate the final attention matrix:

[0052]

[0053] Among them, the projection operation is implemented by the parameter matrices and , where i ∈ [1, h], h represents the number of projection times, which is also the number of heads and subspaces of multi-head self-attention. d model is the embedding dimension of the input sequence, that is, the number of features expected by the encoder.

[0054] Among them, the Transformer network is a Seq2Seq deep learning model based on the multi-head self-attention mechanism. The core idea is to use the multi-head self-attention mechanism to capture and learn the global dependencies of the entire sequence, so as to obtain the long-term representation of the sequence. Specifically, for any element in the sequence, the Transformer network will calculate the correlation between this element and all other elements, and then assign different weights according to the correlation. The Transformer network combines these relationships with the data content and finally forms the output.

[0055] Compared with the prior art, the beneficial effects achieved by the present invention are as follows: The present invention proposes a method for predicting the longitudinal dispersion coefficient and migration velocity of groundwater solutes based on the Transformer network, using CNN to extract the features of porous medium images containing physical parameter information, and using the Transformer network to process the sequence correlation of the image features. The combination of the two enables the model to fully capture and express the spatial information and sequence relationship of the porous medium image, thereby realizing the prediction of the longitudinal dispersion coefficient D L, Accurate prediction of the migration velocity u. This method has significant advantages in terms of computational efficiency, prediction performance, and generalization ability. It can not only solve the problem of time-consuming estimation of parameters but also be a powerful tool for numerical simulation of porous media in the field of groundwater research. Description of the Drawings

[0056] The drawings are used to provide a further understanding of the present invention and constitute a part of the specification. Together with the embodiments of the present invention, they are used to explain the present invention and do not constitute a limitation to the present invention. In the drawings:

[0057] Figure 1 is a flowchart of the construction steps of the PhyCNN-Transformer neural network;

[0058] Figure 2 is a schematic diagram of a three-dimensional porous medium constructed by the precipitation generation method;

[0059] Figure 3 is a schematic diagram of the mapping relationship obtained by the data augmentation method using the porous medium image;

[0060] Figure 4 is the molecular diffusion coefficient D of the implementation example m and the density distribution and truncated lognormal distribution diagram of the Darcy velocity v;

[0061] Figure 5 is the fitting result diagram of the breakthrough curve BTC and ADE of the implementation example;

[0062] Figure 6 is the longitudinal dispersion coefficient D of the implementation example L and the density distribution and truncated lognormal distribution diagram of the migration velocity u;

[0063] Figure 7 is the prediction result diagram of the multi-output regression model of the PhyCNN-Transformer neural network on the validation subset in the implementation example;

[0064] Figure 8 is the prediction result diagram of the multi-output regression model of the PhyCNN-Transformer neural network on the test set in the implementation example. Detailed Embodiments

[0065] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.

[0066] Please refer toFigures 1-8 , the present invention provides a technical solution: a method for predicting the longitudinal dispersion coefficient and migration velocity of groundwater solutes based on a Transformer network. The prediction steps are as follows:

[0067] S1. Construct a three-dimensional porous medium with solid sphere particles stacked by precipitation generation method. Use LBM to simulate the flow field in the porous medium, and use particle tracking to simulate the solute transport process and obtain the breakthrough curve;

[0068] Among them, the steps of the porous medium formed by stacking solid sphere particles by the precipitation generation method are as follows: generate a solid particle, determine its particle size according to a preset probability density function or uniform particle size value, and randomly determine its initial position at the top of the simulation area; the newly generated solid particle continuously settles from the initial position until there are three solid particles supporting it below or it reaches the bottom of the simulation area; at the end of the settlement process, the solid particle reaches the lowest point of its potential energy; repeat the above two steps until the solid particles and the pores between them fill the entire simulation area.

[0069] The LBM uses the D3Q19 model to track the migration, collision and other behaviors of the particle probability density function on discrete lattice points at the mesoscopic scale to describe the physical phenomena at the macroscopic scale, and finely simulates the pore flow field of the three-dimensional porous medium by solving the Navier-Stokes equation.

[0070] The particle tracking model generalizes the groundwater solute transport process as a process in which a large number of solute particles move randomly with time in the flow field. When the boundary condition between the pore and the solid particle is set as a reflective boundary and the rest are periodic boundaries, the breakthrough curve is represented by the probability distribution of the cumulative first breakthrough time of the solute particles.

[0071] S2. Invert and calculate the longitudinal dispersion coefficient D L and the migration velocity u according to the analytical solution of the pollutant transport equation and the SciPy optimization algorithm; the assumed conditions of the pollutant transport equation are as follows: the research domain is a semi-infinite long porous medium column, the medium is uniform and isotropic; the flow field is uniform with a constant velocity, and the migration velocity u of the pollutant (solute) is constant; the advection-dispersion of the pollutant is one-dimensional; there is no requirement for whether the research domain contains pollutants at the initial moment;

[0072] When there is no source-sink effect and no chemical reaction, the mathematical model of pollutant migration under the given flux boundary condition is:

[0073]

[0074] Among them, R d represents the retardation factor, C0 represents the initial concentration of the injected pollutant, x represents the pollutant migration length, u represents the pollutant (solute) migration velocity, D LDenote the longitudinal dispersion coefficient as, and C denote the pollutant concentration.

[0075] If the pollutant is conservative and adsorption does not occur, the solution of this model is:

[0076]

[0077] Among them, R d Denote the retardation factor, C0 denote the initial concentration of the injected pollutant, x denote the pollutant migration length, u denote the pollutant (solute) migration velocity, D L Denote the longitudinal dispersion coefficient, and C denote the pollutant concentration.

[0078] S3. Regard the three-dimensional porous medium as a spatially continuous two-dimensional grayscale image along the water flow simulation direction, construct the two-dimensional parameter matrices of the molecular diffusion coefficient D m and the average pore velocity u′ (Darcy velocity v / two-dimensional porosity ) for each two-dimensional grayscale image and expand them to the same size as the image, and then splice the above two parameter matrices with the original two-dimensional single-channel (grayscale) image along the channel direction to form a three-channel image containing physical information;

[0079] Among them, the three-dimensional porous medium image is regarded as a spatially continuous two-dimensional single-channel image sequence along the water flow simulation direction (the Z-axis direction in the present invention), the length of the three-dimensional porous medium image in the water flow simulation direction is the length of the two-dimensional single-channel image sequence, and the thickness of the two-dimensional single-channel image is equivalent to the pixel size.

[0080] The two-dimensional parameter matrix of the average pore velocity u′:

[0081] M i = u′ i *ones(s, t)

[0082] The two-dimensional parameter matrix of the molecular diffusion coefficient D m :

[0083] N i = D m *ones(s, t)

[0084] Among them, M i Denote the two-dimensional parameter matrix of the average pore velocity u′ corresponding to the i-th two-dimensional single-channel image of the porous medium, and N i Denote the two-dimensional parameter matrix of the molecular diffusion coefficient D corresponding to the i-th two-dimensional single-channel image of the porous medium m , and s and t respectively denote the length and width of the two-dimensional single-channel image.

[0085] S4. The three-channel porous medium image with physical parameter information and the inversion parameter longitudinal dispersion coefficient DL and the migration velocity u to form a dataset with input-output sample pairs, and further divide it into a training set, a validation set and a test set, train the PhyCNN-Transformer neural network multi-output regression model, and use the coefficient of determination R 2 to evaluate the prediction performance and generalization ability of the model. The closer the coefficient of determination R 2 is to 1, the better the prediction performance and generalization ability of the model. Specifically: First, use the image data augmentation method to increase the sample size of the dataset. The image data augmentation method includes three image transformations: vertical flipping, horizontal flipping, and diagonal flipping. Second, use the data range conversion formula to convert the numerical sizes of the average pore flow velocity u′, the molecular diffusion coefficient D m , the longitudinal dispersion coefficient D L and the migration velocity u in the dataset. Finally, use the training set to train the PhyCNN-Transformer neural network multi-output regression model, and use the validation set and the test set to evaluate the prediction performance and generalization ability of the model.

[0086] The PhyCNN-Transformer neural network multi-output regression model: uses CNN to extract three-channel image features containing physical information, uses the Transformer network to process the sequence correlation of the image features, and then realizes the simultaneous prediction of the longitudinal dispersion coefficient D L and the actual water flow velocity u through the fully connected layer.

[0087] Example

[0088] 2500 three-dimensional porous medium samples (200×200×1000 voxels) composed of spherical particles were obtained by the precipitation generation method, and the schematic diagram is shown in Figure 2 .

[0089] For each porous medium, 2 Darcy flow velocity values v1 and v2, and 4 molecular diffusion coefficient values D m,1 , D m,2 , D m,3 and D m,4 were set to perform LBM flow field simulation and particle tracking simulation, so as to obtain 4 breakthrough curves C1(t), C2(t), C3(t), C4(t) at the outlet of the porous medium in the Z-axis direction, and the longitudinal dispersion coefficient D L and the migration velocity u obtained by SciPy optimization inversion. The density distribution and truncated lognormal distribution of the molecular diffusion coefficient D m and the Darcy flow velocity v are shown in Figure 4 . The SciPy optimization inversion effect is illustrated by the fitting degree of the breakthrough curve BTC obtained by particle tracking simulation and the advection-dispersion equation ADE, and the coefficient of determination R 2, characterized by the root mean square error RMSE, and its fitting result is as Figure 5 shown. The density distributions of the longitudinal dispersion coefficient D L and the migration velocity u and the truncated lognormal distribution are shown in Figure 6 .

[0090] The data ranges of the parameters molecular diffusion coefficient D m , average pore velocity u′, longitudinal dispersion coefficient D L and migration velocity u were transformed. The above parameters have the following mapping relationship with the sample images:

[0091] Define the porous medium image set P = {p1, p2, p3,..., p 10000}), molecular diffusion coefficient set D m and Darcy velocity set V′, where the data sets D m and V′ include 10,000 molecular diffusion coefficient values and 5,000 Darcy velocity values respectively:

[0092] D m = {D m,1 , D m,2 , D m,3 ,..., D m,10000}

[0093] V′ = {v′1, v′2, v′3,..., v′ 5000}

[0094] Define the function M to map the porous medium sample p i to the corresponding molecular diffusion coefficient D m,i :

[0095] M: P → D m

[0096] M(p i ) = D m,i

[0097] Define the function F to map the porous medium sample p i to the corresponding Darcy velocity v′ 2n or v′ 2n-1 , and denote it by v i :

[0098] F: P → V′

[0099]

[0100] where i = 1, 2,..., 10000.

[0101] For a deep learning dataset D containing 10,000 input-output pairs, the input of each input-output pair includes a porous medium image p i , molecular diffusion coefficient D m,i , Darcy velocity v i ; the output includes longitudinal dispersion coefficient D L,i and migration velocity u i :

[0102] D = {(x i , y i ) | x i = (p i , D m,i , v i ), y i = (D L,i , u i ), i = 1, 2,..., 10000}

[0103] For dataset D, it is divided into a training set and a test set according to an 8:2 ratio, and the training set is further divided into a training subset and a validation subset according to an 8:2 ratio, that is, the number of samples in the training subset is 6400, the number of samples in the validation subset is 1600, and the number of samples in the test set is 2000.

[0104] Use the Pytorch platform to build a PhyCNN-Transformer neural network architecture. The hyperparameters are set such as the CNN convolution kernel size, number, etc. The number of encoding layers and the number of multi-head self-attention heads in the Transformer Encoder are shown in Table 1.

[0105] Table 1 Network parameters of the PhyCNN-Transformer model adopted in the implementation example

[0106]

[0107] After 30 epochs of training, the neural network achieved accurate predictions of the longitudinal dispersion coefficient D Figure 7 for the validation subset ( Figure 8 ) and the test set ( L ), migration velocity u, showing excellent prediction performance and generalization ability.

[0108] In addition, the time required to calculate the longitudinal dispersion coefficient D L , migration velocity u for 2500 porous media is about 1×10 7 s, the time required to train the neural network (including 8000 input-output sample pairs) is about 1×10 5 s, and the longitudinal dispersion coefficient D of 2000 samples is predicted using the trained neural network model LThe time required for the migration speed u is approximately 1600 s. It can be seen that the PhyCNN-Transformer neural network model has a significant order-of-magnitude improvement in computational efficiency compared with the computational methods of LBM and particle tracking.

[0109] It should be noted that in this document, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the term "comprising", "including" or any other variation thereof is intended to cover non-exclusive inclusion, such that a process, method, article or device comprising a series of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article or device.

[0110] Finally, it should be noted that the above are only preferred embodiments of the present invention and are not used to limit the present invention. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions recorded in the foregoing embodiments, or perform equivalent replacements for some of the technical features. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of the present invention shall be included within the protection scope of the present invention.

Claims

1. A method for predicting the longitudinal dispersivity and migration velocity of groundwater solutes based on a Transformer network, characterized in that, The prediction steps are as follows: Construct a three-dimensional porous medium with solid spherical particle packing by the precipitation generation method, use LBM to simulate the flow field in the porous medium, and use the particle tracking method to simulate the solute transport process and obtain the breakthrough curve (BTC); The longitudinal dispersion coefficient D and the solute migration velocity u are inversely calculated based on the analytical solution of the pollutant migration equation and the SciPy optimization algorithm. L And the solute migration velocity u; The three-dimensional porous medium is regarded as a two-dimensional grayscale image that is spatially continuous along the water flow simulation direction, and the parameter matrices of the molecular diffusion coefficient D m and the average pore velocity u′ are constructed and added to the two-dimensional grayscale image to obtain a three-channel image containing physical information; Combine the three-channel image containing physical information with the inversion parameter longitudinal dispersion coefficient D L , the actual water flow velocity u to form a data set with input-output sample pairs, and further divide it into a training set, a validation set and a test set, and then train the PhyCNN-Transformer neural network multi-output regression model, and evaluate the prediction performance and generalization ability; The PhyCNN-Transformer neural network multi-output regression model: uses a CNN to extract three-channel image features containing physical information, uses a Transformer network to process the sequential correlation of the image features, and then realizes the simultaneous prediction of the longitudinal dispersion coefficient D L and the migration velocity u.

2. The method for predicting the groundwater solute dispersion coefficient and migration velocity based on the Transformer network according to claim 1, characterized in that, The specific steps of constructing the porous medium by packing solid spherical particles by the precipitation generation method are as follows: L1. Generate a solid particle, determine its particle size according to a preset probability density function or uniform particle size value, and randomly determine its initial position at the top of the simulation area; L2. The newly generated solid particle continuously settles from the initial position until there are three solid particles supporting it below or it reaches the bottom of the simulation area; at the end of the settlement process, the solid particle reaches the lowest point of its potential energy; L3. Repeat steps L1 and L2 until the solid particles and the pores between them fill the entire simulation area.

3. The method for predicting the solute dispersion coefficient and migration velocity of groundwater based on the Transformer network according to claim 1, wherein: The assumed conditions for the pollutant migration equation are as follows: the research domain is a semi-infinite long porous medium column, the medium is uniform and isotropic; the flow field is a uniform flow with a constant velocity, and the pollutant migration velocity u is a constant; the convective dispersion of the pollutant is one-dimensional; there is no requirement for whether the research domain contains pollutants at the initial moment; When there is no source-sink effect and no chemical reaction, the mathematical model for the migration of pollutants under the given flux boundary condition is: If the pollutant is conservative and does not undergo adsorption, the solution of this model is: Among them, R d represents the retardation factor, C0 represents the initial concentration of the injected pollutant, x represents the pollutant migration length, u represents the pollutant migration velocity, D L represents the longitudinal dispersion coefficient, and C represents the pollutant concentration.

4. The method for predicting the groundwater solute dispersion coefficient and migration velocity based on the Transformer network according to claim 1, wherein The three-dimensional porous medium image is regarded as a continuous two-dimensional single-channel image sequence in space along the water flow simulation direction, where the length of the three-dimensional porous medium image in the water flow simulation direction is the length of the two-dimensional single-channel image sequence, and the thickness of the two-dimensional single-channel image is equal to the pixel size.

5. The method for predicting the groundwater solute dispersion coefficient and migration velocity based on the Transformer network according to claim 1, wherein The steps for constructing the three-channel porous medium image containing physical information are as follows: For each two-dimensional single-channel image in the two-dimensional single-channel image sequence, a two-dimensional parameter matrix of the molecular diffusion coefficient D m and the average pore velocity u′ is constructed respectively; Expand the two-dimensional parameter matrix to the same size as the original two-dimensional image, and along the channel direction, the two-dimensional parameter matrix of the molecular diffusion coefficient D m is spliced with the two-dimensional parameter matrix of the average pore velocity u′ and the original image to form a three-channel image containing physical information.

6. The method for predicting the groundwater solute dispersion coefficient and migration velocity based on the Transformer network according to claim 1, characterized in that, The two-dimensional parameter matrix of the average pore velocity u′: M i = u' i * ones(s, t) The molecular diffusion coefficient D m Two-dimensional parameter matrix: N i = D m * ones(s, t) Among them, M i represents the two-dimensional parameter matrix of the average pore velocity u′ corresponding to the i-th two-dimensional single-channel image of the porous medium, and N i represents the molecular diffusion coefficient D m two-dimensional parameter matrix corresponding to the i-th two-dimensional single-channel image of the porous medium, where s and t represent the length and width of the two-dimensional single-channel image, respectively.

7. The method for predicting the groundwater solute dispersion coefficient and migration velocity based on the Transformer network according to claim 1, characterized in that: Use the image data augmentation method to increase the number of training samples in the sample set. The image data augmentation method includes vertical flipping, horizontal flipping, and diagonal flipping.

8. The method for predicting the solute dispersion coefficient and migration velocity of groundwater based on the Transformer network according to claim 1, wherein: The order of magnitude of the average pore velocity u′ and the solute migration velocity u is 10 -5 ~10 -4 , the molecular diffusion coefficient D m and the longitudinal dispersion coefficient D L are of the order of 10 -10 ~10 -7 , before training the neural network, convert the ranges of the average pore velocity u′, the solute migration velocity u, the molecular diffusion coefficient D m and the longitudinal dispersion coefficient D L . The conversion formula is: where \(i\) represents the ordinal number of the two-dimensional single-channel image of the porous medium, \(\varphi_i\) represents the porosity of the \(i\)-th two-dimensional single-channel image of the porous medium, and \(v\) represents the Darcy flow velocity value.

Citation Information

Patent Citations

  • Test method and test device for obtaining saturated solubility and diffusion coefficients of solid solute in liquid phase simultaneously

    CN101907549A

  • Method for predicting permeability of porous medium based on LSTM (Long Short Term Memory)

    CN113947026A