Ahora está siguiendo esta publicación
- Verá actualizaciones en las notificaciones de contenido en seguimiento.
- Podrá recibir correos electrónicos, en función de las preferencias de comunicación que haya establecido.
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.
Citar como
Jimmy X. Li (2026). Pore Network Generation and Analysis (https://la.mathworks.com/matlabcentral/fileexchange/170286-pore-network-generation-and-analysis), MATLAB Central File Exchange. Recuperado .
Información general
- Versión 1.0.4 (166 KB)
Compatibilidad con la versión de MATLAB
- Compatible con cualquier versión
Compatibilidad con las plataformas
- Windows
- macOS
- Linux
| Versión | Publicado | Notas de la versión | Action |
|---|---|---|---|
| 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 |
|
