This repository combines two established simulator into a single, streamlined workflow:
-
PMM (Pore Morphology Method)
-
Tavakkoli, O., Ebadi, M., Da Wang, Y., Mostaghimi, P., Armstrong, R.T., 2025. "Assessment of wetting conditions in quasistatic drainage modeling using a pore morphology method and j-function wettability estimator." International Journal of Multiphase Flow 183:105067. doi:10.1016/j.ijmultiphaseflow.2024.105067
-
Repository: https://github.com/Omid-Tavakkoli/PMM
-
-
PFVS (Pore-scale Finite Volume Solver)
-
Chung, T., Da Wang, Y., Mostaghimi, P., Armstrong, R.T., 2019. "Approximating Permeability of Microcomputed-Tomography Images Using Elliptic Flow Equations." SPE Journal 24:1154–1163. 10.2118/191379-pa
-
Repository: https://github.com/yingDaWang-UNSW/Laplace_Solver-master
-
The combined pipeline lets you compute:
- Capillary pressure vs saturation (simulation = 1)
- Absolute permeability (simulation = 2)
- Relative permeabilities across PMM-generated saturation states (simulation = 3)
- Relative permeabilities on segmented experimental multi-phase images (simulation = 4)
- Python 3.9+ recommended.
- Install dependencies:
- pip:
pip install -r requirements.txt- Conda
conda create -n pmm-pfvs python=3.11 numpy scipy scikit-image matplotlib seaborn pyamg tifffile imageio -c conda-forge
conda activate pmm-pfvsA simple key = value text file drives all runs. Important fields:
-
Core:
simulation: 1 (Pc vs S_w via PMM), 2 (absolute perm via PFVS), 3 (relative perm via PMM→PFVS), 4 (relative perm on experimental images via PFVS)filename: path to the segmented porous medium (pore = 0, solid = 1). Used by modes 1–3filesize_x,filesize_y,filesize_z: volume dimensions for.rawfilesresolution: microns per voxel
-
PMM:
sigma(mN/m),theta(deg, <= 60),num_threads,kernel_search(true/false),starting_kernel,starting_sat,visualization
-
PFVS:
pin,pout,solver_tol,solver_dtype(float64/float32),micropore,cond_flag(0: permeability/1: tortuosity)
-
Experimental multi-phase images (simulation = 4):
exp_filename: space- or comma-separated list of.rawfiles (labels: nwp = 0, wp = 1, solid = 2)
Run from the project directory:
python main.py- Mode 1: Pc vs S_w plot and numerical results.
- Mode 2:
result_absolute_permeability.txt. - Mode 3:
results_relative_permeability.txt,relative_permeability.pdf. - Mode 4:
results_relative_permeability.txt,relative_permeability.pdf.