A gangue reclamation area heavy metal element penetration range evaluation method based on multi-scale simulation combined with a GAT model
By using multi-scale simulation and the graph attention network (GAT) model, the accuracy and efficiency issues of heavy metal permeation range assessment in gangue reclamation areas were solved, achieving efficient permeation range assessment.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- XINJIANG INST OF ENG
- Filing Date
- 2026-01-15
- Publication Date
- 2026-06-09
AI Technical Summary
Existing technologies are insufficient for accurately and quickly assessing the penetration range of heavy metal elements in gangue reclamation areas, especially in terms of large-scale continuous spatiotemporal monitoring and computational resource bottlenecks.
We employ multi-scale simulation combined with the GAT model, using the lattice Boltzmann method to characterize water flow, solute transport, and chemical reaction processes within porous media, generating a training dataset. We then establish a mapping relationship from media characteristics to concentration distribution through the graph attention network GAT model, enabling rapid prediction.
It enables rapid and accurate assessment of the penetration range of heavy metals, taking into account both the accuracy of migration mechanisms and computational efficiency, and overcomes the limitations of traditional methods in terms of computational efficiency and assessment accuracy.
Smart Images

Figure CN122174599A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of heavy metal permeation range assessment technology in gangue reclamation areas, and more particularly to a method for assessing the heavy metal permeation range in gangue reclamation areas based on multi-scale simulation combined with GAT model. Background Technology
[0002] Due to the long-term storage of industrial waste in gangue reclamation areas, heavy metals (such as lead, cadmium, and arsenic) within these areas are prone to dissolution and migration under the leaching effect of rainwater. These metals then infiltrate into the surrounding soil and groundwater systems, posing a potential threat to the ecological environment and human health. Accurately assessing the infiltration range of heavy metals is a crucial prerequisite for implementing ecological risk early warning and remediation. Because the gangue-soil medium is highly heterogeneous with a complex and variable pore structure, and because heavy metal migration involves multiphase chemical reactions such as dissolution-precipitation and adsorption-desorption, these microscopic physicochemical processes significantly influence macroscopic infiltration behavior. Therefore, efficiently and accurately characterizing the migration mechanisms of heavy metals in porous media has become an important research direction in environmental engineering and soil science.
[0003] Currently, the assessment methods for the extent of heavy metal infiltration in gangue reclamation areas mainly fall into two categories: one is the measurement method based on limited sampling points and geophysical exploration. Although this method can obtain local data, it is limited by sampling density and cost, making it difficult to achieve large-scale continuous spatiotemporal monitoring; the other is the use of traditional numerical simulation methods, such as macroscopic models based on Darcy flow-convection dispersion equations, which simplify porous media into homogeneous or fractional continuums and describe the migration process through averaged parameters (such as permeability and dispersion). However, such methods have significant limitations: (1) insufficient handling of the complexity of the medium. Macroscopic models cannot accurately characterize the control effect of microscopic pore structure on water flow and solute transport, and the precipitation-dissolution reaction mechanism of heavy metals is oversimplified; (2) low computational efficiency. Although high-resolution models can partially reflect microscopic effects, they face computational resource bottlenecks in multi-parameter, long-term, and large-scale simulations, making it difficult to meet the needs of rapid assessment. In addition, although the Lattice Boltzmann Method (LBM), which has been developed in recent years, can accurately simulate pore-scale flow and chemical reactions through particle distribution evolution, its high computational cost limits its engineering application. Summary of the Invention
[0004] To address the aforementioned technical problems, this invention provides a method for assessing the permeation range of heavy metals in gangue reclamation areas based on multi-scale simulation combined with a GAT model. First, the invention utilizes the lattice Boltzmann method to characterize water flow, solute transport, and chemical reaction processes within porous media, generating a multi-scenario training dataset. Then, based on this dataset, a graph attention network (GAT) model is trained to establish a precise mapping relationship from media characteristics to concentration distribution. Finally, the trained GAT model is used to quickly predict new areas, achieving a rapid and accurate assessment of the heavy metal permeation range in gangue reclamation areas that balances accuracy of migration mechanisms with computational efficiency.
[0005] The technical means employed in this invention are as follows: A method for assessing the permeability range of heavy metal elements in gangue reclamation areas based on multi-scale simulation combined with a GAT model includes: S1. The lattice Boltzmann method is used to characterize the water flow, solute transport and chemical reaction processes in porous media, a multi-physics coupling model is established, and a multi-scene training dataset is generated based on the multi-physics coupling model. S2. Based on the multi-process LBM modeling results, construct the graph attention network (GAT) model, and use the multi-scenario training dataset to train the graph attention network (GAT) model to establish an accurate mapping relationship from medium features to concentration distribution. S3. Call the trained Graph Attention Network (GAT) model to predict the range of heavy metal infiltration in the new reclamation area. Perform machine learning on the prediction results and apply them to the reclamation area to achieve intelligent prediction and assessment of the range of heavy metal infiltration.
[0006] Further, step S1 includes: S11. The coupled process of fluid flow, solute mass transfer, dissolution and precipitation of heavy metals in a porous medium of mixed gangue and soil is determined as the simulation object. The initial porosity, equilibrium concentration of heavy metals and solid molar volume parameters are obtained through borehole sampling and experiments. The grid and time step are set according to the actual range of the reclamation area in combination with the pore size of the medium. S12. Using a discrete approach, define the boundary conditions for the water flow simulation, including the velocity and flow rate boundaries on the water supply and discharge sides; calculate the initial velocity distribution function based on the initial density and initial velocity. Substitute the data into the multi-relaxation MRT-LBM model, iteratively update the distribution function, and extract the average density and flow velocity. S13. The single-relaxation LBGK model is adopted to set the relaxation time of the migration process and the reaction boundary of the solid-liquid interface. The concentration distribution function is initialized according to the initial heavy metal concentration being equal to the equilibrium concentration. The mass transfer equilibrium state is calculated by simulating the real-time flow velocity of the water flow to reflect the convection effect. The concentration distribution function is iteratively updated and the macroscopic concentration is extracted. S14. For pore water near solid substances, determine the reaction type by calculating the difference between the current heavy metal concentration and the equilibrium concentration; adjust the volume of solid substances according to the reaction type and update the pore structure of the medium accordingly; when the solid is completely dissolved, the space originally occupied becomes pores; when precipitation causes the solid volume to increase to a preset threshold, the adjacent pores are filled by the newly generated solid, thereby reducing the porosity. S15. Based on the updated porosity, correct the effective diffusion coefficient of solute transport simulation and the effective permeability of water flow simulation; clarify the multi-field coupling sequence at each time step as water flow simulation iteration, solute transport simulation iteration, reaction judgment to solid phase update, medium adjustment, parameter correction, to ensure the continuous transmission of data between physical fields. S16. At regular intervals, calculate the maximum rate of change of concentration and the rate of change of porosity. When the maximum rate of change of concentration and the rate of change of porosity are both within the acceptable range of small fluctuations in numerical simulation, and the change in the depth of heavy metal penetration is within a reasonable range that can be ignored in engineering evaluation, the model reaches a steady state and the iteration stops. If this state is not reached, return to step S12. S17. Collect measured data on heavy metal concentration and porosity at different depths in the reclamation area, compare them with the model results, and ensure that the deviation is within the acceptable range for the project; divide the heavy metal risk zone according to national standards, adjust the initial porosity and reaction rate constant, simulate the impact of media improvement and anti-seepage layer laying measures on heavy metal infiltration, and provide a basis for pollution prevention and remediation.
[0007] Further, step S12 includes: S121. Construct a multi-relaxation MRT-LBM model as follows:
[0008] The above formula updates the direction of each discrete velocity step by step and each grid node. Distribution function on The distribution function in space is obtained. and time The microscopic state at that point; in the above formula, Discrete velocity direction The velocity distribution function vector, It is an orthogonal transformation matrix. For a relaxed diagonal matrix, For time steps, Discrete velocity; S122, Design the equilibrium distribution function for water flow simulation ,as follows:
[0009] The equilibrium distribution function directly gives the direction of each discrete velocity. The particle distribution density in space; when the water flow is in an equilibrium state with no macroscopic flow acceleration or no viscous dissipation, and time At this point, the equilibrium distribution function gives the proportion of virtual particles moving in different directions; in the above formula, For weighting coefficients, For average density, For average speed, The square of the lattice sound velocity; S123. By summing the equilibrium distribution functions in all directions, the average density is obtained. :
[0010] S124. The average velocity is obtained by weighted summation of discrete velocity and equilibrium distribution function. : .
[0011] Further, step S13 includes: S131. Design the concentration equilibrium distribution function as follows:
[0012] In the above formula, For the average heavy metal concentration, the coefficients 4.5 and 1.5 are obtained by substituting the square of the lattice sound velocity. =1 / 3 obtained, The water flow-solute coupling is achieved by substituting the results of the water flow simulation calculation; S132. Based on the designed concentration equilibrium distribution function, a single-relaxation LBGK model is constructed as follows:
[0013] In the above formula, Let be the concentration distribution function. This is the relaxation time for the migration process (controlling the magnitude of the diffusion coefficient). Let be the concentration equilibrium distribution function; S133. By summing the concentration distribution functions in all discrete directions, the average heavy metal concentration at the computational node is obtained. : .
[0014] Further, in step S14, the boundary conditions for the dissolution-precipitation reaction are set to characterize the concentration distribution function correction rule at the solid-liquid interface, as follows:
[0015] In the above formula, For water flow nodes near the wall, Let be the concentration distribution function after the collision. This refers to the concentration at the solid-liquid interface. Dissolves in time. Time sedimentation, To balance the concentration.
[0016] Further, step S15 includes: S151. Based on the updated porosity, correct the effective diffusion coefficient of solute transport simulation and the effective permeability of water flow simulation:
[0017]
[0018] In the above formula, For real-time effective penetration rate, Initial penetration rate, The real-time effective diffusion coefficient, The initial diffusion coefficient is . The real-time porosity is represented by an exponent of 1.5, which is used to correct for the hindering effect of pore tortuosity on diffusion. S152. Calculate the Reynolds number and Damcole number to quantify the flow intensity, guide the adjustment of flow simulation parameters, ensure that the model matches the actual flow state of the reclamation area, and be used to determine the response control type. The formulas for calculating the Reynolds number and Damcole number are as follows:
[0019]
[0020] In the above formula, For effective flow rate, The vertical depth of the reclaimed area. For water viscosity, The reaction rate constant is... The real-time effective diffusion coefficient; S153. The multi-field coupling sequence at each time step is defined as follows: water flow simulation iteration, solute transport simulation iteration, reaction judgment to solid phase update, medium adjustment, and parameter correction, ensuring the coherent transfer of data between physical fields and forming a complete closed loop.
[0021] The conditional formula on the left controls the fluctuation range of macroscopic concentration, while the conditional formula on the right controls the fluctuation range of porosity. When both conditions are met, the model reaches a steady state, the heavy metal permeation range no longer changes significantly, and the closed loop ends.
[0022] Further, step S2 includes: S21. Using the validated lattice Boltzmann multiphysics coupling model, numerical simulations are performed under a wide variety of medium structures and environmental conditions to generate a large number of paired input and output samples, which constitute the initial training dataset. S22. Standardize the input features and output concentrations of all samples in the initial training dataset to obtain the standardized dataset for the Graph Attention Network (GAT) model, as shown in the following formula:
[0023]
[0024] In the above formula, This represents the input features of all samples in the initial training dataset. and Let represent the mean and standard deviation of the input features for all samples in the initial training dataset, respectively. This represents the standardized input features used for training the Graph Attention Network (GAT) model. This represents the output concentration of all samples in the initial training dataset. and Let denot and represent the mean and standard deviation of the output concentration of all samples in the initial training dataset, respectively. During the training phase, the model will learn to predict this standardized target output concentration. ; S23. Divide the standardized dataset into training, validation, and test sets for model training, performance evaluation, and final performance verification, respectively; a total of Each sample corresponds to a time point, and the data is arranged chronologically from... arrive Arrangement, let:
[0025] In the above formula, The maximum integer value is retained for the number of training set samples. The largest integer is retained to determine the number of samples in the validation set. The test set contains the remaining data; the data is directly split into three parts in chronological order, with the training set starting from the first data point. From the beginning to the end data Up to; the verification set starts from the 1st data From the beginning to the end data Up to; the test set starts from the 1st data From the beginning to the end Up to the last data point; S24. Construct a graph attention network (GAT) model with a multi-head attention mechanism, set the number of attention heads and feature dimension parameters, and use the Xavier initialization method to initialize all trainable parameters such as the weight matrix and attention vector of the graph attention network (GAT) model, so as to provide a suitable initial state for training the graph attention network (GAT) model. S25. Input the graph structure data into the Graph Attention Network (GAT) model and perform the complete forward computation process, including: The attention coefficient between nodes is calculated using the following formula:
[0026] In the above formula, and Representing nodes respectively and The input feature vector, This represents the learnable weight matrix. It is the output feature dimension; It is a learnable attention vector used to calculate attention coefficients; This represents a vector concatenation operation, which combines two vectors with the same dimensions. The vectors are concatenated to form a dimension of ; It is an activation function used to introduce nonlinearity, allowing the model to learn the complex physicochemical relationships between adjacent positions that both promote and inhibit the migration of heavy metals. Through the above formula, the influence of each adjacent grid cell on the heavy metal concentration of the target grid cell is adaptively learned and quantified, thereby characterizing the migration path of pollutants in complex heterogeneous porous media. The attention coefficients are normalized using the softmax function to obtain standardized attention weights. :
[0027] In the above formula, Represents a node The set of neighboring nodes; Indicates at node Of all the neighbors, the neighbors The normalized attention weights satisfy ; S26. The node features processed by the graph attention mechanism are mapped through a fully connected layer to obtain the predicted heavy metal concentration values for each node, including: Based on attention weights, for nodes The features of all neighbors are weighted and summed, and the mean squared error is used as the loss function to obtain the node. New feature representation :
[0028] The above formula is used to fuse information from neighboring nodes, update the feature representation of the current node, calculate the difference between the predicted concentration and the true concentration, and quantify the prediction accuracy of the model in the current training batch. It is a nonlinear activation function used to simulate the combined effect of chemical reactions that occur during the migration of heavy metals on the concentration distribution; It is a node The updated feature vector has a dimension of ; To enhance model stability and expressive power, the following approach was adopted. Each independent attention head is calculated, and The outputs of the individual attention heads are concatenated to form a more powerful feature representation. :
[0029] In the above formula, It's about the number of heads; It is the first Normalized attention weights for each attention head; It is the first The learnable weight matrix corresponding to each attention head; This indicates concatenation along the feature dimensions, and the final output feature dimension is... Finally, the aggregated high-level features are mapped to the predicted normalized concentrations through the output layer. ; S27. Calculate the gradient of the loss function with respect to each parameter of the model using the backpropagation algorithm, and then use the Adam optimizer based on the loss... The gradient direction and learning rate are used to update all weight parameters, including: Calculate the predicted values for all nodes in the graph. Compared with true standardized concentration The mean square error between them is used as the loss. :
[0030] loss The overall deviation between the heavy metal concentration distribution predicted by the graph attention network (GAT) model and the actual concentration distribution obtained through LBM simulation was quantified; in the above formula, For the image The total number of all nodes in the array; The loss function for all parameters of the Graph Attention Network (GAT) model is calculated using the gradient descent algorithm. gradient And adjust the model parameters according to the gradient direction of the loss function:
[0031] In the above formula, The set of all trainable parameters of the model; The learning rate controls the step size for parameter updates; This represents the gradient of the loss function with respect to the parameters.
[0032] S28. During the training process, use the validation set to evaluate the model performance periodically and record the changing trends of training loss and validation loss. When the validation loss no longer decreases for several consecutive training cycles, stop the training process in advance and save the model parameters that perform best on the validation set as the final model.
[0033] Furthermore, in step S23, in order to use a graph attention network for modeling, the simulation data of each reclamation area must be represented as a graph. The specific construction method is as follows: S231, Build Nodes Treat each spatially discretized grid cell as a graph. One of the nodes The feature vector of this node This refers to all standardized input parameters at the current grid cell, including a vector consisting of porosity, flow velocity, and initial concentration; that is, directly mapping the regular cubic grid cells used in the lattice Boltzmann method to nodes in the graph. Each node corresponds to a specific spatial location. The feature vector consists of standardized physical parameters at the current grid cell, including porosity and flow velocity components. Initial heavy metal concentration, equilibrium concentration, and solid molar volume form a... 3D feature vector; S232, Constructing edges :picture The edges connecting nodes define the spatial interaction relationships between nodes. The spatial adjacency criterion is used to establish edges. If two grid cells are spatially adjacent, then there is an edge between the nodes corresponding to the two grid cells, that is, the two grid cells are neighbors. ; S233. Based on the above construction method, the node... Represents a specific grid cell of interest; neighbor ,symbol Representative node The set of neighbors, that is, all nodes that are related to the node. via edge Directly connected nodes The set, which defines the nodes that have the right to pass information during the information aggregation process. Information about spatial location.
[0034] Further, step S3 includes: S31. Transfer the newly acquired input data The model is constructed as a graph structure, where nodes represent spatial locations and edges represent adjacency relationships. The mean and standard deviation of the input features calculated from the training set during the model building phase are used to perform a completely consistent standardization process on the node features.
[0035] For the new assessment area, input data Use the same method as during the training phase. and Standardize the data to ensure consistent data distribution; S32. Input the standardized graph data into the pre-trained optimal graph attention network (GAT) model. The optimal graph attention network (GAT) model directly outputs the predicted standardized concentration of each node through a fast forward computation:
[0036] In the above formula, For the new standardized data, For predicting concentration maps; S33. Using the mean and standard deviation of the output concentration calculated from the training set during the graph attention network (GAT) model construction phase, denormalize the standardized prediction results output by the optimal graph attention network (GAT) model to restore the standardized prediction results to the true physical concentration scale:
[0037] In the above formula, This indicates the final distribution map of heavy metal concentration at the real scale, used for the final assessment of the permeability range; S34. Based on the final heavy metal concentration distribution map after reduction, and in accordance with environmental standards, determine the pollution risk level and the penetration range of heavy metal elements.
[0038] Compared with the prior art, the present invention has the following advantages: 1. This invention employs a graph attention network architecture to train simulated data using deep learning. This network uses a multi-head attention mechanism to weighted aggregate nodes and their neighborhoods in the graph, effectively capturing unstructured and non-uniform spatial dependencies in the medium and establishing an end-to-end mapping from medium characteristic parameters to heavy metal concentration distribution. The trained graph attention network (GAT) model can achieve spatial reconstruction of the infiltration range of heavy metal elements within the reclaimed area.
[0039] 2. By deeply integrating multi-scale modeling and machine learning, this method transforms the traditional time-consuming numerical calculation process into efficient graph neural network inference and prediction. While ensuring the accuracy of physical mechanisms, it achieves a significant improvement in evaluation efficiency and effectively solves the bottleneck problem of computing resources in large-scale site evaluation.
[0040] 3. This invention aims to overcome the limitations of traditional methods in terms of computational efficiency and assessment accuracy. By organically combining multi-scale physical modeling and deep learning, it provides an innovative solution for heavy metal pollution risk assessment in gangue reclamation areas that combines mechanistic accuracy and computational efficiency, filling the gap in existing technologies for assessing the extent of infiltration.
[0041] 4. This invention simulates the migration process based on the lattice Boltzmann method. Through mesoscopic particle evolution simulation, it accurately characterizes the water flow, solute transport, and dissolution-precipitation reaction processes in the complex porous media of gangue-soil, providing a reliable physical mechanism for evaluation.
[0042] 5. This invention is based on the Graph Attention Network (GAT) model and employs machine learning twice. It utilizes a multi-head attention mechanism to adaptively weight and aggregate node features in the graph, enabling rapid assessment of heavy metal penetration range through a single forward propagation, thus improving modeling and prediction accuracy and shortening the time required. Attached Figure Description
[0043] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0044] Figure 1 This is a flowchart of the method of the present invention.
[0045] Figure 2 This is a flowchart illustrating the assessment of heavy metal penetration range in gangue reclamation areas based on the lattice Boltzmann method of this invention.
[0046] Figure 3This is a flowchart of the graph attention network (GAT) model constructed based on the multi-process LBM modeling results of this invention.
[0047] Figure 4 This is a flowchart illustrating how the present invention uses a pre-built model to quickly evaluate a new region. Detailed Implementation
[0048] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0049] It should be noted that the terms "comprising" and "having" and any variations thereof in the specification, claims and accompanying drawings of this invention are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are explicitly listed, but may include other steps or units that are not explicitly listed or that are inherent to such processes, methods, products or devices.
[0050] like Figure 1 As shown, this invention provides a method for assessing the permeability range of heavy metal elements in gangue reclamation areas based on multi-scale simulation combined with a GAT model, including: S1. The lattice Boltzmann method is used to characterize the water flow, solute transport and chemical reaction processes in porous media, a multi-physics coupling model is established, and a multi-scene training dataset is generated based on the multi-physics coupling model. S2. Based on the multi-process LBM modeling results, construct the graph attention network (GAT) model, and use the multi-scenario training dataset to train the graph attention network (GAT) model to establish an accurate mapping relationship from medium features to concentration distribution. S3. Call the trained Graph Attention Network (GAT) model to predict the range of heavy metal infiltration in the new reclamation area. Perform machine learning on the prediction results and apply them to the reclamation area to achieve intelligent prediction and assessment of the range of heavy metal infiltration.
[0051] In specific implementation, as a preferred embodiment of the present invention, such as Figure 2 As shown, step S1 includes: S11. The coupled process of fluid flow, solute mass transfer, dissolution and precipitation of heavy metals in a porous medium of mixed gangue and soil is determined as the simulation object. The initial porosity, equilibrium concentration of heavy metals and solid molar volume parameters are obtained through borehole sampling and experiments. The grid and time step are set according to the actual range of the reclamation area in combination with the pore size of the medium. S12. Using a discrete approach, define the boundary conditions for the water flow simulation, including the velocity and flow rate boundaries on the water supply and discharge sides; calculate the initial velocity distribution function based on the initial density and initial velocity. Substitute the data into the multi-relaxation MRT-LBM model, iteratively update the distribution function, and extract the average density and flow velocity. S13. The single-relaxation LBGK model is adopted, and the relaxation time (correlated diffusion coefficient) and solid-liquid interface reaction boundary are set for the migration process. The concentration distribution function is initialized with the initial heavy metal concentration equal to the equilibrium concentration. The mass transfer equilibrium state is calculated by simulating the real-time flow velocity of the water flow to reflect the convection effect. The concentration distribution function is iteratively updated and the macroscopic concentration is extracted. S14. For pore water near solid substances, the reaction type is determined by calculating the difference between the current heavy metal concentration and the equilibrium concentration (negative difference indicates dissolution, positive difference indicates precipitation, and zero difference indicates no reaction); the volume of the solid substance is adjusted according to the reaction type, and the pore structure of the medium is updated accordingly; when the solid is completely dissolved, the space originally occupied is converted into pores (porosity increases); when precipitation causes the solid volume to increase to a preset threshold, the adjacent pores are filled by the newly generated solid, thereby reducing the porosity; S15. Based on the updated porosity (the ratio of the total number of water flow nodes to the total number of grid nodes), correct the effective diffusion coefficient of solute transport simulation and the effective permeability of water flow simulation; clarify the multi-field coupling sequence at each time step as water flow simulation iteration, solute transport simulation iteration, reaction judgment to solid phase update, medium adjustment, parameter correction, to ensure the continuous transmission of data between physical fields. S16. At regular intervals, calculate the maximum rate of change of concentration and the rate of change of porosity. When the maximum rate of change of concentration and the rate of change of porosity are both within the acceptable range of small fluctuations in numerical simulation, and the change in the depth of heavy metal penetration is within a reasonable range that can be ignored in engineering evaluation, the model reaches a steady state and the iteration stops. If this state is not reached, return to step S12. S17. Collect measured data on heavy metal concentration and porosity at different depths in the reclamation area, compare them with the model results, and ensure that the deviation is within the acceptable range for the project; divide the heavy metal risk zone according to national standards, adjust the initial porosity and reaction rate constant, simulate the impact of media improvement and anti-seepage layer laying measures on heavy metal infiltration, and provide a basis for pollution prevention and remediation.
[0052] Through the above steps, a simulation of heavy metal migration in gangue reclamation areas based on multi-process LBM (water flow simulation MRT-LBM and solute transport simulation LBGK) was realized. It focuses on the coupled processes of fluid flow, solute mass transfer, dissolution, precipitation and media structure evolution in gangue-soil mixed porous media, and provides an efficient and realistic numerical simulation method for quantitative assessment of the infiltration range and concentration distribution of heavy metals in reclamation areas.
[0053] In a specific implementation, as a preferred embodiment of the present invention, step S12 includes: S121. Construct a multi-relaxation MRT-LBM model as follows:
[0054] The above formula updates the direction of each discrete velocity step by step and each grid node. Distribution function on The distribution function in space is obtained. and time The microscopic state at that point; in the above formula, Discrete velocity direction The velocity distribution function vector, It is an orthogonal transformation matrix (the velocity moment related dimension is retained after simplification). For relaxation diagonal matrix (controlling the relaxation rate of different modes). For time steps, The velocity is discrete; in this embodiment, the distribution function is the basis for simulating the migration of water particles and heavy metal ions in porous media, and its evolution determines the macroscopic concentration distribution and permeation range. The MRT-LBM evolution equation describes the evolution of the fluid particle distribution function over time, and the optimization of flow stability by multiple relaxation mechanisms is the basis for calculating the average flow velocity.
[0055] S122, Design the equilibrium distribution function for water flow simulation ,as follows:
[0056] The equilibrium distribution function directly gives the direction of each discrete velocity. The particle distribution density in space; when the water flow is in an equilibrium state with no macroscopic flow acceleration or no viscous dissipation, and time At this point, the equilibrium distribution function gives the proportion of virtual particles moving in different directions; in the above formula, For weighting coefficients, For average density, For average speed, The value is the square of the lattice sound velocity. In this embodiment, the equilibrium distribution function of the water flow simulation describes the distribution law of the flow particles in the equilibrium state. It is directly related to the average density and velocity, and is the core of the formula for calculating the average quantity of the water flow simulation. It is also the core parameter for calculating the distribution of solute transport direction. As the benchmark for each update iteration, it is the key to achieving accurate coupling between the two processes of water flow and solute migration.
[0057] S123. By summing the equilibrium distribution functions in all directions, the average density is obtained. :
[0058] S124. The average velocity is obtained by weighted summation of discrete velocity and equilibrium distribution function. : .
[0059] In this embodiment, the macroscopic quantity calculation formula for water flow simulation extracts the average density and velocity from the microscopic distribution function, realizing the connection from microscopic evolution to macroscopic flow, and providing convective dynamics for solute transport simulation.
[0060] In a specific implementation, as a preferred embodiment of the present invention, step S13 includes: S131. Design the concentration equilibrium distribution function as follows:
[0061] In the above formula, For the average heavy metal concentration, the coefficients 4.5 and 1.5 are obtained by substituting the square of the lattice sound velocity. =1 / 3 obtained, By substituting the results of water flow simulation calculations, water flow-solute coupling is achieved; in this embodiment, and As defined in the flow simulation, additional coefficients are used to correct the contribution of the convection term to the concentration distribution, ensuring the consistency of the migration process.
[0062] S132. Based on the designed concentration equilibrium distribution function, a single-relaxation LBGK model is constructed as follows:
[0063] In the above formula, Let be the concentration distribution function. This is the relaxation time for the migration process (controlling the magnitude of the diffusion coefficient). Let be the concentration equilibrium distribution function; S133. By summing the concentration distribution functions in all discrete directions, the average heavy metal concentration at the computational node is obtained. : .
[0064] In this embodiment, the solute transport simulation (LBGK) evolution equation describes the evolution of the heavy metal concentration distribution function, coupled with the average velocity of the water flow simulation, reflecting the combined effects of convection and diffusion.
[0065] In a specific implementation, as a preferred embodiment of the present invention, in step S14, the concentration distribution function correction rule for the solid-liquid interface is set according to the boundary conditions of the dissolution-precipitation reaction, as follows:
[0066] In the above formula, For water flow nodes near the wall, Let be the concentration distribution function after the collision. This refers to the concentration at the solid-liquid interface. Dissolves in time. Time sedimentation, To balance the concentration.
[0067] In a specific implementation, as a preferred embodiment of the present invention, step S15 includes: S151. Based on the updated porosity (the ratio of the total number of flow nodes to the total number of grid nodes), correct the effective diffusion coefficient for solute transport simulation and the effective permeability for flow simulation:
[0068]
[0069] In the above formula, For real-time effective penetration rate, Initial penetration rate, The real-time effective diffusion coefficient, The initial diffusion coefficient is . The real-time porosity is represented by an exponent of 1.5, which is used to correct for the hindering effect of pore tortuosity on diffusion. S152. Calculate the Reynolds number and Damcole number to quantify the flow intensity, guide the adjustment of flow simulation parameters, ensure that the model matches the actual flow state of the reclamation area, and be used to determine the response control type. The formulas for calculating the Reynolds number and Damcole number are as follows:
[0070]
[0071] In the above formula, For effective flow rate, The vertical depth of the reclaimed area. For water viscosity, The reaction rate constant is... The real-time effective diffusion coefficient; S153. The multi-field coupling sequence at each time step is defined as follows: water flow simulation iteration, solute transport simulation iteration, reaction judgment to solid phase update, medium adjustment, and parameter correction, ensuring the coherent transfer of data between physical fields and forming a complete closed loop.
[0072] The conditional formula on the left controls the fluctuation range of macroscopic concentration, while the conditional formula on the right controls the fluctuation range of porosity. When both conditions are met, the model reaches a steady state, the heavy metal permeation range no longer changes significantly, and the closed loop ends.
[0073] In specific implementation, as a preferred embodiment of the present invention, such as Figure 3 As shown, step S2 includes: S21. Using the validated lattice Boltzmann multiphysics coupling model, numerical simulations are performed under a wide variety of medium structures and environmental conditions to generate a large number of paired input and output samples, which constitute the initial training dataset. S22. Standardize the input features and output concentrations of all samples in the initial training dataset to obtain the standardized dataset for the Graph Attention Network (GAT) model, as shown in the following formula:
[0074]
[0075] In the above formula, This represents the input features of all samples in the initial training dataset. and Let represent the mean and standard deviation of the input features for all samples in the initial training dataset, respectively. This represents the standardized input features used for training the Graph Attention Network (GAT) model. This represents the output concentration of all samples in the initial training dataset. and Let denot and represent the mean and standard deviation of the output concentration of all samples in the initial training dataset, respectively. During the training phase, the model will learn to predict this standardized target output concentration. ; S23. Divide the standardized dataset into training, validation, and test sets for model training, performance evaluation, and final performance verification, respectively; a total of Each sample corresponds to a time point, and the data is arranged chronologically from... arrive Arrangement, let:
[0076] In the above formula, The maximum integer value is retained for the number of training set samples. The largest integer is retained to determine the number of samples in the validation set. The test set contains the remaining data; the data is directly split into three parts in chronological order, with the training set starting from the first data point. From the beginning to the end data Up to; the verification set starts from the 1st data From the beginning to the end data Up to; the test set starts from the 1st data From the beginning to the end Up to the last data point; S24. Construct a graph attention network (GAT) model with a multi-head attention mechanism, set the number of attention heads and feature dimension parameters, and use the Xavier initialization method to initialize all trainable parameters such as the weight matrix and attention vector of the graph attention network (GAT) model, so as to provide a suitable initial state for training the graph attention network (GAT) model. S25. Input the graph structure data into the Graph Attention Network (GAT) model and perform the complete forward computation process, including: The attention coefficient between nodes is calculated using the following formula:
[0077] In the above formula, and Representing nodes respectively and The input feature vector specifically represents physical parameters such as porosity, flow velocity, and initial heavy metal concentration at the current grid cell, with dimensions of... Input feature dimension; This represents a learnable weight matrix used to linearly transform the aforementioned physical parameters in order to extract feature combinations for predicting heavy metal migration. It is the output feature dimension; It is a learnable attention vector used to calculate attention coefficients; This represents a vector concatenation operation, which combines two vectors with the same dimensions. The vectors are concatenated to form a dimension of ; It is an activation function, and the negative slope is usually set to 0.2 to introduce nonlinearity, so that the model can learn the complex physicochemical relationship between adjacent positions that both promote and inhibit the migration of heavy metals. Through the above formula, the influence of each adjacent grid cell on the heavy metal concentration of the target grid cell is adaptively learned and quantified, thereby characterizing the migration path of pollutants in complex heterogeneous porous media. To ensure that the sum of the attention weights of all neighboring nodes is 1, a probability distribution is formed, which directly represents the neighbors. For the center position The final heavy metal concentration contribution percentage. The attention coefficients are normalized using the softmax function to obtain standardized attention weights. :
[0078] In the above formula, Represents a node The set of neighboring nodes; Indicates at node Of all the neighbors, the neighbors The normalized attention weights satisfy ; S26. The node features processed by the graph attention mechanism are mapped through a fully connected layer to obtain the predicted heavy metal concentration values for each node, including: Target Mesh Cell The heavy metal concentration is determined by the physical conditions of all its neighboring grid cells according to their respective influence weights. It's jointly determined. Based on attention weights, the nodes... The features of all neighbors are weighted and summed, and the mean squared error is used as the loss function to obtain the node. New feature representation :
[0079] The above formula is used to fuse information from neighboring nodes, update the feature representation of the current node, calculate the difference between the predicted concentration and the true concentration, and quantify the prediction accuracy of the model in the current training batch. It is a nonlinear activation function used to simulate the combined effects of nonlinear chemical reactions such as adsorption-desorption and dissolution-precipitation that may occur during the migration of heavy metals on the concentration distribution; It is a node The updated feature vector has a dimension of ; To enhance model stability and expressive power, the following approach was adopted. Each independent attention head is calculated, and The outputs of the individual attention heads are concatenated to form a more powerful feature representation. :
[0080] In the above formula, It's about the number of heads; It is the first Normalized attention weights for each attention head; It is the first The learnable weight matrix corresponding to each attention head; This indicates concatenation along the feature dimensions, and the final output feature dimension is... Finally, the aggregated high-level features are mapped to the predicted normalized concentrations through the output layer. In this embodiment, the purpose of this step is to learn features from multiple different representation subspaces to improve the robustness of the model.
[0081] S27. Calculate the gradient of the loss function with respect to each parameter of the model using the backpropagation algorithm, and then use the Adam optimizer based on the loss... The gradient direction and learning rate are used to update all weight parameters, including: Calculate the predicted values for all nodes in the graph. Compared with true standardized concentration The mean square error between them is used as the loss. :
[0082] loss The overall deviation between the heavy metal concentration distribution predicted by the graph attention network (GAT) model and the actual concentration distribution obtained through LBM simulation was quantified; in the above formula, For the image The total number of all nodes in the model; in this embodiment, the prediction error is gradually reduced through iterative optimization, thereby improving the accuracy of the model's prediction of the heavy metal penetration range.
[0083] The loss function for all parameters of the Graph Attention Network (GAT) model is calculated using the gradient descent algorithm. gradient And adjust the model parameters according to the gradient direction of the loss function:
[0084] In the above formula, The set of all trainable parameters of the model, including the weight matrix. Attention vector wait; The learning rate controls the step size for parameter updates; This represents the gradient of the loss function with respect to the parameters. In this embodiment, the adjustment direction is always to reduce the prediction error, thereby gradually learning the patterns of the lattice Boltzmann method into the parameters of the graph attention network.
[0085] S28. During the training process, use the validation set to evaluate the model performance periodically and record the changing trends of training loss and validation loss. When the validation loss no longer decreases for several consecutive training cycles, stop the training process in advance and save the model parameters that perform best on the validation set as the final model.
[0086] In a specific implementation, as a preferred embodiment of the present invention, in step S23, in order to use a graph attention network for modeling, the simulated data of each reclamation area (corresponding to a sample) must be represented as a graph. The specific construction method is as follows: S231, Build Nodes Treat each spatially discretized grid cell as a graph. One of the nodes The feature vector of this node This refers to all standardized input parameters at the current grid cell, including a vector composed of porosity, flow velocity, and initial concentration; that is, directly mapping the regular cubic grid cells used in the lattice Boltzmann method to nodes in the graph. Each node corresponds to a specific spatial location. The feature vector consists of standardized physical parameters at the current grid cell, including porosity and flow velocity components. Initial heavy metal concentration, equilibrium concentration, and solid molar volume form a... 3D feature vector; S232, Constructing edges :picture The edges connecting nodes define the spatial interaction relationships between nodes. In this invention, a spatial adjacency criterion is used to establish edges. If two mesh cells are spatially adjacent, for example, sharing a face, edge, or corner, depending on the discretization scheme used, then an edge is considered to exist between the nodes corresponding to the two mesh cells, meaning the two mesh cells are neighbors. Specifically, if there are adjacent grid cells in the six directions of front, back, left, right, up, and down of the current grid cell, an undirected edge is established between the corresponding nodes. This face adjacency relationship accurately reflects the most direct spatial interaction path of solute migration in porous media. S233. Based on the above construction method, the node... Represents a specific grid cell of interest; neighbor ,symbol Representative node The set of neighbors, that is, all nodes that are related to the node. via edge Directly connected nodes The set, which defines the nodes that have the right to pass information during the information aggregation process. Information about spatial location.
[0087] This completes the transition from standardized datasets to graph structure definitions. Each sample in the training, validation, and test sets is now explicitly defined as an independent graph. The training process of the graph attention network involves learning how to connect each node to its neighbors using the relationships defined above. Local features and its neighboring nodes The characteristics of these elements are collectively mapped to the heavy metal concentration at that node.
[0088] In specific implementation, as a preferred embodiment of the present invention, such as Figure 4 As shown, step S3 includes: S31. Transfer the newly acquired input data (Porosity, flow velocity, etc.) are constructed as a graph structure, where nodes represent spatial locations and edges represent adjacency relationships. The mean and standard deviation of the input features calculated from the training set during the model building phase are used to perform a completely consistent standardization process on the node features.
[0089] For the new assessment area, input data Use the same method as during the training phase. and Standardize the data to ensure consistent data distribution; S32. Input the standardized graph data into the pre-trained optimal graph attention network (GAT) model. The optimal graph attention network (GAT) model directly outputs the predicted standardized concentration of each node through a fast forward computation:
[0090] In the above formula, For the new standardized data, To predict the concentration map; in this embodiment, the standardized new data will be used. Input the pre-trained model Through a single forward propagation, a standardized predicted concentration map is directly output. .
[0091] S33. Using the mean and standard deviation of the output concentration calculated from the training set during the graph attention network (GAT) model construction phase, denormalize the standardized prediction results output by the optimal graph attention network (GAT) model to restore the standardized prediction results to the true physical concentration scale:
[0092] In the above formula, This indicates the final distribution map of heavy metal concentration at the real scale, used for the final assessment of the permeability range; S34. Based on the final heavy metal concentration distribution map after reduction, and in accordance with relevant environmental standards, determine the pollution risk level and the penetration range of heavy metal elements.
[0093] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for assessing the permeability range of heavy metal elements in gangue reclamation areas based on multi-scale simulation combined with a GAT model, characterized in that, include: S1. The lattice Boltzmann method is used to characterize the water flow, solute transport and chemical reaction processes in porous media, a multi-physics coupling model is established, and a multi-scene training dataset is generated based on the multi-physics coupling model. S2. Based on the multi-process LBM modeling results, construct the graph attention network (GAT) model, and use the multi-scenario training dataset to train the graph attention network (GAT) model to establish an accurate mapping relationship from medium features to concentration distribution. S3. Call the trained Graph Attention Network (GAT) model to predict the range of heavy metal infiltration in the new reclamation area. Perform machine learning on the prediction results and apply them to the reclamation area to achieve intelligent prediction and assessment of the range of heavy metal infiltration.
2. The method for assessing the permeability range of heavy metal elements in gangue reclamation areas based on multi-scale simulation combined with GAT model according to claim 1, characterized in that, Step S1 includes: S11. The coupled process of fluid flow, solute mass transfer, dissolution and precipitation of heavy metals in a porous medium of mixed gangue and soil is determined as the simulation object. The initial porosity, equilibrium concentration of heavy metals and solid molar volume parameters are obtained through borehole sampling and experiments. The grid and time step are set according to the actual range of the reclamation area in combination with the pore size of the medium. S12. Using a discrete approach, define the boundary conditions for the water flow simulation, including the velocity and flow rate boundaries on the water supply and discharge sides; calculate the initial velocity distribution function based on the initial density and initial velocity. Substitute the data into the multi-relaxation MRT-LBM model, iteratively update the distribution function, and extract the average density and flow velocity. S13. The single-relaxation LBGK model is adopted to set the relaxation time of the migration process and the reaction boundary of the solid-liquid interface. The concentration distribution function is initialized according to the initial heavy metal concentration being equal to the equilibrium concentration. The mass transfer equilibrium state is calculated by simulating the real-time flow velocity of the water flow to reflect the convection effect. The concentration distribution function is iteratively updated and the macroscopic concentration is extracted. S14. For pore water near solid substances, determine the reaction type by calculating the difference between the current heavy metal concentration and the equilibrium concentration; adjust the volume of solid substances according to the reaction type and update the pore structure of the medium accordingly; when the solid is completely dissolved, the space originally occupied becomes pores; when precipitation causes the solid volume to increase to a preset threshold, the adjacent pores are filled by the newly generated solid, thereby reducing the porosity. S15. Based on the updated porosity, correct the effective diffusion coefficient of solute transport simulation and the effective permeability of water flow simulation; clarify the multi-field coupling sequence at each time step as water flow simulation iteration, solute transport simulation iteration, reaction judgment to solid phase update, medium adjustment, parameter correction, to ensure the continuous transmission of data between physical fields. S16. At regular intervals, calculate the maximum rate of change of concentration and the rate of change of porosity. When the maximum rate of change of concentration and the rate of change of porosity are both within the acceptable range of small fluctuations in numerical simulation, and the change in the depth of heavy metal penetration is within a reasonable range that can be ignored in engineering evaluation, the model reaches a steady state and the iteration stops. If this state is not reached, return to step S12. S17. Collect measured data on heavy metal concentration and porosity at different depths in the reclamation area, compare them with the model results, and ensure that the deviation is within the acceptable range for the project; divide the heavy metal risk zone according to national standards, adjust the initial porosity and reaction rate constant, simulate the impact of media improvement and anti-seepage layer laying measures on heavy metal infiltration, and provide a basis for pollution prevention and remediation.
3. The method for assessing the permeability range of heavy metal elements in gangue reclamation areas based on multi-scale simulation combined with GAT model according to claim 1, characterized in that, Step S12 includes: S121. Construct a multi-relaxation MRT-LBM model as follows: The above formula updates the direction of each discrete velocity step by step and each grid node. Distribution function on The distribution function in space is obtained. and time The microscopic state at that point; in the above formula, Discrete velocity direction The velocity distribution function vector, It is an orthogonal transformation matrix. For a relaxed diagonal matrix, For time steps, Discrete velocity; S122, Design the equilibrium distribution function for water flow simulation ,as follows: The equilibrium distribution function directly gives the direction of each discrete velocity. The particle distribution density in space; when the water flow is in an equilibrium state with no macroscopic flow acceleration or no viscous dissipation, and time At this point, the equilibrium distribution function gives the proportion of virtual particles moving in different directions; in the above formula, For weighting coefficients, For average density, For average speed, The square of the lattice sound velocity; S123. By summing the equilibrium distribution functions in all directions, the average density is obtained. : S124. The average velocity is obtained by weighted summation of discrete velocity and equilibrium distribution function. : 。 4. The method for assessing the permeability range of heavy metal elements in gangue reclamation areas based on multi-scale simulation combined with GAT model according to claim 1, characterized in that, Step S13 includes: S131. Design the concentration equilibrium distribution function as follows: In the above formula, For the average heavy metal concentration, the coefficients 4.5 and 1.5 are obtained by substituting the square of the lattice sound velocity. =1 / 3 obtained, The water flow-solute coupling is achieved by substituting the results of the water flow simulation calculation; S132. Based on the designed concentration equilibrium distribution function, a single-relaxation LBGK model is constructed as follows: In the above formula, Let be the concentration distribution function. This is the relaxation time for the migration process (controlling the magnitude of the diffusion coefficient). Let be the concentration equilibrium distribution function; S133. By summing the concentration distribution functions in all discrete directions, the average heavy metal concentration at the computational node is obtained. : 。 5. The method for assessing the permeability range of heavy metal elements in gangue reclamation areas based on multi-scale simulation combined with GAT model according to claim 1, characterized in that, In step S14, the boundary conditions for the dissolution-precipitation reaction are set to characterize the concentration distribution function correction rule at the solid-liquid interface, as follows: In the above formula, For water flow nodes near the wall, Let be the concentration distribution function after the collision. This refers to the concentration at the solid-liquid interface. Dissolves in time. Time sedimentation, To balance the concentration.
6. The method for assessing the permeability range of heavy metal elements in gangue reclamation areas based on multi-scale simulation combined with GAT model according to claim 1, characterized in that, Step S15 includes: S151. Based on the updated porosity, correct the effective diffusion coefficient of solute transport simulation and the effective permeability of water flow simulation: In the above formula, For real-time effective penetration rate, Initial penetration rate, The real-time effective diffusion coefficient, The initial diffusion coefficient is . The real-time porosity is represented by an exponent of 1.5, which is used to correct for the hindering effect of pore tortuosity on diffusion. S152. Calculate the Reynolds number and Damcole number to quantify the flow intensity, guide the adjustment of flow simulation parameters, ensure that the model matches the actual flow state of the reclamation area, and be used to determine the response control type. The formulas for calculating the Reynolds number and Damcole number are as follows: In the above formula, For effective flow rate, The vertical depth of the reclaimed area. For water viscosity, The reaction rate constant is... The real-time effective diffusion coefficient; S153. The multi-field coupling sequence at each time step is defined as follows: water flow simulation iteration, solute transport simulation iteration, reaction judgment to solid phase update, medium adjustment, and parameter correction, ensuring the coherent transfer of data between physical fields and forming a complete closed loop. The conditional formula on the left controls the fluctuation range of macroscopic concentration, while the conditional formula on the right controls the fluctuation range of porosity. When both conditions are met, the model reaches a steady state, the heavy metal permeation range no longer changes significantly, and the closed loop ends.
7. The method for assessing the permeability range of heavy metal elements in gangue reclamation areas based on multi-scale simulation combined with GAT model according to claim 1, characterized in that, Step S2 includes: S21. Using the validated lattice Boltzmann multiphysics coupling model, numerical simulations are performed under a wide variety of medium structures and environmental conditions to generate a large number of paired input and output samples, which constitute the initial training dataset. S22. Standardize the input features and output concentrations of all samples in the initial training dataset to obtain the standardized dataset for the Graph Attention Network (GAT) model, as shown in the following formula: In the above formula, This represents the input features of all samples in the initial training dataset. and Let represent the mean and standard deviation of the input features for all samples in the initial training dataset, respectively. This represents the standardized input features used for training the Graph Attention Network (GAT) model. This represents the output concentration of all samples in the initial training dataset. and Let denot and represent the mean and standard deviation of the output concentration of all samples in the initial training dataset, respectively. During the training phase, the model will learn to predict this standardized target output concentration. ; S23. Divide the standardized dataset into training, validation, and test sets for model training, performance evaluation, and final performance verification, respectively; a total of Each sample corresponds to a time point, and the data is arranged chronologically from... arrive Arrangement, let: In the above formula, The maximum integer value is retained for the number of training set samples. The largest integer is retained to determine the number of samples in the validation set. The test set contains the remaining data; the data is directly split into three parts in chronological order, with the training set starting from the first data point. From the beginning to the end data Up to; the verification set starts from the 1st data From the beginning to the end data Up to; the test set starts from the 1st data From the beginning to the end Up to the last data point; S24. Construct a graph attention network (GAT) model with a multi-head attention mechanism, set the number of attention heads and feature dimension parameters, and use the Xavier initialization method to initialize all trainable parameters such as the weight matrix and attention vector of the graph attention network (GAT) model, so as to provide a suitable initial state for training the graph attention network (GAT) model. S25. Input the graph structure data into the Graph Attention Network (GAT) model and perform the complete forward computation process, including: The attention coefficient between nodes is calculated using the following formula: In the above formula, and Representing nodes respectively and The input feature vector, This represents the learnable weight matrix. It is the output feature dimension; It is a learnable attention vector used to calculate attention coefficients; This represents a vector concatenation operation, which combines two vectors with the same dimensions. The vectors are concatenated to form a dimension of ; It is an activation function used to introduce nonlinearity, allowing the model to learn the complex physicochemical relationships between adjacent positions that both promote and inhibit the migration of heavy metals. Through the above formula, the influence of each adjacent grid cell on the heavy metal concentration of the target grid cell is adaptively learned and quantified, thereby characterizing the migration path of pollutants in complex heterogeneous porous media. The attention coefficients are normalized using the softmax function to obtain standardized attention weights. : In the above formula, Represents a node The set of neighboring nodes; Indicates at node Of all the neighbors, the neighbors The normalized attention weights satisfy ; S26. The node features processed by the graph attention mechanism are mapped through a fully connected layer to obtain the predicted heavy metal concentration values for each node, including: Based on attention weights, for nodes The features of all neighbors are weighted and summed, and the mean squared error is used as the loss function to obtain the node. New feature representation : The above formula is used to fuse information from neighboring nodes, update the feature representation of the current node, calculate the difference between the predicted concentration and the true concentration, and quantify the prediction accuracy of the model in the current training batch. It is a nonlinear activation function used to simulate the combined effect of chemical reactions that occur during the migration of heavy metals on the concentration distribution; It is a node The updated feature vector has a dimension of ; To enhance model stability and expressive power, the following approach was adopted. Each independent attention head is calculated, and The outputs of the individual attention heads are concatenated to form a more powerful feature representation. : In the above formula, It's about the number of heads; It is the first Normalized attention weights for each attention head; It is the first The learnable weight matrix corresponding to each attention head; This indicates concatenation along the feature dimensions, and the final output feature dimension is... Finally, the aggregated high-level features are mapped to the predicted normalized concentrations through the output layer. ; S27. Calculate the gradient of the loss function with respect to each parameter of the model using the backpropagation algorithm, and then use the Adam optimizer based on the loss... The gradient direction and learning rate are used to update all weight parameters, including: Calculate the predicted values for all nodes in the graph. Compared with true standardized concentration The mean square error between them is used as the loss. : loss The overall deviation between the heavy metal concentration distribution predicted by the graph attention network (GAT) model and the actual concentration distribution obtained through LBM simulation was quantified; in the above formula, For the image The total number of all nodes in the array; The loss function for all parameters of the Graph Attention Network (GAT) model is calculated using the gradient descent algorithm. gradient And adjust the model parameters according to the gradient direction of the loss function: In the above formula, The set of all trainable parameters of the model; The learning rate controls the step size for parameter updates; This represents the gradient of the loss function with respect to the parameters. S28. During the training process, use the validation set to evaluate the model performance periodically and record the changing trends of training loss and validation loss. When the validation loss no longer decreases for several consecutive training cycles, stop the training process in advance and save the model parameters that perform best on the validation set as the final model.
8. The method for assessing the permeability range of heavy metal elements in gangue reclamation areas based on multi-scale simulation combined with GAT model according to claim 7, characterized in that, In step S23, in order to use a graph attention network for modeling, the simulation data of each reclamation area must be represented as a graph. The specific construction method is as follows: S231, Build Nodes Treat each spatially discretized grid cell as a graph. One of the nodes The feature vector of this node This refers to all standardized input parameters at the current grid cell, including a vector consisting of porosity, flow velocity, and initial concentration; that is, directly mapping the regular cubic grid cells used in the lattice Boltzmann method to nodes in the graph. Each node corresponds to a specific spatial location. The feature vector consists of standardized physical parameters at the current grid cell, including porosity and flow velocity components. Initial heavy metal concentration, equilibrium concentration, and solid molar volume form a... 3D feature vector; S232, Constructing edges :picture The edges connecting nodes define the spatial interaction relationships between nodes. The spatial adjacency criterion is used to establish edges. If two grid cells are spatially adjacent, then there is an edge between the nodes corresponding to the two grid cells, that is, the two grid cells are neighbors. ; S233. Based on the above construction method, the node... Represents a specific grid cell of interest; neighbor ,symbol Representative node The set of neighbors, that is, all nodes that are related to the node. via edge Directly connected nodes The set, which defines the nodes that have the right to pass information during the information aggregation process. Information about spatial location.
9. The method for assessing the permeability range of heavy metal elements in gangue reclamation areas based on multi-scale simulation combined with GAT model according to claim 1, characterized in that, Step S3 includes: S31. Transfer the newly acquired input data The model is constructed as a graph structure, where nodes represent spatial locations and edges represent adjacency relationships. The mean and standard deviation of the input features calculated from the training set during the model building phase are used to perform a completely consistent standardization process on the node features. For the new assessment area, input data Use the same method as during the training phase. and Standardize the data to ensure consistent data distribution; S32. Input the standardized graph data into the pre-trained optimal graph attention network (GAT) model. The optimal graph attention network (GAT) model directly outputs the predicted standardized concentration of each node through a fast forward computation: In the above formula, For the new standardized data, For predicting concentration maps; S33. Using the mean and standard deviation of the output concentration calculated from the training set during the graph attention network (GAT) model construction phase, denormalize the standardized prediction results output by the optimal graph attention network (GAT) model to restore the standardized prediction results to the true physical concentration scale: In the above formula, This indicates the final distribution map of heavy metal concentration at the real scale, used for the final assessment of the permeability range; S34. Based on the final heavy metal concentration distribution map after reduction, and in accordance with environmental standards, determine the pollution risk level and the penetration range of heavy metal elements.