Overview
This MATLAB program generates 3D fractured porous media with both matrix porosity and fracture networks. It extends the original pore network generation code to include realistic fracture systems.
Features
1. Pore Network Generation
- Spherical pore generation with controlled size distribution
- Target porosity control
- Average pore size control
2. Fracture Network Generation
- Multiple fracture planes with random orientations
- Controllable fracture parameters:
- Length and width
- Aperture (thickness)
- Dip angle (inclination)
- Strike angle (azimuth)
- Realistic 3D fracture geometry
3. Analysis Capabilities
- Topological analysis (vertices, edges, faces, cells)
- Connectivity analysis (connected components)
- Pore size distribution
- Surface area calculation
- Skeletonization
4. Visualization
- 5 comprehensive figures showing different aspects
- Isosurface rendering
- Skeleton visualization
- Pore size histogram
- Cylindrical sample extraction
5. Export Options
- STL files for 3D printing or CFD simulations
- MAT file workspace
- Fracture data text file
Key Parameters
Domain Size
matlab
nx = 100; % X dimension
ny = 100; % Y dimension
nz = 100; % Z dimension
Pore Network Parameters
matlab
targetPorosity = 0.35; % Matrix porosity (0-1)
targetPoreSize = 8; % Average pore radius (voxels)
Fracture Parameters
matlab
numFractures = 15; % Number of fractures
minFractureLength = 20; % Minimum fracture length (voxels)
maxFractureLength = 60; % Maximum fracture length (voxels)
fractureAperture = 2; % Fracture thickness (voxels)
Usage Instructions
Basic Usage
- Open MATLAB
- Navigate to the directory containing the script
- Run: fractured_porous_media_generation
- Wait for generation and analysis to complete
- Examine the 5 generated figures
- Check exported files in the working directory
Customization
Edit the parameters in Sections 1-3 of the script:
- Adjust domain size for larger/smaller samples
- Modify porosity for different rock types
- Change fracture parameters for different fracture densities
- Adjust random seed (rng) for different realizations
Output Files
- STL Files:
- fractured_porous_media_pores.stl - Pore space geometry
- fractured_porous_media_solid.stl - Solid matrix geometry
- fractured_porous_media_cylindrical.stl - Cylindrical sample
- Data Files:
- fractured_porous_media_workspace.mat - Complete workspace
- fracture_data.txt - Fracture properties
Visualization Guide
Figure 1: Pore Space and Solid Phase
- Cyan: Pore space (including fractures)
- Red: Solid matrix
- Shows the complete 3D structure
Figure 2: Pore Network Skeleton
- Blue transparent surface: Pore space
- Red dots: Skeleton points
- Useful for connectivity analysis
Figure 3: Pore Size Distribution
- Logarithmic x-axis
- Shows frequency distribution of pore diameters
- Helps characterize pore structure
Figure 4: Cylindrical Sample Extraction
- Green: Pore space in cylindrical sample
- Yellow: Solid phase in cylindrical sample
- Simulates core sample extraction
Figure 5: Fracture Network Centers
- Shows fracture center locations
- Red markers indicate fracture positions
Technical Details
Fracture Generation Algorithm
The program generates fractures using a planar approach:
- Define fracture center point
- Specify length, width, and aperture
- Apply dip angle (0-30°) and strike angle (0-360°)
- Create rotation matrices for 3D orientation
- Voxelize the fracture plane
Connectivity Analysis
- Uses MATLAB's bwconncomp function
- Identifies isolated pore clusters
- Reports size of largest connected component
Performance Considerations
- Typical runtime: 1-5 minutes for 100³ domain
- Memory usage: ~100 MB for 100³ domain
- Larger domains (200³) may require 10-30 minutes
Applications
- Geothermal Reservoir Modeling
- Simulate fractured reservoir rocks
- Analyze permeability pathways
- Oil & Gas Engineering
- Characterize fractured carbonate reservoirs
- Model enhanced oil recovery
- Groundwater Hydrology
- Study contaminant transport
- Analyze fracture-matrix interaction
- CO2 Sequestration
- Model storage in fractured formations
- Assess sealing capacity
- CFD Simulations
- Use exported STL files in flow simulators
- Study fluid dynamics in fractures
Troubleshooting
Issue: Out of Memory
Solution: Reduce domain size (nx, ny, nz) or increase MATLAB memory
Issue: Too Few Fractures Visible
Solution: Increase numFractures or fractureAperture
Issue: No Connected Pore Network
Solution: Increase targetPorosity or add more fractures
Issue: Generation Takes Too Long
Solution: Reduce domain size or target porosity
Extension Ideas
- Realistic Fracture Networks
- Implement fractal fracture patterns
- Add fracture clustering
- Anisotropic Pore Structure
- Preferred orientation for pores
- Layered heterogeneity
- Multi-scale Porosity
- Add micro-porosity within matrix
- Nested pore systems
- Flow Simulation Integration
- Export to OpenFOAM
- Permeability tensor calculation
References
Based on:
- Jimmy Li (2024). Pore Network Generation and Analysis
- MATLAB Central File Exchange
- https://au.mathworks.com/matlabcentral/fileexchange/170286
License
MIT License - See script header for full license text
인용 양식
Jimmy X. Li (2025). Fractured Porous Media Generation (https://kr.mathworks.com/matlabcentral/fileexchange/182366-fractured-porous-media-generation), MATLAB Central File Exchange. 검색 날짜: .
MATLAB 릴리스 호환 정보
개발 환경:
R2025b
모든 릴리스와 호환
플랫폼 호환성
Windows macOS Linux태그
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!