Method for generating wettability-adjustable porous quartz atomic-scale model based on CT scanning data

By constructing an atomic-level model of porous quartz using CT scan data, the problem of insufficient utilization of wettability information in existing technologies is solved. This enables spatially variable wettability and efficient automated modeling of atomic-level models, improving the accuracy and efficiency of molecular simulation.

CN121558786APending Publication Date: 2026-02-24CHINA UNIV OF PETROLEUM (EAST CHINA)
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511797724.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-02
Publication Date
2026-02-24

AI Technical Summary

Technical Problem

Existing technologies cannot effectively utilize the wettability information obtained from CT scans to generate atomic-level porous models with spatially variable wettability, resulting in insufficient ability of molecular simulations to reproduce the actual wetting behavior of rock cores.

Method used

By combining efficient data processing algorithms, pore centroid positioning technology, surface atomic cleaning and hydroxylation treatment, a porous quartz atomic-level model is constructed using CT scan data, and the spatial distribution of hydroxyl and methyl groups is automatically adjusted to achieve wettability regulation.

Benefits of technology

The generated model can accurately reflect the hydrophilic or oleophilic characteristics of different regions, improve the physical consistency and prediction accuracy of molecular simulation, and significantly enhance modeling efficiency and automation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121558786A_ABST
    Figure CN121558786A_ABST
Patent Text Reader

Abstract

The invention discloses a wettability-adjustable porous quartz atomic-scale model generation method based on CT scanning data, and relates to the technical field of petroleum engineering and molecular simulation, and the method comprises the following steps: obtaining template coordinates; generating a quartz substrate; carrying out atom screening and hollowing; performing surface atom cleaning and surface hydroxylation treatment on the initial atomic model; on the basis of a wettability field obtained through CT scanning, the functional group type of a hydroxylation area on the pore surface is automatically adjusted, and a target atom model is obtained; and exporting the atomic coordinates of the target atomic model as a standard atomic structure file. According to the method, an atomic-scale model with geometric fidelity, chemical stability and adjustable wettability can be automatically constructed from CT scanning data, so that the physical consistency and prediction precision of molecular simulation on real rock core wetting behaviors are improved, and a high-quality initial structure is provided for molecular dynamics simulation and oil and gas flow research.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of petroleum engineering and molecular simulation technology, and in particular to a method for generating atomic-level models of porous quartz with adjustable wettability based on CT scan data. Background Technology

[0002] In fields such as petroleum engineering, materials science, and catalytic chemistry, the microstructure and fluid transport properties of porous media (such as rock cores, zeolites, and metal-organic frameworks) are central to research. Molecular dynamics (MD) simulations are powerful tools for exploring these microscopic mechanisms, but their effectiveness highly depends on an atomic-level model that accurately reflects the material's geometry, physical connectivity, and surface chemical properties. An ideal atomic-level model must not only accurately reproduce the complex three-dimensional topology of pores but also demonstrate chemically stable surfaces and characterize their wettability. These characteristics directly determine the accuracy and reliability of subsequent simulations.

[0003] Existing methods for constructing such models have significant limitations, resulting in two relatively independent technical fields. On the one hand, in the field of Digital Rock Physics (DRP), the technical process typically begins with 3D imaging data such as CT scans, and ultimately reconstructs a 3D geometric model or pore network model (PNM) for mesoscale fluid flow simulation through image segmentation. However, this approach stops there and does not extend to the construction of fully atomic-level models. On the other hand, in the field of computational materials science, there are methods for removing atoms from intact bulk crystals (such as silica) to "sculpt" nanoporous models, and chemical passivation (such as hydroxylation) of the newly formed surfaces is also standard practice. However, such "top-down" sculpting methods often use ideal geometries (such as cylindrical holes or flat plate holes), lacking a mapping relationship with the actual core structure and failing to reflect the variation characteristics of wettability in different regions.

[0004] In actual rock cores and porous materials, the pore wall surfaces typically exhibit significant differences in wettability, meaning different regions may display hydrophilic or oleophilic characteristics. This wettability distribution information can be directly obtained through high-resolution CT scans or other experimental measurements to characterize the physical surface properties of local pores. However, current modeling workflows cannot effectively utilize this known wettability information to guide the automatic distribution and regulation of surface functional groups in atomic-level models. Traditional methods, after generating hydroxylated surfaces, usually assume uniform overall wettability, failing to express spatially variable surface chemical properties, thus limiting the simulation's ability to reproduce actual wetting behavior.

[0005] Therefore, there is an urgent need for a method that can directly utilize wettability information obtained through methods such as CT scans to achieve automated regulation of functional groups (such as hydroxyl and methyl groups) on the pore surface while maintaining the true geometric structure. This method should be able to introduce a wettability-guided surface modification mechanism based on geometric modeling, generating an atomic-level porous model with spatially variable wettability, thereby improving the physical consistency and prediction accuracy of molecular simulations of the actual core wetting behavior. Summary of the Invention

