Simulating Dogfish Shark Swimming Dynamics Using Julia and WaterLily.jl
This technical article demonstrates how to simulate the swimming motion of a dogfish shark using the Julia programming language and the WaterLily.jl library. The model is based on Lighthill’s pioneering research on slender fish swimming, which idealizes the shark's shape as a thickness distribution around a central backbone and its motion as a lateral traveling wave. The author defines the shark's physical characteristics by fitting splines to thickness data derived from reference images and establishes an amplitude envelope for the wave motion based on observational video data. A key feature of the simulation is the use of an immersed boundary method combined with automatic differentiation, allowing the body to be embedded into the fluid flow without complex meshing. Instead, the simulation relies on a signed distance function (SDF) to define the shark's surface geometry and position dynamically. This approach provides insights into hydrodynamic interactions across various swimming animals. The post serves as a tutorial, adapting code from a Pluto notebook to illustrate how computational tools can model biological locomotion effectively, highlighting the versatility of Julia in scientific computing and fluid dynamics simulations.
Wire timeline
Simulating Dogfish Shark Swimming Dynamics Using Julia and WaterLily.jl
This technical article demonstrates how to simulate the swimming motion of a dogfish shark using the Julia programming language and the WaterLily.jl library. The model is based on Lighthill’s pioneering research on slender fish swimming, which idealizes the shark's shape as a thickness distribution around a central backbone and its motion as a lateral traveling wave. The author defines the shark's physical characteristics by fitting splines to thickness data derived from reference images and establishes an amplitude envelope for the wave motion based on observational video data. A key feature of the simulation is the use of an immersed boundary method combined with automatic differentiation, allowing the body to be embedded into the fluid flow without complex meshing. Instead, the simulation relies on a signed distance function (SDF) to define the shark's surface geometry and position dynamically. This approach provides insights into hydrodynamic interactions across various swimming animals. The post serves as a tutorial, adapting code from a Pluto notebook to illustrate how computational tools can model biological locomotion effectively, highlighting the versatility of Julia in scientific computing and fluid dynamics simulations.
JuliaLang - The Julia programming language