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:
Basically, I allocate all arrays in JavaScript and use the array type from StaticTools.jl (MallocArray). GPUCompiler is used to generate the WASM output. Only a small subset of julia can currently be used this way, but enough for fluid simulations. The upside is that the WASM binary is very small and the demo loads quickly.
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.
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.)