5 ms·
Show HN: Interactive real-time chemistry and fluids: water electrolysis
- pkarnakov 6y agoMay remind somebody of their school chemistry class. But this one includes more things: fluid flow, electric current, diffusion, and nucleation of bubbles. Reduced from a scientific code to run directly in your web browser.
- mushishi 6y agoI am too uninformed to understand what is happening. But I like in principle this kinds of thing -- and that must have been some work to get working, so kudos! Could you provide a short introduction what that does? Wikipedia says that "Electrolysis of water is the process of using electricity to decompose water into oxygen and hydrogen gas" but what I see there seems to be the reverse: merging hydrogen and oxygen gas. Sorry, I was too afraid of chemistry back in school and now I'm paying for it.
- pkarnakov 6y agoInitially, the container is filled with water (shown with white) and a layer of gas above (green). The reaction generates dissolved gases (red) on the electrodes. As soon as the concentration of dissolved gas reaches a critical value, it is converted into bubbles (green) that rise and merge with the existing layer of gas.
- mushishi 6y agoThank you! I try to understand further: So there is two columns not connected to each other, so doesn't seem it is a circuit. But wait a minute, water conducts... So: The left one is negatively charged, and it gives electrons to H20 which receives them and reacts by being converted to H2 gas and 2hydroxide. The right column is positively charged and the 2hydroxide travels (diffuses?) through water as it is negatively charged, and statistically is more likely to go right because positive column attracts it? (I mean the electrical energy travels as waves but the actual molecules also, just slower?) When 2hydroxide reaches the right end, it breaks into 1) electrons that the column receives happily 2) H20 3) O2 gas. Something like that, perhaps. Interesting but frustrating to not get it fully. No need to answer if don't feel like it!
- s-macke 6y agoTwo-phase fluid flow with surface tension in the web. Fantastic! I tried it myself, but my simulations most of the time exploded .... I mean diverged. Keep up the good work! Presenting the research is a must and thanks to cross compilers and WebAssembly it was never so easy to even demonstrate your simulation code.
- pkarnakov 6y agoThank you!
- HPsquared 6y agoThis is fantastic. It even shows something analogous to the change between nucleate boiling and film boiling. EDIT: Could this be adapted to a heat transfer simulation of boiling?
- pkarnakov 6y agoYes, I don't see why not. The model would not need electric current, and the concentration of dissolved gas would be replaced with temperature.
- dbsmith83 6y agoThis reminds me a lot of a lava lamp
- argvargc 6y agoEvery setting on maximum and it becomes a kind of slow-moving horror movie. Every setting on minimum, except mesh set to 128 - and it's a kind of poor-mans MS Paint. After preparing a nice image, set gravity to max and watch the splendor.
- mrguyorama 6y agoWhy can this only use 13% of my ryzen 3600 processor? I thought the whole point of WASM was that it enabled high performance browser based stuff? Is this application really hard to parallelize?
- pkarnakov 6y agoThe application itself is easy to parallelize. And the production version does run in parallel (https://github.com/cselab/aphros https://github.com/cselab/aphros) but relies on OpenMP and MPI. My first attempt to get C++11 threads running through WASM was not successful. Apparently, this feature is also disabled by default in some browsers because of the Spectre vulnerability.