[0006] To address the aforementioned technical problems of low automation, poor geometric fidelity, and unrealistic surface chemical properties in cross-scale model construction, this invention discloses a method for generating atomic-level porous silica models with adjustable wettability based on CT scan data. This method employs a programmed, interconnected sequence of techniques, combining efficient data processing algorithms, pore centroid localization technology, and surface atomic cleaning and hydroxylation treatment. It aims to bridge the gap between macroscopic 3D imaging data and microscopic atomic models, enabling the efficient and automated construction of porous silica (quartz) atomic-level models with complex pore topologies, stable structures, and realistic surface chemical properties, starting from large-scale CT scan raw data or user-defined templates. This provides high-quality initial structures for molecular dynamics simulations, fluid permeation calculations, and other research, significantly improving the automation and computational efficiency of model construction. Furthermore, this invention introduces wettability information obtained from CT scans into the above modeling process, automating the control of functional groups on the pore surface, thereby achieving the construction of atomic-level models with spatially variable wettability. By utilizing the obtained wettability field, while maintaining the accurate reproduction of the geometric structure, the spatial distribution of hydroxyl and methyl groups is automatically adjusted, enabling the model to accurately reflect the hydrophilic or lipophilic characteristics of different regions, and providing chemical boundary conditions that are more in line with physical reality for molecular simulation.

[0007] To achieve the above objectives, the present invention adopts the following technical solution:

[0008] A method for generating an atomic-level model of porous quartz with tunable wettability based on CT scan data includes the following steps:

[0009] S1. Obtain template coordinates describing the target geometry: When the input is CT scan data (3D volume data), the data is thresholded to distinguish between the skeleton and pores, the geometric features of the skeleton are extracted, and geometric template coordinates are generated based on these features; when the input is a geometric template file, the file is loaded directly to obtain the geometric template coordinates.

[0010] S2. Generate quartz substrate: Based on the size range of the geometric template coordinates, automatically generate a blocky quartz substrate containing silicon and oxygen atoms;

[0011] S3. Atom Sorting and Hollowing: Based on the geometric template coordinates and preset radius, by calculating the nearest distance between each atom in the quartz substrate and the template coordinates, atoms are selectively retained or removed to form an initial atomic model with a porous structure;

[0012] S4. Surface chemical property stabilization treatment: Perform surface atom cleaning and surface hydroxylation treatment on the initial atomic model;

[0013] S5. Surface wettability control: Based on the wettability field obtained by CT scanning, the functional group type of the hydroxylated region on the pore surface is automatically adjusted to obtain the target atomic model;

[0014] S6. Export Model: Export the atomic coordinates of the target atomic model as a standard atomic structure file, such as xyz format, for use in subsequent molecular dynamics simulations and other applications.

[0015] Optionally, in step S1, when the input is CT scan data, the geometric features of the skeleton are extracted, specifically including:

[0016] (1) CT scan data is loaded in read-only mode using memory mapping technology, and scanned slice by slice along the Z-axis. Threshold segmentation is performed on each slice to identify porosity voxels.

[0017] (2) Accumulate and calculate the total coordinates and number of all pore voxels to obtain the geometric centroid of the pore network;

[0018] (3) Select the location and size of the target area according to actual needs, and cut out a representative sub-region of the cube from the original data based on the area;

[0019] (4) Image cleaning and enhancement processing is performed on the cut sub-regions, including: removing skeleton fragments smaller than the preset volume threshold by using connected component analysis, and image sharpening processing based on the Laplacian operator to enhance the clarity of the skeleton boundaries.

[0020] (5) Export the processed pore voxel coordinates as an xyz format file. The pore center coordinates are represented by placeholder atoms in the file. This file is used as a template input for the subsequent atomic-level model generation step. The xyz file can be directly called by the subsequent quartz substrate engraving and atomic screening algorithm to realize automated pore structure template transfer and utilization.

[0021] Optionally, in step (1), the threshold segmentation uses the gray-level histogram bimodal analysis method to determine the optimal segmentation threshold.

[0022] Optionally, in step (3), the selection method of the target area includes: automatic cutting based on the geometric centroid of the pore network, directional cutting based on user-specified coordinates, or intelligent cutting based on specific geometric features.

[0023] Optionally, in step (4), in the connected component analysis, a minimum skeleton volume threshold is set, and skeleton fragments smaller than the threshold are removed. The threshold can be adjusted according to data characteristics and modeling requirements.

[0024] Optionally, in step S2, an initial quartz unit cell is generated using a crystallographic modeling tool based on a standard quartz CIF crystal structure file; the required number of unit cell repetitions is calculated according to the bounding box size of the template coordinates, and the unit cell is expanded in the X, Y, and Z directions to form a blocky substrate matching the template size; the generated substrate is geometrically calibrated to ensure that the substrate and the template are correctly aligned in space.

