{"id":51553023,"url":"https://github.com/ayman3000/reactor-simulator","last_synced_at":"2026-07-10T01:30:40.774Z","repository":{"id":370314696,"uuid":"1294193457","full_name":"ayman3000/reactor-simulator","owner":"ayman3000","description":"Educational PWR nuclear reactor simulator (Lamarsh PWR-1000) — point-kinetics physics with 6 delayed-neutron groups, live control room UI, in plain HTML/CSS/JS. No dependencies.","archived":false,"fork":false,"pushed_at":"2026-07-08T20:33:09.000Z","size":377,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-07-08T22:12:43.283Z","etag":null,"topics":["educational","html5","javascript","no-dependencies","nuclear-physics","nuclear-reactor","physics","point-kinetics","pwr","reactor-simulator","simulation","web-audio-api"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ayman3000.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-07-08T20:25:28.000Z","updated_at":"2026-07-08T20:33:36.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/ayman3000/reactor-simulator","commit_stats":null,"previous_names":["ayman3000/reactor-simulator"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/ayman3000/reactor-simulator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ayman3000%2Freactor-simulator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ayman3000%2Freactor-simulator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ayman3000%2Freactor-simulator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ayman3000%2Freactor-simulator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ayman3000","download_url":"https://codeload.github.com/ayman3000/reactor-simulator/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ayman3000%2Freactor-simulator/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35317805,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-09T02:00:07.329Z","response_time":57,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["educational","html5","javascript","no-dependencies","nuclear-physics","nuclear-reactor","physics","point-kinetics","pwr","reactor-simulator","simulation","web-audio-api"],"created_at":"2026-07-10T01:30:40.050Z","updated_at":"2026-07-10T01:30:40.761Z","avatar_url":"https://github.com/ayman3000.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Lamarsh PWR-1000 — Nuclear Reactor Simulator\n\nAn educational pressurized-water-reactor simulator in plain HTML/CSS/JavaScript,\nbuilt around the reactor theory in **John R. Lamarsh, *Introduction to Nuclear\nReactor Theory***. No dependencies, no build step.\n\n**▶️ [Try the live demo](https://ayman3000.github.io/reactor-simulator/)**\n\n![Lamarsh PWR-1000 simulator screenshot](docs/screenshot.png)\n\n\u003e ⚠️ Educational use only. Parameters are representative, lumped, and tuned for\n\u003e teaching — this is not a licensing-grade plant model.\n\n## Run it\n\nOpen the [live demo](https://ayman3000.github.io/reactor-simulator/), or run it\nlocally by double-clicking `index.html` (or serving the folder with any static\nserver).\n\n## Operating the reactor\n\n- **Control rod slider** sets the bank's insertion *target* (0 % = fully\n  withdrawn, 100 % = fully inserted). Rods drive at 5 %/s, so the actual\n  position (shown in the bars and the schematic) lags the target.\n- **▲ OUT / ▼ IN** step the target by 1 %.\n- **SCRAM** drops the whole bank in ~2 s. After a SCRAM only **RESET**\n  restores control.\n- **RESET** returns the plant to its critical, 100 %-power reference state.\n- **🔊 / 🔇** toggles the alarm sounds — a slow beep in WARNING, a two-tone\n  klaxon in DANGEROUS, a continuous siren during meltdown (all synthesized\n  with the Web Audio API; no audio files). Browsers block sound until your\n  first click or keypress, after which alarms arm automatically.\n\n### Things to try\n\n| Action | What happens | Why |\n|---|---|---|\n| Withdraw to ~43 % | Power settles slightly above 100 % | Negative Doppler + moderator feedback compensate the added reactivity |\n| Withdraw to ~38 % | Power stabilizes near 160 % — DANGEROUS | Feedback still wins, but margins are gone |\n| Withdraw below ~33 % | Coolant passes ~345 °C → boiling crisis (DNB) → fuel runs away → **MELTDOWN** | Film boiling collapses fuel→coolant heat transfer, and the damage is irreversible |\n| Withdraw to 0 % | Prompt-critical excursion; core melts in seconds | Inserted reactivity exceeds β = 650 pcm — the reactor is critical on prompt neutrons alone |\n| SCRAM from any pre-melt state | Power collapses to a few % | −9000 pcm bank worth ≫ excess reactivity |\n\n## The model (Lamarsh)\n\n**Point-reactor kinetics, six delayed-neutron groups** (U-235, Keepin data;\nβ = 0.006502, Λ = 10⁻⁴ s), integrated semi-implicitly at 5 ms substeps:\n\n```\ndn/dt  = ((ρ − β)/Λ)·n + Σ λᵢcᵢ\ndcᵢ/dt = (βᵢ/Λ)·n − λᵢcᵢ\n```\n\n**Reactivity balance** (pcm): ρ = ρ_rods + ρ_Doppler + ρ_moderator\n\n- Rod bank integral worth follows the classic S-curve\n  `W(x) = W_tot·(x − sin 2πx / 2π)` with W_tot = −9000 pcm; the core is exactly\n  critical with the bank 45 % inserted at reference temperatures.\n- Doppler: −2.7 pcm/°C of fuel temperature (defect capped at −3000 pcm — it\n  saturates at high fuel temperature).\n- Moderator: −8 pcm/°C of coolant temperature.\n\n**Six-factor formula**, displayed live and kept exactly consistent with ρ:\n\n```\nk_eff = 1/(1 − ρ) = ε · p · f · η · P_f · P_t\nf = Σa(fuel) / [Σa(fuel) + Σa(moderator) + Σa(rods)]\n```\n\nwith ε = 1.02, p = 0.87, η = 2.06, P_f = P_t = 0.983, Σa(fuel) = 0.100 cm⁻¹,\nΣa(moderator) = 0.060 cm⁻¹. Moving the rods changes Σa(rods), hence f, hence\nk — the \"absorption coefficient\" readouts on the panel.\n\n**Thermal-hydraulics** — two lumped nodes (3000 MWt nominal):\n\n```\nC_f·dT_f/dt = P − UA·(T_f − T_c)          C_f = 3.0×10⁷ J/K\nC_c·dT_c/dt = UA·(T_f − T_c) − H·(T_c − T_sg)   C_c = 1.65×10⁹ J/K\n```\n\nHot/cold legs split ±18 °C around T_c at full power; pressure tracks coolant\ntemperature around 155 bar.\n\n**DNB / boiling crisis:** above 345 °C coolant, the fuel→coolant conductance\ndegrades linearly to 15 % by 352 °C and *latches* (cladding damage is\nirreversible until RESET). **Meltdown** latches when fuel reaches UO₂ melting\n(2865 °C) — after that, not even a SCRAM helps.\n\n## Safety states\n\n| State | Condition |\n|---|---|\n| 🟢 SAFE | power ≤ 100.5 %, T_fuel \u003c 1600 °C, T_cool \u003c 335 °C |\n| 🟡 WARNING | power \u003e 100.5 % or T_fuel \u003e 1600 °C or T_cool \u003e 335 °C |\n| 🔴 DANGEROUS | power \u003e 112 % or T_fuel \u003e 2200 °C or T_cool \u003e 345 °C |\n| ☢️ MELTING DOWN!! | T_fuel ≥ 2865 °C (latched — RESET only) |\n\n## Files\n\n| File | Responsibility |\n|---|---|\n| `index.html` | Page structure + SVG plant schematic |\n| `style.css` | Control-room theme, alarm states, animations |\n| `physics.js` | Pure simulation engine (no DOM) — also loadable in Node |\n| `ui.js` | Renders a state snapshot to the DOM/SVG each frame |\n| `audio.js` | Synthesized warning/danger/meltdown alarm sounds (Web Audio) |\n| `main.js` | Controls wiring + requestAnimationFrame loop |\n| `test/physics.test.js` | Headless sanity tests: `node test/physics.test.js` |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fayman3000%2Freactor-simulator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fayman3000%2Freactor-simulator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fayman3000%2Freactor-simulator/lists"}