Rendering Flux Surfaces and Fields on Real Geometry
How the twin's psi(R,Z) field, wall temperatures, and neutron flux are turned into a legible, confidence-aware 3D scene at display frame rate.
From psi(R,Z) to a drawable surface
The twin's MHD module publishes the poloidal flux function psi on an (R,Z) grid. The overlay extracts iso-psi contours — the flux surfaces — and lofts them around the toroidal or axial direction to form 3D shells. The last-closed flux surface (LCFS) is the plasma boundary; for the breeder it must display the canonical negative triangularity delta -0.30, so the renderer measures triangularity from the reconstructed boundary and shows it numerically beside the shape, preventing a stylized D from masking the real geometry.
def flux_shells(psi, R, Z, levels, phi_segments=64):
# levels: normalized psi_n values, 0 (axis) -> 1 (LCFS)
shells = []
for pn in levels:
contour = marching_squares(psi_norm(psi), R, Z, pn) # (R,Z) polyline
shell = revolve(contour, phi_segments) # sweep around axis
shells.append(shell)
tri = triangularity(shells[-1]) # measured delta from LCFS, expect ~ -0.30
return shells, tri
Field mapping and color grammar
Scalar fields are mapped to vertex colors through perceptually uniform ramps so equal color steps mean equal physical steps. Thermal fields use the orange thermal ramp; neutron flux uses a distinct neutron ramp; magnet strain uses the structural gray-blue ramp. Ramps are colorblind-safe and consistent with the site-wide color grammar so a color never means two things across displays — see color grammar in the HMI.
For the burner, the axial view lofts mirror flux tubes between the 26.49 T plug and 17 T throat, and paints the ambipolar potential profile along the axis. The DEC collector geometry is a separate segment where the 5.44%-neutron-fraction blanket load and the direct-conversion grid voltage are shown together.
Confidence-aware shading
Every vertex carries a confidence weight from the twin. Low-confidence regions are rendered with reduced saturation and a diagonal hatch so operators never mistake an interpolated guess for a measured value. When a diagnostic drops and the twin falls back to a GNN-imputed estimate, the affected region visibly changes texture. This is the visual half of the trust contract; the numeric half lives in confidence and provenance display.
The renderer is stateless with respect to physics: if the twin stream stalls, shells freeze and a staleness badge appears rather than extrapolating — see staleness indicators.