[0025] Optionally, in step S2, the size of the quartz substrate is 5-10 angstroms larger than the size of the template boundary frame in all directions to ensure complete coverage of the template area.

[0026] Optionally, in step S3, the quartz substrate is hollowed out based on the template coordinates to form an initial atomic model with a porous structure. Specifically, this includes: constructing a k-dimensional tree data structure to spatially index the template coordinates; calculating the Euclidean distance of each atom in the quartz substrate to the nearest template coordinate point; selectively retaining or removing atoms according to the preset hollowing radius parameter, wherein in the "gap mode", atoms with a distance less than the template coordinates and a hollowing radius are removed to form pores, and in the "skeleton mode", atoms with a distance less than the template coordinates and a hollowing radius are retained to form a skeleton structure; and a block processing strategy is adopted to reduce memory consumption and improve the processing efficiency of large-scale structures.

[0027] Optionally, in step S3, the hollow radius is set to 1.5-3.0 angstroms, which can be adjusted according to the required porosity.

[0028] Optionally, in step S3, during the block processing, the atomic coordinates are divided into multiple sub-blocks according to their spatial location, and each sub-block is independently calculated and filtered for distance.

[0029] Optionally, in step S4, surface atom cleaning and surface hydroxylation treatment are performed on the initial atomic model to obtain a chemically stable final model, specifically including:

[0030] S4.1 Surface Atom Cleaning: Set the boundary region thickness to 3.0 Å and identify atoms within the periodic boundary region; for silicon atoms in non-boundary regions, count the number of their oxygen atom neighbors within a 1.7 Å cutoff distance and remove silicon atoms with fewer than 4 oxygen neighbors; iteratively remove isolated oxygen atoms that are no longer bonded to any effective silicon atoms until no new isolated oxygen atoms exist.

[0031] S4.2 Surface hydroxylation treatment: Identify surface-suspended oxygen atoms that are bonded to only one silicon atom; add hydrogen atoms along the silicon-oxygen bond direction at the oxygen atom position by extending the oxygen-hydrogen bond length by 0.96 Å; perform collision detection on the newly added hydrogen atoms to ensure that the minimum distance between the hydrogen atoms and existing atoms is greater than 0.8 Å; exclude the hydroxylation treatment of boundary region atoms to maintain the periodicity of the structure.

[0032] Optionally, in step S4, the surface atom cleaning and surface hydroxylation process adopts an iterative algorithm, and the atomic coordination state is re-evaluated after each iteration until the structure is stable.

[0033] Optionally, in step S5, the wettability field is derived from the mapping relationship between the voxel gray values ​​of CT scans and wettability parameters, which is obtained through experimental contact angle calibration.

[0034] Optionally, in step S5, the surface wettability control step includes: mapping the wettability field to the atomic coordinates of the model surface, calculating the local wettability index, and allocating hydroxyl or methyl functional groups according to the threshold: when the local region has lipophilic characteristics, the hydroxyl group is replaced with a methyl group; when the region has hydrophilic characteristics, the hydroxyl group distribution is retained or the density is increased. The structure after replacement is processed by geometric optimization and energy minimization to ensure the chemical stability and spatial rationality of the model.

[0035] A second aspect of this invention provides a system for generating atomic-level models of porous materials based on geometric templates, used to perform the above-described method, comprising:

[0036] The template coordinate acquisition module is used to generate geometric template coordinates based on the input CT scan data, or to directly load external geometric template files to generate geometric template coordinates.

[0037] The substrate generation module is used to automatically generate a blocky quartz substrate based on the size range of the template coordinates;

[0038] The atomic screening module is used to hollow out the substrate based on template coordinates to generate an initial atomic model.

[0039] The surface stabilization module is used to perform surface atom cleaning and surface hydroxylation on the initial atomic model;

[0040] The surface wettability control module is used to impart different wettability characteristics to different positions of the molecular model based on the wetting field.

[0041] The model export module is used to export the coordinate data of the final atomic model as a file.

[0042] Optionally, the system also includes a visualization module for three-dimensional visualization and quality assessment of the generated porous structure.

[0043] A third aspect of this invention proposes an atomic-level porous quartz structure model generated using the above method, wherein the model has a geometry consistent with the input template, a controllable surface wettability distribution, and an atomic coordination structure suitable for molecular dynamics simulations.

[0044] A fourth aspect of the present invention provides a terminal configured with a processor and a memory, wherein the memory stores a computer program capable of running on the processor, and the processor executes the steps of the method proposed in the first aspect of the present invention when running the computer program.

[0045] The beneficial effects of this invention are:

[0046] (1) Achieve efficient automated cross-scale modeling: This invention combines macroscopic three-dimensional imaging data with microscopic atomic-level modeling through a complete technical process of skeleton extraction, template generation, atomic screening and surface stabilization. It solves the technical problem of low automation in cross-scale modeling in the prior art, realizes the automated conversion from macroscopic geometric data to microscopic atomic models, and significantly improves modeling efficiency.

