GitPedia

Aphros

Finite volume solver for incompressible multiphase flows with surface tension. Foaming flows in complex geometries.

From cselab·Updated June 25, 2026·View on GitHub·

Finite volume solver for incompressible multiphase flows with surface tension. The project is written primarily in C++, distributed under the MIT License license, first published in 2020. Key topics include: cfd, chemical-engineering, fluid, high-performance-computing, multiphase-flow.

Latest release: v0.1.3
November 8, 2021View Changelog →
<!---DO NOT EDIT THIS FILE. Generated by README.py-->

Aphros

<img src="https://cselab.github.io/aphros/images/foam.png" width=300 align="right">

Finite volume solver for incompressible multiphase flows with surface tension.

Key features:

  • implementation in C++14
  • scalability to thousands of compute nodes
  • fluid solver based on SIMPLE or Bell-Colella-Glaz methods
  • advection with PLIC volume-of-fluid
  • particle method for curvature estimation accurate at low resolutions
    [demo]
    [4]
  • Multi-VOF for scalable coalescence prevention
    [demo]
    [8]
    [11]
<img src="https://cselab.github.io/aphros/images/aphros_tile9.jpg" width=120><img src="https://cselab.github.io/aphros/images/thumb/curv.jpg" height=120><img src="https://cselab.github.io/aphros/images/thumb/hydro.jpg" height=120><img src="https://cselab.github.io/aphros/images/thumb/electrochem.jpg" height=120><img src="https://cselab.github.io/aphros/images/thumb/parser.jpg" height=120>
Gallery wikiCurvatureMulti-VOFElectrochemistryParser

Documentation

Online documentation and PDF generated by doc/sphinx.

Default parameters are listed in deploy/scripts/sim_base.conf.

Requirements

C++14, CMake

Optional dependencies:
MPI,
parallel HDF5,
python3,
python3-numpy

Bundled optional dependencies:
hypre,
overlap,
fpzip

Clone and build

git clone https://github.com/cselab/aphros.git

First, follow deploy/README.md to
prepare environment and install dependencies. Then build with

cd src
make

Code Ocean

The Code Ocean platform hosts the following compute capsule

which builds Aphros in a Linux environment, runs a set of examples, and visualizes the results.

Docker

Instead of building the code in your system, you can build a Docker
container and run a simulation example

docker build github.com/cselab/aphros --tag aphros
cd examples/202_coalescence/standalone
./conf
docker run -v `pwd`:`pwd` -w `pwd` aphros

Minimal build without CMake

Build without dependencies and tests on Unix-like systems
(APHROS_PREFIX is the installation directory, with USE_MPI=1,
USE_HDF=1, USE_OPENCL=1, USE_AVX=1 builds with MPI, parallel
HDF5 library, OpenCL, and AVX extensions):

cd src
../make/bootstrap
make -f Makefile_legacy install APHROS_PREFIX=$HOME/.local USE_MPI=0 USE_HDF=0 USE_OPENCL=0 USE_AVX=0

on Windows using Microsoft C++ toolset (NMAKE, LINK, and CL):

cd src
../make/bootstrap # Requires sh and awk.
nmake /f NMakefile

Videos

Examples of simulations visualized using
ParaView and OSPRay.
Links [conf] lead to the solver configuration.

<img src="https://cselab.github.io/aphros/videos/preview/thumb/coalescence.jpg" height=150><img src="https://cselab.github.io/aphros/videos/preview/thumb/taylor_green.jpg" height=150>
Coalescence of bubbles [conf] [4]Taylor-Green vortex with bubbles [2] [5]
<img src="https://cselab.github.io/aphros/videos/preview/thumb/reactor.jpg" height=150><img src="https://cselab.github.io/aphros/videos/preview/thumb/reactor_full2.jpg" height=150>
Bubble jump-off [1]Electrochemical reactor [conf] [9]
<img src="https://cselab.github.io/aphros/videos/preview/thumb/vortex_bubble.jpg" height=200><img src="https://cselab.github.io/aphros/videos/preview/thumb/plunging_jet.jpg" height=200>
Bubble trapped by vortex ring [5]Plunging jet [2]
<img src="https://cselab.github.io/aphros/videos/preview/thumb/rising_bubbles.jpg" height=150><img src="https://cselab.github.io/aphros/videos/preview/thumb/foaming_waterfall.jpg" height=150>
Clustering of bubbles [conf] [6] [7] [11]Foaming waterfall [conf] [8] [11]
<img src="https://cselab.github.io/aphros/videos/preview/thumb/bidisperse.jpg" height=150><img src="https://cselab.github.io/aphros/videos/preview/thumb/crystal.jpg" height=45>
Bidisperse foam [conf] [11]Microfluidic crystals [conf] [11]
<img src="https://cselab.github.io/aphros/videos/preview/thumb/lammps_polymers.jpg" height=200><img src="https://cselab.github.io/aphros/videos/preview/thumb/korali_pipe.jpg" height=200>
LAMMPS polymers in Taylor-Green vortex [conf]Bubble pipe optimization [10]
<img src="https://cselab.github.io/aphros/videos/preview/thumb/mesh_bubbles.jpg" height=150>
Bubbles through mesh
<img src="https://cselab.github.io/aphros/videos/preview/thumb/breaking_waves.jpg" height=300>
APS Gallery of Fluid Motion 2019 award winner<br> Breaking waves: to foam or not to foam? [6]<br> Collaboration with Jean M. Favre at CSCS.

