LOFT Eksperiment (The LOFT Experiment) by Mihailo Despotovic with Aleksandar Ćirilović, March 1995

A simulation of the LOFT (Loss of Fluid Test) L9-3 experiment, done on 7 April 1982 at the Idaho National Engineering Laboratory (now the Idaho National Laboratory). The LOFT reactor was a 50 MW model of a commercial pressurized water reactor. In L9-3, the pump feeding water to its steam generator was switched off, and the reactor was left to cope without being shut down: an anticipated transient without scram, or ATWS. The program draws the reactor's loop in VGA and runs the five minutes of the experiment: the water flows, the pressurizer fills, its sprays and valves come on, and the reactor's power and the temperatures of its fuel, cladding and coolant are plotted as they go. Before it starts, and whenever it is paused, a click on any part of the drawing explains it. The description of the experiment is in hypertext. It runs here as it did in DOS, in Serbian, with the English beside it.

I made it with Aleksandar Ćirilović, of the Faculty of Mechanical Engineering, while I was an undergraduate at the University of Belgrade, Faculty of Mathematics. The hypertext engine, HYPER.C, is Vuksan Pejović's.

Keys:
To run the simulation:
  1. Click or tap Start again.
  2. Click the DOS screen and press 3, or click or tap 3 start.
  3. Click or tap KRAJ PREGLEDA, the box at the top left of the drawing. Before that, you can click the parts of the drawing to read about them, and click again to close each one.
  4. Press any key, or click or tap any key (Space). The clock starts.
While it runs, → speeds it up, ← slows it down, Space pauses, Enter starts it again, and Esc goes back to the menu. For the description, press 2: move with the arrow keys, and Enter on a highlighted word opens its explanation.
The DOS screen
The screen, in English

        

How it works

The description says that the curves come from three differential equations, for the temperatures of the fuel, the cladding and the coolant, solved by the Runge–Kutta method. The program doesn't solve them: it has their solutions typed in, a value every ten seconds or so, and joins them with straight lines. The reactor's power is the three straight lines of the description, and the pressurizer's level and pressure go up and down by a fixed step each second. So the simulation shows what was measured, and what the equations gave, on the clock of the experiment. The flow in the pipes is drawn with dashed lines whose pattern shifts each second. The pressure figures for the valves and the sprays in the description are those of the Krško nuclear plant.

The hypertext is one file, LOFT.HYP: the texts one after another, each with the corners of its window, and a link is a word between backslashes with the number of the text it opens. HYPER.C shows a text in its window, lights up the link under the cursor, and keeps the windows it opens on a stack, so Del closes the last one and puts back what was under it.

The bugs, and the fixes

Fixed labels the temperatures (C), fills in the three points, and starts the description with nothing lit. The typos, such as Engeenering, are as they were.

One thing the page does differently: the mouse driver told the program only whether the button was down at the moment it looked, every fifth of a second, so a quick click could be missed. Here, a click between two looks counts.

The port was checked against the original C, compiled with a simulated DOS: a text screen, a BGI that lists what it is asked to draw, and a keyboard and a mouse played from a script on a clock that delay() moves. In 600 sessions, 200 of the experiment, with clicks on every part of the drawing, pauses, restarts, changes of speed and runs to the end, and 400 of the description, with moves, pages and links opened and closed, every line drawn, every wait, every look at the mouse and every text screen are the same. Borland C computed in 80 bits and JavaScript computes in 64; that changes one thing here, the fuel's point at exactly 400, 600, 800 and 1000 degrees, a pixel higher in 80 bits. The page computes that in 80 bits, and the C was compiled so too. The pixels are drawn by the page's own BGI, with the letters from Borland's TRIP.CHR. They couldn't be compared with the original's, so they may differ by a pixel here and there.

The original C code: LOFT.C

    
HYPER.C, by Vuksan Pejović

    
INSTALL.C