I recently made an online demo of the 2D Navier-Stokes equation running in a web-browser.
My kids like to play with it to build dams and other obstacles in the flow which you can do via the mouse
I took some notes here to get the WASM part to work:
Thats a pretty slick demo! Good to see how much you can do already in WASM.
Now if we can somehow integrate this with WGLMakie.jl…
Yes that would be awesome! But that won’t be for tomorrow… Currently only elementary math operations work. Named tuples worked too because they could be optimised-out after in-lining all function calls.
What is CPUCompiler? or do you mean GPUCompiler.jl?
yes, indeed. I corrected the typo. Thanks!
(ironically, nothing runs on the GPU actually).
Here is another example of the shallow water equations (for example long waves on the surface of the ocean, like tides)
That is interesting. Do you know what sort of fakery is involved in transferring the field to the new domain after a hole had been made?
When you make a hole, the corresponding grid cells are set to zero velocity and zero surface elevation which creates these kind of shock waves that you are seeing to adjust the flow field.
I was dreaming of some Julia/WASM project like that. Thanks you so much for sharing, I will study your code in detail now (I hope I can use a similar strategy for my projects too.)
I was about to go to sleep Now I cannot sleep.
Yes these waves look a bit hypnotic sometimes