[0047] (2) Improve the fidelity of geometric structure: This invention adopts a direct translation method based on physical geometry, which can accurately maintain the geometric features of the original three-dimensional data and avoid the geometric distortion problem in traditional methods. Through multiple region selection strategies, representative target regions can be extracted according to different needs, ensuring that the generated atomic model has good geometric consistency with the original structure.

[0048] (3) Ensure the chemical stability of the model: This invention effectively solves the chemically unstable structure generated during the geometric cutting process by systematic surface stabilization treatment, including the removal of atoms with insufficient coordination number and surface hydroxylation treatment, so that the generated atomic model has a reasonable atomic coordination environment and stable surface chemical properties, which meets the requirements of molecular dynamics simulation for the initial structure.

[0049] (4) Controllable expression of pore surface wettability: This invention further introduces a wettability regulation mechanism based on traditional hydroxylation treatment. It can directly utilize existing wettability information from CT scans or experimental data to adjust the spatial distribution of hydrophilic and oleophilic regions by automatically replacing the functional group types (such as hydroxyl and methyl groups) on the pore surface. This method enables the model to not only realistically reflect the pore morphology at the geometric level, but also accurately express the local wetting characteristics of the material at the chemical level, providing a higher-fidelity atomic-level structural basis for subsequent fluid permeation, interfacial adsorption, and wettability studies.

[0050] (5) Good applicability and scalability: This invention supports multiple input data formats, including CT scan data and user-defined geometric templates, which are suitable for the automated modeling needs of different types of porous materials. It also supports two generation methods, pore mode and skeleton mode, and can be extended to modeling and simulation scenarios of porous cores, catalytic materials, adsorbent materials and functional materials whose performance is sensitive to surface wettability. Attached Figure Description

[0051] Figure 1 This is a schematic diagram of the process for generating an atomic-level model of porous quartz with adjustable wettability based on CT scan data according to the present invention.

[0052] Figure 2 This is a partially enlarged schematic diagram of a cleaned but unpassivated pore surface according to an embodiment of the present invention;

[0053] Figure 3 This is a partially enlarged schematic diagram of the final porous surface after surface chemical hydroxylation treatment, in which hydrogen atoms are added to the corresponding oxygen atoms (forming hydroxyl groups), as shown in an embodiment of the present invention.

[0054] Figure 4 This is a schematic diagram of an external pore geometry file derived from core CT scan data, as shown in an embodiment of the present invention.

[0055] Figure 5 This is a schematic diagram of an intermediate atomic model generated after the hollowing and surface cleaning steps, as shown in an embodiment of the present invention.

[0056] Figure 6 This is a three-dimensional schematic diagram of a wetting field according to an embodiment of the present invention. Red represents oleophilic properties and blue represents hydrophilic properties.

[0057] Figure 7 The image shows a porous molecular model after being treated with a wetting field, as illustrated in an embodiment of the present invention. The green part on the surface of the model is a methyl group, corresponding to the lipophilic part. Detailed Implementation

[0058] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, not all of them. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention. Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the claimed invention, but merely to represent selected embodiments of the invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0059] A method for generating atomic-level models of porous quartz with tunable wettability based on CT scan data, such as Figure 1 As shown, it includes the following steps:

[0060] S1. Obtain template coordinates

[0061] In a computer system, the system first receives CT scan data or geometric template files input by the user. For example, in a porous core modeling application scenario, it can receive CT scan data files (such as raw format files with dimensions of 2880×2880×2100), threshold segmentation parameters (such as grayscale values ​​of 30000), and target area selection strategies.

[0062] Simultaneously, an initial geometric template acquisition process is prepared, for example, by reading a pre-prepared CT scan data file or directly loading a geometric template file in xyz format. The system will acquire the three-dimensional coordinate information describing the target geometry and perform format standardization processing to provide a unified template data interface for subsequent steps.

[0063] When the input is CT scan data, the system uses memory mapping technology to load the data in read-only mode to avoid memory overflow issues; it determines the optimal threshold through grayscale histogram analysis and performs binary segmentation to distinguish pores from skeleton; depending on the actual modeling requirements, it can choose automatic cutting based on geometric centroid, directional cutting based on user-specified coordinates, or intelligent cutting based on geometric features to extract representative sub-regions from the original data.

[0064] S2, Formation of quartz substrate

[0065] Based on the template coordinates obtained in step S1, a substrate structure of matching size is generated on the basis of the quartz crystal structure, specifically including:

[0066] (1) CIF file reading and unit cell generation: The system reads the standard quartz crystal structure file (CIF format), obtains the unit cell parameters and atomic coordinate information, and generates a basic unit cell structure containing silicon atoms and oxygen atoms;

[0067] (2) Size matching and cell expansion: Based on the bounding box size of the template coordinates, calculate the number of cell repetitions required in the X, Y, and Z directions. Through cell translation and replication operations, generate a sufficiently large block quartz substrate to ensure complete coverage of the template area.

