how to use these pages

every button and every chart in the 2D and 3D RMHD apps · 2D app · 3D app · further reading

Both apps have the same shape: a what is all this? intro under the title (open until you close it once), a 2D / 3D tab pair that switches between them, a bar at the top that is always visible, a panel of settings under it (hidden until you press show params), and below that a column of display cards (pictures of the field) beside a column of chart cards (graphs against time or against scale). Off to the side, or under everything on a narrow screen, is the background reading — turbulence, plasma and why any of it matters. Nothing is modal — you can change any setting at any time, and the run keeps going. The 3D app adds the things a third dimension needs; everything else is identical.

A good first move is to pick a preset from the bar at the top, press the green Run, and change one thing at a time.

the bar at the top

Run starts the simulation and turns into Pause. Pausing freezes time; the displays and charts stay where they are and every control still works, so you can set something up while paused and then run.

Reset rebuilds the initial condition and puts the clock back to zero, using whatever the initial-condition settings currently say. It does not touch your displays or charts.

preset is a drop-down of ready-made configurations. Picking one sets the controls and opens the displays and charts that go with it, then prints a one-paragraph note about what to look for. That note stays at the top of the screen with the bar while you scroll. Presets are configurations, not separate programs: everything stays adjustable afterwards. Each one also has a direct link — for example rmhd2d.html?demo=kh — which opens the page already set up that way.

show params / hide params opens and closes the whole settings panel: it starts closed, so the first thing on screen is the picture, and the page remembers whichever you chose. hide text does the same for the preset's note. Both hide, neither resets.

On the right of the bar is a readout of the simulation time t, the step number, the current time step dt, and how many steps per second your GPU is managing. Under the displays there is a second readout with the kinetic and magnetic energies and the two forcing scales.

simulation settings

resolution is the number of grid points across the box. Higher is sharper and slower. Changing it restarts the run.

box (2D only) is the shape of the box: square 2π×2π, wide 4π×2π, or large 8π×8π. The wide box exists for the shear-layer and tearing demos, which need room along x for one unstable wavelength along y; the large box is simply four times bigger, which is what lets one thin layer hold many unstable wavelengths along it so it can pick its own. Resolution means the number of points across x, and the other axis follows the box. (1024 points is the longest line the transforms will build, so a resolution a given box cannot reach is greyed out in the list rather than quietly reduced.)

Lz (3D only) is the length of the box along the strong background magnetic field, which points along z. Longer boxes hold longer wave packets.

seed is the random seed. The same seed gives the same run.

cfl_safety and cfl_every control the time step. The solver picks dt from how fast the field is moving; cfl_safety is the fraction of the largest stable step it takes (smaller = safer and slower), and cfl_every is how many steps it waits before recomputing it. The defaults are fine unless a run blows up.

dissipation

Dissipation is what removes energy at small scales, so the cascade has somewhere to end. Too little and the smallest scales pile up into noise; too much and there is no turbulence, just a slow smooth decay.

hyper chooses how sharply dissipation switches on with scale. 1 is ordinary viscosity and resistivity. Higher values leave the large scales almost untouched and then bite hard at the grid scale, which buys a wider clean range of scales — useful for looking at spectra, less honest if you care about the physics of the dissipation itself.

diss is the strength, on a logarithmic slider. Its range is recomputed for the current resolution and hyper value, so one sweep of the slider always goes from "too thick to be turbulent" at the top to "too thin for this grid" at the bottom.

auto (ticked by default) sets diss for you, continuously, from the amount of energy actually measured near the smallest resolved scale. While it is ticked the slider is disabled but still shows the value it has chosen, so you can watch it move; untick it and the slider stays exactly where the controller left it. The tearing and rmhd-variables presets turn it off: tearing quotes a growth rate against a fixed resistivity.

Pm (2D only) is the magnetic Prandtl number. The diss slider is the resistivity η (acting on ψ), and the viscosity acting on φ is Pm×η. 1 means both are equal. 0 means no viscosity at all.

z_diss_k (3D only) damps structure along the background field. It has its own auto button, which sets it from the grid.

