Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

16. Flow past obstacles and the permeability of porous media

School of Engineering, Nazarbayev University

In finite-volume or finite-element CFD, computing flow through a micro-CT X-ray scan of sandstone, a fibrous battery electrode, or a catalytic packed bed requires generating millions of body-fitted tetrahedral cells around tortuous pore throats. In Lattice Boltzmann CFD, turning any arbitrary pixel/voxel array into no-slip solid obstacles requires zero remeshing: you pass a 2-D boolean obstacle_mask directly to lattice_boltzmann.simulate_lbm_obstacle_flow_2d, and halfway bounce-back enforces u=0\mathbf{u} = \mathbf{0} across every fluid–solid link. At creeping pore Reynolds numbers (Rep≪1\mathrm{Re}_p \ll 1), microscopic viscous shear over thousands of pore walls homogenizes macroscopically into Darcy’s law usup=−kμdpdx=kνFxu_{\mathrm{sup}} = -\frac{k}{\mu}\frac{dp}{dx} = \frac{k}{\nu} F_x. In this lecture we verify exact slit-pore analytical permeability, compare bluff-body wakes and hydraulic tortuosity around circular vs. square obstacles, show Stokes-regime Darcy linearity (and audit Forchheimer inertial + lattice-Mach compressibility limits), and map porosity–permeability scaling against the Kozeny–Carman relation.

Learning objectives

  1. Verify voxel-masked lattice_boltzmann.simulate_lbm_obstacle_flow_2d against the exact planar slit permeability benchmark kslit=εH2/12k_{\mathrm{slit}} = \varepsilon H^2 / 12 [lu2\mathrm{lu}^2] where porosity ε=H/Ny\varepsilon = H / N_y.

  2. Compare velocity wakes, shear-layer vorticity ω\omega, and hydraulic tortuosity T=⟨∣u∣⟩/⟨ux⟩≥1T = \langle |\mathbf{u}| \rangle / \langle u_x \rangle \geq 1 past circular cylinders versus sharp-edged square obstacles.

  3. Confirm Stokes-regime Darcy linearity (k=νusup/Fxk = \nu u_{\mathrm{sup}} / F_x independent of FxF_x for Rep≪1\mathrm{Re}_p \ll 1) and diagnose high-driving-force Forchheimer inertia and lattice-Mach compressibility (Ma=umax⁡/cs≪1\mathrm{Ma} = u_{\max}/c_s \ll 1).

  4. Predict intrinsic permeability k(ε)k(\varepsilon) across obstacle packing fractions ε∈[0.57,0.94]\varepsilon \in [0.57, 0.94] and compare with the classical Kozeny–Carman scaling k∝ε3/(1−ε)2k \propto \varepsilon^3 / (1 - \varepsilon)^2.

Time: about 60 min

1. Physical Principles: Voxel Bounce-Back & Darcy’s Law from Pore-Scale Stokes Flow

Consider incompressible flow driven by a uniform body force Fx=−1ρdpdxF_x = -\frac{1}{\rho}\frac{dp}{dx} through a periodic Representative Elementary Volume (REV) Ω\Omega of total area ∣Ω∣=NxNy|\Omega| = N_x N_y containing solid phase Ωs\Omega_s (obstacle_mask == True) and pore space Ωf\Omega_f (~obstacle_mask) of porosity ε=∣Ωf∣/∣Ω∣∈(0,1]\varepsilon = |\Omega_f| / |\Omega| \in (0, 1]. Defining the volume-averaged superficial (Darcy) velocity usupu_{\mathrm{sup}} (averaged over total solid + fluid volume) vs. interstitial pore velocity uˉf=usup/ε\bar{u}_f = u_{\mathrm{sup}} / \varepsilon:

usup=1NxNy∑i,jux(i,j)=εuˉf,usup=−kμdpdx=kνFx⟹k=ν usupFx    [lu2](1.1)u_{\mathrm{sup}} = \frac{1}{N_x N_y}\sum_{i,j} u_x(i, j) = \varepsilon \bar{u}_f, \qquad u_{\mathrm{sup}} = -\frac{k}{\mu}\frac{dp}{dx} = \frac{k}{\nu} F_x \quad \Longrightarrow \quad k = \frac{\nu\,u_{\mathrm{sup}}}{F_x}\;\;[\mathrm{lu}^2] \tag{1.1}

The physical units of intrinsic permeability kk: [k]=m2[k] = \mathrm{m}^2 (1 Darcy≈9.869×10−13 m21\text{ Darcy} \approx 9.869 \times 10^{-13}\text{ m}^2, or lu2\mathrm{lu}^2 on the lattice, converting via kphys=kluΔx2k_{\mathrm{phys}} = k_{\mathrm{lu}} \Delta x^2).

