This repository contains the custom OpenFOAM solvers, case files, and data used to simulate the impact, coalescence, and mixing of two (or more) droplets composed of the same fluid.
Droplet interactions can occur either in air or on a solid substrate, with wetting behavior modeled using the Kistler contact angle model.
- Impact and coalescence are modeled using a Volume of Fluid approach.
-
Mixing is captured via a modified diffusion equation using an additional scalar field,
$\gamma$ , initialised in the droplet phase. -
Quantitative mixing is evaluated using a custom mixing metric, automatically written to a
postProcessing/directory during simulation.
All solvers and utilities are based on the open-source finite volume framework OpenFOAM 9, which must be installed prior to use.
The droplet impact and mixing process can be characterized by the following key physical parameters:
| Parameter | Symbol | Case File Location |
|---|---|---|
| Impact velocity | system/setFieldsDict | |
| Impacting Droplet radius | system/setFieldsDict | |
| Droplet Viscosity | constant/transportProperties | |
| Droplet Density | constant/transportProperties | |
| Gas Viscosity | constant/transportProperties | |
| Gas Density | constant/transportProperties | |
| Surface Tension | constant/transportProperties | |
| Gravity | constant/g | |
| Receeding Contact Angle | 0/alpha.drop | |
| Equilibrium Contact Angle | 0/alpha.drop | |
| Advancing Contact Angle | 0/alpha.drop | |
| Diffusivity | system/controlDict | |
| Sesile Droplet Volume | system/setFieldsDict | |
| Sessile Droplet Initial Contact Angle | system/setFieldsDict |
Explain how the sessile droplet geometry is set through a psuedo radius etc.
This code is compatible with OpenFOAM 9, available for download here
The repository mirrors the folder structure of a standard OpenFOAM installation, allowing it to be copied directly into your user directory (e.g. $HOME/OpenFOAM/user-9/).
All custom solvers and utilities must be compiled using OpenFOAM’s build system:
wmake
Alternatively, after cloning the repository:
git clone https://github.com/yatin-darbar/Droplet_Mixing.git
cd Droplet_Mixing
wmake -all
To verify successful compilation, navigate to an example case (e.g. examples/case1) and run:
blockMesh
setFields
diffusiveInterFoam
If the solver runs without warnings in the terminal output, the installation is complete.
Mesh generation and field initialization are handled using the provided helper script:
refineSetFields.sh
Note: Ensure the script is executable (chmod +x refineSetFields.sh)
This script:
- Generates the initial simulation mesh
- Sets the droplet geometry and field distributions
It is good practice to maintain a 0.orig directory that stores the pre-processed initial conditions (before refineSetFields.sh is run).
Simulation can be started with the command:
diffusiveInterFoam
In cases where droplets have reached equilibrium and only diffusion needs to be simulated, the momentum equations can be deactivated to reduce computational cost.
Use the staticDiffusiveInterFoam solver to solve only the phase-restricted diffusion equation without the Navier–Stokes terms.
If droplets are stationary, the staticSetFieldsDict file can be used in place of the standard setFieldsDict to initialize a new simulation with:
- Unaltered droplet geometry, and
- A zero velocity field.
This allows the diffusion of the scalar field to evolve independently of flow dynamics.
| Folder | Description |
|---|---|
solvers/ |
Source code for custom solvers |
utilities/ |
Source code for the Kistler model and custom function objects |
examples/ |
Example case files |
data/ |
Data used in associated publications |
figures/ |
Plots and figures from the study |
If you use or build upon this solver, please cite:
@software{YatinDarbar_diffusiveInterFoam_2025,
author = {Yatin Darbar},
title = {Droplet Mixing -- GitHub Repository},
year = {2025},
url = {https://github.com/yatin-darbar/Droplet_Mixing}
}
(This will be updated with the publication citation once available.)