forcing

Forcing is how energy gets put in. With the checkbox off the run is decaying turbulence: it starts with whatever the initial condition gave it and runs down.

ε+ and ε− are the rates at which energy is injected into the two Elsasser fields, on logarithmic sliders. They are in the same units and the total injection rate is their sum. The lock checkbox moves them together; unlock them to drive an imbalanced cascade, where more energy travels one way along the field than the other.

tau is the correlation time of the random forcing: how long a given random kick stays pointing the same way before it is refreshed.

band n is a pair of handles setting which scales are forced, in units of the box wavenumber — the default 1–3 forces the largest few scales and lets everything smaller be produced by the cascade. They cannot cross. Moving them restarts the solver when you let go.

spacebar blobs (2D only) replaces all of that with forcing you drive by hand. With it ticked, holding the spacebar grows a gaussian vortex at a random place in the box, in one of the two Elsasser fields picked at random — the longer you hold the key, the bigger it gets, up to its full size after about a second; let go and it fades out over a moment. Up to eight can be alive at once in each field, and the readout under the displays counts them and prints the widest one. The random forcing above is switched off while this is ticked: the checkbox, ε±, tau and band n no longer drive anything.

blob amp is how hard a blob pushes: the peak forcing rate itself, not an injection rate. Nothing normalizes it — unlike the ε sliders, which are targets the solver rescales the forcing to hit, this is the physical amplitude, so a loud blob really is a big one and the total energy is not held to anything. (A blob that lands against the flow already there can even take energy out.) It wants tuning by eye: turn it up until the box responds and back off when it goes ragged.

max σ is how big a blob grows while you hold the key. The slider runs from a 64th to a quarter of the shorter side of the box — measuring it off the short side is what keeps a blob the size the number says on the wide box as well as the square one — and the figure beside it is that width itself, in the same units as the σ in the blob readout. Blobs always start small however low this is set: a few grid cells, and never thinner than a 64th of the box, since anything narrower is structure the grid cannot carry.

Two things on the page keep pointing at the random forcing even after you have switched to blobs, and they are worth knowing about rather than trusting. The dashed markers on the spectrum chart, and the reference slope drawn from the upper one rightwards, still stand where band n puts them — but a blob injects at its own scale, roughly one over max σ, which moves as you drag that slider. And the two forcing scales in the readout under the displays are pinned at 1 while blobs are on, because there is no normalization left for them to report.

Worth doing once: tick spacebar blobs, choose the quiescent initial condition, press Reset and Run, and you have an empty box to stir by hand. A single ζ+ blob on its own does almost nothing — in 2D one Elsasser field with the other one absent is an exact steady solution, so the blob simply sits where you put it and slowly fades. Keep pressing until the readout shows one of each sign and the picture changes completely: two blobs of opposite polarity wrap around each other and shred. Nothing in this model happens until the two fields overlap.

initial condition

The preset drop-down inside this group chooses what the run starts from. Reset re-applies it.

The two amp sliders set how strong the starting fields are. Normally they are labelled ζ+ amp and ζ− amp and set the peak strength of each Elsasser field separately; lock moves them together. They rescale the stored initial condition, so you can pause, move a slider and press Reset to get the same shape at a different strength, any number of times. They appear only for the presets they apply to — the letter and sinusoid packets and the drawing. large-scale modes and quiescent have no amplitude to set, the equilibrium demos below set theirs with their own physical knobs instead, and a typed expression already says how strong it is, so for all of those the amp rows are simply not shown.

While you are painting a custom drawing in φ or ψ, the same two sliders are relabelled φ amp and ψ amp and mean something more direct: φ amp is the peak flow speed max |u|, and ψ amp is the peak perpendicular field strength max |b|. That is the only way to ask for something like "a strong vortex plus a weak magnetic island", which is not expressible as a pair of Elsasser amplitudes. Painting ζ+/ζ− puts the old labels back.