1.1 Exact Analytical Benchmark: Parallel Slit-Pore Permeability

Before inserting curved obstacles, test Eq. (1.1) on a 2-D slit channel of fluid aperture H=Ny−2H = N_y - 2 inside NyN_y total rows (ε=H/Ny\varepsilon = H / N_y). From Poiseuille’s law, uˉf=FxH212ν\bar{u}_f = \frac{F_x H^2}{12\nu}, so usup=εuˉf=εH212νFxu_{\mathrm{sup}} = \varepsilon \bar{u}_f = \frac{\varepsilon H^2}{12\nu}F_x, yielding the exact analytical slit permeability:

kslit,exact=εH212=H312Ny    [lu2](1.2)k_{\mathrm{slit,exact}} = \frac{\varepsilon H^2}{12} = \frac{H^3}{12 N_y}\;\;[\mathrm{lu}^2] \tag{1.2}

Demonstration 1: Exact Slit Permeability Benchmark & Zero-Remeshing Cylinder Wake
=================================================================================
Slit channel (H=10, eps=0.8333): k_LBM = 6.968191 vs disc-exact = 6.979167 (cont = 6.944444) lu^2
Cylinder-in-channel: porosity = 0.8678, k = 5.978 lu^2, peak Re_D = 0.52
<Figure size 1232x418 with 4 Axes>

Figure 16.1. Flow past a cylinder in a channel, driven by a body force. (a) Speed; the solid nodes are white. (b) Vorticity.

What Demonstration 1 shows. In the slit benchmark (H = 10), simulate_lbm_obstacle_flow_2d reproduces the continuum permeability εH2/12=6.9444 lu2\varepsilon H^2 / 12 = 6.9444\text{ lu}^2 to 0.5%0.5\% and matches the exact discrete midpoint parabola quadrature ε(H2+12)/12=6.9792 lu2\varepsilon(H^2 + \frac{1}{2})/12 = 6.9792\text{ lu}^2 to 0.16%0.16\%. Dropping a circular obstacle into the channel (mask_cyl) requires zero mesh generation: fluid accelerates through the narrow upper/lower throats and sheds antisymmetric ±ω\pm\omega shear layers off the cylinder shoulders while maintaining u≡0\mathbf{u} \equiv \mathbf{0} on every solid node.


2. Bluff-Body Geometry Comparison & Hydraulic Tortuosity

In porous media transport, fluid streamlines cannot travel straight along +x+x; they detour around solid grains, lengthening the average path by the hydraulic tortuosity T≥1T \geq 1:

T=∑i,j∈Ωfux2+uy2∑i,j∈Ωfux≥1(2.1)T = \frac{\sum_{i,j \in \Omega_f} \sqrt{u_x^2 + u_y^2}}{\sum_{i,j \in \Omega_f} u_x} \geq 1 \tag{2.1}

We compare a smooth circular cylinder against a bluff square obstacle of matched frontal blockage height D=7 luD = 7\text{ lu} inside a periodic 32×2132 \times 21 channel.


Demonstration 2: Circular Cylinder vs Square Prism at Matched Frontal Blockage D = 7 lu
=======================================================================================
Circular obstacle (D=7 lu): eps = 0.8497, tortuosity T = 1.0293, k = 4.9857 lu^2
Square   obstacle (D=7 lu): eps = 0.8318, tortuosity T = 1.0337, k = 3.8971 lu^2

What Demonstration 2 shows. At identical frontal blockage height D=7 luD = 7\text{ lu}, the flat-faced 7×77 \times 7 square prism blocks corner streamlines that glide smoothly around the circular cylinder shoulders, lowering intrinsic permeability kk while maintaining T>1.02T > 1.02.


3. Stokes-Regime Darcy Linearity vs. Inertial & Lattice-Mach Limits

Darcy’s law claims k=νusup/Fxk = \nu u_{\mathrm{sup}} / F_x is a purely geometric material property of the pore space, independent of the applied pressure gradient FxF_x. That linearity holds only when two dimensionless numbers stay small:

  1. Pore Reynolds Number Rep=usupdgν≪1\mathrm{Re}_p = \frac{u_{\mathrm{sup}} d_g}{\nu} \ll 1: once Rep≳1\mathrm{Re}_p \gtrsim 1, quadratic convective wakes add Forchheimer inertial drag (−dpdx=μk0usup+βρusup2-\frac{dp}{dx} = \frac{\mu}{k_0}u_{\mathrm{sup}} + \beta \rho u_{\mathrm{sup}}^2), depressing apparent permeability kapp<k0k_{\mathrm{app}} < k_0.

  2. Lattice Mach Number Ma=umax⁡cs=3 umax⁡≪1\mathrm{Ma} = \frac{u_{\max}}{c_s} = \sqrt{3}\,u_{\max} \ll 1: in weakly compressible LBM (p=ρcs2p = \rho c_s^2), spatial density variations scale as Δρρ0∼O(Ma2)\frac{\Delta \rho}{\rho_0} \sim O(\mathrm{Ma}^2).


