PinchOff provides axisymmetric two-phase VOF simulations of the Rayleigh-Plateau instability and pinch-off dynamics of a liquid cylinder. The code reproduces the universal similarity scalings
Two simulation variants are included:
plateau-basilisk-website.c— inviscid reference case (matches Basilisk tutorial)plateau-viscous.c— viscous extension with finite viscosity ratio
Background references: Popinet (2009), Popinet & Antkowiak (2011)
The solver integrates the axisymmetric incompressible Navier-Stokes equations for two immiscible fluids with surface tension:
The volume fraction field
where
A liquid cylinder of radius
with wavenumber
The interface is tracked with a VOF field, and the mesh is adapted to maintain at least five grid cells across the local cylinder radius, up to maxlevel = 18.
Simulations are nondimensionalized with
| Parameter | Meaning | plateau-viscous | plateau-basilisk-website |
|---|---|---|---|
| Density ratio | 100 | 100 | |
| Viscosity ratio | 100 | 0 (inviscid) | |
| Surface tension | 1 | 1 | |
| Cylinder radius | 0.2 | 0.2 | |
| Wavenumber | |||
| Perturbation amplitude | 0.1 | 0.1 | |
maxlevel |
Max AMR level | 18 | 18 |
PinchOff requires the Basilisk C solver. Install or update to a locked reference:
First-time install (or reinstall):
curl -sL https://raw.githubusercontent.com/comphy-lab/basilisk-C/main/reset_install_basilisk-ref-locked.sh | bash -s -- --ref=v2026-01-29 --hardSubsequent runs (reuses existing basilisk/ if same ref):
curl -sL https://raw.githubusercontent.com/comphy-lab/basilisk-C/main/reset_install_basilisk-ref-locked.sh | bash -s -- --ref=v2026-01-29Note: Replace
v2026-01-29with the latest release tag from comphy-lab/basilisk-C/releases.
Set the BASILISK environment variable to the Basilisk src directory. Keep the Basilisk checkout outside this repository.
Option 1: Local config file (gitignored, repo-specific)
# .project_config
export BASILISK=/path/to/basilisk/srcOption 2: Shell environment (global)
export BASILISK=/path/to/basilisk/src # Add to ~/.bashrc or ~/.zshrcPinchOff/
├── simulationCases/ Simulation entry points
│ ├── plateau-basilisk-website.c
│ ├── plateau-viscous.c
│ ├── runCode.sh Wrapper script (MPI/OpenGL builds)
│ └── Makefile Basilisk Makefile
├── .github/ Website generation and workflows
│ ├── docs/ Generated site output
│ ├── assets/ CSS, JS, fonts for docs
│ └── workflows/ CI/CD for documentation
├── AGENTS.md Agent/build instructions
└── README.md This file
Note: src-local/ and postProcess/ directories are not currently present.
Use the provided shell script for MPI or visualization builds:
cd simulationCases
# MPI run (4 processes)
./runCode.sh plateau-viscous
# Visualization build with OpenGL
./runCode.sh --view plateau-viscous
# Inviscid variant
./runCode.sh plateau-basilisk-websiteRequirements:
.project_configfile in repo root (orBASILISKenvironment variable)qcccompiler in$PATH
Note: The script defaults to a case named plateau (not included). Always specify the case name explicitly.
make -C simulationCases plateau-viscous
./simulationCases/plateau-viscousCaution: If a directory
simulationCases/plateau-viscous/already exists (from a previous run), the Makefile may fail. UserunCode.shor build with a different target name.
qcc -O2 -Wall -disable-dimensions simulationCases/plateau-viscous.c -o plateau-viscous -lm
./plateau-viscousqcc -O2 -Wall -disable-dimensions -fopenmp simulationCases/plateau-viscous.c -o plateau-viscous -lm
export OMP_NUM_THREADS=8
./plateau-viscousCC99='mpicc -std=c99' qcc -Wall -O2 -D_MPI=1 -disable-dimensions \
simulationCases/plateau-viscous.c -o plateau-viscous -lm
mpirun -np 4 ./plateau-viscousqcc -O2 -Wall -disable-dimensions simulationCases/plateau-viscous.c -o plateau-viscous \
-L$BASILISK/gl -lglutils -lfb_tiny -lm
./plateau-viscousParameters are defined as constants in the source files. Edit and recompile to change:
| Parameter | Location | Description | Default |
|---|---|---|---|
maxlevel |
plateau-*.c |
Maximum AMR level | 18 |
R |
plateau-*.c |
Cylinder radius | 0.2 |
k |
plateau-*.c |
Perturbation wavenumber | |
A |
plateau-*.c |
Perturbation amplitude | 0.1 |
rho1, rho2
|
plateau-*.c |
Phase densities | 1, 0.01 |
mu1, mu2
|
plateau-viscous.c |
Phase viscosities | 0.01, 0.0001 |
sigma |
plateau-*.c |
Surface tension | 1 |
tpinch |
plateau-*.c |
Approximate pinch-off time | 0.75626 |
Launch MPI binaries with your cluster scheduler:
# SLURM example
srun -n 16 ./plateau-viscous
# PBS/Torque example
mpirun -np 16 ./plateau-viscousSimulations write the following files in the run directory:
-
log— time series of$(t, r_{\min}, u_{\max})$ written to stderr -
prof-<t>— interface profiles at specific times (fromoutput_facets) -
movie.mp4— interface and mesh animation (when usingview.h)
Example: Capture time series to a log file:
./plateau-viscous 2> logUse the gnuplot fitting scripts embedded in the C file headers to extract similarity exponents from log:
# Define breakup time as the time when axial velocity is maximum
t0="`awk '{ if (NF == 3 && $3 > max) { max = $3; t0 = $1; } } END{ print t0 }' < log`"
# Fit minimum radius scaling
set logscale
fit [1e-7:1e-3] a*x**(2./3.) 'log' u (t0 - $1):2 via a
plot [1e-8:][1./2**18:]'log' u (t0 - $1):2 ps 0.5, a*x**(2./3.)
# Fit maximum velocity scaling
fit [1e-7:1e-3] a*x**(-1./3.) 'log' u (t0 - $1):3 via a
plot [1e-8:]'log' u (t0 - $1):3 ps 0.5, a*x**(-1./3.)The fits should yield exponents
If you use this code, please cite the Basilisk solver and the relevant literature on pinch-off similarity solutions.
@article{PinchOffPaper,
title = {TBD},
author = {TBD},
journal = {TBD},
year = {TBD},
doi = {TBD}
}@software{PinchOff,
title = {PinchOff: Plateau-Rayleigh Pinch-Off in Basilisk},
author = {TBD},
year = {2026},
url = {https://github.com/<org>/<repo>},
note = {Zenodo DOI: TBD}
}- Popinet, S. (2009). "An accurate adaptive solver for surface-tension-driven interfacial flows." J. Comput. Phys., 228(16), 5838–5866. doi:10.1016/j.jcp.2009.04.042
- Popinet, S., & Antkowiak, A. (2011). "Numerical simulation of a viscous liquid pinch-off." Journal TBD. [Reference details TBD]
TBD — Add author names and affiliations.
TBD — No LICENSE file is currently included. Add a LICENSE file to clarify terms of use and redistribution.