Mathematical model and direct numerical simulation code infrastructure for drop impact onto deep liquid pools, supporting collaborative work with Dr. Kat Phillips and Prof. Paul Milewski.
The present code base complements the manuscript published open-access in the Proceedings of the Royal Society A, as well as the preprint available at arXiv:2406.16750. It consists of two parts:
which are compared as part of this body of work.
- The code relies on Basilisk to model the Navier-Stokes equations. See the installation page for instructions.
- Full visualisation capabilities have been used in order to generate animations. These may be switched off depending on the local architecture.
- The two-phase non-coalescing fluid volume implementation by V. Sanjay available here has been successfully employed in this study to limit numerical artifacts during contact time.
Once the Basilisk structure is in place, the driver code here is built either as stand-alone test to be run via run_test.sh in which a single run can be customised, or as a loop over variables of interest (in this case drop radius
Other parameters can be varied through this shell script, with both physical and computational handles provided.
The code is separated into four files
- main.m is the main wrapper for the simulation. Once parameters have been set, run this file. The system is written as an ODE, and the code utilises function ode45 to evolve.
- SpatialData.m contains the initial conditions, and the physical and numerical parameters. Alter this file to customise the run.
- Func.m and PressureSolve.m are functions implemented by main.m. The code will save values of interest to a .mat file upon completion. Saving partway through the simulation is not possible. The simulation has a built in stop criteria when the droplet reaches sufficient 'exit' distance post-impact. When altering parameters, ensure the run-time is long enough to see the computation to completion.
The Faraday Droplets folder contains the same code, alterned now to include an oscillatory gravity term, and the removal of the stopping criterion, to permit repeated bounces.