[0068] (3) Geometric alignment and coordinate calibration: Calculate the geometric center of the quartz substrate and template coordinates, and achieve spatial alignment through coordinate translation operation to provide an accurate spatial reference for the subsequent atom screening process.

[0069] S3, Atomic Sieving and Hollowing Process

[0070] This step aims to precisely hollow out the quartz substrate according to the template geometry, and to perform distance calculation and screening judgment for each atom in the quartz substrate. Specifically, it includes:

[0071] A k-dimensional tree data structure is constructed to spatially index the template coordinates, significantly improving distance query efficiency. For each atom in the substrate, its Euclidean distance to the nearest template coordinate point is calculated. Based on a preset hollow radius parameter (typically 1.5-3.0 Å), atoms with distances smaller than the hollow radius are removed in the void mode to form a porous structure, while atoms with distances smaller than the hollow radius are retained in the skeleton mode to form a skeleton structure. After traversing all atoms, atomic coordinate updates and index reconstruction are performed to form an initial atomic model with the target porous shape, such as... Figure 2 As shown. To improve the efficiency of processing large-scale models, the entire screening process is preferably completed using block-based parallel computing.

[0072] S4, Surface chemical property stabilization treatment

[0073] The initial atomic model formed in step S3 typically has a large number of chemically unstable dangling bonds on its surface, making it structurally unstable. Therefore, surface stabilization treatment is required. This step utilizes coordination number analysis and hydroxylation algorithms to repair structural defects, specifically including:

[0074] (1) Boundary region identification and protection: The boundary thickness is set to 3.0 angstroms. Atoms in the periodic boundary region are identified. These atoms will be protected in the subsequent cleaning process to maintain the periodicity of the structure.

[0075] (2) Cleaning of atoms with insufficient coordination number: For silicon atoms in non-boundary regions, count the number of their oxygen atom neighbors within a 1.7 Å cutoff distance, and remove silicon atoms with fewer than 4 oxygen atom neighbors. An iterative algorithm is used to remove isolated oxygen atoms that no longer bond with any effective silicon atoms until the structure converges;

[0076] (3) Surface hydroxylation treatment: Identify surface-suspended oxygen atoms that are bonded to only one silicon atom, and add hydrogen atoms to form hydroxyl groups by extending 0.96 Å along the silicon-oxygen bond direction; perform collision detection on the newly added hydrogen atoms to ensure that the minimum distance from the existing atoms is greater than 0.8 Å.

[0077] After optimization, a chemically stable hydroxylated porous quartz structure was obtained, such as... Figure 3 As shown.

[0078] S5, Surface wettability control treatment

[0079] After obtaining the hydroxylation model, the wettability information obtained from CT scans or experiments is further used to automatically adjust the functional group types on the pore surface, thereby achieving an atomic-level model with spatially variable wettability. This step includes:

[0080] (1) Wettability field mapping: The wettability field (R value) obtained from the outside is mapped to the atomic coordinates of the model surface, and the local wettability index R of each surface region is calculated to characterize the local hydrophilic or oleophilic characteristics.

[0081] (2) The relative density distribution of hydroxyl and methyl groups is determined according to the numerical range of R value. The system calculates the proportion of target functional groups on each surface grid unit and generates the corresponding number of hydroxyl and methyl substitution sites in the local area according to the proportion, so as to realize the continuous adjustment of functional group density.

[0082] (3) Geometric and chemical optimization: During the local replacement process, a geometric optimization algorithm is used to adjust the methyl orientation and anchoring point to ensure that the newly added atoms do not overlap with the existing structure; then, an energy minimization step is performed to ensure the rationality of bonding and overall chemical stability.

[0083] (4) Results characteristics: After wettability regulation, the model maintains the same geometric structure as the pore topology of the CT scan, and at the same time forms a continuously variable surface wettability distribution at the chemical level, realizing a gradual transition from completely hydrophilic to completely oleophilic. This model can truly reflect the differences in wettability of actual core surfaces, providing a more accurate atomic-level basic structure for the study of interfacial behavior, fluid adsorption and seepage in molecular dynamics simulations.

[0084] S6, Model Export

[0085] The final atomic model optimized in step S5 is exported as a standard atomic structure file format. The system first counts the types and quantities of atoms in the model, and then writes the atomic symbols and three-dimensional coordinate information into the output file according to the xyz file format specification.

[0086] The generated file contains complete atom type identifiers (Si, O, H, C) and their spatial coordinates, and records the wettability parameters (R values) or functional group type labels for each atom or surface unit. This allows for potential energy setting and molecular interaction control based on wettability distribution in molecular simulations. The file header contains structural description information such as the total number of atoms, model size, pore volume ratio, and average surface functional group density. For models containing a mixed distribution of hydroxyl and methyl groups, the system will output statistical data on the proportion of functional groups in local regions, allowing for direct definition of surface chemical properties in subsequent simulations.