σz (3D only) is the length of the wave packets along the background field. It also sets how nonlinear the collision is: the line under these controls prints χ± (well below 1 = a weak collision, the packets pass through each other nearly unchanged; around 1 or more = a strong one, a single collision already shreds them) together with the time at which the two packets meet. There is a cap on σz; increase Lz if you want longer packets.

The equilibrium demos add their own row: a / Lx is the width of the layer, seed the size of the perturbation that grows out of it, U0 the shear-flow strength and b0 the in-plane magnetic field for Kelvin–Helmholtz, and ψ0 the current-sheet strength for tearing. maintain equilibrium flux (tearing) holds the equilibrium against its own slow decay, so what you measure is the instability and not the layer spreading out; switch it off and the measured growth rate drops noticeably. broadband seed (tearing) replaces the single seeded wavelength with every wavelength the layer could go unstable to, at equal size and random phase, so the layer selects its own instead of being handed one — which is what the island chain demo is built on. The island-width chart switches off while it is ticked: that chart measures one island, and this seeds many.

drawing your own initial condition

Choose IC custom (drawn blobs) and press edit IC. The run pauses and the displays are replaced by a single drawing canvas. Click or drag: each stroke deposits a smooth round blob.

paint chooses which field the stroke goes into: φ (a vortex), ψ (a magnetic island), or the two Elsasser potentials ζ+ and ζ− (a wave travelling one way or the other along the field). σ⊥ is the blob width, as a fraction of the box. negative flips the sign of a stroke — so does dragging with the right mouse button. In 3D the editor has its own z-plane slider, and each blob is also given a length along z.

Leaving the editor: save & run keeps the drawing, applies it and resumes; save keeps it and stays paused; cancel throws away everything drawn since you opened the editor. clear empties the canvas without leaving. There is no undo.

The strength of what you drew is set by the amp sliders afterwards, not by how hard you scribbled: the whole drawing is rescaled to the amplitude you ask for. The drawing is dropped if you change the resolution, because it is stored on the grid.

typing your own initial condition

Choose IC expression (typed φ, ψ) and two boxes appear: one for φ, one for ψ. Type a formula in each and the run starts from exactly that. An empty box means exactly zero, so you can set one field and leave the other alone. Unlike the drawing, nothing is rescaled afterwards — what you write is what runs, so the numbers in the formula are the amplitude.

When it takes effect. A formula is applied when you press Enter in the box or click away from it, and again every time you press Reset. The error line below still updates as you type; it is only the applying that waits.

The coordinates are the box's own. x runs from 0 up to Lx, y up to Ly, and in the 3D app z up to Lz. Nothing is scaled to 2π or to 1. Those box lengths are available as Lx, Ly and Lz, so sin(2*pi*x/Lx) is one full wave across the box whatever box you picked, and it stays one full wave when you change the resolution or the box shape. On the 2D app z and Lz are simply not names — you get told so rather than quietly getting a zero.

Also available: pi, e, the operators + - * / ^ and brackets, and the functions sin cos tan asin acos atan atan2 sinh cosh tanh exp log log10 sqrt abs sign min max mod floor ceil hypot pow. log is the natural logarithm — use log10 if you want base 10. mod follows the sign of the second argument, which is the useful convention on a periodic coordinate. ^ is a power, and it binds tightly: -x^2 is −(x²), and 2^3^2 is 29.

Refused functions. If the formula is infinite, undefined, or simply too big to store anywhere on the grid — 1/x at x = 0, log(y) at y = 0, exp(100) anywhere — that field is not uploaded, and the line tells you how many points and where the first one is.

The periodicity warning. The box wraps: the right edge is glued to the left edge, the top to the bottom, and in 3D the two ends along z. Your formula does not have to respect that, and if it does not you get a line saying which seam it fails on and by how much — φ: y seam, jump 0.42 of range. It is a warning, not a refusal; press Run anyway if that is what you meant.

What it is telling you is that the field which actually runs is not the formula. The solver only knows fields that wrap and that are built from waves it can represent, so what gets uploaded is the closest such field — and near a seam that is typed across, "closest" means ripples that sit there and do not fade, plus a haze of energy spread across every small scale that looks like turbulence in the spectrum chart and is not. Type x*y and watch it: it is the quickest way to see why a code like this one wants periodic data. A formula that meets itself in value but turns a corner there (abs(x-Lx/2)) gets a milder version of the same warning, and a milder version of the same ripples.