Demonstration 3: Darcy Linearity Plateau vs High-Forcing Forchheimer & Compressibility Regime
=============================================================================================
F_x [lu/ts^2] | u_sup [lu/ts] |     Re_p |   Ma_max | d_rho / rho0 | k_app [lu^2]
--------------------------------------------------------------------------------
      5.0e-06 |    2.0011e-04 |    0.014 |   0.0006 |    2.197e-04 |      4.00227
      5.0e-05 |    2.0010e-03 |    0.136 |   0.0065 |    2.197e-03 |      4.00204
      8.0e-04 |    3.1575e-02 |    2.147 |   0.1039 |    3.596e-02 |      3.94688
      4.0e-03 |    1.3263e-01 |    9.019 |   0.4917 |    2.674e-01 |      3.31575
<Figure size 1210x440 with 2 Axes>

Figure 16.2. (a) Apparent permeability, relative to its value at the smallest force, against the body force: it falls when inertia becomes important. (b) Density variation against the peak lattice Mach number, with a line of slope 2; the computed variation is proportional to the Mach number.

What Demonstration 3 shows. Across a 10×10\times span of creeping-flow driving force (Fx=5×10−6F_x = 5\times 10^{-6} to 5×10−55\times 10^{-5}), darcy_permeability_lu2 stays constant to within 0.1%0.1\% while Δρ/ρ0<3×10−3\Delta\rho/\rho_0 < 3\times 10^{-3}. At Fx=4×10−3F_x = 4\times 10^{-3}, Rep=9\mathrm{Re}_p = 9 and Ma=0.49\mathrm{Ma} = 0.49: the apparent permeability is 17%17\% lower because of inertia, and the density varies by 27%27\%. In this forced flow the density variation is proportional to the force, and so to the Mach number, as panel (b) shows; it does not follow the estimate Δρ∝Ma2\Delta\rho \propto \mathrm{Ma}^2 of an unforced flow.


4. Porosity–Permeability Scaling vs. Kozeny–Carman

How sensitive is rock or catalyst-bed permeability k(ε)k(\varepsilon) to grain compaction (shrinking porosity ε\varepsilon)? The classical Kozeny–Carman equation models a porous medium as tortuous hydraulic tubes of specific surface area ∝(1−ε)\propto (1 - \varepsilon), predicting:

kKC(ε)=CKCε3(1−ε)2(4.1)k_{\mathrm{KC}}(\varepsilon) = C_{\mathrm{KC}}\frac{\varepsilon^3}{(1 - \varepsilon)^2} \tag{4.1}

We sweep obstacle radius R∈{2.2,3.2,4.2,5.2} luR \in \{2.2, 3.2, 4.2, 5.2\}\text{ lu} in our staggered 20×2020 \times 20 porous array and compare LBM permeability directly against Eq. (4.1).


Demonstration 4: Porosity-Permeability Compaction Sweep vs Kozeny-Carman Scaling
================================================================================
Grain R [lu] |  Porosity eps |   k_LBM [lu^2] |  eps^3 / (1 - eps)^2
--------------------------------------------------------------------
         2.2 |        0.9350 |         7.9576 |              193.468
         3.2 |        0.8150 |         4.0023 |               15.817
         4.2 |        0.7150 |         2.1929 |                4.500
         5.2 |        0.5700 |         0.6313 |                1.002
<Figure size 770x451 with 1 Axes>

Figure 16.3. Permeability against porosity for an array of cylinders (points) and the Kozeny–Carman form Cε3/(1−ε)2C\varepsilon^3/(1-\varepsilon)^2 with CC fitted at one point (dashed line). The form does not describe the computed values.

Inside the algorithm

What Demonstration 4 shows. Lowering the porosity from ε=0.935\varepsilon = 0.935 to ε=0.570\varepsilon = 0.570 lowers the permeability by a factor of 12.6, from 7.96 to 0.63 lu20.63\ \mathrm{lu}^2. The Kozeny–Carman factor ε3/(1−ε)2\varepsilon^3/(1-\varepsilon)^2 falls by a factor of 193 over the same range, so it does not describe these data: it was derived for packed beds of touching grains, and a dilute array of cylinders is not one. The cylinders are also resolved by only a few lattice nodes, which adds a discretization error. Below we inspect simulate_lbm_obstacle_flow_2d and verify its exact macroscopic averaging formulas.

Check against the library


