Below is a concise derivation of the isothermal, steady‐state Dusty‐Gas Model (DGM) for a binary mixture in a porous medium, followed by a simple Python script that solves the 1D concentration profile by finite differences.
—
1. Derivation (binary, isothermal, steady state)
We consider species A and B diffusing through a rigid porous “dust” matrix. In the Dusty‐Gas Model one writes a Maxwell–Stefan balance in which each gas–gas friction is augmented by a gas–solid (Knudsen) term:
Maxwell–Stefan friction
For species i≡A,B in a mixture,
where
• c = total molar concentration = P/(RT)
• μ_i = chemical potential of i
• N_i = molar flux of i [mol/(m²·s)]
• D_{ij} = binary (pore) diffusion coefficient, corrected for tortuosity: D_{ij,eff}= (ε/τ)·D_{ij}
• D_{K,i} = Knudsen diffusivity for i, i.e. D_{K,i} = (2/3)·r_p · √(8RT/πM_i)
Isothermal, ideal gas ⇒ μ_i = μ_i⁰ + RT·ln(x_i P) ⇒ ∇μ_i = RT·∇ln(x_i P).
At steady state and 1-D (z), neglecting bulk convection, we get two coupled ODEs:
for i=A,B
Add up i=A+B ⇒ total flux zero (no net convection)
N_A + N_B = 0 ⇒ N_B = −N_A.
Combine and simplify to get a single expression for the A‐flux (N≡N_A)
code
N = − (P/RT) · [ (ε/τ)·x_B/D_{AB} + 1/D_{K,A} ]^(-1) · d x_A/dz .
(One can also derive a slightly more elaborate form including ∂P/∂z when P varies.)
Boundary conditions
At z=0: x_A = x_A0; at z=L: x_A = x_AL.
The ODE
d x_A/dz = − (RT/P) · (1/K_eff) · N
is integrated over 0→L, and N is determined by the two end‐point conditions (linear in x_A for constant P).
—
2. Simple finite-difference solver in Python
Below is a toy script that
Discretizes z∈[0,L],
Treats N as an unknown constant flux,
Integrates x_A(z) via F‐D,
Uses a root solver to match x_A(L)=x_AL.
python
import numpy as np
from scipy.optimize import root
# 1. Input parameters
L = 1e-3 # [m] thickness
nz = 100 # grid points
z = np.linspace(0, L, nz)
P = 1e5 # [Pa]
T = 298 # [K]
R = 8.314 # [J/(mol·K)]
epsilon= 0.4 # porosity
tau = 2.0 # tortuosity factor
d_p = 1e-6 # pore radius [m]
M_A = 28e-3 # A molar mass [kg/mol]
M_B = 32e-3 # B molar mass
D_AB = 2e-5 # binary diffusivity in free space [m2/s]
xA_0 = 0.2 # feed mole frac at z=0
xA_L = 0.8 # mole frac at z=L
# 2. Pre‐compute effective diffusivities
D_AB_eff = (epsilon/tau)*D_AB
D_KA = (2/3)*d_p*np.sqrt(8*R*T/(np.pi*M_A))
Keff_inv = ( xB := (1 - xA_0) )/D_AB_eff + 1/D_KA # approx initial
def integrate_flux(N):
"""
Given a guessed flux N (mol/m2/s), integrate xA from z=0 to L.
Returns [xA_profile, xA_end].
"""
xA = np.empty(nz)
xA[0] = xA_0
for i in range(nz-1):
# local 'Keff_inv' depends on local xB = 1-xA[i]
invK = ( (1-xA[i]) / D_AB_eff ) + 1/D_KA
dx = - (R*T/P) * invK * N * (z[i+1]-z[i])
xA[i+1] = xA[i] + dx
return xA, xA[-1]
# 3. Solve for N such that xA(L)=xA_L
def residual(N):
_, xA_L_calc = integrate_flux(N)
return xA_L_calc - xA_L
sol = root(residual, 1e-4) # initial guess for N
N_sol = sol.x[0]
xA_profile, _ = integrate_flux(N_sol)
print(f" Converged flux N_A = {N_sol:.3e} mol/m2/s ")
# 4. Plot (if desired)
import matplotlib.pyplot as plt
plt.plot(z, xA_profile, '-o')
plt.xlabel('z [m]')
plt.ylabel('x_A')
plt.title('Dusty‐Gas Model Profile')
plt.grid(True)
plt.show()
How it works
We guess a constant molar flux N_A.
We march forward in z using a local Keff from the instantaneous x_A to update dx.
The root solver adjusts N_A so that the computed x_A(L) matches the prescribed boundary value xA_L.
—
Extensions
Include pressure variation (∂P/∂z) if not isobaric.
Move to multicomponent (⇢>2) by solving the full Maxwell–Stefan linear system at each z.
Replace finite difference by more robust ODE integrators (e.g. scipy.integrate.solve_ivp).
Let me know if you want more details on any of these extensions!