SASEL Lab
SASEL Lab
SASEL Lab
A physics-based engine for coupled heating, boiling and material response on the GPU, demonstrated on household cooking and nutrient retention.

BoilingSim is a physics-based boiling engine. It solves, on a graphics processing unit, the problem of what happens when heat is driven through a solid vessel into a liquid until that liquid boils: how the heat spreads, how the fluid circulates, when and where bubbles form, and what that thermal history does to anything suspended in the liquid or immersed in it.
The engine treats heating, boiling and material response as one coupled system advanced on a single time step. Heat entering the vessel base conducts through the wall and into the liquid as a conjugate problem, so the solid and the liquid evolve together and the wall temperature emerges from the solve. Once the wall superheat crosses the onset of nucleate boiling, bubbles nucleate, grow, detach and rise as tracked particles. The latent heat each bubble carries away and the buoyancy it imparts return to the grid, reshaping the temperature field that determines where the next bubbles form. The thermal properties of the vessel material set the pace of that loop.
A materials database supplies density, specific heat and thermal conductivity for 304 stainless steel, cast iron, aluminum and copper, alongside temperature-resolved properties for water at saturation. Swapping the vessel material is a one-line change to a scenario file. The engine has been validated across a 25-fold span in thermal conductivity, from steel at 16 W/m·K to copper at 401 W/m·K, and it reproduces a result the physics demands: bubble departure diameter comes out material-independent at 2.93 mm, because departure is governed by contact angle, surface tension and density difference, all of which are properties of the fluid. The metal on the far side of the wall governs how quickly the wall reaches temperature, and the bubbles respond to the wall alone.
The reference case that exercises the engine end to end is a carrot boiling in a pot on a stove. It engages every part of the physics at once, and published retention data exist to test the result against. Inside the carrot, represented as a tetrahedral mesh, nutrient loss follows reaction, diffusion and leaching together: Arrhenius kinetics degrade the nutrient at the local temperature, diffusion redistributes it through the tissue, a Sherwood correlation carries it across the surface into the water, and a conservative advection scheme transports it with the flow the fluid solver is already computing.
Every molecule stays accounted for in one of four buckets, retained, leached, degraded or precipitated, and the four sum to 100.00 percent at every output step. Beta-carotene, which is effectively insoluble in water, leaves almost entirely through thermal degradation. Vitamin C, which dissolves readily, gives up about a fifth of its mass to the water. The engine produces both behaviours from the same equations under different material parameters, and tracks the two solutes concurrently through a single thermal and fluid field.
Nutrient loss depends on the temperature each part of the food actually experiences and on how vigorously the liquid around it moves. BoilingSim resolves both: the spatial temperature field, and the bubble dynamics that drive it. Retention therefore follows from first principles, and the prediction extends to conditions where experimental data have yet to be collected.
The solver generalises well beyond cooking. The same coupled engine applies wherever heat, flow, phase change and a chemical or biological change interact: blanching, pasteurization, sterilization, fermentation, drying and industrial vessel design. Cooking serves as the demonstration because it is the most demanding case available with public data to check against.
BoilingSim runs as a live interactive session hosted by the lab. On request we provision the full stack, solver, streaming server and dashboard, on a cloud GPU and share a session URL for a limited window. During that window you drive the simulation from the browser: raise or lower the stove heat flux, swap the pot between stainless steel, aluminum and copper, resize the carrot, switch the tracked nutrient, and watch the 3D scene and the instrumentation respond while the run continues.
To arrange a demonstration, contact Dr. Ebenezer Miezah Kwofie at ebenezer.kwofie@mcgill.ca.
BoilingSim was developed by Etornam Celestine Tsyawo and Emmanuel Amankrah Kwofie at the SASEL Lab, McGill University, under the direction of Dr. Ebenezer Miezah Kwofie. Manuscripts covering the heat transfer model, the nutrient retention coupling, and the software itself are in preparation. The code is held under an all-rights-reserved licence as a lab research asset.
Liquid motion follows the Navier-Stokes equations under the Boussinesq approximation on a staggered marker-and-cell grid, using semi-Lagrangian advection, an implicit diffusion step and a pressure projection that enforces incompressibility. Heat is solved as a conjugate problem across the solid-liquid boundary, so the vessel wall and the liquid form one thermal system. An evaporative enthalpy sink at the free surface allows vapour to leave the domain, which pins the bulk liquid near saturation the way an open pot behaves.
Boiling is resolved bubble by bubble. Once local wall superheat crosses the onset of nucleate boiling, sites nucleate and each bubble travels as a Lagrangian particle through Mikic-Rohsenow growth, Plesset-Zwick condensation, Fritz departure and terminal-slip rise. The latent heat each bubble absorbs returns to the grid as an energy sink and its buoyancy as a momentum source, both by trilinear scatter, closing the loop between the bubble field and the temperature and velocity fields that produced it.
Nutrient loss combines reaction, diffusion and leaching. Arrhenius kinetics act on the solute inside the immersed body and, separately, on whatever has already dissolved into the liquid. Diffusion redistributes solute within the tissue under a zero-flux surface condition. A Sherwood correlation sets the surface mass-transfer rate, sampled against the free-stream velocity a few cells off the surface so the correlation sees the flow that actually drives it. A conservative finite-volume upwind scheme then advects the dissolved solute with the velocity field. A solubility cap holds the liquid at or below saturation, and any mass the cap clips is routed to an explicit precipitation bucket, which keeps the accounting closed.
A partition coefficient controls how strongly the solute prefers the tissue over the liquid, and it is the single parameter that separates a fat-soluble pigment from a water-soluble vitamin. Two solute slots run concurrently against the same thermal, fluid and bubble field, so a pair of nutrients with opposite transport behaviour can be validated together in a single run.
Boiling is checked against the Rohsenow nucleate boiling correlation across all three pot materials, landing at 0.92 to 1.04 times the correlation at a stove flux of 80 kW/m², inside the 15 to 30 percent scatter that the pool-boiling literature reports for Rohsenow itself. Mean bubble departure diameter of 2.93 mm, drawn from tens of thousands of sampled departure events per run, sits mid-band in the published 1.5 to 4.0 mm range for saturated water at atmospheric pressure. The conjugate heat transfer solver is validated independently of the boiling model by the conductive drop across the pot base, which reads 26.7 K measured against 26.7 K analytic for steel.
Nutrient retention is validated against published cooking experiments. Beta-carotene retention after 600 s in a 25 mm carrot is 88.72 percent against an 84 percent experimental reference, inside the 80 to 90 percent target band, with the predicted curve crossing the reference value within 20 s of the reference cook time. Vitamin C, a much more soluble solute, reaches 65.80 percent against a 64 percent reference in its own 40 to 70 percent band, and loses 21 percent of its mass to the water where beta-carotene loses effectively none. Running both solutes together in one pot reproduces each single-solute result to within 0.28 percentage points.
A physical instrumented boiling station is being assembled in the lab, with multi-channel temperature sensing, Python-based data streaming and storage, and automated control of the heating level on an electric stove, so the engine can be tuned against measurements taken under the same conditions it simulates.
The whole pipeline runs as NVIDIA Warp kernels written in Python and compiled just in time for the GPU, which stays the canonical reference implementation. Where profiling identified the pressure Poisson solve as the dominant cost, a replacement kernel was written by hand in CUDA, using shared-memory tiling and coalesced access, and reached from Python through a Rust extension built with PyO3 and maturin. On an RTX 6000 Ada at 2 mm grid spacing that path cuts pressure projection time by 37.8 percent and end-to-end wall time by 20.8 percent for a steel pot, with similar figures for aluminum and copper.
The discipline around those optimizations is what makes the engine trustworthy. Every accelerated path sits behind an environment flag and a parity test that holds it to the reference implementation, at a relative tolerance of 1e-5 for a single step and better than 1e-4 across a full 200-iteration projection. Three additional scatter kernels and a full per-bubble kernel were ported, validated and benchmarked; they ship switched off by default, because the measurements showed the Python-to-Rust call overhead exceeding the kernel-level saving at realistic bubble counts. A Jacobi-preconditioned conjugate gradient pressure solver was built and proved correct, delivering roughly 4.5 times better divergence reduction than the Jacobi loop at about eight times the cost per projection on this geometry; it ships switched off as well, with the conditions that would make it worthwhile recorded alongside. Publishing the negative results beside the successes tells a reader precisely how far the engine has been checked.
Scenarios are declared in YAML and validated through Pydantic models before they reach the solver, so a run can be reconfigured, reviewed and reproduced entirely at the configuration layer. The test suite stands at 218 passing tests across the Python, Rust and CUDA layers, covering solver parity, conservation of scattered quantities, sign conventions and multi-step integration. A sign-convention gate in that suite caught a real error in the conjugate gradient derivation before it reached a result.
Results stream from the solver over a WebSocket server written in Rust with Tokio and Axum into a React dashboard built on React Three Fiber, which renders the stove, the pot, the liquid, the bubble field and the immersed body in 3D as the run progresses. The link is bidirectional: heat flux, vessel material, body size and the solute being tracked can all be changed from the browser mid-run, and a full scenario can be staged from a configuration page and rebuilt on the fly.
The solver, the streaming server and the dashboard each ship as a Docker image and come up together under Docker Compose on any host with an NVIDIA GPU, behind a GPU precheck that fails loudly and explains itself when passthrough is broken. A RunPod configuration runs the same stack on rented cloud GPUs on demand, and a tunnel path exposes a stable URL from a workstation. Every published benchmark figure carries its exact command, scenario file and expected headline number, so any result on the page can be regenerated on demand.
Tech Stack
Categories