HeadlinesBriefing favicon HeadlinesBriefing.com

Chemical Engineer Builds 9K-Line Refinery Simulator with LLMs

Hacker News •
×

A chemical engineer in Texas has built a browser-based refinery simulator using vanilla JavaScript to explain downstream operations to non-industry audiences, including his own children. The 5-minute educational game walks users through the entire petroleum refining process from crude extraction to final product delivery. Built without frameworks, the 9,000-line single-page application uses Matter.js for 2D physics minigames.

Developed as a non-software engineer, the creator relied heavily on AI coding assistants like Claude, Copilot, and Gemini to write the code. The project evolved from a simple concept into a comprehensive simulation covering electrostatic desalting, fractional distillation, hydrotreating, catalytic cracking, and gasoline blending with specific octane and RVP specifications. The developer encountered significant technical challenges managing large codebases with LLMs, implementing responsive physics boundaries, handling mobile browser events, and preventing memory leaks without React's state management.

The free, ad-free game runs entirely client-side and aims to make complex chemical engineering concepts accessible without oversimplifying the science. The developer welcomes feedback on both the educational mechanics and technical implementation, offering to answer questions about the chemical engineering aspects. The project demonstrates how domain experts can leverage AI tools to create specialized educational content despite limited programming experience.