This repository contains code for simulating the dynamics of an elastic spherical impactor falling onto a viscous liquid film. The simulation is implemented in 2D+axi (axisymmetric) configuration using the Basilisk framework.
The simulation models a viscoelastic scalar implementation of a spherical impactor falling onto a viscous liquid film. The physics includes:
- Two-phase flow with surface tension
- Viscoelastic effects
- Axisymmetric geometry
- Fluid-structure interaction
testCases/sphereFilm_catch.c
: Main simulation file implementing the physicstestCases/VideoAxi.py
: Post-processing script for visualizationsrc-local/log-conform-viscoelastic-scalar-2D.h
: Viscoelastic solver implementationsrc-local/two-phase-TF-VE.h
: Two-phase flow implementation
We
: Weber number (ratio of inertial to surface tension forces)Ohd
: Ohnesorge number for the droplet (ratio of viscous to inertial and surface tension forces)Ec
: Elastic parameterDe
: Deborah number (ratio of relaxation time to observation time)Ohf
: Ohnesorge number for the filmhf
: Film thicknessBo
: Bond number (ratio of gravitational to surface tension forces)
- Grid: Adaptive mesh refinement with levels from
MINlevel
(4) toMAXlevel
(10) - Time integration: Centered Navier-Stokes solver
- Interface tracking: Volume-of-Fluid method with tension
- Error tolerances:
- Fraction error: 1e-3
- Velocity error: 1e-3
- Kinetic energy error: 1e-3
- Area error: 1e-3
The code requires the Basilisk framework. Compile using:
qcc -Wall -O2 -o sphereFilm_catch sphereFilm_catch.c -lm
Execute the compiled binary with appropriate parameters:
./sphereFilm_catch [parameters]
Use the VideoAxi.py
script for visualization:
python VideoAxi.py [options]
A Python script for creating visualizations of the simulation results. Features:
- Custom color mapping for different phases
- Facet extraction for interface visualization
- Field data extraction and plotting
- Multi-processing capabilities for faster rendering
- Basilisk framework
- Python libraries:
- NumPy
- Matplotlib
- Subprocess
- Multiprocessing
- Argparse
Vatsal Sanjay ([email protected]) Physics of Fluids
- Version 1.0 (December 5, 2024): Initial release