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.

L5: 2D Reactor Models

Many industrial reactors require 2D descriptions: a tubular reactor with radial temperature/concentration gradients, or a cylindrical catalyst pellet with internal diffusion. This notebook extends pymrm’s 1D operators to 2D using Kronecker products, and introduces the cylindrical divergence operator.

Governing equations

2D Cartesian CDR (cell centres at (zi,rj)(z_i, r_j)):

∂c∂t=Dz∂2c∂z2+Dr∂2c∂r2+R(c)\frac{\partial c}{\partial t} = D_z \frac{\partial^2 c}{\partial z^2} + D_r \frac{\partial^2 c}{\partial r^2} + R(c)

2D cylindrical CDR (with ν=1\nu = 1 for cylindrical, ν=2\nu = 2 for spherical):

∂c∂t=Dz∂2c∂z2+Drrν∂∂r(rν∂c∂r)+R(c)\frac{\partial c}{\partial t} = D_z \frac{\partial^2 c}{\partial z^2} + \frac{D_r}{r^{\nu}} \frac{\partial}{\partial r}\left(r^{\nu}\frac{\partial c}{\partial r}\right) + R(c)

Kronecker product assembly for Nz×NrN_z \times N_r grid:

L=INr⊗Lz+Lr⊗INz\mathbf{L} = \mathbf{I}_{N_r} \otimes \mathbf{L}_z + \mathbf{L}_r \otimes \mathbf{I}_{N_z}

where Lz=Dz Gz\mathbf{L}_z = \mathbf{D}_z\,\mathbf{G}_z and similarly for rr.

PyMRM building blocks

ToolRole
construct_grad(N, dz, axis=0)1D gradient in zz or rr
construct_div(N, dz, nu=0)Divergence; nu=1 for cylindrical
scipy.sparse.kron(A, B)Kronecker product to assemble 2D operator
scipy.sparse.eye(N)Identity of size NN
Array shape (Nz, Nr, Nc)2D multi-component concentration field

Example 1 — 2D Cartesian diffusion-reaction

Steady-state diffusion-reaction in a rectangular domain with Dirichlet BCs on all walls.

<Figure size 700x350 with 2 Axes>

Example 2 — Cylindrical catalyst pellet

Spherical catalyst pellet with ν=2\nu = 2: ddr(r2dcdr)=r2kDc\frac{d}{dr}\left(r^2 \frac{dc}{dr}\right) = \frac{r^2 k}{D} c. Use nu=2 in construct_div.

<Figure size 550x350 with 1 Axes>

Summary

  • Kronecker product Ir⊗Lz+Lr⊗Iz\mathbf{I}_r \otimes \mathbf{L}_z + \mathbf{L}_r \otimes \mathbf{I}_z assembles the 2D Laplacian from 1D blocks

  • Array shape convention (Nz, Nr, Nc) stores all components at once; reshape to (Nz*Nr, Nc) for linear solvers

  • nu=1 (cylindrical) and nu=2 (spherical) in construct_div account for geometry

  • The symmetry boundary at r=0r=0 requires a Neumann (zero-flux) condition

  • Effectiveness factor η=tanh⁡(ϕ)/ϕ\eta = \tanh(\phi)/\phi for slab, 3(ϕcoth⁡ϕ−1)/ϕ23(\phi\coth\phi-1)/\phi^2 for sphere