Method and system for coarse-grained force field model optimization construction based on machine learning
By combining machine learning methods with all-atom molecular dynamics simulations and attention models, coarse-grained potential parameters are iteratively optimized and dynamically weighted. This solves the problems of difficulty in handling high-dimensional parameter spaces and error accumulation in traditional methods, and achieves more efficient potential parameter optimization.
Patent Information
- Application Number
- CN202511734864.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-25
- Publication Date
- 2026-02-24
- Estimated Expiration
- 2045-11-25
AI Technical Summary
Existing technologies are used in the optimization of potential parameters in coarse-grained force field models. However, these technologies struggle to handle high-dimensional parameter spaces, resulting in problems such as error accumulation and high computational costs.
By employing machine learning-based methods, combined with all-atom molecular dynamics simulations and attention models, we perform iterative optimization and dynamic weight allocation of coarse-grained potential parameters, and utilize environmental feature vectors for adaptive optimization.
This improves the accuracy of the potential parameter optimization process for coarse-grained force field models, overcomes the limitations of traditional methods that rely on empirical assumptions and manual adjustments, and achieves more efficient parameter optimization.
Smart Images

Figure CN121191608B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of oil and gas field development, and particularly relates to a method and system for coarse-grained force field model optimization construction based on machine learning. BACKGROUND
[0002] In the field of oil and gas field development, cross-scale simulation is crucial for in-depth understanding of complex physical and chemical processes. Coarse-grained force field (CGMD, Coarse-Grained Molecular Dynamics Simulations) model as an effective simulation tool can model and analyze oil and gas systems at different scales, providing key support for predicting reservoir dynamics and optimizing exploitation strategies. Through coarse-grained force field model, the molecular behavior at atomic scale can be connected with the reservoir characteristics at macroscopic scale, so as to more accurately simulate the migration, aggregation and exploitation process of oil and gas.
[0003] At the same time, the CO2-polyether segment-asphaltene-cheiogen four-component system has important significance in oil and gas field development. The core role of CO2 in enhancing oil recovery is to change the phase state and flowability of reservoir fluids through physical and chemical effects. Polyether segments are usually used to improve the performance of oil displacement agents. Asphaltene and cheiogen are important components in oil and gas field systems, which interact to affect the properties and exploitation process of oil and gas fields. Therefore, in-depth understanding and application of the molecular action mechanism of the four-component system has important guiding significance for optimizing exploitation technology and improving resource utilization.
[0004] Coarse-grained force field model is a simulation method that simplifies molecular structure to reduce computational complexity. It combines multiple atoms into a particle, reducing the degree of freedom of the system, and is suitable for large-scale or long-time molecular dynamics simulation. Coarse-grained potential function is used in coarse-grained force field model to describe the expression of interaction between coarse-grained particles, such as bond stretching, angle bending, non-bonded van der Waals force, etc. Potential parameters are specific numerical parameters in coarse-grained potential function, which determine the energy distribution and dynamic behavior of coarse-grained force field model. Exemplarily, coarse-grained potential function is a mathematical framework, potential parameters are specific numerical values, and coarse-grained force field model is a complete scheme. In actual use, potential parameters need to be optimized to meet the actual calculation requirements.
[0005] However, the optimization process of potential parameters of traditional coarse-grained force field model is usually based on empirical assumptions and manual adjustment, which has strong subjective dependence, high-dimensional parameter space difficult to handle, error accumulation and high computational cost, etc. SUMMARY
[0006] The embodiments of the present application provide a method and system for constructing a coarse-grained force field model based on machine learning, which solve the technical problems that the existing technology is difficult to process high-dimensional parameter space and has error accumulation and high calculation cost in the potential parameter optimization process of the coarse-grained force field model. The fusion optimization of quantum computing and machine learning is realized, and the accuracy of the potential parameter optimization process of the coarse-grained force field model in the oil and gas field development process is improved.
[0007] In a first aspect, the embodiments of the present application provide a method for constructing a coarse-grained force field model based on machine learning, which comprises: simulating initial potential parameters of a coarse-grained potential function based on a full-atom molecular dynamics simulation method to obtain a full-atom RDF curve; iteratively optimizing the initial potential parameters based on the full-atom RDF curve to optimize the coarse-grained potential function; correcting the optimized coarse-grained potential function to obtain an initial coarse-grained force field model; dynamically optimizing the potential parameters in the initial coarse-grained force field model according to an environmental feature vector to obtain optimized potential parameters; wherein the environmental feature vector includes pore size and fracture connectivity of a reservoir; dynamically correlating the environmental feature vector with interaction characteristics of each molecule in a four-component system to obtain a correlation result; inputting the correlation result into an initial attention model for training to obtain an attention model; and dynamically weighting the optimized potential parameters through the attention model to optimize the initial coarse-grained force field model.
[0008] In combination with the first aspect, in a possible implementation manner, before the initial potential parameters of the coarse-grained potential function are simulated based on the full-atom molecular dynamics simulation method, the method further comprises calibrating non-bonding interaction parameters of the four-component system, including: determining molecular configurations of CO2, polyether chain segments, asphaltene and kerogen in the four-component system respectively; setting basis sets of CO2, polyether chain segments, asphaltene and kerogen based on molecular structures and chemical properties of each component in the four-component system; determining interactions between molecular structures of each component based on electron correlation effects and dispersion effects to obtain interaction energies of each molecular structure; and performing convergence tests on each basis set to verify the rationality of selection of each basis set and control errors of each basis set; wherein the non-bonding interaction parameters include the molecular configurations, the basis sets and the interaction energies between molecules.
[0009] In combination with the first aspect, in a second possible implementation manner, the iteratively optimizing the initial potential parameters based on the full-atom RDF curve comprises: iteratively performing a loop step on current potential parameters of the coarse-grained potential function based on a reverse Monte Carlo method, and optimizing the coarse-grained potential function according to the current potential parameters output by the loop step; the loop step comprises: performing full-atom molecular dynamics simulation on the current potential parameters to obtain a current coarse-grained RDF curve; determining whether an iteration termination condition is reached; if the iteration termination condition is reached, outputting the current potential parameters; and if the iteration termination condition is not reached, performing the loop step.
[0010] With reference to the third possible implementation manner of the first aspect, the coarse-grained potential function is corrected to obtain the corrected coarse-grained force field model, including: introducing a correction term into the coarse-grained potential function to construct the coarse-grained force field model; wherein the correction term includes a π-π interaction correction term and a polarity interaction correction term.
[0011] With reference to the fourth possible implementation manner of the first aspect, the dynamic potential parameter optimization of the coarse-grained force field model according to the environmental feature vector includes: in a micro-pore, enhancing a short-range repulsion parameter in the coarse-grained potential function to simulate the molecular crowding effect in the actual environment; in a macro-pore, reducing a diffusion resistance weight; wherein the micro-pore represents a pore size less than 2 nm, and the macro-pore represents a pore size greater than 50 nm; in a high fracture connectivity, weakening the electrostatic interaction; in a low fracture connectivity, strengthening the π-π interaction correction term; wherein the high fracture connectivity represents a fracture connectivity greater than 70%, and the low fracture connectivity represents a fracture connectivity less than 30%; wherein the environmental feature vector includes the pore size and the fracture connectivity, and is represented as: ; wherein, represents the environmental feature vector, represents the pore size, represents the porosity, and the porosity is used to represent the fracture connectivity; represents the pore size spatial gradient, represents the porosity spatial gradient.
[0012] With reference to the fifth possible implementation manner of the first aspect, after the dynamic weight distribution of the coarse-grained force field model, the method further includes calculating a loss function to optimize the coarse-grained force field model, wherein the loss function includes: ; wherein, represents the loss function, represents a mean square error term, represents an optimized potential parameter, represents a target potential parameter, represents a hyperparameter, represents a variance penalty term, represents an attention weight of the pore size, represents an attention weight of the porosity.
[0013] In conjunction with the first possible implementation of the first aspect, the sixth possible implementation also includes optimizing the computation process, including: splitting the quaternary system into independent molecular pairs, performing parallel computation on the independent molecular pairs based on a hierarchical parallel strategy, and using GPUs to accelerate the computation process; performing hierarchical offloading of basis sets according to the computation tasks of different basis sets; accelerating dynamic weight allocation based on sparse attention mechanisms and mixed-precision computation; and constructing a cloud computing cluster to dynamically adapt computing power to the iterative optimization process of the coarse-grained potential function.
[0014] Secondly, embodiments of this application provide a system for optimizing and constructing a coarse-grained force field model based on machine learning. The system is used to apply a method for optimizing and constructing a coarse-grained force field model based on machine learning, comprising: a non-bonded interaction parameter calibration module for determining the molecular structure of each component in a quaternary system and setting basis sets for each component based on the corresponding molecular structure; a coarse-grained force field model construction module for iteratively optimizing the coarse-grained potential function and correcting the optimized coarse-grained potential function to construct a coarse-grained force field model; a dynamic potential parameter optimization module for dynamically optimizing the potential parameters of the coarse-grained force field model based on environmental feature vectors and dynamically allocating weights to the coarse-grained force field model through an attention model; and a computational resource optimization module, including a hybrid parallel computing framework unit for parallel computing of the quaternary system; a hierarchical unloading unit for hierarchical unloading of basis sets; a hardware acceleration unit for accelerating dynamic weight allocation; and a resource allocation unit for dynamic adaptation of computing power.
[0015] Thirdly, embodiments of this application provide an apparatus comprising: a processor; a memory for storing processor-executable instructions; wherein, when the processor executes the executable instructions, it implements the method as described in the first aspect or any possible implementation of the first aspect.
[0016] Fourthly, embodiments of this application provide a non-volatile computer-readable storage medium, the non-volatile computer-readable storage medium including storage for storing a computer program or instructions that, when executed, cause the method described in the first aspect or any possible implementation of the first aspect to be implemented.
[0017] One or more technical solutions provided in the embodiments of this application have at least the following technical effects or advantages:
[0018] This application obtains a coarse-grained force field model by iteratively optimizing and modifying the coarse-grained potential function; dynamically optimizes the potential parameters of the coarse-grained force field model based on environmental feature vectors; and dynamically assigns weights to the environmental feature vectors through an attention mechanism. This enables the potential parameters in the coarse-grained force field model to be adaptively optimized according to different system characteristics and simulation scenarios. It effectively solves the technical problems of existing technologies for optimizing potential parameters in coarse-grained force field models, such as difficulty in handling high-dimensional parameter spaces, error accumulation, and high computational costs. This achieves a significant improvement in the optimization accuracy of potential parameters in coarse-grained force field models within the oil and gas field development field. Attached Figure Description
[0019] To more clearly illustrate the technical solutions of the embodiments of this application, the drawings used in the description of the embodiments of this application 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.
[0020] Figure 1 A flowchart illustrating a method for optimizing and constructing a coarse-grained force field model based on machine learning, as provided in this application embodiment;
[0021] Figure 2 A flowchart for non-bonded interaction parameter calibration provided in this application embodiment;
[0022] Figure 3 A flowchart illustrating the iterative optimization of the coarse-grained potential function provided in this application embodiment. Detailed Implementation
[0023] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.
[0024] In oil and gas field development, the CO2-polyether segment-asphaltene-kerogen quaternary system is of great significance. Specifically, the core role of CO2 in improving oil and gas field recovery is to alter the phase state and fluidity of reservoir fluids through physicochemical processes. The specific effects of CO2 include:
[0025] (1) Reduce crude oil viscosity: After CO2 dissolves in crude oil, it dilutes the intermolecular forces of hydrocarbon molecules, significantly reducing crude oil viscosity (the result can be 1-2 orders of magnitude) and improving fluidity.
[0026] (2) Expansion effect: CO2 dissolution causes crude oil volume to expand (the expansion rate can reach 10% to 70%), increasing driving pressure and pushing crude oil to the production well.
[0027] (3) Reduced interfacial tension: CO2 forms a gas-liquid interface with crude oil, which reduces the interfacial tension between oil and water and promotes the release of capillary-bound oil.
[0028] (4) Extraction of light components: Supercritical CO2 (scCO2) for light hydrocarbons (C5-C 30 It has high solubility, selectively extracts light components, and improves crude oil fluidity.
[0029] Polyether segments are often used to improve the performance of oil displacement agents, while asphaltenes and kerogen are important components of the oil and gas system, and their interactions affect the properties of oil and gas and the extraction process.
[0030] This application proposes a method for optimizing and constructing a coarse-grained force field model based on machine learning, based on the aforementioned CO2-polyether segment-asphaltene-kerogen quaternary system. For example... Figure 1 As shown, the method includes:
[0031] Step S1: Simulate the initial potential parameters of the coarse-grained potential function based on the all-atom molecular dynamics (MD) simulation method to obtain the all-atom RDF (Radial Distribution Function) curve.
[0032] Step S2: Iteratively optimize the initial potential parameters based on the all-atom RDF curve to optimize the coarse-grained potential function.
[0033] Step S3: Correct the optimized coarse-grained potential function to obtain the initial coarse-grained force field model.
[0034] Step S4: Dynamically optimize the potential parameters in the initial coarse-grained force field model based on the environmental feature vector to obtain the optimized potential parameters; wherein, the environmental feature vector includes the pore size and fracture connectivity of the reservoir.
[0035] Step S5: Dynamically correlate the environmental feature vector with the interaction characteristics between molecules in the quaternary system to obtain the correlation results.
[0036] Step S6: Input the association results into the initial attention model for training to obtain the attention model.
[0037] Step S7: Dynamically assign weights to the optimized potential parameters using an attention model to optimize the initial coarse-grained force field model.
[0038] This application obtains a coarse-grained force field model by iteratively optimizing and refining the coarse-grained potential function; dynamically optimizes the potential parameters of the coarse-grained force field model based on environmental feature vectors; and dynamically assigns weights to the environmental feature vectors through an attention mechanism. This enables the potential parameters in the coarse-grained force field model to be adaptively optimized according to different system characteristics and simulation scenarios. It effectively solves the technical problem that the optimization process for potential parameters of coarse-grained force field models in traditional oil and gas field development relies on empirical assumptions and manual adjustments. This achieves a significant improvement in the optimization accuracy of potential parameters in coarse-grained force field models within the oil and gas field development field.
[0039] It should be noted that the initial potential parameters in step S2 are the initial potential parameters of the coarse-grained potential function. After iterative optimization of the initial potential parameters, the optimized potential parameters are obtained. The potential parameters described in step S4, which dynamically optimize the potential parameters in the initial coarse-grained force field model based on the environmental feature vector, refer to the optimized potential parameters.
[0040] For example, before step S1, this embodiment of the application also needs to calibrate the non-bonded interaction parameters of the quaternary system, which is a CO2-polyether segment-asphaltene-kerogen quaternary system. During the calibration of the non-bonded interaction parameters, DFT-D3 / CCSD(T) (DFT: Density functional theory; D3: Dispersion correction; CCSD(T): Coupled cluster single / double excitation plus triple excitation perturbation correction) quantum chemical calculations need to be performed using Gaussian16 software.
[0041] The calibration process for non-bonded interaction parameters includes:
[0042] Step 101: Selection of Molecular Configuration: Based on experimental data and theoretical analysis, determine the molecular configurations of CO2, polyether segments, asphaltene, and kerogen in the quaternary system. The molecular configurations need to be representative to ensure that the selected configurations accurately reflect the characteristics of the quaternary system.
[0043] 102: Setting basis sets: Select appropriate basis sets for each component (CO2, polyether segments, asphaltene, and kerogen) in the quaternary system. When selecting appropriate basis sets, it is necessary to take into account the molecular structure, chemical properties, computational accuracy, and efficiency of each component. For example, use smaller basis sets for light atoms and larger basis sets for heavy atoms to ensure that the electron cloud distribution of each component is accurately described.
[0044] Step 103: Calculate the interaction energy: Use Gaussian16 software to calculate the interaction energy between the molecular structures in the quaternary system by taking into account electronic correlation and dispersion effects through the DFT-D3 / CCSD(T) method.
[0045] Step 104: Perform basis set convergence testing on each component in the quaternary system: By gradually increasing the basis set (e.g., from 6-31G(d) to aug-cc-pVQZ) for the same molecular configuration, the error is strictly controlled by verifying the convergence of the basis set energy. For example, if the energy change is <1% after increasing the basis set, the choice of basis set is considered reasonable; otherwise, it is unreasonable. The core of step 104 is to ensure that the calculation error between the quantum chemical calculation results and experimental or high-precision theoretical values (such as CCSD(T) / CBS) is <2%.
[0046] When developing a coarse-grained force field model for the CO2-polyether segment-asphaltene-kerogen quaternary system, for example, in step 102, the basis sets of each component need to be selected based on the chemical properties of each component and the interaction requirements within the quaternary system. The specific selection method is as follows:
[0047] ① CO2 molecular basis set setting: Referring to the linear nonpolar characteristics of CO2, the embodiments of this application adopt the 6-311++G(d,p) basis set.
[0048] In this basis set, 6-311G is the core part, used to describe the atomic orbitals in layers. This means that the inner layers of the atomic orbitals use six Gaussian functions, while the valence layer is divided into three more detailed functions. ++ represents the diffusion function, used to describe the diffusion of the electron cloud. (d,p) represents the polarization function, used to allow orbital deformation, characterizing bond angle vibrations and electron cloud distribution. In the embodiments of this application, the bond angle vibrations within the CO2 molecule are the bending vibrations of OCO.
[0049] Therefore, the 6-311++G(d,p) basis set enhances the description of molecular dipole moments and long-range van der Waals interactions by adding dispersion functions, while introducing polarization functions to characterize bond angle vibrations and electron cloud distribution in OCO.
[0050] ② Basis set of polyether segments: Due to the flexible structure of polyether segments (such as polyethylene glycol), a mixed basis set strategy needs to be adopted in the process of setting up the basis set of polyether segments.
[0051] Regarding the ether bonds (-O-) in the polyether segments, the 6-31G(d) basis set was selected, and the polarization of the CO bond and the hydrogen bond interaction were optimized by the polarization function (d).
[0052] For the alkyl chain (-CH2-CH2-) of the polyether segment, a simplified 6-31G basis set was selected to reduce computational costs.
[0053] ③ Basis set design of asphaltenes: A layered basis set strategy is required for the polycyclic aromatic hydrocarbon core, sulfur / nitrogen heteroatoms, and side chain structure of asphaltenes. The C and H atoms of the polycyclic aromatic hydrocarbon core adopt the 6-31+G(d) basis set, using dispersion functions to enhance the description of π-π stacking interactions, and optimizing bond lengths through polarization functions (d); the heteroatoms (S, N) are selected from the def2-SVP basis set to specifically improve the accuracy of sulfur / nitrogen valence orbital calculations; the alkyl part of the side chain is downgraded to the 6-31G basis set because its contribution to the main interactions of asphaltenes molecules is relatively small.
[0054] ④ Basis set of kerogen molecule: Since the kerogen molecule has a complex organic skeleton, the 6-311G(d,p) basis set is used for kerogen to describe the electrostatic and hydrogen bonding interactions of kerogen. For example, metal impurities may also exist in kerogen, so the LANL2DZ (Los Alamos National Laboratory, DoubleZeta) pseudopotential basis set is used for metal atoms to simplify the calculation of d orbitals of transition metals.
[0055] By employing the basis set strategies for each component within the quaternary system (①-④), a dynamic balance between computational efficiency and accuracy can be achieved. This provides a reliable quantum chemical standard for calibrating nonbonding interaction parameters in the quaternary system.
[0056] For example, the detailed process of step 103 is as follows:
[0057] For the CO2-polyether segment-asphaltene-kerogen quaternary system, parameters including charge distribution, bond length, and bond angle are calculated based on the characteristics of the quaternary system to accurately describe the interaction energies between the components. High-precision non-bonded interaction energy parameters are obtained through quantum chemical calculations, with errors controlled within 2%, providing benchmark values for the potential parameters of coarse-grained force field models.
[0058] This paper addresses the impact of dispersion effects on the interaction energy between components in a quaternary system. Traditional density functional theory underestimates intermolecular dispersion forces. In this embodiment, D3 dispersion correction is used as theoretical data and added as a correction term to a coarse-grained force field model or quantum chemical calculation using a parameterization method to compensate for systematic biases in the theoretical model. The principle behind D3 dispersion correction is to adjust the behavior of dispersion correction at short and medium ranges by introducing an empirical correction term (Becke-Johnson, BJ damping) into DFT-D3. Therefore, the calculation method for the dispersion correction energy based on BJ damping in DFT-D3 is as follows:
[0059] .
[0060] In the formula, This represents the dispersion correction energy of DFT-D3 based on BJ damping. A , B Each represents one of the two atoms in an atom pair. The form of an atom pair is ( A , B ), For atomic pairs ( A , B The dispersion coefficient of is determined by the type of atom and the distance. This represents the damping coefficient, used to prevent the distance between atoms from diverging. . n This indicates the order in the dispersion correction process. Indicates correspondence n Scaling factor of the order. and This represents the empirical parameter in the damping coefficient. express A , B The distance between two atoms. express A , B Between two atoms based on order n The distance.
[0061] By using a large number of molecular systems in an open-source database, the damping coefficient, dispersion coefficient, and damping function parameters of atomic pairs are fitted to improve the accuracy of weak interactions (such as the adsorption energy of CO2 and asphaltene), making the calculation results closer to reality and improving the accuracy of non-bonded interaction parameters during calibration.
[0062] Step S2, as described in the embodiments of this application, iteratively optimizes the initial potential parameters based on the all-atom RDF curve to optimize the coarse-grained potential function. The specific process includes:
[0063] Step S201: Obtain the all-atom RDF curve based on the all-atom MD simulation method.
[0064] Step S202: Based on the all-atom RDF curve, the coarse-grained potential function is iteratively optimized using the inverse Monte Carlo method.
[0065] For example, in the embodiments of this application, the all-atom MD simulation method can accurately describe the interactions between atoms and generate information on the microstructure of the system. From the all-atom MD simulation process, all-atom RDF curves are obtained through statistical analysis. The all-atom RDF curves reflect the probability distribution of distances between atoms. The specific steps are as follows:
[0066] Step S2011: Construct a full-atom model of the CO2-polyether segment-asphaltene-kerogen quaternary system and use a simulated force field model (such as OPLS-AA or CHARMM) to describe the interatomic interactions in the full-atom model.
[0067] Step S2012: Equilibrium the system under an NPT ensemble (isothermal and isobaric ensemble) to ensure stable temperature and pressure. In step S2012, the system equilibrium time is set to 10 ns (nanoseconds), the temperature to 300 K (Kelvin), and the pressure to 1 par (Pascal).
[0068] Step S2013: Perform a production simulation and save the trajectory file. For example, the production simulation time is set to 50-100 ns (nanoseconds), and the frame rate for saving the trajectory file is set to 1 frame / ps (picoseconds).
[0069] Step S2014: Analyze the target atom pairs and statistically analyze the distance distribution between the atoms. For example, the target atom pairs include -O- of CO2 and -C- of asphaltenes, and -O- of polyether segments and -H- of kerogen. The analysis is performed using either gmx rdf (a computational program within GROMACS, a molecular dynamics package for studying biomolecular systems) or the VMD (Visual Molecular Dynamics) plugin.
[0070] Step S2015: Calculate the probability density of target atom pairs within a specific distance interval and normalize it to an RDF value:
[0071] .
[0072] in, Represents the RDF value. Indicates local density, This represents the bulk density. For example, a specific distance range is set to 0 nm-1 nm.
[0073] Step S2016: Based on the production simulation time, the RDF value obtained in step S2015 is set to be continuous to obtain the all-atom RDF curve.
[0074] Step S202 describes the iterative optimization of the coarse-grained potential function based on the all-atom RDF curve using the inverse Monte Carlo method. Specifically, it involves iteratively executing a loop step on the current potential parameters of the coarse-grained potential function using the inverse Monte Carlo method, including:
[0075] A full-atom molecular dynamics simulation was performed on the current potential parameters to obtain the current coarse-grained RDF curve.
[0076] Determine whether the iteration termination condition has been met.
[0077] If the iteration termination condition is met, then the loop steps are executed.
[0078] The iteration termination conditions include: determining whether the current root mean square error is greater than the root mean square error threshold, and whether the current number of iterations has reached the maximum number of iterations.
[0079] If the current root mean square error is greater than the root mean square error threshold, the inverse Monte Carlo method is used to update the current potential parameters based on the error direction between the current root mean square error and the initial root mean square error, and then the loop steps are executed.
[0080] If the current root mean square error is less than or equal to the root mean square error threshold, exit the loop step and output the current potential parameters.
[0081] The current root mean square error is calculated based on the current coarse-grained RDF curve and the all-atom RDF curve.
[0082] When the iteration termination condition is whether the current iteration count has reached the maximum iteration count, for example, the maximum iteration count can be set to 100.
[0083] If the current iteration count has not reached the maximum iteration count, the iteration count is incremented by one, the current potential parameters are updated based on the error direction between the current root mean square error and the initial root mean square error, and the loop steps are executed.
[0084] If the number of iterations reaches the maximum number of iterations, exit the loop step and output the current potential parameters.
[0085] Before executing the loop steps, it is necessary to pre-set the root mean square error threshold and the maximum number of iterations for the coarse-grained potential function using an open-source database.
[0086] It should be noted that the current potential parameters are the same as the potential parameters used in the coarse-grained potential function in this application embodiment. The initial potential parameters described in this application embodiment are the potential parameters in the initial state of the coarse-grained potential function under simulation conditions.
[0087] In this embodiment, step S3 involves modifying the coarse-grained potential function to obtain an initial coarse-grained force field model. This requires introducing several modification terms to construct the coarse-grained force field model, accurately describing the interactions between molecules in the quaternary system (e.g., π-π stacking of aromatic rings and dipole interaction between polyether segments and CO2 in asphaltenes). Specifically, the modification terms include π-π interaction modification terms and polar interaction modification terms.
[0088] ①: π-π interaction correction term, taking into account the π-π interactions between aromatic structures in the quaternary system. Based on the benzo[a]pyrene model, the coarse-grained potential function is calibrated. The π-π interaction energy is determined through quantum chemical calculations. Specifically, an angle-dependent repulsion-attraction term is added to the calibrated coarse-grained potential function:
[0089] .
[0090] in, Indicates a repulsive-attractive term. r Indicates the radius between aromatic structures. This represents the angle between the normal vectors of the aromatic ring plane. and The potential parameter is determined through quantum chemical calculations (such as SAPT decomposition).
[0091] ② Polarity Modification Term: In this embodiment, the polarity modification term specifically refers to a dipole-dipole interaction term. This is achieved by introducing dipole-dipole interaction terms into the ether oxygen atom (O) and the C atom of CO2 in the polyether segment:
[0092] .
[0093] Where C is the coefficient of the action term, which is obtained by fitting the molecular dipole moment calculated by DFT. This is a dipole-dipole action term.
[0094] The initial coarse-grained force field model obtained in step S3 performs well in static homogeneous systems. However, in actual oil reservoirs, the spatiotemporal variations in pore size (typically 1 nm-1 μm) and fracture connectivity (0%–90%) significantly affect molecular behavior (such as CO2 diffusion and asphaltene aggregation). Therefore, dynamic potential parameter optimization is required based on the eigenvectors in the actual situation, i.e., step S4.
[0095] In step S4, the environmental feature vector includes pore size and crack connectivity:
[0096] .
[0097] in, Represents the environmental feature vector. Indicates pore size, Porosity is used to characterize the connectivity of fractures. Represents the spatial gradient of pore size. This represents the spatial gradient of porosity. Both the spatial gradient of pore size and the spatial gradient of porosity are used to describe heterogeneity.
[0098] In practice, the confined space effect in micropores (pore size < 2 nm) enhances the collision frequency between molecules, necessitating the modification of the short-range repulsion parameter in the coarse-grained potential function to simulate the molecular crowding effect in real-world environments. In macropores (pore size > 50 nm), it is necessary to reduce the diffusion resistance weight.
[0099] Meanwhile, at high fracture connectivity (fracture connectivity > 70%), fluid flow dominates, thus requiring weakening of electrostatic interactions. At low fracture connectivity (fracture connectivity < 30%), local adsorption effects are significant, necessitating strengthening of the π-π interaction correction term.
[0100] The initial attention model in step S6 was constructed using PyTorch. The intermolecular interaction characteristics mentioned include the CO2-asphaltene binding energy and the flexible structure of the polyether segments.
[0101] After dynamically associating the environmental feature vector with the interaction features, the association result is obtained. The association result is then input into the initial attention model to obtain the attention model. The features of the input layer of this attention model take into account the environmental feature vector (including pore size and crack connectivity).
[0102] The dynamic weight allocation mentioned in step S7 is the core of the coarse-grained force field model in this embodiment. Through the mechanism of the attention model, the weights of pore size and crack connectivity are automatically adjusted according to the characteristics of different simulation scenarios and quaternary systems. This solves the problem of potential parameter deviation caused by environmental changes during cross-scale simulation of the coarse-grained force field model.
[0103] After dynamic weight allocation, the process includes calculating the loss function and backpropagating the error across scales. Specifically, the loss function represents a measure of the difference between the predicted values and the experimental / high-precision simulated values. The potential parameters are optimized by minimizing the loss function. The loss function includes not only the prediction error of the potential parameters but also an environment-dependent variance penalty term.
[0104] For example, the loss function includes:
[0105] .
[0106] in, Represents the loss function. This represents the mean square error term, ensuring that the optimized potential parameters are consistent with the high-precision simulated / experimental potential parameters. This represents the optimized potential parameters. Indicates the target potential parameters. Indicates hyperparameters, This represents the variance penalty term, which is expressed through hyperparameters. To constrain excessive fluctuations in attention weights and avoid parameter oscillations under sudden environmental changes, Attention weights representing pore size Attention weights representing porosity.
[0107] During cross-scale error backpropagation, the spatial gradients of pore size and porosity simultaneously influence the potential parameters and attention weights (including the attention weights for pore size and porosity) of the coarse-grained force field model, achieving end-to-end joint optimization.
[0108] In this application embodiment, environmental adaptive verification and accuracy control are also included.
[0109] Specifically, the optimization logic for the weighting of pore size and fracture connectivity lies in the fact that, under different oil and gas reservoir conditions, the degree of influence of pore size and fracture connectivity on fluid flow and mass transport varies. This application constructs a verification system covering different pore sizes (1nm-100nm) and fracture connectivity (10%-90%) to evaluate the generalization ability of the coarse-grained force field model optimized with dynamic potential parameters. The coarse-grained force field model dynamically allocates weights according to the actual situation, accurately reflecting the characteristics of the quaternary system. Machine learning is used to adjust the potential parameters in the coarse-grained force field model in real time, compensating for the accuracy loss caused by simplification in the coarse-grained force field model (such as neglected local conformational changes and environmental dependence).
[0110] In training the coarse-grained force field model, appropriate hyperparameters, such as the learning rate and the number of iterations, are set. The learning rate controls the parameter update step size, and the number of iterations determines the number of training rounds. The performance of the coarse-grained force field model is evaluated using the error validation standard of the potential parameters (<0.3 kcal / mol) to ensure that the accuracy of the optimized potential parameters meets the requirements. Simultaneously, the rationality of the environmental weights needs to be considered. In a porous network with continuously changing gradients, the attention weights (…) and A smooth transition is required to avoid abrupt changes.
[0111] By encoding pore size and fracture connectivity into environmental feature vectors, assigning attention weights, correcting dynamic potential parameters, and performing multi-scale verification in a closed-loop process, the dynamic optimization module achieves intelligent adaptation of coarse-grained force field models to pore structures and fracture networks. This module does not rely on the pre-defined force field structures of the first two parts, but instead adjusts the potential parameter weights in real time using externally input geological environmental data. This effectively solves the accuracy loss problem caused by environmental simplification in traditional coarse-grained force field models during cross-scale simulations, providing a highly robust simulation tool for the development of complex oil and gas reservoirs.
[0112] In this embodiment, the method for optimizing the entire computational process of constructing the coarse-grained force field model based on machine learning is also optimized. Specifically, this includes:
[0113] Step 801: The quaternary system is split into independent molecular pairs, and the independent molecular pairs are computed in parallel based on a hierarchical parallel strategy, and the computation process is accelerated by using a GPU (graphics processing unit).
[0114] Step 802: Based on the computational tasks of different basis sets, perform hierarchical unloading of basis sets.
[0115] Step 803: Accelerate dynamic weight allocation based on sparse attention mechanism and mixed precision computation.
[0116] Step 804: Construct a cloud computing cluster and dynamically adapt computing power to the iterative optimization process of the coarse-grained potential function.
[0117] In step 801, for quantum chemical calculations (such as Gaussian16's DFT-D3), a hierarchical parallel strategy combining MPI (Message Passing Interface) multi-node parallelism and OpenMP (Open Multi-Processing, a multi-threaded programming scheme for shared memory parallel systems) multi-threading is adopted to split the quaternary system into independent molecular pairs (such as CO2-asphaltene, polyether segment-kerogen) and perform parallel calculations. During the calculation process, the GPU is used to accelerate the calculation.
[0118] For basis set policy computation, especially the computation tasks of light atoms and heavy atoms, step 802 offloads the light atom basis set to the GPU processor in stages through the RDMA (Remote Direct Memory Access) network, while the heavy atom basis set tasks are retained in the CPU (Central Processing Unit) for multi-core parallel computation, thus completing the hierarchical offloading of the basis set and reducing cross-node communication overhead.
[0119] During the dynamic weight allocation process, CUDA TensorCore (Compute Unified Device Architecture TensorCore, an internal processing unit of a graphics processor) and mixed precision (FP16 / FP32) computation are enabled. The sparse attention mechanism of the NVIDIA A100 GPU (a graphics processor produced by NVIDIA with the model number A100) is used to accelerate the dynamic weight allocation, reduce memory usage, and increase training speed by 3 to 5 times.
[0120] In the iterative optimization of the coarse-grained potential function, a cloud computing cluster is built based on Kubernetes (an open-source container orchestration platform for automated deployment, scaling and management of containerized applications) to automatically allocate FPGA (Field Programmable Gate Array) hardware acceleration nodes for high-load tasks (such as CCSD(T) / aug-cc-pVTZ computation). At the same time, the iterative optimization process of the potential parameters using the inverse Monte Carlo method is performed in batch processing by CPU clusters to achieve dynamic adaptation of computing power.
[0121] In this application embodiment, a system for constructing a coarse-grained force field model based on machine learning is also proposed, the system comprising:
[0122] The nonbonded interaction parameter calibration module is used to determine the molecular structure of each component in the quaternary system and set the basis set of each component based on the corresponding molecular structure.
[0123] The coarse-grained force field model construction module is used to iteratively optimize the coarse-grained potential function and correct the optimized coarse-grained potential function in order to construct a coarse-grained force field model.
[0124] The dynamic potential parameter optimization module is used to optimize the dynamic potential parameters of the coarse-grained force field model based on the environmental feature vector, and to dynamically allocate weights to the coarse-grained force field model through an attention model.
[0125] The computing resource optimization module includes a hybrid parallel computing framework unit for parallel computing of the quaternion system; a hierarchical offloading unit for hierarchical offloading of the basis set; a hardware acceleration unit for accelerating dynamic weight allocation; and a resource allocation unit for dynamic adaptation of computing power.
[0126] While this application provides the method operation steps as described in the embodiments or flowcharts, more or fewer operation steps may be included based on conventional or non-inventive labor. The order of steps listed in this embodiment is merely one possible execution order among many and does not represent the only execution order. In actual device or client product execution, the methods shown in this embodiment or the accompanying drawings can be executed sequentially or in parallel (e.g., in a parallel processor or multi-threaded processing environment).
[0127] Some modules in the apparatus described in this application can be described in the general context of computer-executable instructions that are executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, classes, etc., that perform a specific task or implement a specific abstract data type. This application can also be practiced in distributed computing environments where tasks are performed by remote processing devices connected via a communication network. In distributed computing environments, program modules can reside in local and remote computer storage media, including storage devices.
[0128] The apparatus or module described in the above embodiments can be implemented by a computer chip or physical entity, or by a product with a certain function. For ease of description, the above apparatus is described by dividing it into various modules according to their functions. When implementing the embodiments of this application, the functions of each module can be implemented in one or more software and / or hardware. Of course, a module that implements a certain function can also be implemented by combining multiple sub-modules or sub-units.
[0129] The methods, apparatus, or modules described in this application can be implemented in a computer-readable program code manner. The controller can be implemented in any suitable manner, such as a microprocessor or processor and a computer-readable medium storing computer-readable program code (e.g., software or firmware) executable by the (micro)processor, logic gates, switches, application-specific integrated circuits (ASICs), programmable logic controllers, and embedded microcontrollers. Examples of controllers include, but are not limited to, the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicon Labs C8051F320. A memory controller can also be implemented as part of the control logic of a memory. Those skilled in the art will also recognize that, in addition to implementing the controller in purely computer-readable program code manner, the same functionality can be achieved by logically programming the method steps to make the controller take the form of logic gates, switches, application-specific integrated circuits, programmable logic controllers, and embedded microcontrollers. Therefore, such a controller can be considered a hardware component, and the means included within it for implementing various functions can also be considered as structures within the hardware component. Alternatively, the device used to implement various functions can be viewed as either a software module that implements the method or a structure within a hardware component.
[0130] This application also provides an apparatus, the apparatus comprising: a processor; a memory for storing processor-executable instructions; wherein, when the processor executes the executable instructions, it implements the method described in this application.
[0131] This application also provides a non-volatile computer-readable storage medium storing a computer program or instructions thereon, which, when executed, enables the method described in this application embodiment to be implemented.
[0132] Furthermore, in the various embodiments of the present invention, each functional module can be integrated into a processing module, or each module can exist independently, or two or more modules can be integrated into a single module.
[0133] The aforementioned storage media include, but are not limited to, Random Access Memory (RAM), Read-Only Memory (ROM), Cache, Hard Disk Drive (HDD), or Memory Card. The memory can be used to store computer program instructions.
[0134] As can be seen from the above description of the embodiments, those skilled in the art can clearly understand that this application can be implemented by means of software plus necessary hardware. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product, or it can be embodied in the process of data migration. The computer software product can be stored in a storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, mobile terminal, server, or network device, etc.) to execute the methods described in various embodiments or some parts of the embodiments of this application.
[0135] The various embodiments described in this specification are presented in a progressive manner. Similar or identical parts between embodiments can be referred to interchangeably. Each embodiment focuses on its differences from other embodiments. All or part of this application can be used in numerous general-purpose or special-purpose computer system environments or configurations. Examples include: personal computers, server computers, handheld or portable devices, tablet devices, mobile communication terminals, multiprocessor systems, microprocessor-based systems, programmable electronic devices, network PCs, minicomputers, mainframe computers, and distributed computing environments including any of the above systems or devices, etc.
[0136] The above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit this application. Although this application 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 therein. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of this application.
Claims
1. A method for optimizing and constructing a coarse-grained force field model based on machine learning, characterized in that, include: The initial potential parameters of the coarse-grained potential function are simulated using the all-atom molecular dynamics simulation method, and the all-atom RDF curve is obtained. The initial potential parameters are iteratively optimized based on the all-atom RDF curve to optimize the coarse-grained potential function; A correction term is introduced into the coarse-grained potential function to construct a coarse-grained force field model; The correction terms include π-π interaction correction terms and polar interaction correction terms; The coarse-grained force field model is dynamically optimized based on environmental feature vectors to obtain optimized potential parameters; wherein, the environmental feature vectors include reservoir pore size and fracture connectivity; the dynamic potential parameter optimization includes: In micropores, the short-range repulsion parameter in the coarse-grained potential function is enhanced to simulate the molecular crowding effect in a real environment; in macropores, the diffusion resistance weight is reduced; where micropores refer to pore sizes less than 2 nm and macropores refer to pore sizes greater than 50 nm. Under high fracture connectivity, electrostatic interactions are weakened; under low fracture connectivity, the π-π interaction correction term is strengthened; where high fracture connectivity means fracture connectivity greater than 70%, and low fracture connectivity means fracture connectivity less than 30%. The environmental feature vector includes pore size and crack connectivity, expressed as: ; In the formula, Represents the environmental feature vector. Indicates pore size, Porosity is used to characterize the connectivity of fractures. Represents the spatial gradient of pore size. Represents the spatial gradient of porosity; The environmental feature vector is dynamically correlated with the interaction characteristics between molecules in the quaternary system to obtain the correlation results. The association results are input into the initial attention model for training to obtain the attention model; An attention model is used to dynamically assign weights to the optimized potential parameters in order to optimize the initial coarse-grained force field model.
2. The method according to claim 1, characterized in that, Before simulating the initial potential parameters of the coarse-grained potential function using the all-atom molecular dynamics simulation method, the following steps are also included: The nonbonding interaction parameters of the quaternary system are calibrated, including: The molecular configurations of CO2, polyether segments, asphaltenes, and kerogen in the quaternary system were determined respectively. Based on the molecular structure and chemical properties of each component in the quaternary system, basis sets were set for CO2, polyether segments, asphaltene and kerogen, respectively. Based on electronic correlation and dispersion effects, the interactions between the molecular structures of each component are determined, and the interaction energies of each molecular structure are obtained. Convergence tests were performed on each basis set to verify the rationality of the basis set selection and to control the error of each basis set; wherein, the non-bonded interaction parameters include molecular configuration, basis set and intermolecular interaction energy.
3. The method according to claim 1, characterized in that, The iterative optimization of the initial potential parameters based on the all-atom RDF curve includes: The coarse-grained potential function is iteratively executed with loop steps based on the current potential parameters of the inverse Monte Carlo method, and the coarse-grained potential function is optimized based on the current potential parameters output by the loop steps. The cyclic steps include: Perform all-atom molecular dynamics simulations on the current potential parameters to obtain the current coarse-grained RDF curve; Determine whether the iteration termination condition has been met; If the iteration termination condition is met, the current potential parameters are output. If the iteration termination condition is not met, the loop step is executed.
4. The method according to claim 1, characterized in that, After dynamically assigning weights to the coarse-grained force field model, the method further includes calculating a loss function to optimize the coarse-grained force field model. Loss functions include: ; in, Represents the loss function. This represents the mean square error term. This represents the optimized potential parameters. Indicates the target potential parameters. Indicates hyperparameters, This represents the variance penalty term. Attention weights representing pore size Attention weights are used to represent porosity.
5. The method according to claim 2, characterized in that, It also includes optimizing the calculation process, including: The quaternary system is decomposed into independent molecular pairs, and the independent molecular pairs are computed in parallel based on a hierarchical parallel strategy, while the graphics processor is used to accelerate the computation process. The basis sets are offloaded in stages according to the computational tasks of different basis sets; Accelerate dynamic weight allocation based on sparse attention mechanism and mixed-precision computation; Build a cloud computing cluster and dynamically adapt computing power to the iterative optimization process of the coarse-grained potential function.
6. A system for optimizing and constructing a coarse-grained force field model based on machine learning, the system being used to apply the method for optimizing and constructing a coarse-grained force field model based on machine learning as described in any one of claims 1 to 5, characterized in that, include: The nonbonded interaction parameter calibration module is used to determine the molecular structure of each component in the quaternary system and set the basis set of each component based on the corresponding molecular structure. The coarse-grained force field model construction module is used to iteratively optimize the coarse-grained potential function and correct the optimized coarse-grained potential function in order to construct a coarse-grained force field model. The dynamic potential parameter optimization module is used to optimize the dynamic potential parameters of the coarse-grained force field model based on the environmental feature vector, and to dynamically assign weights to the optimized potential parameters through an attention model in order to optimize the initial coarse-grained force field model. The computing resource optimization module includes a hybrid parallel computing framework unit for parallel computing of the quaternion system; a hierarchical offloading unit for hierarchical offloading of the basis set; a hardware acceleration unit for accelerating dynamic weight allocation; and a resource allocation unit for dynamic adaptation of computing power.
7. An apparatus for performing a method for constructing a coarse-grained force field model based on machine learning optimization, characterized in that, include: processor; Memory used to store processor-executable instructions; When the processor executes the executable instructions, it implements the method as described in any one of claims 1 to 5.
8. A non-volatile computer-readable storage medium, characterized in that, Includes storage of computer programs or instructions that, when executed, cause the method as described in any one of claims 1 to 5 to be implemented.
Citation Information
Patent Citations
Method and system for predicting friction coefficient of organic drag reducer
CN116976225A
Polymer coarseness force field parameter optimization method and device
CN118607336A