[0087] After completing all the above steps, a porous quartz structure model is obtained, which is generated from macroscopic three-dimensional data or geometric templates through an automated processing flow. This model has both geometric fidelity and surface wettability expression capabilities. The model meets the requirements of molecular simulation research in terms of geometric fidelity, surface chemical properties, and computational applicability.

[0088] A system for performing the above method includes:

[0089] The template coordinate acquisition module is used to generate geometric template coordinates based on the input CT scan data, or to directly load external geometric template files to generate geometric template coordinates.

[0090] The substrate generation module is used to automatically generate a blocky quartz substrate based on the size range of the template coordinates;

[0091] The atomic screening module is used to hollow out the substrate based on template coordinates to generate an initial atomic model.

[0092] The surface stabilization module is used to perform surface atom cleaning and surface hydroxylation on the initial atomic model;

[0093] The surface wettability control module is used to impart different wettability characteristics to different positions of the molecular model based on the wetting field.

[0094] The model export module is used to export the coordinate data of the final atomic model as a file.

[0095] Optionally, the system also includes a visualization module for three-dimensional visualization and quality assessment of the generated porous structure.

[0096] This invention also provides a terminal equipped with a memory and a processor. The memory stores a computer program that can run on the processor. When the processor runs the computer program, it executes the steps of the methods described in the above embodiments. The terminal includes, but is not limited to, terminal devices such as servers, mobile phones, computers, and tablet computers.

[0097] Specifically, in this embodiment of the invention, the processor can be a central processing unit (CPU), or it can be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or any conventional processor.

[0098] It should also be understood that the memory in the embodiments of this application can be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. The non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. The volatile memory can be random access memory (RAM), which is used as an external cache. By way of example, but not limitation, many forms of random access memory (RAM) are available, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate synchronous DRAM (DDRSDRAM), enhanced synchronous DRAM (ESDRAM), synchronous link DRAM (SLDRAM), and direct rambus RAM (DRRAM).

[0099] Application examples

[0100] This application example aims to illustrate in detail how to automatically generate an atomic-level porous quartz model with realistic geometric and chemical characteristics from a large core CT scan raw data using the method of this invention.

[0101] (1) Data acquisition and segmentation

[0102] In this embodiment, the received input file is a large CT scan data file named FdkRecon-ushort-2880×2880×2100.raw. This file has dimensions of 2880 voxels in width (X-axis), 2880 voxels in height (Y-axis), and 2100 voxels in depth (Z-axis), and the data type is 16-bit unsigned integer. The system first downsamples the data, using an equal-interval sampling method with a step size of 2 to improve subsequent processing efficiency. Then, a grayscale histogram is generated for threshold analysis. Through histogram analysis and empirical analysis, the system determines the segmentation threshold to be 30000, identifying all voxels with grayscale values ​​less than 30000 as pores, and the remaining voxels as skeletons. Volume rendering is then performed on the downsampled complete data, allowing for a preliminary observation of the three-dimensional pore network structure, such as... Figure 4 As shown.

[0103] (2) Target region extraction and modeling

[0104] To avoid the enormous computational burden of directly processing the complete dataset of over 17 billion voxels, this step employs centroid segmentation to extract the core region. The system utilizes memory mapping technology to scan data from 2100 slices one by one without fully loading the file. Specifically, the system uses numpy.memmap to open the 17GB raw file in read-only mode, processes each slice along the Z-axis, performs threshold segmentation on each slice, and displays the processing progress in real time. During the centroid accumulation calculation, the system initializes accumulation variables, accumulates the coordinate information of each pore voxel, and calculates the geometric centroid of the entire pore network at the three-dimensional array index (Z, Y, X) = (1049, 1440, 1438) using the formula total_pore_count += num_pores_in_slice and coordinate accumulation.

[0105] Subsequently, the system implements an intelligent sub-region extraction strategy, calculating the cube's side length as min(depth, height, width) / 50 to obtain a side length of 42 voxels. During the boundary safety check phase, the system calculates the cutting range start_z = max(0, cz - 21) and end_z = min(2100, cz + 21), performing the same boundary checks in the Y and X directions to determine the actual cutting dimension as 42×42×42 voxels. By reusing memory mapping to avoid full loading, the system directly extracts the target region using NumPy slicing operations, saving the extracted data as a new file. The data file size for this sub-region is reduced from approximately 17GB to approximately 0.3MB, significantly reducing the computational burden. The extracted sub-region data undergoes structural optimization. The system sets a minimum reasonable skeleton cluster volume of 30 voxels, uses scipy.ndimage.label for 3D connected component analysis, calculates the volume of each connected component, identifies and removes 675 physically disconnected tiny skeleton fragments smaller than this volume, and retains the main skeleton connectivity structure after cleanup.

