Reaction-Diffusion Topology Optimization
Overview
A catalytic reactor (or micro-mixer) converts a species at its solid surfaces; the more surface area exposed to the flow, the faster the reaction. ReactionDiffusionTopOpt optimizes the layout of catalyst vs. void to maximize the reaction rate — the species diffuses (D_cat in catalyst, D_void in void), and converts at rate k_r in the catalytic phase.
using RasmahA catalytic reactor
Fix the species concentration at one inlet face and let the optimizer place the catalyst where it converts most.
m = tetrahedralize_box(1.0, 1.0, 1.0, 3, 3, 3)
n = size(m.nodes, 2)
inlet = [i for i in 1:n if m.nodes[1, i] < 1e-6]
x, hist = solve(ReactionDiffusionTopOpt(), m, Material(youngs_modulus = 1e9, poisson_ratio = 0.3);
inlet = inlet, volfrac = 0.5, k_r = 1.0, D_cat = 1.0, D_void = 1e-2,
max_iter = 20)([1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.001, 1.0, 1.0, 1.0 … 1.0, 1.0, 0.001, 0.001, 0.001, 0.001, 0.001, 0.001, 0.001, 0.001], [-0.1158473225714858, -0.11606553326031356, -0.11643176875435536, -0.11703326461779595, -0.11811069711694196, -0.12019494704352612, -0.12461135600145651, -0.1350279837110414, -0.16283223950556638, -0.24754259673384582, -0.35270721334124583, -0.35941851408170206, -0.3903130638332599, -0.4477073658783035, -0.4461127061329435, -0.44553401992390235, -0.4447638710957907, -0.45249751224837453, -0.4505868902450784, -0.4496993394606121])
Verification — the reaction rate grows
The objective is the negative reaction rate, so it decreases as the catalyst is placed more effectively:
println("objective: ", round(hist[1]; digits = 4), " → ", round(hist[end]; digits = 4))
println("reaction rate grows: ", hist[end] < hist[1])
println("density in [0,1]: ", all(0 .<= x .<= 1))objective: -0.1158 → -0.4497
reaction rate grows: true
density in [0,1]: true
vtk(m; field = x, fieldname = "catalyst density", edges = true)Next steps
- Species transport — the advection–diffusion forward solve.
- Microfluidic mixer — the flow-coupled variant.
