Skip to content

Latest commit

 

History

History
198 lines (148 loc) · 5.68 KB

File metadata and controls

198 lines (148 loc) · 5.68 KB

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 Durham University, 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 - done ✅)
  • 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.c
  • simulationCases/dropImpact-EVP.c
  • simulationCases/dropImpact-EVP-HB.c
  • simulationCases/dropAtomisation.c
  • simulationCases/pinchOff.c
  • simulationCases/testEigenDecomposition.c
  • Parameter files such as:
    • default-VE.params
    • default-EVP.params
    • default-EVP-HB.params
    • simulationCases/Bo0.0010.dat

Repository Structure

  • runSimulation.sh: Root-level runner using --case and --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/).

Running the Code

Install Basilisk

  • Follow the instructions here.
  • 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/MultiRheoFlow.git
cd MultiRheoFlow
curl -sL https://raw.githubusercontent.com/comphy-lab/basilisk-C/main/reset_install_basilisk-ref-locked.sh | bash -s -- --ref=v2026-01-29 --hard

Update v2026-01-29 with the latest version.

Compile a Case with Make

cd simulationCases
make dropImpact.tst

To disable on-the-fly visualization:

cd simulationCases
CFLAGS=-DDISPLAY=-1 make dropImpact.tst

Run 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.c

Defaults:

  • --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.params
  • dropImpact-EVP -> default-EVP.params
  • dropImpact-EVP-HB -> default-EVP-HB.params

Parameter keys:

  • VE and EVP: MAXlevel, Ldomain (or L0), tmax, We, Ohs, Oha, De, Ec
  • EVP-HB: MAXlevel, Ldomain (or L0), tmax, We, Ohs, Oha, Ohp, Ec, J, n (or nHB)
    • De is computed internally as De = 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.params

Legacy 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-HB

Compile and Run from CLI

qcc -O2 -Wall -disable-dimensions -I$PWD/src-local \
  simulationCases/dropImpact.c -o dropImpact -lm
./dropImpact

Compile 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 ./dropImpact

Post-Processing

  • postProcess/VideoAxi.py
  • postProcess/getData-elastic-scalar2D.c
  • postProcess/getFacet2D.c

Documentation

Generate the documentation locally:

.github/scripts/build.sh

Preview locally:

.github/scripts/deploy.sh

Contributing

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.