[0106] Based on the optimized 3D structural data, the system generates a geometric template file for subsequent atomic-level modeling. To ensure accurate mapping of the microstructure, the system optimizes the number of atoms accommodated in each voxel based on the bond length distance between target atoms. Specifically, the system analyzes the spatial distribution of the framework voxels, determines an appropriate atomic density based on the typical bond length of C / C bonds (approximately 1.54 Å), and places carbon atoms as placeholders at each framework voxel position. The generated carbon atom coordinates are smoothed, and a Gaussian filtering algorithm is used to fine-tune the atomic positions, eliminating geometric discontinuities caused by voxel discretization and ensuring that the generated atomic distribution more closely matches the microstructural characteristics of real materials. After optimization and smoothing, the system exports the carbon atom coordinates as a standard xyz format file, such as... Figure 5 As shown, the file contains approximately 1,162,770 carbon atom placeholders, which serve as the input template for subsequent quartz substrate cutout processing.

[0107] (3) Formation and surface stabilization treatment of porous quartz structure

[0108] Based on the carbon atom placeholder template file generated in step (2), the system first generates a quartz substrate structure with matching dimensions. The system analyzes the geometric template containing 1,162,770 template points and determines the template space size to be 481.92 × 458.93 × 481.92 Å, with template coordinate ranges of X = [0.4, 482.3], Y = [23.4, 482.3], and Z = [0.4, 482.3] Å. According to the unit cell parameters (a = 4.915 Å, b = 8.513 Å, c = 5.4313 Å) of the standard quartz CIF crystal structure file, the system calculates the required number of unit cell repetitions to be 99 times in the X direction, 54 times in the Y direction, and 89 times in the Z direction. Using the atomsk tool, a blocky quartz substrate containing 8,564,292 atoms is generated, with an actual box size of 486.12 × 459.09 × 482.74 Å.

[0109] Subsequently, a hollowing process is performed, precisely carving the quartz substrate according to the geometric features of the carbon atom template. In void mode, the system removes silicon and oxygen atoms that are less than the set hollowing radius from the carbon atom coordinates, forming an initial atomic-level porous structure containing 605,940 atoms.

[0110] Because the hollowing process generates a large number of chemically unstable dangling bond structures, the system needs to perform surface stabilization. Considering the requirement of periodic boundary conditions, the system sets the thickness of the boundary region to 0.5 Å and does not perform coordination number cleaning on the atoms in the boundary region to maintain the periodicity of the structure. During the cleaning of atoms with insufficient coordination number, the system counts the number of O atom neighbors within a 1.7 Å cutoff distance for each Si atom, identifying 38,264 Si atoms with insufficient coordination number (number of O neighbors less than 4), and marking these Si atoms as to be removed. Through an iterative isolated atom cleaning algorithm, 27,979 O atoms that are no longer connected to any valid Si are iteratively removed, for a total of 66,243 atoms removed. After cleaning, the number of atoms is reduced from 605,940 to 539,697.

[0111] In the precise surface hydroxylation stage, the system performed surface hydroxylation on the cleaned 539,697 atoms. Due to the use of periodic boundary condition optimization, the system skipped 0 O atoms in the XY boundary region to maintain periodicity and 0 O atoms in the Z boundary region. The system identified surface-suspended oxygen atoms bonded to only one silicon atom and added hydrogen atoms extending 0.96 Å along the silicon-oxygen bond direction to form hydroxyl groups. In the collision detection and quality control stage, the system ensured that the hydrogen atoms did not overlap with existing atoms, successfully adding 100,164 H atoms to form stable surface hydroxyl groups, ultimately increasing the number of atoms from 539,697 to 639,861. The hydroxylation process ensured that all surface-suspended oxygen atoms formed chemically stable hydroxyl structures.

[0112] (4) Establishment of surface wetting mapping field

[0113] Based on the wettability information file wet_field.npy corresponding to the core sample, its three-dimensional display is as follows: Figure 6 As shown. This file records the local wettability parameters (R value) of the CT intensity values ​​after experimental calibration. The R value ranges from 0.0 to 1.0, corresponding to completely oleophilic to completely hydrophilic. The system interpolates this wettability field to the pore surface coordinate grid, establishing a "surface coordinate-R value" mapping table for subsequent functional group density calculations.

[0114] (5) Surface wettability regulation and functional group density distribution

[0115] Based on the wettability mapping results obtained in step (4), the system continuously adjusts the density of hydroxyl and methyl groups on the pore surface. The system first calculates the average wettability parameter R value for each surface grid cell and determines the local functional group distribution ratio based on this value. A higher R value indicates a more hydrophilic region, corresponding to a higher hydroxyl density, while a lower R value indicates a more lipophilic region, corresponding to a higher methyl group density. Subsequently, the system sets the local functional group ratio relationship f(OH)=R, f(CH3)=1–R according to the linear density model, and automatically replaces the functional group type within the surface region according to this ratio. Specifically, when the R value is low, the system selects some hydroxyl groups in the corresponding region and replaces them with methyl groups, adjusting the methyl orientation and anchor points through a geometric optimization algorithm to avoid spatial overlap and bond angle distortion. The entire replacement process is executed automatically across the entire surface, supplemented by local energy minimization operations to maintain the stability of the model in terms of chemical bond lengths, bond angles, and overall structure. Through the above steps, regions with continuously varying wettability characteristics are formed on the pore surface: regions with high R values ​​exhibit hydrophilic characteristics and dense hydroxyl groups; regions with low R values ​​exhibit lipophilic characteristics and higher methyl group density. After this modulation process, the model achieves a gradual transition from completely hydrophilic to completely lipophilic at the nanoscale, resulting in a porous quartz atomic-level model that simultaneously possesses realistic geometry and spatially variable wettability distribution, such as... Figure 7 As shown.

