WaterLily.jl v1.0 is out! ![]()
WaterLily is a simple and fast fluid simulator written in pure Julia. It solves the unsteady incompressible 2D or 3D Navier-Stokes equations on a Cartesian grid. The pressure Poisson equation is solved with a geometric multigrid method. Solid boundaries are modelled using the Boundary Data Immersion Method.
v1.0 has ported the solver from a serial CPU execution to a backend-agnostic execution including multi-threaded CPU and GPU from different vendors (NVIDIA and AMD tested so far) thanks to KernelAbstractions.jl. Compared to the previous serial version, we have benchmarked up to x182 speed-up on a GPU.
The most impressive fact is that the solver source code remains only around 800 LOC! We implement the @loop macro, which wraps @kernel from KernelAbstraction.jl and produces a kernel for an expression such as @loop <expr> over <I in R>, where I is a CartesianIndex and R is a CartesianIndices range. And just by changing the array type of our Simulation struct from Array to CuArray or ROCArray, we can run in CPU, NVIDIA GPUs, or AMD GPUs, respectively.
All this would not have been possible without CUDA.jl, AMDGPU.jl and KernelAbstractions.jl, so, again, thank you! ![]()
Feel free to ping @weymouth or myself for more info ![]()