Pore Network Generation and Analysis

版本 1.0.4 (166.1 KB) 作者: Jimmy X. Li
This MATLAB script simulates the generation of a 3D porous medium using a random seeding and growth algorithm.
9.0 次下载
更新时间 2024/7/26

查看许可证

This MATLAB script simulates a 3D porous medium and performs various analyses on the generated pore structure. The script initializes a 3D domain, generates a pore network to achieve a target porosity, and analyzes the domain for various characteristics like the number of cells, faces, edges, and vertices. Additionally, it visualizes the pore structure, performs skeletonization, analyzes the pore size distribution, and exports the generated porous medium as an STL file.
How to Use the Code
Initialization:
  • The script starts by defining the size of the 3D grid (nx, ny, nz).
  • It initializes the 3D matrix domain to represent the porous medium.
Pore Network Generation:
  • The target porosity (targetPorosity) and average pore size (targetPoreSize) are defined.
  • A while loop iteratively generates the pore network until the target porosity is achieved.
Domain Analysis:
  • The analyzeDomain function extracts the isosurface from the binary domain and calculates the number of cells, faces, edges, and vertices.
Visualization:
  • The script visualizes the pore structure using isosurface and patch.
Skeletonization and Pore Size Distribution:
  • Skeletonization is performed using bwskel.
  • The pore size distribution is analyzed and visualized using a histogram.
Export to STL:
  • The stlwrite function exports the generated porous medium as an STL file for use in 3D modeling and printing.
Cylinder Representation:
  • The function takes the vertices of the pore network and visualizes them as cylinders.
  • Each segment between two consecutive vertices is represented as a cylinder.
  • The radius of the cylinders can be specified, allowing for flexibility in the visualization based on the scale and resolution of the pore network.
Interactive Visualization:
  • The generated cubes/cylinders are displayed in a 3D plot, providing an interactive way to explore the pore network structure.
  • The function utilizes MATLAB's surf function to plot the cubes/cylinders, enhancing the visual quality with lighting and camera adjustments.

引用格式

Jimmy X. Li (2024). Pore Network Generation and Analysis (https://www.mathworks.com/matlabcentral/fileexchange/170286-pore-network-generation-and-analysis), MATLAB Central File Exchange. 检索来源 .

MATLAB 版本兼容性
创建方式 R2024a
兼容任何版本
平台兼容性
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
版本 已发布 发行说明
1.0.4

update images

1.0.3

update the figs.

1.0.2

upload the image

1.0.1

update the citation information

1.0.0