[0116] (6) Model export

[0117] The final generated hydroxylated porous quartz model containing Si, O, and H atoms is exported as a hydroxylated_quartz.xyz file. The file contains four atom types (Si, O, H, and C) and their three-dimensional coordinates. Metadata such as the total number of atoms, pore volume ratio, and average functional group ratio are written to the file header. Each atom is accompanied by a wettability parameter R or a functional group label (OH / CH3) to support the definition of potential energy based on wettability distribution in subsequent molecular simulations.

[0118] Of course, the above description is not intended to limit the present invention, and the present invention is not limited to the examples given above. Any changes, modifications, additions or substitutions made by those skilled in the art within the scope of the present invention should also fall within the protection scope of the present invention.

Claims

1. A method for generating an atomic-level model of porous quartz with adjustable wettability based on CT scan data, characterized in that, Includes the following steps: S1. Obtain template coordinates: When the input is CT scan data, the data is thresholded to distinguish between skeleton and pores, the geometric features of the skeleton are extracted, and geometric template coordinates are generated based on these features; when the input is a geometric template file, the file is loaded directly to obtain the geometric template coordinates. S2. Generate quartz substrate: Based on the size range of the geometric template coordinates, automatically generate a blocky quartz substrate containing silicon and oxygen atoms; S3. Atom Sorting and Hollowing: Based on the geometric template coordinates and preset radius, by calculating the nearest distance between each atom in the quartz substrate and the template coordinates, atoms are selectively retained or removed to form an initial atomic model with a porous structure; S4. Surface chemical property stabilization treatment: Perform surface atom cleaning and surface hydroxylation treatment on the initial atomic model; S5. Surface wettability control: Based on the wettability field obtained by CT scanning, the functional group type of the hydroxylated region on the pore surface is automatically adjusted to obtain the target atomic model; S6. Export Model: Exports the atomic coordinates of the target atomic model as a standard atomic structure file.

2. The method for generating an atomic-level model of porous quartz with adjustable wettability based on CT scan data as described in claim 1, characterized in that, In step S1, when the input is CT scan data, the geometric features of the skeleton are extracted, specifically including: (1) CT scan data is loaded in read-only mode using memory mapping technology, and scanned slice by slice along the Z-axis. Threshold segmentation is performed on each slice to identify porosity voxels. (2) Accumulate and calculate the total coordinates and number of all pore voxels to obtain the geometric centroid of the pore network; (3) Select the location and size of the target area according to actual needs, and use this area as a basis to cut out representative sub-regions from the original data; (4) Image cleaning and enhancement processing is performed on the cut sub-regions, including: removing skeleton fragments smaller than the preset volume threshold by using connected component analysis, and image sharpening processing based on the Laplacian operator to enhance the clarity of the skeleton boundaries. (5) Export the processed pore voxel coordinates as an xyz format file.

3. The method for generating an atomic-level model of porous quartz with adjustable wettability based on CT scan data as described in claim 1, characterized in that, In step S5, the wettability field is derived from the mapping relationship between the voxel gray value of the CT scan and the wettability parameter, which is obtained through experimental contact angle calibration.

4. The method for generating an atomic-level model of porous quartz with adjustable wettability based on CT scan data as described in claim 1, characterized in that, In step S5, the wettability field is mapped to the atomic coordinates of the model surface, the local wettability index is calculated, and hydroxyl or methyl functional groups are assigned according to the threshold.

5. A system for generating atomic-level models of porous materials based on geometric templates, characterized in that, For performing the method as described in any one of claims 1 to 4, comprising: The template coordinate acquisition module is used to process CT scan data or directly load geometric template files to generate geometric template coordinates. The substrate generation module is used to automatically generate a blocky quartz substrate based on the size range of the template coordinates. The atomic screening module is used to hollow out the substrate based on template coordinates to generate an initial atomic model. The surface stabilization module is used to perform surface atom cleaning and surface hydroxylation on the initial atomic model; The surface wettability control module is used to impart different wettability characteristics to different positions of the molecular model based on the wetting field. The model export module is used to export the coordinate data of the final atomic model as a file.

6. A terminal, characterized in that, The system is equipped with a processor and a memory, the memory storing computer-executable instructions that, when executed by the processor, cause the computing system to perform the steps of the method as described in any one of claims 1 to 4.