Inside the Algorithm: lattice_boltzmann.simulate_lbm_obstacle_flow_2d
=====================================================================
def simulate_lbm_obstacle_flow_2d(
    obstacle_mask: np.ndarray,
    tau: float = 0.80,
    body_force_x: float = 1.5e-5,
    n_steps: int = 800,
) -> dict:
    """Simulate 2-D periodic/porous-channel D2Q9 flow past an arbitrary boolean `obstacle_mask` and compute Darcy k."""
    solid = np.asarray(obstacle_mask, dtype=bool)
    if solid.ndim != 2 or np.all(solid) or tau <= 0.5:
        raise ValueError("obstacle_mask must be a 2-D boolean array with at least one fluid node and tau > 0.5.")
    nx, ny = solid.shape
    nu = lbm_viscosity_from_tau(tau)

    rho = np.ones((nx, ny), dtype=float)
    ux = np.zeros((nx, ny), dtype=float)
    uy = np.zeros((nx, ny), dtype=float)
    f = d2q9_equilibrium(rho, ux, uy)

    cx_vec = D2Q9_VELOCITIES[:, 0][:, None, None]
    cy_vec = D2Q9_VELOCITIES[:, 1][:, None, None]

    for _ in range(n_steps):
        rho = np.sum(f, axis=0)
        ux = (np.sum(cx_vec * f, axis=0) + 0.5 * body_force_x) / rho
        uy = np.sum(cy_vec * f, axis=0) / rho
        ux[solid] = 0.0
        uy[solid] = 0.0

        feq = d2q9_equilibrium(rho, ux, uy)
        src = _guo_forcing_term(ux, uy, body_force_x, 0.0, tau)
        f_post = f - (f - feq) / tau + src
        for i in range(9):
            f_post[i, solid] = f[D2Q9_OPPOSITE[i], solid]
        f = _stream_periodic(f_post)

    rho = np.sum(f, axis=0)
    ux = (np.sum(cx_vec * f, axis=0) + 0.5 * body_force_x) / rho
    uy = np.sum(cy_vec * f, axis=0) / rho
    ux[solid] = 0.0
    uy[solid] = 0.0

    porosity = float(np.mean(~solid))
    u_superficial = float(np.mean(ux))
    k_darcy = (nu * u_superficial / body_force_x) if abs(body_force_x) > 0.0 else 0.0
    dv_dx = np.roll(uy, -1, axis=0) - np.roll(uy, 1, axis=0)
    du_dy = np.roll(ux, -1, axis=1) - np.roll(ux, 1, axis=1)
    vort = 0.5 * (dv_dx - du_dy)
    return {
        "rho": rho,
        "ux": ux,
        "uy": uy,
        "vorticity": vort,
        "porosity": porosity,
        "superficial_velocity": u_superficial,
        "darcy_permeability_lu2": float(k_darcy),
    }

Verified exact consistency of porosity, superficial_velocity, and darcy_permeability_lu2

Exercises

Worked solutions are in 16_solutions.ipynb. The cell below the list is a short self-check to start from.

  1. Verify a result. On a 4×124 \times 12 lattice at τ=12+34\tau = \frac{1}{2} + \frac{\sqrt{3}}{4}, construct masks for M∈{1,2,4}M \in \{1, 2, 4\} identical parallel slit pores of aperture hM=8/M∈{8,4,2} luh_M = 8 / M \in \{8, 4, 2\}\text{ lu} so all three masks share identical porosity ε=8/12=2/3\varepsilon = 8 / 12 = 2/3. Verify via simulate_lbm_obstacle_flow_2d that each permeability matches the exact discrete midpoint parabola identity kM,disc=ε(hM2+1/2)12k_{M,\mathrm{disc}} = \frac{\varepsilon(h_M^2 + 1/2)}{12} to < 0.2%.

  2. Find how it fails. Verify that simulate_lbm_obstacle_flow_2d raises ValueError for an all-solid mask, a 1-D mask, or tau <= 0.5, and compare body_force_x = 1e-5 vs 3e-3 through a constricted pore throat (20 x 16 domain) to show how violating Ma≪1\mathrm{Ma} \ll 1 produces >6%> 6\% artificial density compression.

  3. Implement it yourself. Implement analyze_porous_fibrous_bed(mask, tau=0.80, fx=1.2e-5, n_steps=220) returning porosity, u_interstitial, tortuosity, and darcy_k. Compare a straight slit channel against a staggered 4-fiber bed on 24 x 24, verifying T=1.000000T = 1.000000 for the straight slit and T>1.05T > 1.05 for the staggered fiber bed.


Self-check for the exercises
============================
Same porosity eps = 2/3: 1x8-lu slit k = 3.5829 vs 2x4-lu slits k = 0.9167 | ratio = 3.9086 (disc-exact = 3.9091)
All checks passed.