[HN Gopher] Show HN: Interactive real-time chemistry and fluids:...
       ___________________________________________________________________
        
       Show HN: Interactive real-time chemistry and fluids: water
       electrolysis
        
       Author : pkarnakov
       Score  : 93 points
       Date   : 2021-02-26 08:42 UTC (14 hours ago)
        
 (HTM) web link (cselab.github.io)
 (TXT) w3m dump (cselab.github.io)
        
       | dbsmith83 wrote:
       | This reminds me a lot of a lava lamp
        
       | mrguyorama wrote:
       | Why 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 wrote:
         | The application itself is easy to parallelize. And the
         | production version does run in parallel
         | (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.
        
       | argvargc wrote:
       | Every 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.
        
       | s-macke wrote:
       | Two-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 wrote:
         | Thank you!
        
       | HPsquared wrote:
       | This 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 wrote:
         | Yes, I don't see why not. The model would not need electric
         | current, and the concentration of dissolved gas would be
         | replaced with temperature.
        
       | pkarnakov wrote:
       | May 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 wrote:
         | I 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 wrote:
           | Initially, 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 wrote:
             | Thank 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!
        
       ___________________________________________________________________
       (page generated 2021-02-26 23:02 UTC)