Menu

Asymmetries-in-coalescence

Asymmetries in coalescence: size asymmetry. Still axially symmetric.

Basilisk (Required)

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-13 --hard

Subsequent 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-13

Note: Replace v2026-01-13 with the latest release tag.

Repository Structure

Simulation Files

This project contains two simulation files:

coalescenceBubble.c (Primary)

The main simulation file used for all production runs. Outputs: - i dt t ke Xc Vcm (6 columns)

coalescenceBubble-tag.c (Optional)

An extended version with interface tagging for detailed shape tracking. Uses tag.h to identify and track only the largest connected bubble region (filters out satellite droplets). Outputs additional geometric measurements: - i dt t ke Xc Vcm Re ZNp ZSp (9 columns) - Re: Equatorial radius at center of mass - ZNp: North pole position (positive x on axis) - ZSp: South pole position (negative x on axis)

Note: All cases in this project are run with coalescenceBubble.c. The -tag.c variant is provided as an optional alternative for cases requiring detailed shape tracking.

Why coalescenceBubble.c (not coalescenceBubble-tag.c)

The running scripts use coalescenceBubble.c because:

  1. distance.h is incompatible with MPI - The distance.h header (used for computing initial conditions from shape files) cannot be compiled with -D_MPI=1
  2. OpenMP is compatible - distance.h works fine with OpenMP (-fopenmp)
  3. Two-stage execution - We first run briefly with OpenMP to generate the restart file with initial conditions, then run the full simulation with MPI (which restores from the restart file, bypassing distance.h)

The coalescenceBubble-tag.c file additionally uses tag.h for tracking shape metrics, which adds complexity not needed for basic coalescence studies.

Single Case

# Serial execution (both stages: OpenMP for restart, then serial)
./runSimulation.sh default.params
# MPI execution (Stage 1: OpenMP, Stage 2: MPI)
./runSimulation.sh --mpi --cores 8 default.params
# Compile only (check for errors)
./runSimulation.sh --compile-only default.params

Parameter Sweep

# Dry run (see parameter combinations)
./runParameterSweep.sh --dry-run
# Run all combinations (serial)
./runParameterSweep.sh sweep.params
# Run with MPI (8 cores per case)
./runParameterSweep.sh --mpi --cores 8 sweep.params

HPC (Snellius)

# Submit parameter sweep to SLURM
sbatch runSweepSnellius.sbatch

Post-Processing

# Process multiple cases with default settings
./runPostProcess-Ncases.sh 3000 3001 3002
# Process a range of cases
./runPostProcess-Ncases.sh 3000-3010
# Process with 8 CPUs and custom snapshot count
./runPostProcess-Ncases.sh --CPUs 8 --nGFS 100 3000
# Skip video encoding (only generate frames)
./runPostProcess-Ncases.sh --skip-video-encode 3000
# Dry run to preview commands
./runPostProcess-Ncases.sh --dry-run 3000

C Helper Tools (must be compiled before running):

qcc -O2 -Wall -disable-dimensions postProcess/getFacet.c -o postProcess/getFacet -lm
qcc -O2 -Wall -disable-dimensions postProcess/getData-generic.c -o postProcess/getData-generic -lm
qcc -O2 -Wall -disable-dimensions postProcess/getCOM.c -o postProcess/getCOM -lm
  • getFacet: Extracts interface facets using PLIC reconstruction
  • getData-generic: Samples velocity/strain-rate fields on structured grids
  • getCOM: Computes center of mass position and velocity

Output locations: - simulationCases/<CaseNo>/Video/ - PNG frames - simulationCases/<CaseNo>/<CaseNo>_COMData.csv - COM time series - simulationCases/<CaseNo>/<CaseNo>.mp4 - Encoded video

Command Line Parameters

The simulation takes 6 arguments: OhOut RhoIn Rr MAXlevel tmax zWall - OhOut: Ohnesorge number for outer fluid, based on the small-bubble radius R_s (e.g., 1e-2) - RhoIn: Density ratio inner/outer (e.g., 1e-3) - Rr: Radius ratio R_l/R_s with R_s = 1 and R_l = Rr; available values: 1.00, 1.50, 2.00, 4.00, 8.00 (matching DataFiles) - MAXlevel: Maximum refinement level (e.g., 10) - tmax: Maximum simulation time (e.g., 40.0) - zWall: Wall position (e.g., 0.01)

Running Manually (Legacy)

There are two ways to run the codes:

  1. Using the vanilla basilisk method:
cd simulationCases
qcc -I../src-local -O2 -Wall -disable-dimensions coalescenceBubble.c -o coalescenceBubble -lm
./coalescenceBubble 1e-2 1e-3 1.00 12 1.5 0.05
  1. Using the makefile (can be interactively run using bview browser):
cd simulationCases
CFLAGS=-DDISPLAY=-1 make coalescenceBubble.tst

Check the localhost on coalescenceBubble/display.html. something like: https://basilisk.fr/three.js/editor/index.html?ws://localhost:7100 and run interactively.

To run using openMP, please use the flag -fopenmp

cd simulationCases
qcc -I../src-local -O2 -Wall -disable-dimensions coalescenceBubble.c -o coalescenceBubble -lm -fopenmp
export OMP_NUM_THREADS=8
./coalescenceBubble 1e-2 1e-3 1.00 12 1.5 0.05

Note: The code will not directly work with openmpi (with -D_MPI flag and mpirun). To do that, please follow the procedure we use:

  1. Run the following for a few timesteps (stop using tmax=1e-2 or so)
cd simulationCases
qcc -I../src-local -O2 -Wall -disable-dimensions coalescenceBubble.c -o coalescenceBubble -lm -fopenmp
export OMP_NUM_THREADS=8
./coalescenceBubble 1e-2 1e-3 1.00 12 1e-2 0.05

This will generate a “restart” file

  1. Do not delete the restart file. Now you can use mpirun, like:
cd simulationCases
CC99='mpicc -std=c99' qcc -I../src-local -Wall -O2 -D_MPI=1 -disable-dimensions coalescenceBubble.c -o coalescenceBubble -lm
mpirun -np 8 ./coalescenceBubble 1e-2 1e-3 1.00 12 1.5 0.05

Generated Documentation

Root Directory

postProcess

simulationCases

src-local