# MFC **Repository Path**: yuzi233/MFC ## Basic Information - **Project Name**: MFC - **Description**: Exascale simulation of multiphase/physics fluid dynamics - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-01-08 - **Last Updated**: 2026-01-08 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README

MFC Banner

Star History Chart

> **If MFC helps your work, please ⭐ the repo and cite it!** ### Who uses MFC MFC runs at exascale on the world's fastest supercomputers: - **OLCF Frontier** (>33K AMD MI250X GPUs) - **LLNL El Capitan** (>43K AMD MI300A APUs) - **LLNL Tuolumne**, **CSCS Alps**, and many others ### Try MFC | Path | Command | | --- | --- | | **Codespaces** (fastest) 💨 | Click the "Codespaces" badge above to launch in 1 click | | **Docker** 🐳 | `docker run -it --rm --entrypoint bash sbryngelson/mfc:latest-cpu` | | **Homebrew** (macOS) 🍺 | `brew install mflowcode/mfc/mfc && mfc $(brew --prefix mfc)/examples/1D_sodshocktube/case.py -n 2` | | **Local build** 💻 | `./mfc.sh build -j $(nproc) && ./mfc.sh test -j $(nproc)` | **Welcome!** MFC simulates compressible multi-phase flows, [among other things](#what-else-can-this-thing-do). It uses metaprogramming and is short (20K lines) and portable. MFC conducted the largest known CFD simulation at 200 trillion grid points, and 1 quadrillion degrees of freedom (as of September 2025). MFC is a 2025 Gordon Bell Prize Finalist.


Is MFC useful for you? Consider citing it or giving a star!