display cards — the pictures

+ display in the "displays & charts" group adds a card (up to three); the × on a card's header closes it. Every card is independent, so you can watch three different quantities of the same run side by side.

The first drop-down is what is drawn. The caption under the picture repeats it with its definition:

arrows overlays the direction of the field on the magnitude modes (|u|, |b|, |z±|).

contours draws in-plane field lines over the picture: ψ contours are magnetic field lines, φ contours are streamlines, and ψ + φ draws both at once in two colours, which is how you see whether flow and field are aligned. Two more drop-downs appear with them: the number of contour levels, and whether to draw them over the colour field or over a plain bg — a blank plate, for when the colours underneath are in the way. The lines are evenly spaced in value, so they crowd together where the field is strong.

The last drop-down is the colormap: afmhot, viridis, RdBu or grayscale, per card.

A narrow filter kmin slider appears on every card once you tick k⊥ filter in the displays & charts panel: it is the scale filter, and it drops everything larger than the size you set. It is off to begin with, and it changes the picture only — never the run.

In the 2D app each card also carries two offset sliders. They slide the picture inside its frame, up to half a box each way — positive offset x to the right, positive offset y downwards. The box is periodic, so nothing is cropped: what leaves one edge comes back in at the other, and you are looking at the same field from a different origin. It is for the structure that happens to straddle an edge — a current sheet, an island, a packet — which you can now bring to the middle of the card and watch there. At the centre of both sliders (where they start) they do nothing whatever; off centre, the caption says offset: (+0.25, −0.10)L, because the picture no longer lines up with the box coordinates everything else on the page is quoted in. Each card has its own pair, so one card can sit on the sheet while another holds the whole box. The run is not offset — and neither are the spectra, the energies or the cut trace, which keeps cutting the real x = Lx/2.