Developers

Aphros is developed by researchers at ETH Zurich and Harvard University

advised by

Other contributors are: Fabian Wermelinger (Cubism backend)

Publications

  1. Hashemi SMH, Karnakov P, Hadikhani P, Chinello E, Litvinov S, Moser C, Koumoutsakos P, Psaltis D.
    A versatile and membrane-less electrochemical reactor for the electrolysis of water and brine.
    Energy & environmental science. 2019
    10.1039/C9EE00219G
  2. Karnakov P, Wermelinger F, Chatzimanolakis M, Litvinov S, Koumoutsakos P.
    A high performance computing framework for multiphase, turbulent flows on structured grids.
    Proceedings of the platform for advanced scientific computing conference on – PASC ’19. 2019
    10.1145/3324989.3325727
    [pdf]
  3. Karnakov P, Litvinov S, Koumoutsakos P.
    Coalescence and transport of bubbles and drops.
    10th International Conference on Multiphase Flow (ICMF). 2019
    [pdf]
  4. Karnakov P, Litvinov S, and Koumoutsakos P.
    A hybrid particle volume-of-fluid method for curvature estimation in multiphase flows.
    International journal of multiphase flow. 2020
    10.1016/j.ijmultiphaseflow.2020.103209
    arXiv:1906.00314
  5. Wan Z, Karnakov P, Koumoutsakos P, Sapsis T.
    Bubbles in Turbulent Flows: Data-driven, kinematic models with history terms.
    International journal of multiphase flow. 2020
    10.1016/j.ijmultiphaseflow.2020.103286
    arXiv:1910.02068
  6. Karnakov P, Litvinov S, Favre JM, Koumoutsakos P.
    V0018: Breaking waves: to foam or not to foam?
    Gallery of Fluid Motion Award
    video
    article
  7. Annual report 2019 of the Swiss National Supercomputing Centre (cover page)
    [link]
  8. Karnakov P, Wermelinger F, Litvinov S, Koumoutsakos P.
    Aphros: High Performance Software for Multiphase Flows with Large Scale Bubble and Drop Clusters.
    Proceedings of the platform for advanced scientific computing conference on – PASC ’20. 2020
    10.1145/3394277.3401856
    [pdf]
  9. Karnakov P. The multilayer volume-of-fluid method for multiphase
    flows across scales: breaking waves, microfluidics, and membrane-less
    electrolyzers. PhD thesis. ETH Zurich. 2021
    10.3929/ethz-b-000547518
  10. Martin SM, Wälchli D, Arampatzis G, Economides AE, Karnakov P, Koumoutsakos P.
    Korali: Efficient and scalable software framework for Bayesian uncertainty quantification and stochastic optimization.
    Computer Methods in Applied Mechanics and Engineering. 2021
    10.1016/j.cma.2021.114264
  11. Karnakov P, Litvinov S, Koumoutsakos P.
    Computing foaming flows across scales: from breaking waves to microfluidics.
    Science Advances. 2022
    10.1126/sciadv.abm0590

Citing

If you use Aphros in your work, please consider using the following

@article{aphros2022,
  author = {Petr Karnakov  and Sergey Litvinov  and Petros Koumoutsakos},
  title = {Computing foaming flows across scales: From breaking waves to microfluidics},
  journal = {Science Advances},
  volume = {8},
  number = {5},
  pages = {eabm0590},
  year = {2022},
  doi = {10.1126/sciadv.abm0590},
  URL = {https://www.science.org/doi/abs/10.1126/sciadv.abm0590},
  eprint = {https://www.science.org/doi/pdf/10.1126/sciadv.abm0590},
}

Contributors

Showing top 2 contributors by commit count.

View all contributors on GitHub →

This article is auto-generated from cselab/aphros via the GitHub API.Last fetched: 6/27/2026