MFC
High-fidelity multiphase flow simulation
|
You can either download MFC's latest release from GitHub or clone the repository:
MFC can be built in multiple ways on various operating systems. Please select your desired configuration from the list bellow:
If you wish to build MFC using NVidia's NVHPC SDK, first follow the instructions here.
On Windows, you can either use Intel Compilers with the standard Microsoft toolchain, Docker or the Windows Subsystem for Linux (WSL) for a Linux experience.
Install the latest version of:
Then, in order to initialize your development environment, open a terminal window and run:
To follow this guide, please replace ./mfc.sh
with mfc.bat
when running any commands. ./mfc.sh
is intended Unix-like systems. You will also have access to the .sln
Microsoft Visual Studio solution files for an IDE (Integrated Development Environment).
Install the latest version of the Windows Subsystem for Linux (WSL) as well as a distribution such as Ubuntu which can be found here. Acquiring an interactive session is as simple as typing wsl
in your command prompt, or alternatively, selecting the distribution from the dropdown menu available in the Microsoft Terminal.
You can now follow the appropriate instructions for your distribution.
echo $SHELL
)echo $SHELL
)An editor should open. Please paste the following lines into it before saving the file. If you wish to use a version of GNU's GCC other than 13, modify the first assignment. These lines ensure that LLVM's Clang, and Apple's modified version of GCC, won't be used to compile MFC. Further reading on open-mpi
incompatibility with clang
-based gcc
on macOS: here. We do not support clang
due to conflicts with the Silo dependency.
Close the open editor and terminal window. Open a new terminal window before executing the commands below.
They will download the dependencies MFC requires to build itself.
Docker is a lightweight, cross-platform, and performant alternative to Virtual Machines (VMs). We build a Docker Image that contains the packages required to build and run MFC on your local machine.
First install Docker and Git:
brew install git docker
(requires Homebrew).Once Docker and Git are installed on your system, clone MFC with
To fetch the prebuilt Docker image and enter an interactive bash session with the recommended settings applied, run
We automatically mount and configure the proper permissions in order for you to access your local copy of MFC, available at ~/MFC
. You will be logged-in as the me
user with root permissions.
:warning: The state of your container is entirely transient, except for the MFC mount. Thus, any modification outside of ~/MFC
should be considered as permanently lost upon session exit.
MFC can be built with support for various (compile-time) features:
Feature | Enable | Disable | Default | Description |
---|---|---|---|---|
MPI | --mpi | --no-mpi | On | Lets MFC run on multiple processors (and nodes) simultaneously. |
GPU | --gpu | --no-gpu | Off | Enables GPU acceleration via OpenACC. |
Debug | --debug | --no-debug | Off | Requests the compiler build MFC in debug mode. |
⚠️ The --gpu
option requires that your compiler supports OpenACC for Fortran for your target GPU architecture.
When these options are given to mfc.sh
, they will be remembered when you issue future commands. You can enable and disable features at any time by passing any of the arguments above. For example, if you have previously built MFC with MPI support and no longer wish to run using MPI, you can pass --no-mpi
once, for the change to be permanent.
MFC is composed of three codes, each being a separate target. By default, all targets (pre_process
, simulation
, and post_process
) are selected. To only select a subset, use the -t
(i.e., --targets
) argument. For a detailed list of options, arguments, and features, please refer to ./mfc.sh build --help
.
Most first-time users will want to build MFC using 8 threads (or more!) with MPI support:
Examples:
./mfc.sh build --gpu -j 8
../mfc.sh build --no-mpi
.simulation
code in Debug mode with MPI and GPU support: ./mfc.sh build --debug --gpu -t simulation
.Run MFC's test suite with 8 threads:
Please refer to the Testing document for more information.
MFC has example cases in the examples
folder. You can run such a case interactively using 2 tasks by typing:
Please refer to the Running document for more information on case.py
files and how to run them.