Gallery¶
What the parameters do, seen in 3-D. Every image shows one period of the field
(the whole periodic box). The surfaces are the level cut \(f = \xi\) of the exact
field, closed by flat caps where the solid meets the box faces. All images use
the same seed, so within a row only the parameter in the column header changes.
The script that renders them, docs/scripts/make_gallery.py, fixes all
parameters and regenerates the identical images.

Solid fraction¶
\(H^2 = 54\) (48 directions). Raising \(\phi_B\) moves the level cut \(\xi\) up: ligaments thicken and the pores close, while the length scale (set by \(H^2\)) stays put. Ligament diameters are given relative to the box side \(L\).
| \(\phi_B = 0.20\) | \(\phi_B = 0.30\) | \(\phi_B = 0.40\) | \(\phi_B = 0.50\) |
|---|---|---|---|
![]() |
![]() |
![]() |
![]() |
| \(d = 0.070\,L\) | \(d = 0.077\,L\) | \(d = 0.085\,L\) | \(d = 0.092\,L\) |
Length scale¶
\(\phi_B = 0.30\). The wave number is \(q_0 = 2\pi H / L\), so a larger \(H^2\) packs more ligaments into the same box. Doubling \(H\) halves the ligament diameter. See Choosing parameters to pick \(H^2\) from a target ligament diameter.
| \(H^2 = 41\) | \(H^2 = 54\) | \(H^2 = 101\) | \(H^2 = 161\) |
|---|---|---|---|
![]() |
![]() |
![]() |
![]() |
| 48 directions, \(d = 0.089\,L\) | 48 directions, \(d = 0.077\,L\) | 84 directions, \(d = 0.057\,L\) | 96 directions, \(d = 0.045\,L\) |
Why the number of directions matters¶
\(\phi_B = 0.40\). Wave vectors are restricted to integer Miller indices so the
box is exactly periodic, and some \(H^2\) allow only a few directions. With 24
directions (\(H^2 = 14\)) the structure is visibly blocky and aligned with the
cube axes. With 48 (\(H^2 = 41\)) it looks isotropic. nanofoams.check() warns
about the first case ([anisotropy]); see Theory.
| \(H^2 = 14\): 24 directions | \(H^2 = 41\): 48 directions |
|---|---|
![]() |
![]() |
The atoms¶
What a molecular-dynamics code gets: a nanoporous gold sample (fcc, \(a_0 = 4.078\) Å), \(48^3\) unit cells (19.6 nm box), \(\phi_B = 0.35\), \(H^2 = 41\), predicted ligament diameter 1.8 nm. That is 146 657 solid atoms out of 442 368 sites. The image shows a 9 nm corner. The surfaces are crystal facets, because the level cut selects whole lattice sites.

import nanofoams
foam = nanofoams.generate(
lattice="fcc",
lattice_parameter=4.078,
cells=48,
solid_fraction=0.35,
h2=41,
seed=3,
)
foam.write_lammps_data("np_au.data", masses=[196.97])









