RasmahRasmah

Photonic Band Gap Topology Optimization

println("Julia ", VERSION)
Julia 1.12.6

Overview

A photonic crystal blocks light in a band of frequencies by arranging two materials with different permittivity into a periodic pattern. Topology optimization finds that pattern automatically: for the in-plane Helmholtz eigenproblem

\[\nabla\cdot\left(\frac{1}{\varepsilon_r(\rho)}\,\nabla H\right) = \frac{\omega^2}{c^2} H,\]

the design maximizes the gap between the n-th and (n+1)-th eigenfrequencies, opening a stop-band (Sigmund & Hougaard 2008).

using Rasmah
using LinearAlgebra

part  = box(1.0, 1.0, 1.0)
b     = brep(part)
left  = faces_in_box(b, [-0.6, -1.0, -1.0], [-0.4, 1.0, 1.0])
right = faces_in_box(b, [ 0.4, -1.0, -1.0], [ 0.6, 1.0, 1.0])
mesh  = tetrahedralize(b, 6)
TetMesh{Matrix{Float64}, Matrix{Int64}, Rasmah.BRepFaceLabels}([-0.5 -0.33333333333333337 … 0.33333333333333337 0.5; -0.5 -0.5 … 0.5 0.5; -0.5 -0.5 … 0.5 0.5], [1 1 … 286 286; 2 9 … 335 336; 9 8 … 336 287; 58 58 … 343 343], Rasmah.BRepFaceLabels(FaceSet[FaceSet([19 17 … 23 8; 26 24 … 24 9; 27 25 … 31 16]), FaceSet([295 331 … 300 307; 302 332 … 301 314; 303 339 … 308 315]), FaceSet([1 52 … 246 3; 2 101 … 247 52; 51 102 … 296 53]), FaceSet([289 141 … 96 244; 290 190 … 97 245; 339 191 … 146 294]), FaceSet([127 232 … 15 253; 176 239 … 22 260; 183 288 … 71 309]), FaceSet([238 7 … 91 140; 287 14 … 140 147; 294 63 … 147 196])]))

Maximizing the band gap

The permittivity contrast is what opens a gap, so a high-index material (here silicon, n = 3.42) is used. solve(PhotonicBandGapTopOpt(), …) returns the density field and the band-gap history:

φ, hist = solve(PhotonicBandGapTopOpt(), mesh, silicon;
                fixed = left => [0.0], volfrac = 0.6, max_iter = 40)

println("initial gap = ", round(hist[1];  digits = 3))
println("final gap   = ", round(hist[end]; digits = 3))
initial gap = -0.776
final gap   = -1.311

The gap objective rises in magnitude as the design concentrates high-permittivity material into a periodic dielectric structure. (A void fraction near 0.5 gives the strongest dielectric contrast.) The resulting field is the optimized permittivity layout:

vtk(mesh; field = φ, fieldname = "material density")

The related VibroAcousticTopOpt driver minimizes radiated sound power instead — see the API reference for the vibroacoustic entry point.

Next steps