Organic matter molecular model pore structure analysis method
The pore structure of organic matter molecular models was calculated using molecular dynamics methods. The convex hull method and lattice method were used to identify connected and closed pores, which solved the problem of porosity calculation in the prior art, improved the calculation efficiency and accuracy, and provided reliable data support for material design.
Patent Information
- Application Number
- CN202510916205.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-03
- Publication Date
- 2025-11-07
- Estimated Expiration
- 2045-07-03
AI Technical Summary
Existing molecular simulation methods struggle to accurately extract pore information when calculating the porosity and pore volume of porous materials, making it difficult to identify connected and closed pores. Furthermore, their computational algorithms are inefficient and lack precision, especially in modeling complex systems.
Using a molecular dynamics-based approach, the total atomic volume is calculated by inputting the structural file of an organic molecular model. The model volume is determined using the convex hull method, and the connectivity of the pore structure is analyzed by combining the lattice method and a preset search algorithm. The volumes of connected pores and closed pores are quantified, and the analysis results are output.
It enables accurate calculation of porosity and volume in complex structures, improves computational efficiency and accuracy, provides efficient porosity analysis tools, and supports material design and optimization.
Smart Images

Figure CN120913718A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of molecular simulation of oil and gas geology, in particular, a method for calculating and analyzing the structure volume, pore volume and pore structure of an organic matter molecular model based on a structure file of the organic matter molecular model simulated by molecular dynamics. BACKGROUND
[0002] Pore structure analysis is an important tool for studying the properties of porous materials and is of great significance for material development and optimization. Pore volume and pore volume, as key parameters of porous materials, directly affect their physical and chemical properties, such as adsorption capacity, gas storage, ion transport, and catalytic efficiency. In molecular simulation, the calculation of porosity not only comprehensively analyzes the pore volume of the material, but also further analyzes the distribution characteristics of connected pores and closed pores. Therefore, accurate calculation of the pore characteristics of the model in molecular simulation is a key step for evaluating material performance and guiding design optimization.
[0003] Traditional experimental methods such as gas adsorption method (BET method) or X-ray computed tomography (CT scan) can provide relatively accurate pore data, but it is difficult to deeply analyze the microstructure of the material at the atomic scale, and it is still very difficult to quantitatively analyze the connectivity of the pores, especially in dynamic simulation or early stage of material design. Molecular simulation technology can directly extract pore characteristics from simulation data by processing atomic-level structure information of the material, such as coordinate structure files generated by molecular dynamics, providing a more efficient and lower-cost analysis method.
[0004] However, existing molecular simulation methods face many challenges in data calculation, such as how to accurately extract pore information from complex molecular structures, how to efficiently identify connected pores and closed pores in high-dimensional space, and how to optimize the calculation algorithm to process large-scale atomic coordinate data. These problems limit the performance of existing methods in terms of efficiency and accuracy, especially in the modeling of complex porous materials. SUMMARY
[0005] The present application provides a method for analyzing the pore structure of an organic matter molecular model, which solves the problems of the prior art, accurately calculates the porosity and volume in complex structures, has an efficient calculation method and an easy-to-use interface, and helps researchers to perform pore analysis of 3D structures in multiple fields.
[0006] To achieve the above-mentioned purpose, the present application adopts the following technical solutions: In a first aspect, the present application provides a method for analyzing the pore structure of an organic matter molecular model, comprising: S1, inputting a model structure file of an organic matter molecular model, the model structure file carrying the atomic types and three-dimensional coordinates of each atom contained in the organic matter molecular model; S2, calculating the total volume of atoms in the organic matter molecular model according to the model structure file; S3, determining the convex hull enclosing all atoms in the organic matter molecular model to calculate the model volume of the organic matter molecular model; S4, analyzing and calculating the pore volume and porosity in the organic matter molecular model according to the model volume and the total volume of atoms; S5, establishing a spatial index structure of the organic matter molecular model based on the lattice method, analyzing the connectivity of the pore structure in the organic matter molecular model using a preset search algorithm, and quantifying the connected pore volume and closed pore volume; S6, outputting the analysis result.
[0007] In an implementation, the input model structure file of the organic matter molecular model includes a file in pdb or gro format, and also includes the simulation box vector information parsed from the input data.
[0008] In an implementation, the S2 includes: The volume of a single atom is estimated using the van der Waals radius, and the total atomic volume of the organic matter molecular model is calculated by applying volume correction based on the chemical bonds identified between atoms, which is based on the atomic types and the connection relationship between atoms, using preset element volume contribution values and bond volume contribution values.
[0009] In an implementation, the specific calculation process includes: According to the three-dimensional coordinates of each atom and the atomic type, the atomic volume of each atom is calculated using the preset van der Waals radius; The total element volume contribution is obtained by multiplying the number of atoms of each element determined according to the atomic type by the preset element volume contribution value of the element; The total bond volume contribution is obtained by multiplying the count of each bond type by the preset bond volume contribution value of the bond type; The total atomic volume is obtained by adding the total element volume contribution and the total bond volume contribution.
[0010] Specifically, it can include: ① Calculate the atomic volume; assign bond length data (nm) to each atom read according to the preset van der Waals radius database, and approximate the atomic volume as the volume of a sphere with the van der Waals radius as the radius.
[0011] ②Chemical bond identification and counting; preferentially use the obtained explicit bond connection information (such as the CONECT record in the pdb file). For each explicit connection, determine the corresponding bond type (for example, based on the element type of the bonding atoms).
[0012] If explicit bond information is missing, a distance-based bond finding method is adopted: a spatial index structure of atom coordinates (K-d tree) is constructed. Query each atom's neighboring atoms within a pre-set maximum bond length search radius. For each found atom pair, calculate its inter-atomic distance. Compare the calculated distance with a pre-set database of typical bond lengths (containing approximate bond lengths and tolerance ranges for different element pairs, different bond orders). Determine the most likely bond type (e.g. single bond, double bond, triple bond) according to the best match (smallest distance error and within the tolerance range).
[0013] ③ Bond type mapping and counting; map the identified chemical bonds (whether from explicit information or distance judgment) to a pre-defined database of bond contribution types, which contains identifiers for non-ring bonds, ring bonds, and special functional groups (such as benzene ring, nitro group). Count each identified bond type. Obtain the volume contribution value of the chemical bond, (unit , usually negative), and add up to calculate the total bond volume contribution.
[0014] For cyclic structures and special functional groups, more complex graph theory algorithms or chemical informatics libraries can be integrated for more accurate identification and counting, to improve the accuracy of bond type judgment.
[0015] ④ Volume contribution addition: calculate the total atomic volume contribution according to ①. Calculate the total bond volume contribution according to the volume contribution of each bond obtained in ③. Add the total element volume contribution and the total bond volume contribution to obtain the total atomic volume of the material structure, unit . Ensure that the calculation result is not negative.
[0016] In an implementation, the chemical bond in the organic matter molecule model is identified, including: Obtain the display bond connection information in the model structure file to determine the corresponding chemical bond; If explicit connection information is missing, a distance-based bond finding method is adopted: a spatial index structure of atom coordinates (K-d tree) is constructed. Query each atom's neighboring atoms within a pre-set maximum bond length search radius. For each found atom pair, calculate its inter-atomic distance. Compare the calculated distance with a pre-set database of typical bond lengths (containing approximate bond lengths and tolerance ranges for different element pairs, different bond orders). Determine the most likely bond type (e.g. single bond, double bond, triple bond) according to the best match (smallest distance error and within the tolerance range).
[0017] In an implementation, in step S5, the spatial index structure is a K-d tree structure.
[0018] In an implementation, in step S5, the pre-set search algorithm is a breadth-first search algorithm.
[0019] Specifically, the above step S5 specifically includes: ① Griding; determine the boundary of the analysis region, preferentially use the simulation box boundary, if no box, use the minimum / maximum range of atom coordinates and add a buffer. According to the preset grid resolution (herein the size of methane molecule is used as the standard, which can be modified), generate three-dimensional uniform grid points in the analysis region. Record the total number of grid points.
[0020] ② Space index construction; obtain the coordinates of all atoms, if the system has periodic boundary conditions (especially orthogonal box), map the atom coordinates into the main simulation box to handle atoms across the boundary. Use the atom coordinates to construct K-d tree.
[0021] ③ Pore grid identification; for each grid point, use K-d tree to query all neighboring atom indexes within a certain search radius. Calculate the distance between the grid point and each neighboring atom. Determine whether the grid point is inside the sphere defined by the van der Waals radius of any neighboring atom. If the grid point is not inside the van der Waals sphere of any neighboring atom, mark it as a "pore grid point". Record the total number of pore grid points.
[0022] More preferably, when calculating the pore and grid boundary, in order to avoid larger pore errors caused by dividing the grid points to the outside of the model, the boundary of the convex hull is used as the boundary of the divided grid points.
[0023] ④ Connectivity analysis (BFS); initialize a queue and add all "pore grid points" located on the boundary of the model to the queue, and mark these points as "visited" and "connected" "closed". When the queue is not empty, take a grid point (current point) from the queue, check the six direct neighbors (up, down, left, right, front, back) of the current point. For each neighbor: if the neighbor is a "pore grid point" and has not been marked as "visited", mark it as "visited" and "connected" and add it to the queue. After the BFS is completed, all grid points marked as "connected" are the pore part connected to the outside. Record the total number of connected grid points, and the grid points marked as "closed" are the closed pore part.
[0024] ④ Connected and closed pore volume calculation; multiply the number of connected / closed grid points by the volume of a single grid point to obtain the estimated value of the connected / closed pore volume, unit . The total pore volume calculated should be the sum of the connected pore volume and the closed pore volume calculated here, which is used as the correct result. If the connected volume estimate exceeds the total pore volume, the closed volume is 0 and the connected volume is equal to the total pore volume. Divide the connected pore volume by the total pore volume to obtain the connected porosity.
[0025] In a second aspect, a computer readable storage medium is provided, wherein at least one computer program is stored in the computer readable storage medium, and the at least one computer program is loaded and executed by a processor to enable a computer to implement the method for analyzing pore structure of organic matter molecular model according to the first aspect.
[0026] In a third aspect, a computer device is provided, comprising a memory and a processor, wherein the memory stores computer program instructions, and the processor is configured to execute the instructions to implement the method according to the first aspect.
[0027] The method provided by the present application fully relies on the structure file of molecular simulation in a balanced state, and can accurately extract and classify pore information by analyzing three-dimensional atomic coordinate data, combining slice analysis, chemical bond correction and efficient spatial search algorithm. The core technology includes calculating the total pore volume of the model based on the convex hull method, identifying connected pores and closed pores by using breadth-first search (BFS) and K-D tree data structure, and can intuitively present the results in a visual manner. This method significantly improves the efficiency and accuracy of the calculation of the porosity of the model, and provides reliable data support for simulation and optimization in material design. It is a new type of analysis tool for molecular simulation. BRIEF DESCRIPTION OF DRAWINGS
[0028] Fig. 1 is a flowchart of the porosity and pore ratio of the calculation model according to an embodiment of the present application.
[0029] Fig. 2 is a schematic diagram of the irregular organic matter kerogen model molecular structure in embodiment 1 of the present application.
[0030] Fig. 3 is a calculation result diagram of the irregular organic matter kerogen model molecule in embodiment 1 of the present application.
[0031] Fig. 4 is a schematic diagram of the regular silicon dioxide model molecular structure in embodiment 2 of the present application.
[0032] Fig. 5 is a calculation result diagram of the regular silicon dioxide model molecule in embodiment 2 of the present application. DETAILED DESCRIPTION
[0033] In order to make the purpose, technical scheme and advantages of the embodiments of the present application clearer, the technical scheme of the embodiments of the present application will be described clearly and completely below in combination with the drawings of the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all the embodiments. Based on the described embodiments of the present application, all other embodiments obtained by those skilled in the art belong to the scope of protection of the present application.
[0034] In view of the defects and problems of the prior art, the present application provides an organic matter molecular model pore structure analysis method, comprising: S1, inputting a model structure file of an organic matter molecular model, the model structure file carrying atom types and three-dimensional coordinates of each atom contained in the organic matter molecular model; S2, calculating a total volume of atoms in the organic matter molecular model according to the model structure file; S3, determining a convex hull surrounding all atoms of the organic matter molecular model to calculate a model volume of the organic matter molecular model; S4, analyzing and calculating a pore volume and a porosity in the organic matter molecular model according to the model volume and the total volume of atoms; S5, establishing a spatial index structure of the organic matter molecular model based on a lattice method, analyzing connectivity of a pore structure in the organic matter molecular model by using a preset search algorithm, and quantifying a connected pore volume and a closed pore volume; S6, outputting an analysis result.
[0035] The above method will be described in one or more more detailed embodiments and application examples in combination with more drawings.
[0036] Detailed method embodiment 1 Referring to FIG. 1, the present application embodiment provides a method flow, wherein the method involves the following key technical contents: Step S1, data input and preprocessing: the calculation flow of the present application first needs a user to select an input file, and requires that the file format is a coordinate file in gro or pdb format. The format file contains the atomic composition, three-dimensional coordinates and other key information of the molecular model, and is the basis for subsequent analysis.
[0037] When reading the file, a function for recognizing gro or pdb format is automatically called according to the file extension, and the type and coordinates of each atom are parsed from the file. For example, according to the fixed format of the gro file, the system will automatically skip the header and tail data of the file, and only keep the valid information in the middle part, including the coordinates and categories of each atom, and confirm that all length units are unified to nm. These extracted data provide a basis for subsequent porosity and volume calculation.
[0038] Step S2, calculating the total volume of atoms: in order to calculate the total volume of atoms in the model, the present application estimates the volume of each atom based on the van der Waals radius, calculates the volume of a single atom, and adds up the volumes of all atoms to obtain the total volume of atoms in the model. A volume correction method based on chemical bond information is introduced to correct the initial calculated model volume.
[0039] Step S2 specifically includes: Step S21 Calculate atomic volume: First extract the type of each atom recorded in the coordinate file, and look up the corresponding van der Waals radius value according to its type, and calculate the volume of the atomic sphere according to the van der Waals radius.
[0040] Step S22 Chemical bond identification and counting: Call the chemical bond identification module If the input data contains explicit atomic connection records, preferentially identify the chemical bonds between atoms based on these records. If explicit connection information is missing, perform a chemical bond search based on the distance between atoms, and use the coordinates of all atoms (in units of nm) to construct a spatial index structure (such as a K-d tree). For each atom, query its neighboring atoms within a preset search radius (based on the maximum possible bond length, in units of nm). Calculate the distance between the atom pairs (in units of nm). Compare the calculated distance with the pre-defined database of typical chemical bond lengths BOND_LENGTHS (containing bond length ranges for different bond orders, different element pairs, in units of nm). Determine the most likely chemical bond and its type (e.g. C-C single bond, C=O double bond, etc.) according to the best degree of distance matching (e.g. smallest error and within tolerance). Note that this distance method has limitations in determining bond order (single / double / triple), ring properties, and special functional groups, and may require more advanced algorithms or libraries for accurate determination.
[0041] Step S23 Bond type mapping and counting: Map each chemical bond identified in step S22 to a pre-defined list of chemical bond contribution types, count the number of occurrences of each successfully mapped chemical bond type, and store it in a dictionary. For bonds that cannot be clearly mapped or identified, record or issue a warning.
[0042] Step S24 Volume contribution addition: Multiply the count of each chemical bond type obtained in step S23 by its corresponding unit volume contribution value, and then add up the contribution values of all chemical bonds to obtain the total chemical bond volume contribution (Note that this value is usually negative). Add the total atomic volume calculated in step S21 to the total chemical bond volume contribution obtained in this step Perform algebraic addition, i.e.: = + . The resulting value represents the actual space volume occupied by the atom. Ensure that the final calculated total atomic volume is not negative, if a negative value appears, set it to 0 and issue a warning.
[0043] Step S3: Calculate the model volume: call the convex hull calculation function with the array of 3D coordinates of all atoms obtained from Step S1 as input. The convex hull algorithm finds the smallest convex polyhedron that contains all the input atomic coordinate points. The goal of the convex hull algorithm is to find the smallest convex polyhedron that contains all the points in the point set. Similar to quicksort, it first finds the coordinate extremum points (e.g., the minimum and maximum coordinate points for x, y, z), which must be on the convex hull. Then, based on the initial polyhedron (e.g., tetrahedron) formed by these points, recursively assign the remaining points to the "outside" of each face and find the point farthest from the face to join the convex hull, constantly expanding and updating the convex hull facets until all points are inside or on the boundary of the convex hull. From the return result of the convex hull calculation function, extract the calculated volume value. This volume value represents the volume of the outer boundary that encloses the entire atomic structure . This method is particularly suitable for handling irregular atomic arrangements, complex shapes, and structures with internal cavities, channels, or surfaces with complex concave-convex conditions.
[0044] Step S4: Calculate the pore volume: The pore volume is the volume of the space not occupied by atoms in the total volume of the model, representing the porosity of the material. In this step, the pore volume is obtained by calculating the difference between the model volume and the atomic volume. Specifically, the system first calls the model volume and total atomic volume data calculated in the previous steps, and calculates using the formula: = - Through this calculation, the total pore volume of the model can be obtained, laying the foundation for further analysis of the type and distribution characteristics of the pore region. In addition, this result is also used to evaluate the porosity of the material, which is defined as the ratio of the total pore volume to the model volume, usually expressed in percentage form, and is an important parameter for measuring the performance of porous materials.
[0045] Step S5: Calculate the closed / connected pore volume: To further analyze the geometric characteristics and connectivity of the pore region, the present invention proposes a method for identifying closed pores and connected pores based on spatial data structures and algorithms. The K-d tree (K-dimensional tree) is used as a spatial indexing structure to efficiently search and segment the extracted pore region. The KD-Tree uses the Breadth-First Search (BFS) algorithm to analyze the connectivity of the pore region, identifying which pore regions are connected to each other and which pores are connected to the outside of the model, marked as connected pores. The remaining pores are closed pores. Through this step, not only can the type and distribution of pores in the material be quantified, but also detailed references can be provided for application scenarios. The above results can be further combined with parameters such as porosity and pore ratio to provide comprehensive data support for the optimization design and functional development of materials.
[0046] Step S5 specifically includes: Step S51: Spatial Gridding and KD Tree Construction: Determine the three-dimensional spatial analysis region based on the minimum / maximum range of atomic coordinates of the material structure. Within the determined spatial range, generate uniformly distributed three-dimensional grid points according to a preset grid resolution. Construct a KD tree for all grid points.
[0047] Step S52: Pore lattice point identification: Traverse all generated lattice points. For each lattice point, use the Kd tree constructed in step S51 to query all its neighboring atoms within a predetermined search radius. Calculate the distance between the lattice point and each neighboring atom to determine whether the lattice point is located inside a sphere defined by the van der Waals radius of any neighboring atom. If a lattice point is not located inside the van der Waals sphere of any neighboring atom, then mark the lattice point as a "pore lattice point".
[0048] Step S53 Connectivity Analysis: Create a queue to store the grid points to be visited, and create a state array to mark the state of all grid points (0 - non-pore, 1 - pore unvisited, 2 - pore visited / connected, 3 - pore visited / closed). Mark all "pore grid points" identified in Step S52 as state 1 in the array. Find all pore grid points (points with state 1) located on the gridded spatial boundary. Update the state of these boundary pore grid points to 2 (indicating visited and connected). While the queue is not empty, iterate through each grid point. Check the six direct spatial neighbors (up, down, left, right, front, back) of the grid point. For each neighbor, if the neighbor grid point is a "pore grid point" (state 1), update its state to 2 (marked as visited / connected) and add it to the queue. After the search is complete, all grid points with state 2 represent the pore parts connected to the outside world.
[0049] Step S54 Calculation of connected and closed pore volume: Count the number of all "connected pore grid points" with a state of 2, multiply by the grid point size, and that is the size of the connected pore. The size of a closed pore is obtained by counting the number of all "closed pore grid points" with a state of 3 and multiplying the count by the grid point size. Then according to The pore volume calculated in step S4 is then verified and corrected.
[0050] Step S6 Result Display: Based on the above calculation results, the output results include volume, porosity, void ratio, etc.
[0051] Application Example 1 The embodiment provides an application example of implementing the above algorithm function based on a python language, and describes a process of analyzing a pore structure of an irregular kerogen material stored in a pdb format file by using the method. Figure 3 The calculation result is shown in Figure 4
[0052] Specifically includes: 1. Import necessary modules: Numpy: for numerical calculation and array operation. scipy.spatial.KDTree: for efficient nearest neighbor query, used for connected pore analysis. collections.deque: bidirectional queue, used for breadth-first search (BFS). tkinter: for building a graphical user interface.
[0053] 2. Data reading: the example of the application first selects and reads a PDB file (for example, '22.pdb') through a graphical interface. The'read_pdb_file' function in the program is responsible for parsing the PDB file, extracting the atomic serial number, atomic name, atomic coordinates, and storing them in nm units. At the same time, according to the atomic name or the element column in the file, the atomic element type is guessed, and the corresponding van der Waals radius is found. If the PDB file contains CONECT records, the program will also read these records for subsequent chemical bond identification.
[0054] 3. Chemical bond identification and atomic total volume calculation: the program traverses all atoms, finds the corresponding van der Waals radius according to the element type, calculates the volume of each atom as a sphere, and accumulates to obtain the uncorrected atomic sphere total volume. The program calls the 'find_bonds_and_count_types' function. Since the PDB file usually contains CONECT records, the program will prefer to use these records to identify the connection between atoms. By comparing the atom pair in the CONECT record with its spatial distance, and referring to the built-in typical bond length information ('BOND_LENGTHS'), the program tries to determine the type of chemical bond and count. According to a large number of skeleton chemical bonds identified, the program finds the corresponding volume contribution ('BOND_VOLUME_CONTRIBUTIONS') and calculates the total correction. Calculate the corrected atomic total volume (V_atom). This volume represents the space occupied by the model itself atoms.
[0055] 4. Model Volume Calculation: The program calls the function 'calculate_model_volume_convex_hull' to calculate the convex hull volume (V_model) of the model using all the atomic coordinates read. The convex hull volume represents the total spatial extent of the segment outside. Meanwhile, the convex hull vertices are extracted as the basis for the griding range. This volume is usually much larger than the total atomic volume, and the difference is the potential pore space. Total Pore Volume Calculation: The program calculates the total pore volume (V_pore_total) as the model volume minus the total atomic volume (V_pore_total = V_model - V_atom), which represents the total void space inside the material.
[0056] 5. Pore Connectivity Analysis: The program determines the griding range based on the model boundary (convex hull vertices). A regular grid of points covering this range is generated according to 'GRID_RESOLUTION'. A K-d tree containing the atomic coordinates is constructed. All generated grid points are traversed. A large number of grid points located between the model atoms are identified as "pore grid points" since they are not within the van der Waals spheres of any nearby atoms. These points constitute the grid representation of the pore space inside the material. The program performs a Breadth-First Search (BFS) to analyze the connectivity of the pore grid points. First, BFS is started from the pore grid points located on the boundary of the griding region. If the pores of the material segment are open and extend to the model boundary, all pore grid points along these pores will be marked as "connected pore points". These points represent the pore space that is connected to the external environment. Next, the program traverses all remaining (not marked as connected) pore grid points. A new BFS is started from each unvisited pore point to find a cluster of independent pore points. These clusters are completely contained within the material and are not connected to the outside, so they are marked as "closed pore points". These points represent isolated cavities inside the material or parts of pores that fail to extend to the segment boundary. According to the number of connected and closed pore points found, multiply by the grid cell volume respectively, the connected pore volume and the closed pore volume based on BFS count are calculated, and verified by the total pore volume. The connected volume represents the connected pore space of the material, and the closed volume represents the closed pore space.
[0057] 6. User Interface and Result Presentation: After the calculation is complete, the program presents the results through the GUI interface. The user can see the total atomic volume, model volume, total pore volume, connected pore volume, closed pore volume, and corresponding porosities calculated. For this example, the total pore volume is expected to be a large positive value. The connected pore volume and the closed pore volume will also be positive values, and their relative sizes depend on the specific pore structure of the material (whether it is dominated by open channels or isolated cavities). These results quantify the pore characteristics of the material.
[0058] Application Example 2 This embodiment provides an application example of implementing the above algorithm function based on the python language, and describes the process of analyzing the structure of a regular silicon dioxide material stored in a gro file using the method of the present application. Embodiment 2 uses a regular silicon dioxide material model containing 65968 Si and O atoms. The molecular configuration is as shown in Figure 5 , which is the configuration of a hollow cylinder in a cuboid, and the calculation results are as shown in Figure 5 .
[0059] Specifically includes: 1. Import necessary modules: the same as embodiment 1, import Numpy, KDTree, deque, tkinter, etc. 2. Data reading: the present application first selects and reads a GRO file (for example, 'd14.gro') through a graphical interface. The'read_gro_file' function in the program is responsible for parsing the GRO file, extracting atomic names, atomic coordinates (in nm units), and guessing element types according to atomic names, and looking up van der Waals radii. The GRO file usually contains box vectors (in nm units), and the program will read these information and use it for subsequent periodic boundary condition processing (although the periodic processing in the code is simplified, which mainly affects the K-d tree query and the mapping of grid coordinates). Chemical bond identification and atomic total volume calculation: the program traverses all atoms, calculates and accumulates their van der Waals sphere volume. The program calls the 'find_bonds_and_count_types' function. Since the GRO file usually does not contain CONECT records, the program will mainly rely on the spatial distance between atoms and refer to the built-in typical bond length ('BOND_LENGTHS') to identify chemical bonds and count. This step is crucial for accurately calculating the chemical bond correction volume. According to the large number of skeleton chemical bonds identified, the program looks up the corresponding volume contribution ('BOND_VOLUME_CONTRIBUTIONS') and calculates the total correction amount. Calculate the corrected atomic total volume (V_atom). This volume represents the space occupied by the model itself atoms.
[0060] 3. Model volume calculation: The program calls the function ‘calculate_model_volume_convex_hull’ to calculate the 3D convex hull using all the atomic coordinates read. The convex hull is the smallest convex polyhedron that contains all the atoms, and its volume represents the total volume outside the molecule (V_model). This step also extracts the vertices of the convex hull as the basis to define the range of subsequent griding. For a small isolated molecule, this convex hull volume represents the approximate space occupied by the molecule, which can be calculated for the rule model, should be 2460 left and right.
[0061] 4. Total pore volume calculation: Internally, the program calculates the total pore volume (V_pore_total) as the model volume minus the total atomic volume (V_pore_total = V_model - V_atom). For a molecule with internal cavities but tight material, V_model is expected to be larger than V_atom, and the total pore volume should be slightly larger than the internal cavity volume, should be slightly larger than 1526 .
[0062] 5. Pore connectivity analysis: Based on the model boundary defined by the convex hull vertices, the program generates a 3D regular grid in this region according to the preset grid resolution ‘GRID_RESOLUTION’ (e.g. 0.38 nm). A K-d tree containing all atomic coordinates is constructed for fast atomic queries. The program iterates through all generated grid points. For each grid point, the K-d tree is used to efficiently query the atoms within a certain radius range. If a grid point is not within the van der Waals sphere of any nearby atom (considering atomic radii), the grid point is marked as a “pore grid point”. For a tightly connected molecule, it is expected that only a few grid points will be identified as pore grid points, as there are no internal voids in the molecule and the external space has been determined by the model boundary. If pore grid points are identified, the program performs a breadth-first search (BFS). First, BFS is started from the pore grid points located on the boundary of the gridding region. All pore points that can be reached from the boundary grid points through adjacent pore grid points are marked as “connected pore points”. Then, the program iterates through all remaining (not marked as connected) pore grid points. From each unvisited pore point, a new BFS is started to find an independent cluster of pore grid points, which are marked as “closed pore points”. According to the number of connected pore points and closed pore points found, multiply by the volume of each grid cell to calculate the connected pore volume and closed pore volume. For a regular and dense small molecule, due to the small number of internal pore grid points, the number of closed points is expected to be small.
[0063] 6. User interface and result presentation: After the calculation is completed, the program presents the results through the constructed Tkinter GUI interface. The user can see the calculated total atomic volume, model volume, total pore volume, connected pore volume, closed pore volume, and the corresponding porosities (connected porosity = connected volume / total pore volume, closed porosity = closed volume / total pore volume) on the interface. For this example, the values of the closed pore volume and closed porosity are expected to be very low, close to zero.
[0064] The above merely provides the preferred embodiments of the present application, but should not be used to limit the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the scope of protection of the present application.
Claims
1. A method for analyzing pore structure of a molecular model of organic matter, characterized by, The method comprises the following steps: S1, inputting a model structure file of an organic matter molecule model, wherein the model structure file carries atomic types and three-dimensional coordinates of atoms contained in the organic matter molecule model; S2, calculating a total atomic volume in the organic matter molecule model according to the model structure file; S3, determining a convex hull surrounding all atoms in the organic matter molecule model to calculate a model volume of the organic matter molecule model; S4, analyzing and calculating a pore volume and a porosity in the organic matter molecule model according to the model volume and the total atomic volume; S5, establishing a spatial index structure of the organic matter molecule model based on a lattice method, analyzing connectivity of a pore structure in the organic matter molecule model by using a preset search algorithm, and quantifying a connected pore volume and a closed pore volume; S6, outputting an analysis result.
2. The method according to claim 1, wherein In the step S2, the method comprises the following steps: a single atomic volume is estimated by using a van der Waals radius, and a volume correction is applied according to identified chemical bonds between atoms, wherein the volume correction is based on the atomic types and the connection relationship between atoms, and uses preset element volume contribution values and chemical bond volume contribution values to calculate the total atomic volume of the organic matter molecule model.
3. The method according to claim 2, wherein The specific calculation process comprises the following steps: atomic volumes of atoms are calculated by using preset van der Waals radii according to three-dimensional coordinates of the atoms and the atomic types; a total element volume contribution is obtained by multiplying the atomic number of each element type by the preset element volume contribution value of the element type; a total chemical bond volume contribution is obtained by multiplying the count of each chemical bond type by the preset chemical bond volume contribution value of the chemical bond type; the total element volume contribution and the total chemical bond volume contribution are added to obtain the total atomic volume.
4. The method according to claim 3, wherein The method for identifying chemical bonds in the organic matter molecule model comprises the following steps: connection information of chemical bonds in the model structure file is obtained to determine corresponding chemical bonds; if the explicit connection information is missing, a distance-based chemical bond searching method is used to query adjacent atoms within a preset maximum bond length search radius for each atom, and for the found atom pairs, the distance between the atoms is calculated; the calculated distance is compared with a preset typical chemical bond length database, and the chemical bond is determined according to the error range of the comparison.
5. The method according to claim 1, wherein In step S5, the spatial index structure is a K-d tree structure.
6. The method according to claim 1, wherein In step S5, the preset search algorithm is a breadth-first search algorithm.
7. A computer readable storage medium characterized in that, The computer readable storage medium stores at least one computer program, and the at least one computer program is loaded and executed by the processor to enable the computer to implement the organic matter molecule model pore structure analysis method according to any one of claims 1 to 6.
8. A computer device, comprising: The computer readable storage medium stores at least one computer program, and the at least one computer program is loaded and executed by the processor to enable the computer to implement the organic matter molecule model pore structure analysis method according to any one of claims 1 to 6.
Citation Information
Patent Citations
A metal-organic framework with optimized open metal sites and pore spaces for high methane storage at room termerature
CN103619856A
Solute low-energy segregation interface model modeling method based on free volume distribution
CN113421616A
Shale oil adsorption strength evaluation method based on intermolecular interaction energy
CN116842697A
Method for constructing kerogen pore model
CN118190755A
Calculation method and calculation program for gas density in nanopores under coal seam in-situ condition
CN118366555A