MultiRheoFlow
An extensible framework for multiphase flows with complex rheology, built on Basilisk C
Overview
MultiRheoFlow is an open-source multiphase, multirheology extension of the ElastoFlow solver. It provides a catalogue of models implemented in Basilisk C, leveraging adaptive mesh refinement for high-fidelity simulations of non-Newtonian fluids and viscoelastic materials with free surfaces, interfaces, and capillary effects.
Developed at the Computational Multiphase Physics (CoMPhy) Lab at the University of Twente, MultiRheoFlow provides a modular platform where different rheological constitutive equations can be integrated with multiphase flow scenarios.
Key Features
- Diverse Rheology Models: Simulates
a wide spectrum of material behaviors:
- Newtonian fluids (done ✅)
- Viscoelastic fluids (Oldroyd-B - done ✅, Giesekus - good to have 🍀, FENE-P - urgent 📌)
- Yield-stress materials (Bingham - done ✅, Herschel-Bulkley - done ✅)
- Elastoviscoplastic materials (Saramito model - good to have 🍀)
- Multiphase Capabilities: Handles
interfacial dynamics with:
- Two-phase and multiphase flow support
- Accurate surface tension and capillary effects
- Interface capturing via the volume-of-fluid method
- Arbitrary density and viscosity contrasts
- High-Performance Computing:
Leverages Basilisk’s advantages:
- Adaptive mesh refinement for computational efficiency
- Parallelization for large-scale simulations
- 2D, axisymmetric, and 3D simulation capabilities
- Log-Conformation Method: Ensures stability for highly elastic flows using advanced numerical techniques
Test Cases
simulationCases/dropImpact.csimulationCases/dropImpact-EVP.csimulationCases/dropImpact-EVP-HB.csimulationCases/dropAtomisation.csimulationCases/pinchOff.csimulationCases/testEigenDecomposition.c- Parameter files such as:
default-VE.paramsdefault-EVP.paramsdefault-EVP-HB.paramssimulationCases/Bo0.0010.dat
Repository Structure
runSimulation.sh: Root-level runner using--caseand--input.default-*.params: Root-level default parameter files for drop-impact variants.src-local/: Project-specific Basilisk headers and helpers.simulationCases/: Simulation entry points and case utilities.postProcess/: Post-processing and visualization tools..github/: Documentation and CI tooling (generated docs go to.github/docs/).- Root scripts such as
reset_install_requirements.sh.
Running the Code
Install Basilisk
- Follow the instructions here.
- For macOS and Linux, you can use
reset_install_requirements.sh. - For Windows, we recommend using WSL; please report any issues you find.
# Prerequisites: Basilisk installation (http://basilisk.fr)
git clone https://github.com/comphy-lab/RheoMultiFlow.git
cd RheoMultiFlow
curl -sL https://raw.githubusercontent.com/comphy-lab/basilisk-C/main/reset_install_basilisk-ref-locked.sh | bash -s -- --ref=v2026-01-29 --hardUpdate v2026-01-29 with the latest
version.
Compile a Case with Make
cd simulationCases
make dropImpact.tstTo disable on-the-fly visualization:
cd simulationCases
CFLAGS=-DDISPLAY=-1 make dropImpact.tstRun via Root Runner
bash runSimulation.sh
bash runSimulation.sh --case simulationCases/dropImpact.c
bash runSimulation.sh --case simulationCases/dropImpact-EVP.c
bash runSimulation.sh --case simulationCases/dropImpact-EVP-HB.cDefaults:
--case->simulationCases/dropImpact.c--input->default-VE.params
When a different case is provided and
--input is omitted,
runSimulation.sh uses case-specific
defaults:
dropImpact->default-VE.paramsdropImpact-EVP->default-EVP.paramsdropImpact-EVP-HB->default-EVP-HB.params
Parameter keys:
- VE and EVP:
MAXlevel,Ldomain(orL0),tmax,We,Ohs,Oha,De,Ec - EVP-HB:
MAXlevel,Ldomain(orL0),tmax,We,Ohs,Oha,Ohp,Ec,J,n(ornHB)Deis computed internally asDe = Ohp/Ec
You can also override defaults by passing a parameter file:
bash runSimulation.sh --case simulationCases/dropImpact-EVP-HB.c \
--input default-EVP-HB.params
bash runSimulation.sh --case simulationCases/dropImpact-EVP-HB.c \
--input my-custom.paramsLegacy Wrapper
simulationCases/runCases.sh remains
available as a compatibility wrapper around
runSimulation.sh:
cd simulationCases
bash runCases.sh dropImpact-EVP-HB default-EVP-HB.params
bash cleanup.sh dropImpact-EVP-HBCompile and Run from CLI
qcc -O2 -Wall -disable-dimensions -I$PWD/src-local \
simulationCases/dropImpact.c -o dropImpact -lm
./dropImpactCompile and Run with MPI (macOS)
Note: you should have OpenMPI installed.
CC99='mpicc -std=c99 -D_GNU_SOURCE=1' qcc -Wall -O2 -D_MPI=1 \
-disable-dimensions -I$PWD/src-local simulationCases/dropImpact.c \
-o dropImpact -lm
mpirun -np $NUM_PROCESSORS_TO_USE ./dropImpactPost-Processing
postProcess/VideoAxi.pypostProcess/getData-elastic-scalar2D.cpostProcess/getFacet2D.c
Documentation
Generate the documentation locally:
.github/scripts/build.shPreview locally:
.github/scripts/deploy.shContributing
Contributions to MultiRheoFlow are welcome! Please see our Contributing guide for details on how to submit code, report bugs, or request features.
License
This project is licensed under the GNU GPLv3 License. See the LICENSE file for details, consistent with Basilisk’s licensing.
Acknowledgments
MultiRheoFlow builds upon ElastoFlow and the Basilisk C framework.
Generated Documentation
Root Directory
postProcess
simulationCases
- simulationCases/cleanup.sh
- simulationCases/dropAtomisation.c
- simulationCases/dropImpact-EVP-HB.c
- simulationCases/dropImpact-EVP.c
- simulationCases/dropImpact.c
- simulationCases/pinchOff.c
- simulationCases/runCases.sh
- simulationCases/testEigenDecomposition.c
src-local
- src-local/case-params.h
- src-local/eigen_decomposition.h
- src-local/log-conform-elastoviscoplastic-HB-scalar-2D.h
- src-local/log-conform-elastoviscoplastic-HB-scalar-3D.h
- src-local/log-conform-elastoviscoplastic-scalar-2D.h
- src-local/log-conform-elastoviscoplastic-scalar-3D.h
- src-local/log-conform-elastoviscoplastic.h
- src-local/log-conform-viscoelastic-scalar-2D.h
- src-local/log-conform-viscoelastic-scalar-3D.h
- src-local/log-conform-viscoelastic.h
- src-local/two-phaseEVP-HB.h
- src-local/two-phaseEVP.h
- src-local/two-phaseVE.h