Chapter 6 · Section 9
Streams Along the Filaments
The BPT law
BPT Part 3.14 (The Game's Reading): "Its matter does not arrive from nowhere: galaxies grow by cold streams falling in along the filaments of the cosmic web, which run between neighboring halos (Kereš et al., 2005; Dekel et al., 2009). So each of the largest galaxies draws two or three streams of stars, aimed along the filaments toward its nearest neighboring galaxies. Their stars fall inward from about halfway to each neighbour, curl into the galaxy's turning as they near it (keeping their angular momentum, they turn faster as they fall), and join the disk at its edge, while new stars start far out on the filament." BPT Part 3.12 gives the physics behind it: "Cold streams feed galaxies. Below about 10¹² Suns the infalling gas cools faster than it falls; it never heats to the virial temperature but flows in along the filaments, cold, and feeds the disk directly (Kereš et al., 2005; Dekel et al., 2009)." The conserved angular momentum is the same law Part 3.12 states for every collapse: "Angular momentum per mass, Ω·R², is kept. Gas falling to a tenth of its radius turns a hundred times faster."
The established physics
- Galaxies gain much of their gas in cold streams along filaments (Kereš, Katz, Weinberg & Davé 2005, How do galaxies get their gas?; Dekel, Birnboim, Engel et al. 2009, Cold streams in early massive hot haloes as the main mode of galaxy formation).
- Gas falling in keeps its specific angular momentum j = ρ²·Ω, so its angular speed grows as Ω ∝ 1/ρ² (exact for conserved j).
The game's math
setStreams() scene3d.js:570–597 and placeStreams(pos, flips) scene3d.js:598–615.
The points and the galaxies (scene3d.js:571–575):
B_s = round(0.08 · P) none if B_s < 50
big = the ⌊B_s / 42⌋ galaxies with the most stars (at least 1)
per = max(16, ⌊B_s / |big|⌋) points each
42 is three filaments of 14 stars. Example: P = 16,000 gives B_s = 1280, the 30 largest galaxies, 42 points each. With only 5 galaxies, per = 256 each.
The filaments (scene3d.js:585–586). For each galaxy, the other galaxies are sorted by periodic distance; it takes the nearest 2, or 3 with chance one half, each as (distance d, bearing). A galaxy with no other galaxy gets two filaments in opposite random directions at d = 6·R.
Each stream star (scene3d.js:588–592), R the galaxy's drawn radius:
out = max(1.6·R, min(5·R, 0.5·d)) it starts from halfway to the neighbor, at most 5 R, at least 1.6 R
ρ = R + u · (out − R) start anywhere along the stream
offset across the filament = (u − 0.5) · 0.35 · R
Its fall and curl (scene3d.js:600–613), each frame, ω the galaxy's turn rate Ω_d (Part 6.6):
ρ ← ρ − min(0.05·R, flips · |ω| · out / (3 · 2π)) it falls the whole stream in three disk turns
φ_s ← φ_s + clamp(sense · |ω| · flips · (R / max(ρ, 0.5·R))², −0.1, 0.1)
if ρ ≤ R: ρ ← out, φ_s ← 0 it joined the disk; a new star far out
curl = φ_s · min(1, (out − ρ)/(out − R))
bearing = filament bearing + curl; the cross offset shrinks as ρ/out
The curl rate (R/ρ)² is the conserved-angular-momentum law, taking the turn rate at the disk's edge as ω.
In the game
Round the largest galaxies the player sees thin lines of blue-white stars ([0.62, 0.78, 1], each a little dimmer or brighter, scene3d.js:591) reaching out two or three ways toward the nearest neighboring galaxies, from as far as halfway to them. Along each line the stars move inward, slowly far out, then swing round into the galaxy's own turning sense as they near its edge, faster and faster, and vanish into the disk, while new stars appear far out on the same line: a steady inflow along the web. A stream's width narrows as it nears the galaxy. The streams follow the galaxy as its well moves, and turn with the galaxy's own Disk Turn Rate, so an early, fast-turning galaxy pulls its streams in fast and curls them tightly, and a late one draws them in slowly. They stop when the physics is paused, as the galaxies do, and they are rebuilt at every reading, so a stream swings to a new neighbor when the nearest galaxy changes.
The scale model
Each stream star stands for nothing counted: it is a marker of matter falling along a filament, drawn in the inflow's direction toward the nearest drawn galaxies, at the enlarged galaxy size of Part 6.5. Its timing is in flips and follows the galaxy's law turn rate. The actual filaments of the simulation are in the body field and the starlight skin (Part 6.10 and the matter chapter).
Where the game and the theory differ
- BPT's streams run "along the filaments of the cosmic web". The game does not trace the simulated filaments: it aims each stream at the nearest drawn galaxies, which is where BPT says the filaments run, but the line drawn is straight toward the neighbor, not the web's own path.
- BPT gives "each of the largest galaxies" streams. Which galaxies count as largest is set by the device's points: the ⌊B_s/42⌋ galaxies with the most stars, 30 on a desktop at 16,000 points; none when the streams' share is under 50 points.
- The fall takes three turns at the disk's rate; the comment at scene3d.js:604 says "about three outer orbits", and neither is from a source. The same comment says the turn grows "as R/ρ"; that is the speed, and the code's (R/ρ)² is the angular rate, which is the correct one for the angle.
- Each frame a star falls at most 0.05·R and curls at most 0.1 radians, so on fast-turning galaxies the drawn fall and curl are slower than the stated law.
- Whether a galaxy has two or three filaments is drawn at random with chance one half; BPT says "two or three streams" and gives no rule.
Fixed numbers
| Number | Where | What it is | Kind |
|---|---|---|---|
| 0.08 | scene3d.js:571 | streams get 8% of the points | CAP |
| 50 | scene3d.js:572 | no streams under 50 points | CAP |
| 42 | scene3d.js:574 | points a galaxy: 3 filaments × 14 stars; sets how many galaxies get streams | CAP |
| 16 | scene3d.js:574 | least points a galaxy's streams | CAP |
| 1.3 | scene3d.js:578 | buffer headroom | METHOD |
| 2, 3, 0.5 | scene3d.js:586 | two filaments, a third with chance one half | METHOD (BPT Part 3.14: "two or three streams"; no rule given) |
| 6 | scene3d.js:586 | a lone galaxy's filaments at 6·R | METHOD |
| 0.5 | scene3d.js:588 | streams start halfway to the neighbor | BPT (Part 3.14: "from about halfway to each neighbour") |
| 5 | scene3d.js:588 | streams start at most 5 drawn radii out | CAP |
| 1.6 | scene3d.js:588 | streams start at least 1.6 drawn radii out | CAP |
| 0.35 | scene3d.js:589 | a filament's width, × R | DISPLAY |
| [0.62, 0.78, 1], 0.8, 0.2 | scene3d.js:591 | stream star color and its spread | DISPLAY |
| 0.016, 0.008, 8, 0.12, 1.35 | scene3d.js:592 | stream star size | DISPLAY |
| 3 | scene3d.js:605 | the fall takes three disk turns | METHOD (BPT: "about three outer orbits"; no source) |
| 0.05 | scene3d.js:605 | greatest fall a frame, × R | CAP |
| 2 | scene3d.js:606 | curl rate ∝ (R/ρ)², conserved angular momentum | PHYSICS (j = ρ²Ω conserved) |
| 0.5 | scene3d.js:606 | curl rate held at ρ ≥ 0.5·R | METHOD (finite near the center) |
| 0.1 | scene3d.js:606 | greatest curl a frame, radians | CAP |
| 1e-6 | scene3d.js:609 | least denominator in the curl ramp | METHOD |