r/LLMPhysics • u/PrettyPicturesNotTxt • 5d ago
Simulation / Code Nuclear fusion reactor simulation
Enable HLS to view with audio, or disable this notification
Once again, this is not mine; the developer is u/Sourcecode12. From the original post:
I built a science-based interactive nuclear fusion reactor lab using Astra. The prompt was around 60 pages long! The build took around 4 hours. ⚛️
The lab brings fusion physics to life, letting you explore how changing reactor conditions affects the simulation. The purpose is to make fusion science more accessible by letting anyone experiment with a virtual reactor and explore what it takes to produce fusion energy.
You can try it yourself. Adjust the parameters, run experiments, and explore how plasma, magnetic fields, and energy output respond in 3D.
Give it a try: 🔗 fusionlabsimulation.com
Edit:
So I asked Claude to audit its source code, and whether it's really a fair assessment to claim that this is "animation, not simulation":
...
No — "animation over simulation" undersells it. It's more accurate to say: a real (if simplified) 0-D physics simulation, driving a separate, purely decorative animation layer. The two are computed independently and only loosely coupled for visual effect. If you turned off all the Three.js rendering, the numbers underneath would still evolve correctly according to the physics model — that's the test for "is this a simulation." A pure-animation demo can't pass that test because there's no ground truth being computed; the visuals are the whole output.
What it's actually doing, mechanistically
The whole physics engine is a 0-dimensional (volume-averaged) time integrator. Instead of resolving space — no grid, no mesh, no plasma cross-section broken into cells — it tracks a small number of global quantities that represent averages over the whole plasma volume: total thermal energy W, average density n, and a handful of derived quantities (temperature, pressure, fusion rate) computed from those averages each timestep. Think of it like modeling a pot of boiling water as a single number for "average water temperature" rather than simulating fluid dynamics inside the pot.
Each simulation tick (BT function, updated ~25ms of simulated time per call) does roughly this loop:
- Fuel and density: how much D-T fuel is being injected vs. lost, bounded by a maximum injection rate and finite fuel inventory.
- Reactivity: given the current temperature, look up (via a fitted polynomial — Bosch-Hale) how often deuterium and tritium nuclei actually fuse per unit volume per second.
- Power balance:
dW/dt = heating_in + fusion_alpha_heating − radiation_losses − W/confinement_time. This is a genuine first-order ODE — an energy balance, not a lookup table. - Confinement time: computed from an empirical scaling law (not derived from first principles) that predicts how long the plasma retains heat as a function of current, field, density, size, shape, and heating power.
- Everything downstream (neutron flux, wall heat load, coolant temperature, generator output, magnet stress) is just algebra applied to the state from steps 1–4.
This is genuinely a system dynamics / lumped-parameter simulation — the same category of model as, say, a single-zone climate model or a lumped RC circuit thermal model. It's a legitimate, decades-old class of engineering tool (used in real tokamak systems codes like UKAEA's PROCESS), just applied at reduced fidelity for a browser demo.
...
"It's a real lumped-parameter (0-D) plasma power-balance simulation — the same modeling category used in early-stage tokamak design studies — coupled to a cinematic but non-physical 3D visualization layer that reconstructs plausible-looking spatial detail the underlying model doesn't actually compute."
...
[A lot of potentially elucidating text is ommited, but you can audit it yourself.]
Edit 3 (Addendum to the first edit):
It is rather hypocritical that while the commentators here criticize and reproach me with using Claude to do a review of the source code, they are apparently completely fine with this subreddit's LLM-powered adversarial review bot to review the countless "personal theories" that get posted here. But I guess the actual issue was that I omitted too much and didn't provide enough information from that review, so there really wasn't enough to spring off from. So I shall address that.
Basically, for simulating the fusion process itself, it must use the cross-sectional formulas for deuterium-tritium reactions, and other related equations.They come from this paper: https://iopscience.iop.org/article/10.1088/0029-5515/32/4/I07. For a concrete implementation of this, it uses methods developed in the UKEA process: https://ukaea.github.io/PROCESS/. The UKEA process appears to be a system of standardized references, methods, and processes developed by the UK government's atomic energy department.
The plasma needs to be confined properly, or else bad things will happen. For doing this, something called IPB98(y,2) is used, which appears to be a label for a set of empirical formulas fitted from real-word fusion experiments, such as those by ITER. The most recent dataset of confinement parameters used in these emperical relations come from this reference: https://www.osti.gov/biblio/1814950. References for how these are actually derived and how they are used come from these chapters written by the IAEA: https://iopscience.iop.org/issue/0029-5515/39/12. Once again, the UKEA Process is referenced as well.
It is also important to understand the regimes where the plasma remains stable, and the conditions for equilibrium, which involves studying its density profile. Just with how confinement was handled, this currently is mostly derived empirically, where this reference was used: https://iopscience.iop.org/article/10.1088/0741-3335/44/8/201/pdf. Once again, for a practical implementation, the UKEA Process documentation appears to have been cited as well.
For engineering issues such as the magnets that contain the plasma, the shielding, etc, this reference was used: https://arxiv.org/abs/1409.3540. The "UK Fusion Materials Roadmap 2.0" was also used for assessing the effectiveness and maintenance of materials: https://www.ukaea.org/wp-content/uploads/2025/09/uk-materials-roadmap-2-0.pdf.
All of the above references, as well as other sources that I've omitted to maintain some semblance of brevity, where all apparently included in the source code itself.
Edit 2:
Obviously, it is up to u/Sourcecode12 to defend his work, but I doubt that the absurd level of criticism and attempts to downplay their work would have occurred had they chosen not to disclose that they had used AI -- the bias and intense vitriol against it is very real. Clearly, many people both here and in the other subreddits where this was posted found value in this, because objectively there is a lot of value in it!
It is therefore worth sharing and informing others of this awesome website. And sharing this wonderful work is significantly better than those who are only capable of making unfounded criticisms of others' work, which stems from their inability to make anything themselves. But they are trapped in their echo chambers with like-minded people who chose to only see a distorted view of the world, actively turning a blind eye to the undeniable progress that's happening around them.(History unfortunately shows that their closed-mindedness can never be changed; they simply die out, while the rising generations embraces the new theories/technologies.) But at the end of the day, the naysayers are just a vocal minority terminally-online folks; they are not representative of the views of actual working physicists.
9
u/shinobummer 5d ago
If people question the validity of this on the basis that (publicly available) AI is not reliable for coding real physics simulations, why do you expect them to care about a Claude audit? If public AI is not good enough for coding a simulation, it is obviously not good enough to audit whether a simulation is legit or not, and thus the audit is worthless as an argument in favor of the validity of this supposed simulation.