In 3D each card also has a view drop-down, and it opens on volume — the whole box, drawn see-through, which has its own section below. z slice shows one plane, picked by the slider beside it — a slider that is only there in that mode, since the other views have no single plane to pick. track z+ and track z− follow a wave packet as it moves, so the display rides along with it. cube faces draws the three visible outer faces of the box instead of one plane (the top face is the card's own plane, so a tracking cube card puts the collision on top). field lines draws the magnetic field lines themselves through the whole box, with the box outline; the field selector and the arrows do nothing in that view, but the contour selector still inks the top face. Next to + display / + chart there is a page-wide tracking drop-down deciding how those trackers follow a packet: energy centroid (smooth, the default) or peak plane (the single strongest plane, which jumps about more) — and, beside it, true box shape, which is what draws the box with its real edge lengths. Untick it and the box is drawn as a cube whatever Lz says, which is how these pages looked before.

Along the bottom of each card, on the caption line: a colorbar showing the card's colormap and the range the colours currently mean, and the save and rec buttons.

the 3D volume view

volume is the view a 3D display card opens on, and the one the Alfvén-wave collision preset is built around. Instead of one plane, or the three outer faces, it draws the whole box see-through: for every pixel on screen it shoots a ray through the box and adds up what that ray passes through. The box is drawn with its real proportions, so a long Lz is a long column and not a cube — untick true box shape in the displays & charts panel if you would rather have the cube back.

What it draws is not the field everywhere — that would be fog — but two surfaces of constant value, one at +level and one at −level of the range the colorbar is showing, softened into shells rather than left as hard skins. At these resolutions a hard surface shows the grid it was built on and a soft one does not. The positive shell takes one end of the card's colormap and the negative shell the other, the same colours the slice views use, so the two agree. Quantities that can only be positive (|u|, |b|, |z±|) get the one shell instead of two.

The two labelled sliders in the card header belong to this view and appear only in it. % range is where the shells sit, as a fraction of the colour range: low picks up weak structure and fills the box, high keeps only the strongest cores. How thick the shells are follows that level (it is 0.4 of it), so there is no third slider. opacity is how solidly they draw — low is a haze you can see through, high and the front of the box hides the back of it. Both are per card, and both are only how the picture is drawn: the simulation neither sees them nor cares.

Two things change in the card header. The arrows checkbox becomes lines and overlays the magnetic field lines through the whole box; it is off to begin with, because the lines are drawn on top of the picture rather than woven into it, so a line that ought to be behind a shell will still be in front of it. And the contour controls disappear: contours are drawn on a plane, and there is no plane here.

The two σ quantities cannot be volume-rendered — they are built from four fields at once and a card has room for two — so a card asking for σc or σr in this view quietly shows cube faces instead, and its two sliders hide with the view they belong to.

Marching a volume is the most expensive drawing these pages do. If a card feels heavy, one volume card with the others on slices is a fair trade — and the picture does not change with the machine: the shells sit where the sliders say either way.

the scale filter — looking at the small scales on their own

Tick k⊥ filter in the displays & charts panel and every display card grows a narrow filter kmin slider: a filter on the picture, in both apps. It keeps only structures smaller than a size you choose — k⊥ at or above the handle, counted in box wavenumbers, which is the unit the spectrum chart's horizontal axis uses, so where you put the handle is a place on that axis. The top of the range is always the dealias cut, i.e. the smallest thing the run resolves. At 0 the filter is off, and off is exactly off: the picture is then the same picture, pixel for pixel, as if the slider did not exist. Untick the box and the sliders go away again.

It filters the picture and nothing else. The simulation is not filtered: the run, the time step, the energies, the spectra and the field lines all carry the whole field. (Saving or recording a filtered card saves the filtered picture — what you see is what you get.) Two cards can show two different cuts of the same instant side by side, which is what the control is for. The caption says filter: k⊥ = 10:kmax whenever it is active, because a filtered picture looks like a different simulation and is not one.

Why bother: turbulence is many sizes at once, and the big structures are the bright ones, so a raw snapshot mostly shows the big ones. Slide the handle up during a developed run and the picture rescales to what is left — sheets and eddies that get thinner across the magnetic field as you go up, while staying long along it. That growing elongation is the same thing the anisotropy chart measures as a falling curve; here you are looking at it directly. In 2D the same cut shows the small-scale sheets and the alignment between flow and field. Filtered snapshots like these are how the anisotropy was first measured (Cho & Vishniac; Maron & Goldreich) — the difference is that here the scale is a slider and the run keeps going. The 2D spectrum chart does the same filtering as a measurement rather than as a picture.

Practical notes. The edge of the filter is soft, about one wavenumber wide, on purpose: a hard cut rings, and the ringing would look like structure that is not there. What is left high up is a small amount of energy, and the colour scale follows the filtered field, so it will amplify whatever is there — including grid noise, at the very top of the range. That is the honest reason the sliders are off until you ask for them: it is a tool for a developed run, not a knob for a first look. In 3D it applies to the volume view too, which is the payoff: a filtered j∥ in a long box, one range of scales at a time.

the colorbar

The strip on the right of the caption line is the card's own colormap, with three numbers under it: the value at the left end, in the middle, and at the right end.

Which range it shows follows the quantity:

Everything else rescales itself continuously to whatever is in the picture, which is why the numbers move while the run does. That is worth remembering when comparing two moments: the colours are the same, the numbers are not. The bar is hidden in the 3D field-lines view, which draws no colour field.

chart cards — the graphs

+ chart adds one; the drop-down in its header chooses the type, and the × closes it. You can have several of the same type with different options.

save, next to the ×, makes a PNG of the graph exactly as it is drawn. On the 2D spectrum — the one chart whose colours are the quantity — the colour scale is saved underneath the plot, so the picture still says what its colours mean. The file is named after the page, the chart and the simulation time, for example taranis-rmhd2d-spectrum-t12.500.png, and it waits on the card behind a download button exactly as a display card's picture does (see saving a picture or a video).

energy trace — energies against time. The option chooses E_u, E_b (kinetic and magnetic) or E+, E− (the two Elsasser energies, which is what tells you whether the cascade is imbalanced). The total is drawn in both.

spectra — how energy is distributed across scales, on log axes, so a power law is a straight line. Options:

anisotropy (3D) — how stretched the eddies are along the background magnetic field, scale by scale. Turbulence in a magnetised plasma does not make round eddies: the smaller they get, the longer and thinner they are along the field. This chart measures that, and it is the one plot where the theory of the last thirty years is directly visible. To see the same thing by eye rather than as a curve, put a display card's scale filter on and slide it up.

It is built from the two spectra of the chart above, with no extra work asked of the GPU. For a given amount of energy at small scales, it asks which perpendicular scale and which parallel scale hold that much, and plots one against the other; doing it for a ladder of energies gives the curve. Reading it:

2D spectrum E(k⊥,k∥) (3D) — the picture the chart above reduces to a curve: how much energy sits at each combination of a perpendicular and a parallel scale, drawn as a heatmap. Bright is more energy (the colorbar under it gives the range). The bright ridge running up and to the right, bending over as it goes, is critical balance. Both axes cover exactly what was measured and no more: across, from the left-hand edge of the first perpendicular band to the right-hand edge of the last (nothing below the first band was ever cut out of the field, so there is no axis for it); up, from the parallel scale the forcing itself injects at — the forcing's z profile is a single cosine over the box, so the first parallel bin is the injection scale — to the last resolved bin. The axis then carries on a little past that last bin, ticks and all, purely so the legend has empty canvas to sit on instead of covering the top left of the picture: the extra strip is real axis with nothing measured in it, and no cell moves against the axis because of it.

cut trace — a slice through the field along a single line (along y, at the middle of the box). The option picks which pair of components: u_x, u_y · b_x, b_y · |z+|, |z−|. In 3D it has its own z-plane source.

island width (2D, for the tearing demo) — the width W of the magnetic island against time, on a log axis, so the early growth is a straight line and the later slow stage bends over. The legend fits the slope of that straight part and quotes it as a growth rate γ, which is the number to compare against the linear theory value in the preset's note. It goes blank once the curve stops being a straight line, which is not a fault: the rate is genuinely local.

k_y = 2π/L_y mode (2D, for the Kelvin–Helmholtz demo) — the size of the growing mode against time, again on a log axis with a fitted γ. It exists because the energy trace cannot show this at all: the equilibrium shear carries about a million times more energy than the seed, so the total energy sits flat while the instability grows through six decades.

eigenfunction (2D) — the shape of the growing mode across the box, which is the one thing the tearing demo otherwise never shows. The chart above says how fast the island grows; this one says what is growing. It plots the size of one Fourier component in y — |ψ̂| and |φ̂| at a single ky — against x, right across the box.

saving a picture or a video

save makes a PNG of the card's current view: the field, the arrows or field lines drawn over it, and the colorbar. The file is named after the page, the quantity and the simulation time, for example taranis-rmhd2d-vorticity-t12.500.png.

Chart cards carry the same save button, in their header: it writes the graph as it is drawn, with its colour scale where the chart has one. There is no rec on a chart.

rec starts recording that card to a short video and turns into stop. Press it again to stop, or leave it: it stops itself after 30 seconds so a forgotten recording cannot grow without bound. The file is a plain MP4 at 30 frames a second: the page encodes it and assembles it itself, one keyframe every second, which is what makes it play on a phone as well as on a laptop. (Left to record the video for us, the browser writes a fancier kind of MP4 that iPhones and iPads show as a handful of stills.) Where the browser is too old for that, the video is recorded the old way instead and may come out as a WebM. The video is the field canvas alone — arrows, field lines and the colorbar are in the PNG but not in the video. Recording is a browser feature that not every browser has; if yours does not, the button is simply not there, and save still works.

Neither writes anything by itself. When you press stop (or save), a small line appears on the card giving the file's size — and, for a video, how long it is — with a download button and, where the browser can hand a file to another app, a share one; share is what you want on a phone. The picture and the video keep their own lines, so saving a picture does not take a recording away. Nothing is uploaded anywhere: the whole simulation runs on your own machine.

save all, next to + display and + chart, saves everything on screen at once: a PNG of every display card and every chart card, exactly as save would have written each of them one at a time. They arrive as a single ZIP file — one file to download, and one to share from a phone, instead of one prompt per card — and the line it lands on is the same one, just under the button rather than on a card. Inside, the pictures are named for the card that made them (disp1-vorticity.png, chart2-spectrum.png), in the order the cards appear on the page.

A params.json travels with them, describing the run the pictures came from: the resolution and the box, the simulation time, the dissipation and its exponent, what was being injected and where, and which initial condition it started from — including, when that was an expression, the two formulas as typed, since for that one preset the formulas are the initial condition. It is there so that a folder of pictures still says what it is a month later.

save fields, beside it, saves the data rather than a picture of it: the two potentials φ and ψ as they stand at that instant, in real space, as ordinary float32 arrays. The file is an .npz — a numpy archive, which is a plain ZIP you can also just unpack — named like the pictures, for example taranis-rmhd2d-fields-t12.500.npz. It is one moment, not a time series. Expect about 2 MB from a 512² 2D run and around 30 MB from the largest 3D box, so on a phone it is worth watching which one you press.

Four lines read it, and the coordinate vectors are in the file so you do not have to rebuild the grid:

import numpy as np
import matplotlib.pyplot as plt
d = np.load("taranis-rmhd2d-fields-t12.500.npz")
plt.pcolormesh(d["x"], d["y"], d["phi"].T)

The axis order. In 2D phi and psi have shape (nx, ny): phi[i, j] is the value at x[i], y[j]. In 3D they have shape (nz, nx, ny) — z first — so d["phi"][k] is the whole horizontal plane at height z[k]. That is why the snippet above transposes before plotting: pcolormesh wants the first axis to be the vertical one. The same params.json is in the archive and states the order too, so a file found later still explains itself.

One thing to know before you take a spectrum of it. The run is dealiased: two thirds of the way to the grid's finest wavenumber, everything is deliberately set to zero and kept there, which is what stops a spectral code folding the small scales it cannot represent back onto the large ones. So the saved field has no content at all above that cutoff. A spectrum of it will fall off a cliff there, and that cliff is the numerical method, not the physics — do not read it as a dissipation range.

rec all, beside it, records every display card you have open into one video, side by side (or stacked, whichever comes out closer to square), each panel labelled with the quantity it shows. There is no list to pick from: open the displays you want to record and press it. It appears once you have two display cards — with one, the card's own rec is the same thing — and its title says what the file will be, for example “2 tiles, 1024×512”.

The point of one file rather than two is that the panels are the same frames: z⁺ and z⁻ side by side in an imbalanced run only tell you anything if they are in step, and two separate recordings are not. So the whole frame is captured or none of it is — if one panel cannot be read in time, that moment is left out of the video rather than shown twice. On a slow machine the clip covers less wall clock than you stood there for; it is never out of step and never stretched. It stops itself after 30 seconds like any other recording, and the file waits on the same line, under the button.

Some phones will not encode a picture that wide. If yours refuses, the panels are recorded at half size instead and the line says so. Where the browser cannot encode video at all this button is simply not there, and recording one card at a time still works. Closing a display card while it is recording stops the recording and keeps what it has — the file is still there to download.

the presets, in one line each

2D

3D

the self-test, and what to do when something looks wrong

At the bottom of each app is a Self-test button. It runs a small fixed problem through the same GPU code the live run uses and compares the answers against values computed at higher precision by the original research code, printing a table of relative errors against their tolerances. It is there so you can check for yourself that the browser is solving the same equations.

If a run turns into noise or the numbers go blank, the usual cause is too little dissipation for the resolution: tick auto, or push the diss slider up a little, and press Reset. If the page says it cannot find a GPU, the browser does not have WebGPU enabled.

These apps run in single precision, which is right for looking at things and not a substitute for a research run.

Implementation notes, the numerical contracts and the verification tooling are in the repository, not here.