```bibtex @article{Wilfong_2025, author = {Wilfong, Benjamin and {Le Berre}, Henry and Radhakrishnan, Anand and Gupta, Ansh and Vaca-Revelo, Diego and Adam, Dimitrios and Yu, Haocheng and Lee, Hyeoksu and Chreim, Jose Rodolfo and {Carcana Barbosa}, Mirelys and Zhang, Yanjun and Cisneros-Garibay, Esteban and Gnanaskandan, Aswin and {Rodriguez Jr.}, Mauro and Budiardja, Reuben D. and Abbott, Stephen and Colonius, Tim and Bryngelson, Spencer H.}, title = {{MFC 5.0: A}n exascale many-physics flow solver}, journal = {arXiv preprint arXiv:2503.07953}, year = {2025}, doi = {10.48550/arXiv.2503.07953} } ``` MFC is used on the latest leadership-class supercomputers. It scales ideally to exascale; [tens of thousands of GPUs on NVIDIA- and AMD-GPU machines](#is-this-really-exascale) on Oak Ridge Frontier, LLNL El Capitan, CSCS Alps, among others. MFC is a SPEChpc benchmark candidate, part of the JSC JUPITER Early Access Program, and used OLCF Frontier and LLNL El Capitan early access systems. Get in touch with Spencer if you have questions! We have an [active Slack channel](https://join.slack.com/t/mflowcode/shared_invite/zt-y75wibvk-g~zztjknjYkK1hFgCuJxVw) and development team. MFC has high- and low-level documentation, visualizations, and more on [its website](https://mflowcode.github.io/). ## An example We keep many examples. Here are some of them! MFC can execute high-fidelity simulations of shock-droplet interaction (see `examples/3d_shockdroplet`)

Shock Droplet Example

This one simulates high-Mach flow over an airfoil:

Airfoil Example

And here is a high-amplitude acoustic wave reflecting and emerging through a circular orifice:

Orifice Example

## Getting started You can navigate [to this webpage](https://mflowcode.github.io/documentation/md_getting-started.html) to get you get started using MFC on your local machine, cluster, or supercomputer! It's rather straightforward. Some examples are below. ### Codespaces and Containers For a _very_ quick start, open a GitHub Codespace to load a pre-configured Docker container and familiarize yourself with MFC commands. Click <> Code (green button at top right) → Codespaces (right tab) → + (create a codespace). Alternatively, run MFC directly with Docker on your local machine: ```bash docker run -it --rm --entrypoint bash sbryngelson/mfc:latest-cpu ``` Once inside the container, navigate to `/opt/MFC` to access MFC and run examples. > ****Note:**** Codespaces is a free service with a monthly quota of compute time and storage usage. > It is recommended for testing commands, troubleshooting, and running simple case files without installing dependencies or building MFC on your device. > Don't conduct any critical work here! > To learn more, please see [how Docker & Containers work](https://mflowcode.github.io/documentation/md_docker.html). ### macOS quick start (Homebrew) Install the prebuilt package and run an example: ```bash brew install mflowcode/mfc/mfc mkdir -p ~/mfc_quickstart && cd ~/mfc_quickstart cp $(brew --prefix mfc)/examples/1D_sodshocktube/case.py . mfc case.py -n 2 ``` Use `-n X` to select the number of MPI processes. For developer commands (`build`, `test`, etc.), clone the repo and use `./mfc.sh`. ### macOS from source We'll give a brief introduction for building from source on MacOS below. Using [brew](https://brew.sh), install MFC's dependencies: ```shell brew install coreutils python cmake fftw hdf5 gcc boost open-mpi lapack ``` You're now ready to build and test MFC! Put it to a local directory via ```shell git clone https://github.com/MFlowCode/MFC cd MFC ``` and be sure MFC knows where to find Boost by appending to your dotfiles and sourcing them again ```shell echo -e "export BOOST_INCLUDE='$(brew --prefix --installed boost)/include'" | tee -a ~/.bash_profile ~/.zshrc . ~/.bash_profile 2>/dev/null || . ~/.zshrc 2>/dev/null ! [ -z "${BOOST_INCLUDE+x}" ] && echo 'Environment is ready!' || echo 'Error: $BOOST_INCLUDE is unset. Please adjust the previous commands to fit with your environment.' ``` then you can build MFC and run the test suite! ```shell ./mfc.sh build -j $(nproc) ./mfc.sh test -j $(nproc) ``` And... you're done! You can learn more about MFC's capabilities [via its documentation](https://mflowcode.github.io/documentation/index.html) or play with the examples located in the `examples/` directory (some are [shown here](https://mflowcode.github.io/documentation/md_examples.html))! The shock-droplet interaction case above was run via ```shell ./mfc.sh run -n $(nproc) ./examples/3d_shockdroplet/case.py ``` where `$(nproc)` is the number of cores the example will run on (and the number of physical cores on your CPU device). You can visualize the output data in `examples/3d_shockdroplet/silo_hdf5` via Paraview, Visit, or your favorite software. ## Is this _really_ exascale? [OLCF Frontier](https://www.olcf.ornl.gov/frontier/) is the first exascale supercomputer. The weak scaling of MFC on this machine shows near-ideal utilization. We also scale ideally to >98% of LLNL El Capitan.

Scaling

## What else can this thing do? ### Physics * 1-3D * Compressible * Low Mach number treatment available * Multi- and single-component * 4, 5, and 6 equation models for multi-component/phase features * Kapila and Allaire models 5-equation models * Multi- and single-phase * Phase change via p, pT, and pTg schemes * Grids * 1-3D Cartesian, cylindrical, axisymmetric. * Arbitrary grid stretching for multiple domain regions. * Complex/arbitrary geometries via immersed boundary method * STL geometry files supported * Surface tension for multiphase cases * Sub-grid dynamics * Euler-Euler particle models for bubble dynamics and similar * Euler-Lagrange bubble dynamics * Viscous effects (high-order accurate representations) * Ideal and stiffened gas equations of state * Body forces * Acoustic wave generation (one- and two-way sound sources) * Magnetohydrodynamics (MHD) * Relativistic Magnetohydrodynamics (RMHD) ### Numerics * Shock and interface capturing schemes * First-order upwinding * MUSCL (order 2) * Slope limiters: minmod, monotonized central, Van Albada, Van Leer, superbee * WENO reconstructions (orders 3, 5, and 7) * WENO variants: WENO-JS, WENO-M, WENO-Z, TENO * Monotonicity-preserving reconstructions * Reliable handling of large density ratios * Exact and approximate (e.g., HLL, HLLC, HLLD) Riemann solvers * Boundary conditions * Periodic, reflective, extrapolation/Neumann * Slip and no-slip * Thompson-based characteristic BCs: non-reflecting sub/supersonic buffers, inflows, outflows * Generalized characteristic relaxation boundary conditions * Runge-Kutta orders 1-3 (SSP TVD), adaptive time stepping * RK4-5 operator splitting for Euler-Lagrange modeling * Interface sharpening (THINC-like) * Information geometric regularization (IGR) * Shock capturing without WENO and Riemann solvers ### Large-scale and accelerated simulation * GPU compatible on NVIDIA ([P/V/A/H]100, GH200, etc.) and AMD (MI[1/2/3]00+) GPU and APU hardware * Ideal weak scaling to 100% of the largest GPU and superchip supercomputers * \>43K AMD APUs (MI300A) on [LLNL El Capitan](https://hpc.llnl.gov/hardware/compute-platforms/el-capitan) * \>3K AMD APUs (MI300A) on [LLNL Tuolumne](https://hpc.llnl.gov/hardware/compute-platforms/tuolumne) * \>33K AMD GPUs (MI250X) on [OLCF Frontier](https://www.olcf.ornl.gov/frontier/) * \>10K NVIDIA GPUs (V100) on [OLCF Summit](https://www.olcf.ornl.gov/summit/) * Near compute roofline behavior * RDMA (remote data memory access; GPU-GPU direct communication) via GPU-aware MPI on NVIDIA (CUDA-aware MPI) and AMD GPU systems * Optional single-precision computation and storage ### Software robustness and other features * [Fypp](https://fypp.readthedocs.io/en/stable/fypp.html) metaprogramming for code readability, performance, and portability * Continuous Integration (CI) * \>500 Regression tests with each PR. * Performed with GNU (GCC), Intel (oneAPI), Cray (CCE), and NVIDIA (NVHPC) compilers on NVIDIA and AMD GPUs. * Line-level test coverage reports via [Codecov](https://app.codecov.io/gh/MFlowCode/MFC) and `gcov` * Benchmarking to avoid performance regressions and identify speed-ups * Continuous Deployment (CD) of [website](https://mflowcode.github.io) and [API documentation](https://mflowcode.github.io/documentation/index.html) ## Citation If you use MFC, consider citing it as below. Ref. 1 includes all modern MFC features, including GPU acceleration and many new physics features. If referencing MFC's (GPU) performance, consider citing ref. 1 and 2, which describe the solver and its design. The original open-source release of MFC is ref. 3, which should be cited for provenance as appropriate. ```bibtex @article{Wilfong_2025, author = {Wilfong, Benjamin and {Le Berre}, Henry and Radhakrishnan, Anand and Gupta, Ansh and Vaca-Revelo, Diego and Adam, Dimitrios and Yu, Haocheng and Lee, Hyeoksu and Chreim, Jose Rodolfo and {Carcana Barbosa}, Mirelys and Zhang, Yanjun and Cisneros-Garibay, Esteban and Gnanaskandan, Aswin and {Rodriguez Jr.}, Mauro and Budiardja, Reuben D. and Abbott, Stephen and Colonius, Tim and Bryngelson, Spencer H.}, title = {{MFC 5.0: A}n exascale many-physics flow solver}, journal = {arXiv preprint arXiv:2503.07953}, year = {2025}, doi = {10.48550/arXiv.2503.07953} } @article{Radhakrishnan_2024, title = {Method for portable, scalable, and performant {GPU}-accelerated simulation of multiphase compressible flow}, author = {A. Radhakrishnan and H. {Le Berre} and B. Wilfong and J.-S. Spratt and M. {Rodriguez Jr.} and T. Colonius and S. H. Bryngelson}, journal = {Computer Physics Communications}, year = {2024}, volume = {302}, pages = {109238}, doi = {10.1016/j.cpc.2024.109238} } @article{Bryngelson_2021, title = {{MFC: A}n open-source high-order multi-component, multi-phase, and multi-scale compressible flow solver}, author = {S. H. Bryngelson and K. Schmidmayer and V. Coralic and J. C. Meng and K. Maeda and T. Colonius}, journal = {Computer Physics Communications}, year = {2021}, volume = {266}, pages = {107396}, doi = {10.1016/j.cpc.2020.107396} } ``` ## License Copyright 2021 Spencer Bryngelson and Tim Colonius. MFC is under the MIT license (see [LICENSE](LICENSE) for full text). ## Acknowledgements Federal sponsors have supported MFC development, including the US Department of Defense (DOD), the National Institutes of Health (NIH), the Department of Energy (DOE) and National Nuclear Security Administration (NNSA), and the National Science Foundation (NSF). MFC computations have used many supercomputing systems. A partial list is below * OLCF Frontier and Summit, and testbeds Wombat, Crusher, and Spock (allocation CFD154, PI Bryngelson). * LLNL El Capitan, Tuolumne, and Lassen; El Capitan early access system Tioga. * NCSA Delta and DeltaAI, PSC Bridges(1/2), SDSC Comet and Expanse, Purdue Anvil, TACC Stampede(1-3), and TAMU ACES via ACCESS-CI allocations from Bryngelson, Colonius, Rodriguez, and more. * DOD systems Blueback, Onyx, Carpenter, Nautilus, and Narwhal via the DOD HPCMP program. * Sandia National Labs systems Doom and Attaway, and testbed systems Weaver and Vortex.