Skip to content

Quick start

After installing poromics, you can estimate transport properties in just a few lines. All solvers accept 2D or 3D binary images where True = pore and False = solid.

Note

The first time you call tortuosity_fd, Julia and its dependencies are installed automatically (one-time setup). The LBM solvers (tortuosity_lbm, permeability_lbm) use Taichi and work out of the box.

Generate a test image

# mkdocs: render
import porespy as ps
import matplotlib.pyplot as plt

im = ps.generators.blobs(shape=[100, 100, 1], porosity=0.6, blobiness=0.5, seed=42)

fig, ax = plt.subplots(figsize=(4, 4))
ax.imshow(im[:, :, 0], cmap="viridis", interpolation="nearest")
ax.set_title("Boolean Image")

Tortuosity (FD)

result = poromics.tortuosity_fd(im, axis=1, rtol=1e-5, gpu=False)
print(result)

TortuosityResult: axis = 1 porosity = 0.5119 tau = 4.3482 D_eff/D = 0.117726 F = 8.4943 converged = True

Tortuosity (LBM)

result = poromics.tortuosity_lbm(im, axis=1, D=1e-9, voxel_size=1e-6)
print(result)

TortuosityResult: axis = 1 porosity = 0.5119 tau = 4.4830 D_eff/D = 0.114186 F = 8.7576 converged = True (32001 iters)

Permeability

result = poromics.permeability_lbm(im, axis=1, nu=1e-6, voxel_size=1e-6)
print(result)

PermeabilityResult: axis = 1 porosity = 0.5119 k = 2.9281e-13 m² (296.69 mD) u_darcy = 3.5138e-04 m/s u_pore = 6.8642e-04 m/s converged = True (4501 iters)

What's next?

  • Learn about each solver's physics and options: Solvers
  • See worked examples with visualization: Examples
  • Use the lower-level simulation API for custom workflows: Simulation API