MFiX-User Guide2
MFiX-User Guide2
MFiX-User Guide2
Release 21.4
1 About 1
1.1 MFiX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.2 Development state of MFiX models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.3 GUI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.4 Support Forum . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.5 User contribution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
2 Getting Started 5
2.1 Windows Installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
2.2 MFiX Installation on Mac . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
2.3 Linux Installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
2.4 Pip Installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
3 Tutorials 15
3.1 First Tutorial . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
3.2 Two Dimensional Fluid Bed, Two Fluid Model (TFM) . . . . . . . . . . . . . . . . . . . . . . . . . . 18
3.3 Two Dimensional Fluid Bed, Discrete Element Model (DEM) . . . . . . . . . . . . . . . . . . . . . . 31
3.4 Three Dimensional Single phase flow over a sphere . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
3.5 Three Dimensional Fluidized Bed . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
3.6 Three Dimensional DEM Hopper . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
3.7 DEM Granular Flow Chutes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
3.8 SMS meshing workflow, cyclone, Discrete Element Model (DEM) . . . . . . . . . . . . . . . . . . . 72
3.9 DEM Initial Conditions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
3.10 Procedural Geometry . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
3.11 Advanced Tutorials . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114
i
5 Building the Solver 173
5.1 Building Custom Interactive Solver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173
5.2 Building a Batch Solver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174
5.3 Build from Source (for Developers) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 176
7 Visualization 185
7.1 Visualization in GUI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 185
7.2 Post Processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 185
8 Reference 191
8.1 GUI Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 191
8.2 User-Defined Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 206
8.3 Keywords . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 209
8.4 Frequently Asked Questions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 372
8.5 How to setup PIC simulations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 380
Bibliography 389
ii
CHAPTER
ONE
ABOUT
1.1 MFiX
MFiX is an open-source multiphase flow solver and is free to download and use. A one-time, no-cost registration is
required prior to downloading the source code. To register, go to https://mfix.netl.doe.gov/ and click on the “Register”
button in the upper right corner. Once you have read the notice, you can submit your application by clicking on “REG-
ISTER.” After your application has been reviewed and accepted, you will receive an email notification and instructions
on how to download the code. Please allow for 2-3 business days for your registration to be processed.
Potential users may find reviewing the Frequently Asked Questions section of the MFiX website useful before downloading
the code.
MFiX provides a suite of models that treat the carrier phase (typically the gas phase) and disperse phase (typically the
solids phase) differently. Their current state of development is summarized in the tables below.
Symbol description for the following tables:
Symbol Description
• Implemented and fully tested
◦ Implemented with limited testing
Not tested or status unknown
† Models not extended to DMP-parallel are only available for serial runs
‡ Models not extended to SMP-parallel are available for SMP runs but do not scale with thread count
MFiX-TFM (Two-Fluid Model) is an Eulerian-Eulerian model, which supports a broad range of capabilities for dense,
reacting, multiphase flows by representing the fluid and solids as interpenetrating continua. This is the most mature MFiX
model and is capable of modeling multiphase reactors ranging in size from benchtop to industry-scale. Approximation
of the solid phase as a continuum typically allows for faster simulation time than Lagrangian techniques; however, it also
introduces the need for accurate mathematical models to capture realistic solids phase behavior. This includes transport
properties, heterogeneous reaction kinetics, and constitutive relations for interaction between fluid and solid phases, e.g.,
solids phase drag and interphase heat transfer.
1
MFiX User Guide, Release 21.4
MFiX-DEM (Discrete Element Model) is an Eulerian-Lagrangian model that treats the fluid phase as a continuum and
models the individual particles of the solid phase. This is a relatively new variation on MFiX. While the treatment of
individual particles can provide higher fidelity over a broad range of flow regimes (from dilute to packed), it becomes
very challenging (in terms of computational resources) when dealing with very large numbers of particles for large-scale
simulations. These large-scale applications will require high performance computing (HPC) resources and large amounts
of computer time. Code optimization and speed up are critical research fronts to support industrial scale applications.
MFiX-CGP (Coarse Grained Particle) is an Eulerian-Lagrangian model similar to DEM, where particles are grouped
into larger coarse-grained particles (CGP). The collisions between CGPs are resolved the same way as in DEM. This
modeling approach is more affordable than DEM since fewer CGPs need to be tracked. This modeling approach falls
between DEM and PIC in terms of computational resources.
MFiX-PIC (Multiphase Particle in Cell) is another Eulerian-Lagrangian model that represents the fluid as a continuum
while using “parcels” to represent groups of real particles with similar physical characteristics. The MFiX-PIC approach
offers reduced computational cost over MFiX-DEM as there are typically fewer parcels to track and parcel collisions are
not resolved. However, the added modeling approximations influence the overall accuracy of the method. Development,
validation, and optimization of modeling approximations are critical research fronts.
2 Chapter 1. About
MFiX User Guide, Release 21.4
MFiX-Hybrid (Eulerian-Lagrangian-Eulerian) is a blend of MFiX-TFM and MFiX-DEM that represents the fluid
as a continuum and models solids as either a continuous phase (TFM) or discrete particles (DEM). This technique is
presently restricted to solving only the momentum equations to yield hydrodynamic predictions. This model is still in its
infancy and has seen only limited testing.
Note: The hybrid model is not currently supported and users should use caution if they decide to explore the hybrid
model. Creating MFiX-Hybrid models in the GUI is not supported.
1.3 GUI
The MFiX GUI is a front-end tool that allows users to quickly set-up MFiX models, run the developed models, and
provide post-processing tools with the goal of making MFiX easy to use.
The GUI is written in Python using the cross-platform Qt framework. The Anaconda platform is used for MFiX depen-
dencies, which allows us to support MFiX on Linux, Windows, and Mac. The Visualization Toolkit (VTK) is used to
visualize and manipulate the input geometry.
When your subscription to MFiX is accepted, you are automatically added to the MFiX forum, where important an-
nouncements about MFiX are shared with the MFiX community. If you are already an MFiX member, use you current
credentials to participate in the forum.
The Forum is a discussion platform for MFiX, Nodeworks and Tracker software. Developers and users can post topics
(discussion threads) to various categories for each software.
Users are encouraged to participate in the discussion and share their work (input files, udf’s, images or small animations
showing simulation results) to benefit the entire MFiX community.
The support forum is located at https://mfix.netl.doe.gov/forum. Click on the topics of interest to you.
Support forum etiquette:
1.3. GUI 3
MFiX User Guide, Release 21.4
1) Do not post offensive or inappropriate material. Stay courteous and respectful at all times.
2) Please allow sufficient time (say 2 to 3 business days) for MFiX developers and users to reply before posting
unanswered questions again.
3) Post questions in the appropriate forum category. Do not send requests or emails directly to MFiX developers or
other users unless a prior arrangement has been made. This ensures questions and answers are archived, and it
allows the entire MFiX community to engage. Additionally, follow-up questions should occur in the same thread.
4) Do not ask for a copy of a reference, e.g., a journal article. Do not post copyrighted material.
5) Prior to posting questions regarding MFiX installation or compilation issues, please search the forum to see if your
question has already been answered.
6) When posting a question to the forum, provide a complete description of the issue you encountered. It may be
useful to provide the following information in your post:
a. MFiX version you are trying to install or run
b. Some details on your operating system environment (for Linux: copy and paste the output of the command
“uname –a”, Linux distribution name and version also)
c. Your compiler name and version number (e.g. ifort -v will give the version number for Intel Fortran compiler)
d. Output for your $PATH environment (in csh type echo $PATH)
e. Your MPI library name and version number (if compilations problem with DMP mode encountered but
make sure you can compile and run a simple hello world type MPI program with your current installation)
Also please provide hardware details such as number of cores per socket in your system (or send the output
for “cat /proc/cpuinfo” and how many cores you are trying to utilize.
Note: Common reasons you may not receive an answer to your request
1. Your question has already been answered and is available in the archive.
2. You did not provide sufficient description of your problem (saying “It doesn’t work” is not useful).
3. Your question is outside the scope of the MFiX forum.
If you wish to contribute to the development of MFiX, please contact the MFiX team at admin@mfix.netl.doe.gov. We
are looking for simulation results (figures, animations, input files, user-defined subroutines), and new models that could
benefit the entire MFiX community. If you have written or know any publication that uses MFiX, please let us know
and we will post the citation on the website (https://mfix.netl.doe.gov/publications). Proper credit will be given to all
contributors.
These steps have been broken out by platform:
4 Chapter 1. About
CHAPTER
TWO
GETTING STARTED
This section explains how to install the Anaconda MFiX packages on Linux, Mac, or Windows. There are four steps
overall to the MFiX install process:
1. Create an account at https://mfix.netl.doe.gov
2. Download and install Anaconda
3. Create a new Conda environment
4. Install MFiX in the Conda environment
Step 4 requires registration and a login account. MFiX is an open-source multiphase flow solver and is free to download
and use. A one-time no-cost registration is required prior to downloading the software. To register, go to https://mfix.
netl.doe.gov/register and submit your account information. Your application will be manually reviewed and accepted, so
please allow for 2-3 business days for your registration to be processed. You will receive a confirmation email when you
can login.
Note: The MFiX solver can still be used from a source tarball (as in previous releases). See Build from Source (for
Developers) for more information.
For further details, see the install section for your platform.
MFiX has been developed and tested on the following Windows versions:
• Windows 10 (64-bit)
If you have an issue running MFiX works on your system, ask for help at Support Forum.
Download the 64-bit, Python 3, Windows version of Anaconda (~500 MB download) or Miniconda (~50 MB download).
For instance, with the Anaconda installer:
1. Double-click on the downloaded file. (At the time of this writing, Anaconda3-2020.02-Windows-
x86_64.exe)
2. Uncheck “Add Anaconda to my PATH environment variable”
3. Check “Register Anaconda as my default Python”
5
MFiX User Guide, Release 21.4
Anaconda is now installed. To verify, open the Start Menu, and run Anaconda Prompt⏎.
Note: If you already installed MFiX, you may see the following message. Select y to confirm.
MFiX will be installed in a new conda environment. The process will take a few minutes to complete.
Open the Anaconda prompt by opening the Start Menu, type “Anaconda Prompt”, and selecting the Anaconda Prompt.
Then run the following commands:
1. Run conda activate mfix-21.4
2. Run mfix⏎
Your prompt should look something like this:
C:\> mfix
You are now ready to proceed to the First Tutorial and Tutorials.
After using MFiX you can just exit to leave the Anaconda Prompt. However, if you need to deactivate the mfix-21.4
conda environment, you can do so with:
C:\(mfix-21.4)> deactivate
C:\>
To remove the conda environment (if you have the environment activated, deactivate it first):
To uninstall Anaconda entirely, go to “Add or remove programs” under Windows Control Panel, and uninstall Anaconda.
Note: To learn more about managing conda environments, visit the conda documentation .
As of this release, MFiX has been tested on the latest version of MacOS at the time of this release, 10.14 (Mojave).
Earlier of MacOS are likely to work. If you have an issue running MFiX on your Mac, ask for help at Support Forum.
Download the Python 3, Mac version of Anaconda (~500 MB download) or Miniconda (~50 MB download). Either the
Graphical Installer or Command Line Installer would work.
For instance, with the Anaconda Graphical Installer:
1. Open up Finder and navigate to the Download directory.
2. Double-click the downloaded file. (At the time of this writing, Anaconda3-2021.05-MacOSX-x86_64.
pkg for Graphical Installer).
3. Follow the installation guide, using the default settings.
Note: If you already installed MFiX, you may see the following message. Select y to confirm.
WARNING: A conda environment already exists
Remove existing environment (y/[n])? y
MFiX will be installed in a new conda environment. The process will take a few minutes to complete.
Open Terminal (if not open already), and run the following commands:
1. Run conda activate mfix-21.4
2. Run mfix⏎
Your prompt should look something like this:
> conda env list
# conda environments:
#
base * /Users/user/anaconda3
mfix-21.4 /Users/user/anaconda3/envs/mfix-21.4
You are now ready to proceed to the First Tutorial and Tutorials.
Note: Activating a conda environment sets certain environment variables such as PATH in the current shell. It does not
create a new shell session.
You will need to activate the environment every time before running MFiX.
After using MFiX you can just exit to leave the Terminal session. However, if you need to deactivate the mfix-21.4
conda environment, you can do so with:
(mfix-21.4)> deactivate
>
To remove the conda environment (if you have the environment activated, deactivate it first):
To uninstall Anaconda entirely, remove the Anaconda directory. By default, ~/anaconda3 in your home directory.
From the Terminal:
> cd ~
> rm -rf anaconda3/
Note: To learn more about managing conda environments, visit the conda documentation .
MFiX has been developed and tested on the following linux distributions:
• Ubuntu 18.10
• CentOS 7
Other recent releases of Linux are likely to work. If you have an issue running MFiX works your distro, ask for help at
Support Forum.
Download the 64-bit, Python 3, Linux version of Anaconda (~500 MB download) or Miniconda (~50 MB download).
For instance, with the Anaconda installer:
1. Open a terminal
2. cd to the directory of the downloaded installer (for example ~/Downloads)
3. Run the downloaded installer (At the time of this writing, sh Anaconda3-2021.05-Linux-x86_64.sh⏎.
4. You will be asked to review the License, hit enter
5. Hit the space bar until you get to the end of the license agreement.
6. Agree to the license by typing yes and hitting enter
7. When prompted for an installation location, hit enter to use the default.
8. When prompted to add the conda bin directory to PATH, enter yes and hit enter.
Anaconda is now installed. In order for the changes to take effect, close the terminal and open a new one. Verify that
your PATH was updated by running conda in the new terminal.
Note: If you already installed MFiX, you may see the following message. Select y to confirm.
MFiX will be installed in a new conda environment. The process will take a few minutes to complete.
Build dependencies are needed for building a custom interactive solver. If you only use the default solver, you can skip
this step.
Building the MFiX solver requires:
• Fortran 2003 compiler (GFortran 4.8 or later)
• GNU Make
• CMake
• For DMP support, an MPI implementation (such as OpenMPI)
For building with other compilers, or for building with DMP, see Building Custom Interactive Solver.
Installing GCC and Make through your system package manager (such as apt or yum) is recommended.
To build and run MFiX with DMP, you will need an MPI implementation installed, such as OpenMPI.
To install OpenMPI on Ubuntu/Debian derived distributions:
To run MFiX:
1. Open a terminal
2. Run conda activate mfix-21.4
3. Run mfix⏎ to start MFiX
Your prompt should look something like this:
You are now ready to proceed to the First Tutorial and Tutorials.
Note: Activating a conda environment sets certain environment variables such as PATH in the current shell. It does not
create a new shell session.
You will need to activate the environment every time before running MFiX.
After using MFiX you can just exit to leave the terminal session. However, if you need to deactivate the mfix-21.4
conda environment, you can do so with:
(mfix-21.4)> deactivate
>
To remove the conda environment (if you have the environment activated, deactivate it first):
To uninstall Anaconda entirely, remove the Anaconda directory. By default, ~/anaconda3 in your home directory.
From the terminal:
> cd ~
> rm -rf anaconda3/
Note: To learn more about managing conda environments, visit the conda documentation .
As of MFiX 20.1, Python wheels are available for installation with Pip. (Installation via the Conda packages will continue
to be supported.)
The Pip package includes the MFiX GUI and the MFiX solver source. It does not include a local copy of the MFiX
documentation or a binary version of the solver. If you install MFiX with Pip, you will need to build a solver yourself.
The Pip package should work on any platform, so long you have Python, CMake, GNU Make, and a Fortran compiler.
Make sure Python 3.7 or later is installed, either from your system package manager or from Python.org.
1. Browse to MFiX Download (requires registration and login)
2. Go to the Source tab
3. Download either the source tarball or the wheel (*.whl) file.
4. Install the downloaded file with pip.
MFiX runs the same whether installed from a source tarball or wheel. The source tarball is better for looking at the
source. The wheel file installs slightly faster.
Warning: The install command assumes your intended Python command is python. If python on your system
is Python 2.x or for any other reason is not your intended Python version, then edit the pasted command in your shell
to start with python3, python3.8, or whatever the full path is to your intended Python distribution to remove
any uncertainty.
The MFiX wheel is a pure Python package, and does not include a solver binary. To actually run the solver, you will need:
• Fortran 2003 compiler (GFortran 4.8 or later recommended)
• GNU Make
• CMake
• For DMP support, an MPI implementation (such as OpenMPI)
Installing the compiler, CMake, and Make through your system package manager (such as apt or yum) is recommended.
Note: If your system package manager has an old version of CMake, you can install a recent version with python -m
pip install cmake.
On Windows, the Scoop tool can be used to install build dependencies for MFiX.
> scoop install gcc # install full MinGW installation, including MinGW Make
> scoop install cmake
To run MFiX:
1. Open a terminal
2. Run mfix⏎ to start MFiX
You are now ready to proceed to the First Tutorial and Tutorials.
To uninstall MFiX:
THREE
TUTORIALS
These are detailed step-by-step tutorials for setting up projects in MFiX from scratch.
This section illustrates how to launch the GUI, open a project, run it, and visualize the results.
This section assumes MFiX is already installed. To install MFiX, see the Setup Guide.
It is also assumed that the terminal shell on Linux and Mac is bash. If this is not the case, type bash at the prompt
before activating the environment.
Everything in this section applies to all platforms (Linux, macOS, Windows) unless otherwise noted.
Starting the GUI requires first to activate the environment (to select a given installed version of MFiX):
On Windows, open the Anaconda Prompt and activate the mfix environment
On Linux open a terminal and activate the mfix environment from bash.
On macOS open a terminal and activate the mfix environment from bash.
Next, type mfix at the prompt. The two steps are shown below for each Operating System:
# Windows
conda activate mfix-21.4
(mfix-21.4) C:\> mfix
# Linux or Mac
conda activate mfix-21.4
(mfix-21.4) > mfix
If this is the first time opening the GUI, the main menu will automatically open. Otherwise, the previous project will
automatically open.
15
MFiX User Guide, Release 21.4
• Click (New)
A list of project templates is displayed.
The templates are tagged with the following icons. (Some templates have more than one icon).
Icon Description
Chemistry
Note: The blank template is the default, but it won’t run without customization. It requires a pressure outflow, among
other things.
• Filter the templates by de-selecting the (single phase), and (chemistry) icons
• Double-click on hopper_3d (3D DEM granular flow hopper) to create a new project
• Enter a project name (or keep the existing name) and browse to a location for the new project.
• Click Ok
A new project directory will be created in the selected directory, with the name being the project name. Here, a DEM
Hopper simulation setup has been loaded and is ready to run. You should see the model geometry in the “model” window
(top-right).
16 Chapter 3. Tutorials
MFiX User Guide, Release 21.4
3.1.5 Pausing/Unpausing
• Click the (run) button to unpause the solver and continue running.
3.1.6 Stopping/Resuming
This tutorial shows how to create a two dimensional fluidized bed simulation using the two fluid model. The model setup
is:
Property Value
geometry 10 cm x 30 cm
mesh 20 x 60
solid diameter 200 microns (200 × 10−6 m)
solid density 2500 kg/m2
gas velocity 0.25 m/s
temperature 298 K
pressure 101325 Pa
Note: A new project directory will be created in the location directory, with the name being the project name.
18 Chapter 3. Tutorials
MFiX User Guide, Release 21.4
Note: We could have entered 0.1 and 0.3 to define the domain extents, but this example shows that simple mathematical
expressions (+,-,*,/) are allowed.
Select the Regions pane. By default, a region that covers the entire domain is already defined. This is typically used to
initialize the flow field and visualize the results.
• click the button to create a new region to be used for the bed initial condition.
• Enter a name for the region in the Name field (“bed”)
• Change the color by pressing the Color button
• Enter xmin or min in the From X field
• Enter xmax or max in the To X field
• Enter ymin or min in the From Y field
• Enter ymax/2 or max/2 in the To Y field
• Enter zmin or min in the From Z field
• Enter zmax or max in the To Z field
Note: Here we could have entered numerical values for the coordinates, but it is recommended to use parameters (xmin,
xmax etc.) when possible. These parameters will update automatically if the “Domain Extents” change.
• Click the button to create a new region with the From and To fields already filled out for a region at the
bottom of the domain, to be used by the gas inlet boundary condition. From Y and To Y should equal ymin,
defining an XZ-plane.
• Enter a name for the region in the Name field (“inlet”)
• Click the button to create a new region with the From and To fields already filled out for a region at the
top of the domain, to be used by the pressure outlet boundary condition. From Y and To Y should equal ymax,
defining an XZ-plane.
• Enter a name for the region in the Name field (“outlet”)
20 Chapter 3. Tutorials
MFiX User Guide, Release 21.4
22 Chapter 3. Tutorials
MFiX User Guide, Release 21.4
• On the “Fluid” sub-pane, enter a velocity in the Y-axial velocity field of “0.25” m/s
24 Chapter 3. Tutorials
MFiX User Guide, Release 21.4
Note: The default pressure is already set to 101325 Pa, no changes need to be made to the outlet boundary condition.
Note: By default, boundaries that are left undefined (here the left and right planes) will behave as No-Slip walls.
26 Chapter 3. Tutorials
MFiX User Guide, Release 21.4
• Select the Volume fraction, Pressure, and Velocity vector check-boxes on the Fluid sub-sub-
pane
28 Chapter 3. Tutorials
MFiX User Guide, Release 21.4
• Create a new visualization tab by pressing the next to the Model tab
• Select an item to view, such as plotting the time step (dt) or click the 3D view button to view the vtk output files.
• On the VTK results tab, the visibility and representation of the *.vtk files can be controlled with the menu on the
side.
For this simulation, increasing the grid resolution will better resolve the bubbles (at the expense of a slower simulation
time). To do this:
30 Chapter 3. Tutorials
MFiX User Guide, Release 21.4
This tutorial shows how to create a two dimensional fluidized bed simulation using the Discrete Element Model. The
model setup is:
Property Value
geometry 15 cm x 90 cm x 0.4 cm
mesh 15 x 45 x 1
solid diameter 4000 microns (4000 × 10−6 m)
solid density 2700 kg/m2
gas velocity 42.0 m/s
temperature 298 K
pressure 101325 Pa
Note: Since there is only one cell in the Z direction, this model is effectively a 2D simulation.
32 Chapter 3. Tutorials
MFiX User Guide, Release 21.4
• click the button to create a new region that covers the entire domain to be used for the bed initial condition.
• Enter a name for the region in the Name field (“bed”)
• Change the To Y field to be “ymax/2”
• Click the button to create a new region to be used by the gas inlet boundary condition.
• Enter a name for the region in the Name field (“inlet”)
• Enter 0.07 in the From X field and 0.08 in the To X field.
• Click the button to create a new region to be used by pressure outlet boundary condition.
• Enter a name for the region in the Name field (“outlet”)
34 Chapter 3. Tutorials
MFiX User Guide, Release 21.4
• Select the solid (named previously as “solid”) sub-pane and enter a volume fraction of 0.4 in the Volume Frac-
tion field. This will fill the bottom half of the domain with solids.
• Note the estimated number of particles and inventory (around 3,200 particles or 0.3 kg). When running DEM
simulations on a single core machine, it is recommended to stay below 100,000 particles to get reasonable run
times.
• On the “Fluid” sub-pane, enter a velocity in the Y-axial velocity field of “42” m/s
36 Chapter 3. Tutorials
MFiX User Guide, Release 21.4
Note: The default pressure is already set to 101325 Pa, no changes need to be made to the outlet boundary condition.
Note: By default, boundaries that are left undefined (here the left, right, front, and back planes) will behave as No-Slip
walls.
• Enter a base name for the *.vtu files in the Filename base field (“particles”)
• Change the Write interval to 0.01 seconds
• Select the Diameter and Translational Velocity check-boxes
38 Chapter 3. Tutorials
MFiX User Guide, Release 21.4
• Create a new visualization tab by pressing the next to the Model tab
• Select an item to view, such as plotting the time step (dt) or click the 3D view button to view the vtk output files.
• On the VTK results tab, the visibility and representation of the *.vtk files can be controlled with the menu on the
side.
This tutorial shows how to create a three dimensional single phase flow over a sphere.
Property Value
geometry 60 cm 20 cm x 20 cm
mesh 30 x 10 x 10
gas velocity 1 m/s
temperature 298 K
pressure 101325 Pa
40 Chapter 3. Tutorials
MFiX User Guide, Release 21.4
Note: A new project directory will be created in the location directory, with the name being the project name.
42 Chapter 3. Tutorials
MFiX User Guide, Release 21.4
Next, add a sphere by clicking the button -> primitives -> sphere. This adds a sphere constructed of triangles (STL)
to the project.
Change the center position and radius of the sphere so that it is located in the domain by entering the following:
• 10/100 for the center X position
• 10/100 for the center Y position
• 10/100 for the center Z position
Change the radius of the sphere by entering:
• 5/100 for the radius.
44 Chapter 3. Tutorials
MFiX User Guide, Release 21.4
Select the Regions pane. By default, a region that covers the entire domain is already defined.
A region for the sphere is needed to apply a wall boundary condition to:
• click the button to create a region that encompasses the entire domain
• change the name of the region to a descriptive name such as “sphere”
• Check the Select Facets (STL) check-box to turn the region into a STL region. The facets of the sphere
should now be selected.
Create a region to apply a mass inflow boundary condition to:
• Click the
• Enter a name for the region in the Name field (“inlet”)
Create a region to apply a pressure outlet boundary condition to:
• Click the
• Enter a name for the region in the Name field (“outlet”)
Finally, create a slice through the center to use as a vtk output region:
• Click the
• Enter a name for the region in the Name field (“slice”)
• Enter zmax/2 in both the From Z and To Z fields to move the region to the center of the domain
46 Chapter 3. Tutorials
MFiX User Guide, Release 21.4
Select the Boundary conditions pane and create a wall boundary condition for the sphere by:
Note: The default pressure is already set to 101325 Pa, no changes need to be made to the outlet boundary condition.
• Create a new visualization tab by pressing the next to the Model tab
• Select an item to view, such as plotting the time step (dt) or click the 3D view button to view the vtk output files.
• On the VTK results tab, the visibility and representation of the *.vtk files can be controlled with the menu on the
side.
48 Chapter 3. Tutorials
MFiX User Guide, Release 21.4
This tutorial shows how to create a three dimensional fluidized bed simulation using the two fluid model and the discrete
element model (DEM). The model setup is:
Property Value
geometry 10 cm diameter x 40 cm
mesh 20 x 60 x 20
solid diameter 200 microns (200 × 10−6 m)
solid density 2500 kg/m2
gas velocity 0.25 m/s
temperature 298 K
pressure 101325 Pa
50 Chapter 3. Tutorials
MFiX User Guide, Release 21.4
• Flip the normals by clicking the button and selecting the flip normals filter
Note: This is a fairly coarse grid for a TFM simulation. After completing this tutorial, try increasing the grid resolution
to better resolve the bubbles.
52 Chapter 3. Tutorials
MFiX User Guide, Release 21.4
Select the Regions pane. By default, a region that covers the entire domain is already defined. This is typically used to
initialize the flow field and visualize the results.
• click the button to create a new region to be used for the bed initial condition.
• Enter a name for the region in the Name field (“bed”)
• Change the color by pressing the Color button
• Enter 0 in the To Y field
• Click the button to create a new region to be used by the gas inlet boundary condition.
• Enter a name for the region in the Name field (“inlet”)
• Click the button to create a new region to be used by the pressure outlet boundary condition.
• Enter a name for the region in the Name field (“outlet”)
• Click the button to create a new region to be used to select the walls.
• Click the button to create a new region to be used to save a slice of cells at the center of the domain.
• Enter a name for the region in the Name field (“slice”)
• Enter 0 in the From X and To X fields
54 Chapter 3. Tutorials
MFiX User Guide, Release 21.4
Note: The default pressure is already set to 101325 Pa, no changes need to be made to the outlet boundary condition.
56 Chapter 3. Tutorials
MFiX User Guide, Release 21.4
58 Chapter 3. Tutorials
MFiX User Guide, Release 21.4
• Create a new visualization tab by pressing the next to the Model tab
• Select an item to view, such as plotting the time step (dt) or click the 3D view button to view the vtk output files.
• On the VTK results tab, the visibility and representation of the *.vtk files can be controlled with the menu on the
side.
Note: The grid resolution needs to be coarser because we are drastically increasing the particle diameter below. The
fluid grid cell size has to be bigger than the particle size.
• On the Solids pane, change that particle diameter to 5.0000e-03 to get a more reasonable particle count for
tutorial purposes.
• On the Solids pane, DEM sub-pane: - check the Enable automatic particle generation - enter
a value of 15 in the Search grid partitions, KMAX field.
• On the Boundary Conditions pane, change the inlet Y-axial velocity to 0.6 m/s
• On the Boundary Conditions pane, delete the walls boundary condition and re-add it to write the correct
wall parameters for the DEM simulation.
• On the Output pane, VTK sub-pane:
– Delete the all or Background_IC output
– Create a new output, change the Output type to Particle data and select the Background_IC
region.
– Change the write frequency to 0.01
– Select the Diameter and Translational Velocity data
• Run the simulation
• Create a VTK window to visualize the data. It will automatically show the slice (cell data) and the particles.
This tutorial shows how to create a three dimensional granular flow DEM simulation. The model setup is:
Property Value
geometry 5 cm diameter hopper
mesh 10 x 25 x 10
solid diameter 0.003 m
solid density 2500 kg/m2
gas velocity NA
temperature 298 K
pressure NA
60 Chapter 3. Tutorials
MFiX User Guide, Release 21.4
• Press the Reset View icon on the top-left corner of the Model window
Select the Regions pane. By default, a region that covers the entire domain is already defined.
A region for the hopper walls (STL) is needed to apply a wall boundary condition to:
• click the button to create a region that encompasses the entire domain
• change the name of the region to a descriptive name such as “walls”
• Check the Select Facets (STL) check-box to turn the region into a STL region. The facets of the hopper
should now be selected.
62 Chapter 3. Tutorials
MFiX User Guide, Release 21.4
In order to allow the particles to leave the domain through the bottom, the facets at the bottom of the hopper need to be
deselected. There are three ways to accomplish this:
1. Change the Y Min domain extent value on the geometry pane by a small amount so that those facets fall outside
the simulation domain (for example, change the value to -0.0974).
2. Change the Y From region extent value on the regions pane for this STL region by a small amount so that those
facets fall outside the region (for example, change the value to ymin+0.0001)
3. Or, use the Filter facets based on normals option on the region pane.
For this example, use option 3 to filter the facets that have normals pointed in the Y direction by:
• Select box from the Selection method drop-down.
• Uncheck Slice facets.
• Check the Filter facets based on normals check-box
• Enter a vector pointed in the positive Y direction by entering 0, 1, and 0 in the x, y, z fields, respectively
• Check the Include equilibrant vector to include facets with normals in the opposite direction of the
vector (-x, -y, -z)
• Enter an angle of 10 in the angle field to include facets with normals within 10 degrees of the filter vector
• Check the Invert Selection check box to de-select facets that fall along the filter vector and select all the
other facets
All the facets, except for the facets at the top and bottom, of the hopper should now be selected.
Create a region to apply a pressure outlet boundary condition to allow particles to leave the domain:
• Click the
• Enter a name for the region in the Name field (“outlet”)
Finally, create a region to initialize the solids:
• Click the
• Enter a name for the region in the Name field (“solids”)
• Enter ymin/3 in the From Y field
• Enter 0 in the To Y field
Select the Boundary conditions pane and create a wall boundary condition for the hopper by:
64 Chapter 3. Tutorials
MFiX User Guide, Release 21.4
• On the Select Region dialog, select “Pressure Outflow” from the Boundary type combo-box
• Select the “outlet” region and click OK
• Create a new visualization tab by pressing the in the upper right hand corner.
• Select an item to view, such as plotting the time step (dt) or click the VTK button to view the vtk output files.
This tutorial shows how to create a three dimensional pure granular flow simulation from a series of cylindrical chutes.
The model setup is:
66 Chapter 3. Tutorials
MFiX User Guide, Release 21.4
Property Value
geometry 1.75 m x 0.94 m x 0.2 m
mesh 20 x 20 x 10
solid diameter 12.5 mm (0.0125 m)
solid density 2500 kg/m2
temperature 298 K
pressure 101325 Pa
• (fig_add_cylinder): Create the cylindrical geometry by pressing -> primitives -> cylinder
– Enter 0.1 meters for the cylinder radius
– Enter 30 for the cylinder resolution
68 Chapter 3. Tutorials
MFiX User Guide, Release 21.4
• Copy the chute by pressing the button with the chute selected (named transform)
– Enter a value of 0.8 in the Translate X field
– Enter a value of 0.6 in the Translate Y field
– Enter a value of 120 in the Rotation Z field
• Copy the chute again by pressing the button with the chute selected (named transform1)
– Enter a value of 0.0 in the Translate X field
– Enter a value of 0.3 in the Translate Y field
– Enter a value of 70 in the Rotation Z field
• Press the Autosize button to fit the domain extents to the geometry
70 Chapter 3. Tutorials
MFiX User Guide, Release 21.4
• Create a new visualization tab by pressing the in the upper right hand corner.
• Select an item to view, such as plotting the time step (dt) or click the VTK button to view the vtk output files.
This tutorial shows how to use the new meshing workflow, called SMS (Segregated Mesher/Solver). The SMS workflow
breaks the CFD workflow into two major steps: Mesher and Solver modes. Each mode of operation is performed in a
separate tab in the GUI.
During the Meshing step, the user focuses on generating the mesh and verifies it is appropriate before moving on to the
Solver setup. Only three panes are available during Meshing: Geometry, Regions, and Mesh. Once the mesh is generated
it must be accepted (after inspection) to unlock the other panes, and move to the second step (Solver mode). The solver
mode allows to set all other model settings, and run the MFiX solver to obtain and visualize the simulation results.
The SMS workflow is currently available as a beta testing feature, and can be turned on from the settings menu (select SMS:
Segregated Mesher/Solver (beta) from the Mesher workflow drop down list). The blank template will automatically
72 Chapter 3. Tutorials
MFiX User Guide, Release 21.4
prompt the user to use the SMS workflow and users are encouraged to try it and provide feedback to the development
team.
• If you have not switched to SMS workflow, you will be prompted to switch. Accept SMS mode.
We are now starting a new project in SMS workflow. There are two tabs in the GUI to setup and run the simulation. The
Mesher tab is where the mesh is setup and generated. The Modeler tab is where the rest of the settings and the simulation
are performed. The Modeler tab is initially locked until the mesh has been generated and accepted. Running the MFiX
solver is also not allowed until the mesh has been generated. At run time, the solver will read the mesh and proceed with
the CFD solution.
We will use an STL file as the geometry input. Download the file here
Go to the Geometry pane:
• Choose STL file as the geometry input.
• Navigate to where you downloaded cyclone.stl, select it and answer Yes when prompted to copy the file to
the project directory.
• Verify the STL normals are pointing in the right direction. In the model window, show the Geometry, hide the
Background Mesh, Hide the Regions (visibility is toggled by clicking on each icon). Set the Geometry style to
edges, opacity to 1.0, check the Show normals box, set the Scale to 0.05, set count to 10,000 (to show
all normals).
The normal vectors should point towards the fluid region (here towards the inside of the cyclone). For internal flows, the
tips of the arrows are generally not visible, except through openings in the STL geometry. Openings in the STL geometry
are allowed as long as they are outside of the domain extents.
Note: When the normals are pointing in the wrong direction, they can be flipped in the Geometry parameters. Check
the Flip normals box and notice the difference in the Model view. Uncheck the box since the original STL file was
correctly oriented.
74 Chapter 3. Tutorials
MFiX User Guide, Release 21.4
Here, we need to define the mesh boundaries. Boundaries include the cyclone wall (curved surface defined by the STL
geometry), and the inlet and outlets, defined along the domain outer box (plane boundaries). A Boundary Condition type
must be defined, but it will be possible to change it later (in Modeler Tab). The actual boundary conditions (like the inlet
velocity, or outlet pressure) do not need to be set at this point.
Go to the Regions pane:
• There is already a Background IC that is predefined in the Blank template. We can ignore it for now.
• Click the button to create a new region to be used by pressure outflow boundary condition.
• Select Pressure outflow in the Boundary type drop down menu.
• Enter a name for the region in the Name field (“Top outlet”).
• Change the region Color to Blue.
• Adjust the From/To coordinates in the x-direction: From -0.07 to 0.07.
• Adjust the From/To coordinates in the z-direction: From -0.07 to 0.07.
• Click the button to create a new region to be used by another pressure outflow boundary condition.
• Select Pressure outflow in the Boundary type drop down menu.
• Enter a name for the region in the Name field (“Bottom outlet”).
• Change the region Color to Yellow.
• Adjust the From/To coordinates in the x-direction: From -0.07 to 0.07.
• Adjust the From/To coordinates in the z-direction: From -0.07 to 0.07.
• Click the button to create a new region to be used by mass inflow boundary condition.
• Select Mass inflow in the Boundary type drop down menu.
• Enter a name for the region in the Name field (“Front inlet”).
• Change the region Color to Red.
• Adjust the From/To coordinates in the x-direction: From xmin to -0.025.
• Adjust the From/To coordinates in the y-direction: From 0.55 to 0.80.
• click the button to create a new region that covers the entire domain to be used for the wall boundary
condition.
• Select No-slip wall in the Boundary type drop down menu.
• Enter a name for the region in the Name field (“Wall”).
• Change the region Color to Green.
• Check Select facets (STL) and cyclone.stl, use all for the selection method. You should see that
there are 7554 facets selected.
Note: The pressure outlet and mass inflow boundaries are located along the domain box. They are defined as rectangular
2D regions and must overlap the actual boundary areas (intersection of the STL file with the box planes). The exact
76 Chapter 3. Tutorials
MFiX User Guide, Release 21.4
boundary area will be computed automatically when preprocessing is performed. Since there is only one Boundary
condition on the Top, Bottom and Front planes, we could also have used the entire planes instead of adjusting the region
coordinates.
78 Chapter 3. Tutorials
MFiX User Guide, Release 21.4
Note: Optional but recommended: To see examples of unacceptable meshes, try the following:
• Go back to the Geometry pane, and flip the normals. This will incorrectly orient the STL file. This is a common
error when importing STL files. Generate the mesh and visualize the Boundary_Mesh. Having an open surface and
boundaries inside-out is an indication that the normals are not properly oriented. The mesh should not be accepted.
• Uncheck the Flip normals box in the Geometry pane to get correct orientation. Go to the Region pane, and
select the Front inlet region in the region table and set the Boundary type to None. Save the project and generate
the mesh. The Boundary_Mesh will look like an open surface, this is an indication a Boundary condition is missing.
The mesh should not be accepted.
Remember to set the Front inlet Region boundary type to Mass inflow again before continuing. Generate the mesh,
inspect it and accept it before moving to the Modeler tab.
Switch to the Modeler tab (second tab at the bottom left corner of the GUI).
• On the Model pane, enter a descriptive text in the Description field.
• Select “Discrete Element Model (MFiX-DEM)” in the Solver drop-down menu.
• Keep all other settings at their default values.
We already have the Background_IC region that is predefined. We will use it to initialize the flow field. We have defined
all Boundary Condition regions during the meshing step. There are no other regions that need to be defined in this tutorial.
We will re-use Background_IC region for the VTK output file.
80 Chapter 3. Tutorials
MFiX User Guide, Release 21.4
82 Chapter 3. Tutorials
MFiX User Guide, Release 21.4
84 Chapter 3. Tutorials
MFiX User Guide, Release 21.4
86 Chapter 3. Tutorials
MFiX User Guide, Release 21.4
• Enter a base name for the *.vtu files in the Filename base field (“Particles”).
• Change the Write interval to 0.01 seconds.
• Select the Diameter and Translational Velocity check-boxes.
88 Chapter 3. Tutorials
MFiX User Guide, Release 21.4
• Create a new visualization tab by pressing the next to the Model tab.
• Click the 3D view button to view the vtk output files.
• On the VTK results tab, the visibility and representation of the *.vtk files can be controlled with the menu on the
side.
90 Chapter 3. Tutorials
MFiX User Guide, Release 21.4
This tutorial will illustrate various seeding options when initializing particles in an initial condition region. It is based on
the 3d hopper tutorial. We will only change the initial conditions.
Instead of specifying a solids fraction, we can input a solids mass or a number of particles:
• On the Initial conditions pane, select the “initial solids” region.
• In the Solids>DEM pane, Click the button in the Particle size distribution table (the table is initially empty
if no psd have been defined yet):
92 Chapter 3. Tutorials
MFiX User Guide, Release 21.4
We now have a psd that we can use in initial or mass inlet boundary conditions.
• Go to the Initial condition pane, go to the drop down menu under ‘Particle size distribution’ and select
the psd we just defined, Normal (mean = 0.01 m).
• Run the simulation and visualize the particles.
Besides the Normal and Log-normal psd’s, we can also use custom distribution from a text file. It can be edited through
any text editor including the GUI built-in editor. The PSD custom file is organized as follows:
1st line: Number of points, number of distribution (this must be set to one currently).
2nd line: PDF (probability density function) of CDF (Cumulative distribution function).
3rd line: Header.
4th line and below: The data itself. First column is the diameter, second column is either the PDF or CDF value.
The figure below shows an example of a custom PSD file. Only the first few lines are shown.
Fig. 3.4: Example of a Custom file used to define a Particle Size Distribution.
• In the Solids>DEM pane, Click the button in the Particle size distribution table, and define a custom psd:
• Name: Bimodal psd (use a descriptive name).
• Distribution type: Custom
• Select file: Choose bimodal_psd.txt in the project directory.
• Click Plot distribution.
94 Chapter 3. Tutorials
MFiX User Guide, Release 21.4
visualization viewport by clicking on the sign on the right-most tab and select the histogram view. This will
setup a histogram plot. Users can change the file to view, the variable, number of bins and style (lines or bars). To
adjust the scale, right-click on the view and enter the axis limits or have them be automatically updated based on
data.
96 Chapter 3. Tutorials
MFiX User Guide, Release 21.4
We can read the initial particle data from a text file, called particle_input.dat. The format of this file has changed
in the 20.3 release. The old file version can still be used but it is recommended to use the latest format.
The new format allows to either read variables or set a constant value for all particles. The file contains a long header
where information about the data is specified. This controls how many columns and which variables are read from the
file. Next, the data section contains the data for each particle. Each column corresponds to a variable. In 3D, the first 3
columns are always the x,y and z coordinates of the particle’s center. In 2D, the first 2 columns are always the x and y
coordinates of the particle’s center. There are two options for the other variables: either read the data for each particle in
the next column, or assign a constant value to all particles.
Below is an example of a particle_input.dat file (the line number is shown on the left and it not part of the data
itself):
• Line 1 : File version. Do not change this line.
• Lines 2-18 : Instructions to use the file.
• Line 19 : This is a 3D geometry. The first 3 columns in the data section will be x,y,z.
• Line 20 : We will read data for 35361 particles.
• Line 24 : We always read coordinates in the first 2 or 3 columns (do not change)
• Line 25 : We do not read particle’s phase ID for each particle. It is assigned a constant value: 1
• Line 26 : We will read the particle’s diameter in the next column (column#4).
• Line 27 : We do not read particle’s density. It is assigned a constant value: 2500.0 kg/m^3
• Line 25 : We do not read particle’s velocity. It is assigned a constant value: (u,v,w) = (0.0,0.0,0.0) m/s
• Lines 29-30: This is a cold, non reacting case, we do not read Temperature or species.
• Line 31 : We do not have user scalars, so we do not read them.
• Lines 32-34: Data header
The data starts on Line 35. Based on the above settings, we need to read, x,y,z, and the diameter of each particles, i.e., 4
columns, for 35361 particles. Only the first few lines of the data is shown.
1 Version 2.0
2 ========================================================================
3 Instructions:
4 Dimension: Enter "2" for 2D, "3" for 3D (Integer)
5 Particles: Number of particles to read from this file (Integer)
6 For each variable, enter whether it will be read from the file
7 ("T" to be read (True), "F" to not be read (False)). When not read, enter the
8 default values assign to all particles.
9 Coordinates are always read (X,Y in 2D, X,Y,Z in 3D)
10 Phase_ID, Diameter, Density, Temperature are scalars
11 Velocity requires U,V in 2D, U,V,W in 3D
12 Temperature is only read/set if the energy equation is solved
13 Species are only read/set if the species equations are solved, and requires
14 all species to be set (if phase 1 has 2 species and phase 2 has 4 species,
15 all particles must have 4 entries, even phase 1 particles (pad list with zeros)
16 User scalars need DES_USR_VAR_SIZE values
17 Data starts at line 35. Each column correspond to a variable.
18 ========================================================================
19 Dimension: 3
20 Particles: 35361
(continues on next page)
98 Chapter 3. Tutorials
MFiX User Guide, Release 21.4
This data files contains particles that have settled in the top half of the hopper. To use it as initial conditions:
• In the Solids>DEM pane, uncheck Enable automatic particle generation, and enter a data file
particle count of 35361. An entry is required to maintain compatibility with the old format, but the value on line
20 of the version 2.0 file will actually be used.
• In the Initial condition pane, delete the Initial solids initial condition.
• In the Run pane, set the stop time to 1.0 seconds.
• Run the simulation. You should see the initial configuration shown below:
This tutorial shows how to use procedural shapes to define geometry. This capability was introduced in the 21.1 release.
Simple shapes (cylinder and bends) will be defined and combined to create the geometry. Each shape is controlled by
parameters. Filters are applied to the shapes to transform (scale, translate, rotate) the geometry, or flip the normal vector
orientation (internal vs external flow). Boolean operations are used to combine the shapes.
The primary focus of this tutorial is to build the geometry. This is done in SMS mode (see SMS meshing workflow tutorial
for more details).
Fig. 3.8: Example of a DEM initial condition using particle_input.dat version 2.0.
• If you have not switched to SMS workflow, you will be prompted to switch. Accept SMS mode.
• Choose -> Procedural > Cylinder as the geometry input (named cylinder).
• Choose -> Procedural > Bend as the geometry input (named “bend”).
• Enter the bend’s parameters:
– Front section: Radius = 0.02 m, Length = 0.05 m, Resolution = 10
– Back section: Radius = 0.05 m, Length = 0.25 m, Resolution = 20
– Bend section: Major radius = 0.075 m, Minor radius = 0.02 m, Start angle= 0 deg, end angle = 90 deg,
resolution = 16
– Circumference: Start angle= 0 deg, end angle = 360 deg, resolution = 16
– Check the Bottom cap and Top cap check boxes and set the resolution to 3 for both caps. Leave Offset
=0
• Rotate and translate the bend:
– Select the bend (named bend)
• Choose -> Procedural > Bend as the geometry input (named bend1).
• Enter the bend’s parameters:
– Front section: Radius = 0.02 m, Length = 0.1 m, Resolution = 10
– Back section: Radius = 0.02 m, Length = 0.1 m, Resolution = 10
– Bend section: Major radius = 0.05 m, Minor radius = 0.02 m, Start angle= 0 deg, end angle = 90 deg,
resolution = 10
– Circumference: Start angle= 0 deg, end angle = 360 deg, resolution = 16
– Check the Bottom cap and Top cap check boxes and set the resolution to 3 for both caps. Leave Offset
=0
• Add a filter: -> flip normals. Now the vecors point towards the fluid region. The tips of the arrows
are not visible, but we can see the origin (shown as a dot at the center of each face).
• Click the button to create a new region to be used by a mass inlet boundary condition.
• Select Mass inlet in the Boundary type drop down menu.
• Enter a name for the region in the Name field (“top inlet”).
• Change the region Color to Red.
• Click the button to create a new region to be used by another mass inlet boundary condition.
• Select Mass inlet in the Boundary type drop down menu.
• Enter a name for the region in the Name field (“bottom inlet”).
• Change the region Color to Pink.
• Click the button to create a new region to be used by pressure outlet boundary condition.
• Select Pressure Outflow in the Boundary type drop down menu.
• Enter a name for the region in the Name field (“outlet”).
• Change the region Color to Yellow.
• click the button to create a new region that covers the entire domain to be used for the wall boundary
condition.
• Select No-slip wall in the Boundary type drop down menu.
• Enter a name for the region in the Name field (“wall”).
Note: The pressure outlet and mass inflow boundaries are located along the domain box. They are defined as rectangular
2D regions and must overlap the actual boundary areas (intersection of the STL file with the box planes). The exact
boundary area will be computed automatically when preprocessing is performed.
• click the button to create a new region that will be used as initial condition region. This is not needed to
generate the mesh, but will be used later when setting up the simulation.
• Leave the Boundary type to None.
• Enter a name for the region in the Name field (“init bed”).
• Change the region Color to Black.
• Set the Y-extent form ymin to 0.15 m.
• Click Generate.
• Look at the console output to verify the mesh generation completed successfully.
• In the Model view, hide the Geometry, Background Mesh and Regions, show the Boundary_Mesh, set Color by to
bc_id, Style to edges and opacity to 1.0.
• The Boundary_Mesh should look like a closed surface with colors matching the Boundary Conditions regions.
After inspection, the mesh is deemed acceptable and we can move to setting up the simulation (Solver mode). Click
Accept. This will unlock the Modeler tab.
Switch to the Modeler tab (second tab at the bottom left corner of the GUI).
• On the Model pane, enter a descriptive text in the Description field.
• Select “Discrete Element Model (MFiX-DEM)” in the Solver drop-down menu.
• Keep all other settings at their default values.
We already have set all the regions, there is no change required in this pane.
• Create a new visualization tab by pressing the next to the Model tab.
• Click the 3D view button to view the vtk output files.
• On the VTK results tab, the visibility and representation of the *.vtk files can be controlled with the menu on the
side.
The following tutorials demonstrate advanced features that can be implemented with user defined files (UDFs). They
require editing Fortran source files (usr_*.f or other *.f files) and building the custom solver.
• Reacting flows
– Silane Pyrolysis (2D TFM): Setup TFM reaction rates.
– Silane Pyrolysis (3D PIC): Setup PIC/DEM reaction rates.
– Absorption column (2D TFM): Setup TFM reaction rates and user-defined properties.
• Transient keyframe data
– Conveyor belts (Granular DEM): Impose tangential velocity to wall. Download pdf file
– Rotating drum (Granular DEM): Impose tangential velocity to wall. Download pdf file
– Screwfeeder (Granular DEM): Control a group of particles to represent moving geometry. Download pdf
file
– Pulsating fluidized bed (TFM): Impose fluctuating inlet velocity Download pdf file
FOUR
MODEL GUIDE
The Model pane is used to specify global project settings. Depending on what is selected, other panes are enabled or
disabled.
• Description allows for a short model description to be provided. This is written in the .OUT file by the solver.
• Solver specifies the model solver.
– Single phase is the MFiX fluid solver. This disables all solids model inputs.
– Two-Fluid Model (MFiX-TFM) treats both the fluid and solids as interpenetrating continua.
– Discrete Element Model (MFiX-DEM) treats the fluid as a continuum while modeling individual particles and
collisions.
– Particle in Cell Model (MFiX-PIC) treats the fluid as a continuum while using “parcels” to represent groups of
real particles with similar physical characteristics.
• Disable the fluid phase turns off the fluid solver for MFiX-TFM and MFiX-DEM simulations for pure granular
flows. The fluid solver cannot be disabled for single phase flows.
• Enable thermal energy equations solves thermal transport equations for all phases.
• Turbulence Model incorporates the selected turbulence model.
– None
– L-Scale Mixing - Do not include turbulence.
∗ Requires a turbulent length scale definition for all initial condition regions.
– K-Epsilon - Do not include turbulence.
∗ Requires turbulent kinetic energy and turbulent dissipation definitions for all initial condition regions and
all mass and pressure inflow boundary conditions.
• Max turbulent viscosity has units of (P a · sec) and is used to bound turbulent viscosity.
m
• Gravity has units of ( sec 2 ) and defines gravitational acceleration in the x, y, and z directions.
• Drag Model specifies the fluid-particle drag model. This option is only available with the MFiX-TFM and MFiX-
DEM solvers.
115
MFiX User Guide, Release 21.4
– Syamlal-O’Brien [SB1988]
∗ Requires the specification of the C1 tuning parameter, 0.8 by default.
∗ Requires the specification of the D1 tuning parameter, 2.65 by default.
– Beestra-van der Hoef-Kuipers [BVK2007]
– Gidaspow [DG1990]
– Gidaspow Blend [LB2000]
– Holloway-Yin-Sundaresan [HYS2010]
∗ Requires the specification of the lubrication cutoff distance, 1e-6 meters by default.
– Koch-Hill [HKL2001]
– Wen-Yu [WY1966]
– User-Defined Function (UDF)
∗ A custom drag model must be provided in the usr_drag.f file
∗ A custom solver must be built.
Note: The polydisperse tag following a specified drag model indicates that the polydisperse correction factor is available.
For additional details see [HBK2005], [BVK2007a], and [BVK2007b].
Note: There are some restrictions to when using sub-grid models. They are only available with MFiX-TFM simulations
using the Wen-Yu drag law, and without turbulence model. Additional restrictions apply.
4.2 Geometry
The Geometry pane is used to define the model geometry. This includes whether the model is 2D or 3D, and the overall
domain extents (xmin, xmax, ymin, ymax, zmin, zmax). If there is complex geometry, the “Auto-size” button can
automatically set the extents to surround the geometry.
The geometry section provides tools for adding geometry objects (from STL files, or primitive elements), filters to trans-
form geometry objects, and wizards to automate creating common complex geometries. Geometry objects can be copied,
removed, or combined using Boolean operations. All the geometry operations are done using the Visualization Toolkit
(VTK)’s library.
Geometry toolbar icons:
Icon Description
In the geometry tree, the geometry object is displayed with the following icons:
polydata
implicit
filter
union
intersect
difference
To add a Geometry object, click on the (Geometry) icon and select the geometry to add from the drop-down menu.
There are two types of geometric objects supported in the GUI: implicit functions (quadrics), and objects defined by
polydata (everything else: STL files, procedural shapes, primitives, parametrics, wizard geometry).
The following geometric objects can be added:
• STL files (select a *.stl file from a file dialog)
• Procedural shapes (cylinder, bend)
• Implicit (Quadric) functions (sphere, box, cylinder, cone, quadric, superquadric)
• Primitives (sphere, box, cylinder, cone)
• Parametrics (torus, boy, conic spiral, etc.)
Procedural shapes were introduced in the 21.1 release. These are triangulated polydata objects that are defined by a series
of parameters. They offer better control on the triangles quality than implicits or primitives.
Cylinder
Parameters:
• Radius (R)
• Height (H)
• Number of divisions along the height
• Starting angle in the circumferential direction
• Ending angle in the circumferential direction
• Number of divisions along the circumferential direction
• Bottom cap
• Number of divisions in the bottom cap’s radial direction
• Top cap
• Number of divisions in the top cap’s radial direction
The top and bottom caps are shaped like fans, i.e., they converge radially towards the center of the cap. Caps are not
needed if the cylinder extends past the MFiX domain in the axial direction, when inlet/outlet boundary conditions are
defined along the MFiX box (say at y=ymin and y=ymax for a vertical cylinder).
It is recommended to include caps when combining shapes (union, intersection, difference) since the boolean operations
are more robust with closed shapes.
Bend
Front section:
• Length (L f )
• Radius (R f )
• Number of divisions along the front section length
Back section:
• Length (L b )
• Radius (R b )
• Number of divisions along the back section length
Bend section:
• Major radius (R M )
• Minor radius (R m )
• Starting angle (θ f )
• Ending angle (θ b )
• Number of divisions in the angular direction
Circumference:
• Starting angle in the circumferential direction
• Ending angle in the circumferential direction
• Number of divisions along the circumferential direction
Caps:
• Bottom cap
• Number of divisions in the bottom cap’s radial direction
• Top cap
• Number of divisions in the top cap’s radial direction
To apply a filter to the selected geometry, select a filter from the Filter menu. The filter options can be edited in the
parameter section. The following filters are included:
4.2.4 Wizards
Three wizards are available to more easily create common multiphase flow geometries: cyclones, reactors, and hoppers.
A special “distributed” wizard is used to distribute one geometry inside another geometry with random, cubic, or body
centered cubic positions. Random rotations can also be applied with the wizard.
To remove a selected geometry, click the (Remove) button. If a geometry is grouped as part of a Boolean Operation,
removing it is disabled until that Boolean Operation is removed first.
To duplicate the selected geometry, click the (Duplicate) button. If multiple geometry objects are selected, dupli-
cation is disabled.
There are two types of geometric objects supported in the GUI: implicit functions (quadrics) and objects defined by
polydata (everything else: STL files, primitives, parametrics, wizard geometry). Boolean operations cannot be performed
between polydata and implicit geometry objects; the implicit function needs to be converted to polydata by using the
sample implicit filter. Converting the implicit function also needs to be done in order for the GUI to export a STL
file that the mfixsolver can use.
Boolean operations can only be performed with geometry objects of the same type (implicit, polydata). Boolean operations
can not be performed between polydata and implicit geometry objects. If an implicit and a polydata must be managed
together, the implicit object must be first converted to a polydata object using the sample implicit filter.
Note: Boolean operation between two polydata objects is supported by MFiX, but for complex objects the VTK library
may crash.
4.3 Mesh
The Background tab is for specifying the mesh used by the Eulerian solver. A uniform mesh can be specified by entering
the number of cells in the x, y, and z directions. The resulting Cell Size is computed from the geometry and the number
of cells (Cell Size is not editable directly). The resulting mesh will be visible in the model setup view. The visibility of
the mesh can be toggled with the (Visibility) button at the top of the model setup view.
Control points can be added by pressing the button. Once a control point has been added, the position, number
of cells, stretch, first and last parameters can be changed. To split a control point, right-click on the control point
and select split from the resulting menu. This operation will create a new control point at the midpoint between the
previous control point and the selected control point, dividing the cells evenly between the two. Control points can be
4.3.2 Mesher
Meshing of complex geometry is performed dynamically by the solver at runtime. The Mesher tab exposes options to
adjust the cut-cell mesher. These options include:
Option Description
External select internal or external flow. Note: this depends on which way the normals are pointing on the STL
flow file. If they are pointing out of the geometry, then the text will be correct.
Small cell tolerance to detect, and remove small cells
tolerance
Small area tolerance to detect, and remove cells with small faces
tolerance
Merge toler- tolerance used to merge duplicate nodes
ance
Snap toler- tolerance to move an intersection point to an existing cell corner
ance
Allocation factor used in allocation of cut-cell arrays
Factor
Maximum maximum number of iterations used to find intersection points
iterations
Intersection tolerance used to find intersection of background mesh and STL triangles
tolerance
Facet angle ignore STL facets that have an angle less than this tolerance
tolerance
Dot product tolerance used to determine if a point lies in a facet
tolerance
Max facets maximum number of facets allowed in a cell
per cell
4.4 Regions
The Regions pane defines spatial regions (points, lines, planes, boxes, or STLs) of the geometry that are used for:
• Initial Conditions
• Boundary Conditions
• Point Sources
• Internal Surfaces
• Monitors
• Outputs
The following buttons are at the top of the Regions pane:
Icon Description
The (Add) button creates a new region. The region will be created with a generic name such as R_1; it is strongly
recommended to rename the region to something more descriptive, so that it is easier to refer to it later. The Color button
will change the color of the region in the model setup view.
The table created with the “From” and “To” fields for the X, Y, and Z axes define the extents of the region. These widgets
take special parameters, min and max, that reference the minimum and maximum values of the domain, as specified in
the geometry section. These values will get automatically updated when the extents in the geometry section are updated.
The region type will be inferred from the specified extents.
If the region needs to be a collection of triangles from the STL file, select the Select Facets (STL) check-box. The
selection shape can be changed between a box and an ellipsoid. Triangles that fall on the edge of the shape can be sliced
by selecting the Slice Facets check-box. The triangles can be further filtered by the normal direction by specifying a
vector and a deviation angle around that vector.
Hint: If a region is referenced by an item in the Used By column, the region can not be deleted and its type (STL vs
non-STL) cannot be changed.
4.5 Fluid
The fluid pane is used to select the models and parameters defining the fluid phase. The fluid pane is only accessible if
the fluid phase is being solved.
Name The name used to refer to the continuous phase in the GUI. By default, the continuous phase is termed “fluid”,
However, it may be renamed for convenience.
Solve Momentum Equation By default, all momentum equations are solved. Individual momentum equations may be
disabled by toggling the check box.
Solve Species Equations By default, species transport equations are not solved for the fluid phase. If species equations
are enabled, species will need to be added to the fluid phase using the fluid species tool.
Enable Scalar Equations By default, no additional scalar transport equations are solved with the fluid phase. Additional
scalars may be added by toggling the scalar checkbox and specifying the number of additional scalars to track.
Energy Equations Energy equations cannot be enabled or disabled on a per-phase basis. As such, they are enabled or
disabled for all phases in the Model Setup pane.
• Constant:
– A positive (non-zero) number must be provided.
• Ideal gas law
– Requires fluid temperature be specified for the whole domain and all flow boundary conditions.
– Requires a fluid molecular weight.
• User-Defined Function (UDF)
– A custom equation of state must be provided in the usrproperties.f
– A custom solver must be built.
Viscosity has units of (P a · sec) and may be specified using one of the following approaches.
• Constant:
– A positive (non-zero) number must be provided.
• Sutherland’s law
– Requires fluid temperature be specified for the whole domain and all flow boundary conditions.
• User-Defined Function (UDF)
– A custom equation of state must be provided in the usrproperties.f
– A custom solver must be built.
kg
Molecular Weight has units of ( kmol ) and may be specified using one of the following approaches.
• Constant:
– A positive (non-zero) number must be provided.
• Mixture
– Requires fluid species definition.
– Requires fluid species mass fractions specification for the whole domain and all flow boundary conditions
J
Specific Heat has units of ( kg·K ) and may be specified using one of the following approaches.
• Constant:
– A positive (non-zero) number must be provided.
• Mixture
– Requires fluid species definition.
– Requires fluid species mass fractions specification for the whole domain and all flow boundary conditions
• User-Defined Function (UDF)
– A custom equation of state must be provided in the usrproperties.f
– A custom solver must be built.
W
Thermal Conductivity has units of ( m·K ) may be specified using one of the following approaches.
• Constant:
– A non-negative number must be provided.
• Dilute Mixture Approximation
– Requires fluid temperature be specified for the whole domain and all flow boundary conditions.
• User-Defined Function (UDF)
– A custom equation of state must be provided in the usrproperties.f
– A custom solver must be built.
Reference pressure has units of (P a) and is zero by default. A constant value may be specified to shift the simulation
pressure prior to scaling.
Pressure scale factor is dimensionless and is one by default. A constant value may be specified to scale the simulation
pressure.
Specie that comprise the fluid phase are summarized in the species overview table. New species are added by clicking
the add button, , at the top of the species table, and selecting one or more valid regions (see Fig. 4.6).
4.6 Solids
The solids pane is used to set solids phases material properties. The “Materials” tab sets material properties shared by
most models (TFM, DEM and PIC). Specific settings for each model are accessed through their respective tabs (TFM,
DEM, or PIC).
A new solids phase is created by clicking the add button, , at the top of the solids table. This will create a new entry
in the table. The table summarizes all defined solids phases by listing the name, model, particle diameter and density. A
blank entry in the density means the particle density is variable (it depends on its chemical composition).
Name The name used to refer to the solids phase in the GUI. By default, the solids phase is called “Solid” followed by its
assigned phase number. The phase number is incremented every time the button is pressed. The solids phase
name may be renamed for convenience (optional). This name will appear in other panes or tabs when referring to
the solids phase (say while setting initial or boundary conditions).
Model (read only)
The modeling approach used to represent the solids phase. Available options include TFM (Two-Fluid
Model), DEM (Discrete Element Model) and PIC (Particle in Cell). The setting is currently locked (the
same solid model must be used for all solids phases), and mirrors the solver selection in the Model Setup
pane.
A solids phase can be deleted by selecting it (click on its name in the solids table) and clicking the remove button, ,
at the top of the solids table. If the solids phase is used in the model with a non-zero solids fraction (say in an initial or
boundary condition), the deletion will need to be confirmed by the user. If confirmed, the deleted solids volume fraction
will be assigned back to the fluid phase.
Solve momentum equation (TFM only) By default, all momentum equations are solved. Individual momentum equa-
tions may be disabled by toggling the check box.
Solve species equations By default, species transport equations are not solved for the solids phase. If species equations
are enabled, species will need to be added to the solids phase using the solids species tool. ADD REF
Some material properties are only needed for a specific solid model or when the energy or species equation is solved.
Diameter (m) The initial particle diameter. It will remain constant for non-reactive flows, and for reactive flows with
a variable density. If the density is constant, and chemical reactions take place, the particle diameter will vary to
reflect particle mass gain/loss.
Density (kg / m3 ) The particle density can be set as:
• Constant:
– A positive (non-zero) number must be provided.
– The diameter may change due to chemical reactions.
• Variable:
– The density is computed from particle’s mass and volume.
– The particle mass is function of the particle’s chemical composition.
– A variable density can only be used if species equations are solved.
Viscosity (P a · s) TFM only It may be specified using one of the following approaches:
• Constant:
– A positive (non-zero) number must be provided.
• Continuum Solids stress Theory
• User-Defined Function (UDF)
– A custom equation of state must be provided in the usrproperties.f
– A custom solver must be built.
kg
Molecular weight ( kmol ) It may only be specified using the following approach, and is only used when Energy and
solids species equations are solved:
• Mixture
– Requires species be used to defined the solid.
– Requires species mass fractions be specified for the whole domain and all flow boundary conditions
J
Specific heat ( kg·K ) It may be specified using one of the following approaches (only used when Energy and species
equations are solved):
• Constant:
– A positive (non-zero) number must be provided.
• Mixture
– Requires species be used to defined the fluid.
– Requires species mass fractions be specified for the whole domain and all flow boundary conditions
• User-Defined Function (UDF)
– A custom equation of state must be provided in the usrproperties.f
– A custom solver must be built.
W
Thermal conductivity ( m·K ) It may be specified using one of the following approaches:
• Constant:
Specie that comprise the solid phase are summarized in the species overview table. New species are added by clicking
Disable close pack (TFM only) Options to enable/disable a TFM phase from forming a packed bed. This is typically
used to make the solids phase behave as a liquid phase.
Enable added mass force (TFM only) Options to enable/disable the added (or virtual) mass force in a TFM phase.
This tends to stabilize bubbly gas/liquid flows.
Specific Two-Fluid Model settings are accessed from the TFM tab.
Packed bed void fraction (−) The void fraction at close pack.
Viscous stress model The solids phase stress model. Options include the algebraic formulation or various kinetic theo-
ries requiring solving a Partial Differential Equation for the granular energy:
• Algebraic Formulation [DEFAULT]
• Lun et al, 1984
• Iddir & Arastoopour, 2005
• Simonin, 1996 (requires k-ε turbulence enabled)
• Cao & Ahmadi, 1995 (requires k-ε turbulence enabled)
• Garzo and Dufty, 1999 (monodisperse system only)
• Garzo, Tenneti, Subramaniam, Hrenya, 2012 (monodisperse system only)
• Garzo, Hrenya and Dufty, 2007 - Requires at most two solids phases - Requires Wen-Yu or HYS drag model
- Selection not available with added mass force
Frictional stress model
• Schaeffer model [DEFAULT]
• Srivastava and Sundaresan
• Only solids pressure
Solids volume fraction at onset of friction (−) The minimum solids fraction above which the Srivastava and Sundare-
san model sets in.
Particle-particle restitution coefficient (−) : The coefficient of restitution for particle-particle collision.
Interphase friction coefficient (−) : The coefficient of friction between particles of two solids phases.
Angle of internal friction (deg) : The angle of internal friction. The plastic regime stress can be turned off by setting
this value to zero.
Radial distribution function
• Carnahan-Startling (only option for monodisperse systems)
• Lebowitz (default for polydisperse system)
• Mansoori (polydisperse system)
• Modified Lebowitz (polydisperse system)
• Modified Mansoori (polydisperse system)
Stress blending The blending function used to smooth transition around the packed bed volume fraction. It requires the
Schaeffer frictional stress model.
• None [DEFAULT]
• Hyperbolic Tangent
• Sigmodial
Segregation slope coefficient (−) Coefficient used in calculating the initial slope in segregation for polydisperse systems.
Max packing correlation The correlation used to compute the maximum packing for polydisperse systems:
• Constant [DEFAULT]
• Yu & Standish
• Fedors & Landel (only with two solids phases)
Excluded volume in Boyle-Massoudi stress (?) The excluded volume in Boyle-Massoudi stress. It is only used with
the algebraic formulation of viscous stress model (optional).
Specific Discrete Element Model settings are accessed from the DEM tab.
Enable automatic particle generation Initialize particle location and velocity based on information from Initial Con-
dition regions. If this option is disabled and any initial condition uses a non-zero solids volume fraction, the user
will be prompted to turn on this option. Disabling this option will read initial particle location and velocity from a
user generated text file (particle_input.dat) that must be saved in the project directory.
Data file particle count (−) The number of particles read from particle_input.dat file when the automatic particle gen-
eration is turned off. This number must be smaller or equal to the number of lines in the file.
Particle Size Distribution (PSD) A series of PSDs can be defined to be used in an initial condition region or a mass
inlet boundary condition. A PSD represents the number of particles having a given size. It is currently a number-
based (not volume-based) distribution. A new PSD is created by clicking the add button, , and entering the
PSD parameters. The PSD can follow a Normal or Log-normal distribution. There is an option to load a text file
containing a custom PSD.
Initially, the table will be empty. Double click on one row to edit a PSD, Click on to remove a PSD from the table.
First, enter a descriptive name for the PSD and choose the PSD type.
Parameters for the Normal and Log-normal distribution are:
• Mean particle diameter
• Standard deviation
• Minimum diameter , used to clip the distribution and avoid extremely small particles
• Maximum diameter , used to clip the distribution and avoid extremely large particles
Custom PSDs will read the distribution from a text file. It can be edited through any text editor including the GUI built-in
editor. The PSD custom file is organized as follows:
1st line: Number of points, number of distribution (this must be set to one currently).
2nd line: PDF (probability density function) of CDF (Cumulative distribution function).
3rd line: Header.
4th line and below: The data itself. First column is the diameter, second column is either the PDF or CDF value.
The figure below shows an example of a custom PSD file. Only the first few lines are shown.
Fig. 4.3: Example of a Custom file used to define a Particle Size Distribution.
Once the parameters are defined, the PSD can be plotted by clicling the ‘Plot distribution’ button.
Integration method The DEM time stepping scheme when integrating the particle trajectories (acceleration to velocity
and velocity to position):
• Euler [DEFAULT]
• Adams-Bashforth
Collision model The soft-sphere collision model:
• Linear Spring Dashpot (LSD)
• Hertzian
Coupling method The level of coupling between the gas phase and the solids phase:
• One-way coupled
• Fully coupled
Interpolation The direction of interpolation between field and particle data:
• No interpolation
• field-to-particle and particle-to-field
• field-to-particle only
• particle-to-field only
Scheme The interpolation scheme:
• None (centroid method)
• Garg, 2012 (interpolation width is dictated by grid spacing)
• Square DPVM (Divided Particle Volume Method), requires an interpolation width.
Width (m) The square DPVM interpolation width.
Enable mean field diffusion Smooths the disperse phase average fields by solving a diffusion equation.
Width (m) The diffusion length scale.
Enable explicit coupling of interphase quantities Option to explicitly couple the fluid and solids hydrodynamics.
Friction coefficient (−) The particle-particle and particle-wall Coulomb friction coefficient. This is required for both
the LSD and Hertzian collision models.
N
Normal spring constant ( m ) The particle-particle and particle-wall normal spring constant (LSD collision model).
Spring norm/tan ratio (−) The ratio of normal to tangential spring constants for particle-particle and particle-wall
(LSD collision model).
Damping norm/tan ratio () The ratio of normal to tangential damping factors for particle-particle and particle-wall
(LSD collision model).
Young’s modulus (P a) The wall and particles (one entry per phase) Young’s modulus (Hertzian collision model).
Poisson’s ratio (−) The wall and particles (one entry per phase) Poisson’s ratio (Hertzian collision model).
Restitution coefficients (normal) (−) The list of normal restitution coefficients for particle-wall and particle-particle
interaction. The particle-particle entries are arranged into a symmetrical matrix. The diagonal terms and the upper
side of the matrix need to be filled. There is one entry per phase for the particle-wall coefficient. This settings is
required for both the LSD and Hertzian collision models.
Restitution coefficients (tangential) (−) The list of tangential restitution coefficients for particle-wall and particle-
particle interaction. The particle-particle entries are arranged into a symmetrical matrix. The diagonal terms
and the upper side of the matrix need to be filled. There is one entry per phase for the particle-wall coefficient.
This settings is only required for the Hertzian collision model.
Cohesion model Toggles the van der Waals cohesion model. When turned on, additional parameters need to be set (see
below):
Hamaker constant (J) The particle-particle and particle-wall Hamaker constant used in the van der Waals cohesion
model.
Outer cutoff (m) The particle-particle and particle-wall maximum separation distances above which the van der Waals
cohesion forces are set to zero.
Inner cutoff (−) The particle-particle and particle-wall minimum separation distances below which the van der Waals
cohesion forces are computed using a surface adhesion model.
Asperities (−) The mean radius of surface asperities used in the cohesive force model.
Minimum fluid volume fraction (−) Threshold used to clip the fluid phase volume fraction (to avoid non-physical
values, typically when a particle size is near a small cut cell).
Neighbor search method The neighbor search algorithm:
• Grid-based
• N-Square
Max steps between neighbor search (−) The maximum number of DEM iterations between two neighbor searches.
The neighbor search may be called earlier if the particle moves a distance greater than a defined quantity (see
below).
Factor defining particle neighborhood (−) A multiplying factor applied to the particle’s radius to define the region
where particle neighbors are searched from.
Distance/diameter triggering search (−) The distance a particle can travel before triggering an automatic neighbor
search.
Search grid partition (−) The number of DEM grid cells in each direction used for the neighbor search. This is an
optional setting. If left undefined, the number of cells is computed so that the DEM grid size is three times the
maximum particle diameter.
Enable user scalar tracking Turns on the tracking of user-defined scalars attached to each particle. When the tracking
is enables, the number of scalars (positive integer) needs to be set.
Minimum conduction distance (m) The minimum separation distance between particles (used in the particle-fluid-
particle conduction model to remove singularity).
Fluid lens proportionality constant (−) Constant used to calculate the fluid lens radius that surrounds the particle (used
in the particle-fluid-particle conduction model).
Young’s modulus used to correct DEM conduction (P a) The wall and particles (one entry per phase) Young’s mod-
ulus used to correct the DEM conduction. These optional input are used with both LSD and Hertzian collision
models. Particles are typically made softer to increase the DEM time step. This may lead to inaccurate conduc-
tion. If defined, this Young’s modulus will be used to correct the DEM conduction model.
Poisson’s ratio used to correct DEM conduction (−) The wall and particles (one entry per phase) Poisson’s ratio used
to correct the DEM conduction. These optional input are used with both LSD and Hertzian collision models.
Specific Particle in Cell settings are accessed from the PIC tab.
Many of the PIC settings refer to the PIC solids stress model, which influences parcel motion:
P p γ
p
τp = max[cp −p ,δ(1−p )]
Void fraction at close pack (−) The void fraction (cp ) at maximum packing.
Volume fraction exponential scale factor (−) The empirical exponent (γ) on solids fraction in the solids stress model.
Typical values are between 2.0 to 5.0.
Pressure linear scale factor (P a) The empirical pressure (Pp ) constant in the solids stress model. Typical values are
10 to 1000 Pa.
Empirical dampening factor (−) A factor in a restitution coefficient for comparing solids stress with slip velocity.
Typical value is 0.85.
Non-singularity constant (−) The constant (δ) to prevent division by zero in solids stress model. Typical value is
1.0E-8.
Wall normal restitution coefficient (−) The parcel-wall restitution coefficient for normal velocity component after wall
collision.
Wall tangential restitution coefficient (−) The parcel-wall restitution coefficient for tangential velocity component af-
ter wall collision.
Solids slip velocity scale factor (−) A damping coefficient on slip velocity. Typical value is 1.0.
4.7 Scalars
To add a Scalar, navigate to the Scalars pane from the Modeler View, and click the (+) button.
To remove a Scalar, navigate to the Scalars pane from the Modeler View, select the scalar to remove, and click the (-)
button.
By default, scalars are named “Scalar ID” where ID is the index of the scalar. It is recommended to edit the Name to
something more descriptive. However, the scalar name is local to the GUI and not provided to the solver; in the solver
and UDFs the Scalar is only referred to by Index.
There is a drop-down box to select the convecting phase from the phases defined in Fluids or Solids panes.
Selecting a phase with index PHASE sets keyword PHASE4SCALAR(ID) = PHASE where ID is the scalar index for
the current scalar. PHASE is 0 for the fluid phase, or a positive integer for TFM solids.
The fluid phase is only an option when the fluid solver is enabled (Disable Fluid Solver is unchecked on Model Pane). Any
defined TFM solids phases are listed as options for PHASE, but DEM and PIC solids phases are not listed as options.
The MFiX solver assumes scalar array inputs are contiguous. As a result, if one or more scalar equations is removed or
the order of the scalars is changed, then all scalar input arrays must be updated. For example, consider three scalars that
are convected with a different phase.
NScalar = 3
Phase4Scalar(1) = 0
Phase4Scalar(2) = 1
Phase4Scalar(3) = 2
If a user deletes the second scalar, then array values assigned to the third scalar must be shifted down.
NScalar = 2
Phase4Scalar(1) = 0
Phase4Scalar(2) = 2
Phase4Scalar(1:NScalar)
IC_Scalar(:, 1:NScalar)
BC_HW_Scalar(:, 1:NScalar)
BC_ScalarW(:, 1:NScalar)
BC_C_Scalar(:, 1:NScalar)
BC_Scalar(:, 1:NScalar)
VTK_Scalar(:,1:NScalar)
MONITOR_Scalar(:,1:NScalar)
Initial Conditions (ICs) are specified in the Initial conditions task pane. ICs summarized in the IC summary table illustrated
in Fig. 4.5. The MFiX solver will apply ICs in the order that they are defined in this pane. As a result, if two or more
regions overlap, the IC with the larger index (ID) is used in the intersecting region. IC IDs are shown in the table, and
can be changed using the up and down arrows.
To define an initial condition, there must be a region already defined in the Regions Pane.
Initial conditions are specified over rectangular regions corresponding to the scalar grid. A new IC region is created by
clicking the add button, , at the top of the IC region table, and selecting one or more valid regions (see Fig. 4.6).
Valid IC Regions
• Box regions
• XY-planes (2D simulations only)
Invalid IC Regions
• Any region already used by another IC
• XZ- and YZ-planes
• Point regions
• STL regions
When the fluid phase is enabled, initial values for fluid field variables must be specified for the entire computational
domain. The models being solved dictate which variables require an initial value.
Volume Fraction The fluid phase volume fraction has a default value of one. If solids are defined and given volume
fractions greater than zero, the fluid phase volume fraction is automatically calculated by subtracting the sum of the solids
phase volume fractions from one.
Temperature The fluid phase temperature has a default value of 293.15K. Specification of the fluid temperature is
required when the following settings are used:
• The energy equation is solved
• Fluid density is computed by the Ideal Gas Law
• Fluid viscosity is computed by the Sutherland’s Law
Pressure An initial pressure field may be specified. If none is provided, the fluid solver will attempt to impose a hydrostatic
pressure drop across the domain.
Velocity The fluid phase velocity field has a default value of zero.
Species Mass Fractions Species mass fractions must be defined for all species when solving the species transport equa-
tions. By default the species mass fraction of the last defined fluid species is set to one and all others are set to zero. The
total of all species mass fractions must equal one.
Turbulence If using the mixing length turbulence model, a mixing length scale must be defined for the whole domain.
If solving the k-ε turbulence model, initial values for turbulent kinetic energy and turbulent dissipation must be provided.
Radiation Coefficient A radiation coefficient has a default value of zero, and can only be specified when solving the
energy equations. The default value is strongly recommended.
Radiation Temperature The radiation temperature has a default value of 293.15K, and can only be specified when
solving the energy equations. The default value is strongly recommended.
When one or more solids phases are enabled, initial values for solids field variables must be specified for the entire
computational domain. The models being solved dictate which variables require an initial value.
Volume Fraction The solids phase volume fraction has a default value of zero. The sum of all solids phase volume
fractions are used to calculate the volume (void) fraction of the fluid phase. If solids are defined and given volume
fractions greater than zero, the fluid phase volume fraction is automatically calculated by subtracting the sum of the solids
volume fractions from one.
Inventory (DEM solids only) Amount of solids (by mass) in the initial condition region.
Particle count (DEM solids only) Number of particles in the initial condition region.
Particle size distribution (DEM solids only) Particle size distribution in the initial condition region. This can be left
as “Uniform” (default) and the particle diameter (d_p0) defined in the Solids>Material pane will be used. If a PSD was
defined in the Solids>DEM pane, it can be chosen here to initialize particles in this region with a PSD.
Temperature The solids phase temperature has a default value of 293.15K. Specification of solids temperature is required
when solving energy equations.
Pressure (TFM solids only) Solids pressure is an optional input for TFM solids models. There is only one value for all
solids phases.
Granular Temperature The initial granular temperature has a default value of zero.
• For TFM solids, granular temperature can only be specified when solving one of the non-algebraic viscous stress
models.
• For DEM solids models, a value may be specified when using the automatic particle generator to modify the initial
particle velocity distribution.
Species Mass Fractions Species mass fractions must be defined for all species when solving the species transport equa-
tions. By default the species mass fraction of the last defined fluid species is set to one and all others are set to zero. The
total of all species mass fractions must equal one.
Fit particles to region (DEM solids only) This option is used with the automatic particle generator to expand the initial
particle lattice to span the region.
DEM seeding options
Initial lattice distribution (DEM solids only) Particles are initially seeding on a lattice, which can be cubic or hexagonal
arrangement. Hexagonal arrangement can typically achieve higher packing density than cubic arrangement.
Spacing between particle (DEM solids only) Spacing (expressed as a fraction of the largest diameter, must be between
zero and 1) between particles in the lattice. Default value is 0.05 (5% of the particle diameter). This spacing applies
equally in all directions unless one of the spacing factors (x,y, or z direction) is less than one.
Spacing factor in x-direction (DEM solids only) Factor used to reduce the spacing in the x-direction (between zero and
one). This factor is a multiplier to the overall spacing (if the spacing is 0.05 and the factor in x-direction is 0.5, then the
effective spacing in the x-direction is 0.025 times the diameter).
Spacing factor in y-direction (DEM solids only) Factor used to reduce the spacing in the y-direction (between zero and
one). This factor is a multiplier to the overall spacing (if the spacing is 0.05 and the factor in y-direction is 0.5, then the
effective spacing in the x-direction is 0.025 times the diameter).
Spacing factor in z-direction (DEM solids only) Factor used to reduce the spacing in the z-direction (between zero and
one). This factor is a multiplier to the overall spacing (if the spacing is 0.05 and the factor in z-direction is 0.5, then the
effective spacing in the x-direction is 0.025 times the diameter).
Random factor applied to particle positions (DEM solids only) Factor to randomize the particle position around the
baseline lattice position (between zero and one). The same factor applies in all directions unless a random factor less than
one is specified in the x,y or z-direction.
Random factor in x-direction (DEM solids only) Factor used to reduce the randomness in the x-direction (between zero
and one).
Random factor in y-direction (DEM solids only) Factor used to reduce the randomness in the y-direction (between zero
and one).
Random factor in z-direction (DEM solids only) Factor used to reduce the randomness in the z-direction (between zero
and one).
Radiation Coefficient The radiation coefficient has a default value of zero, and can only be specified when solving the
energy equations. The default value is strongly recommended.
Radiation Temperature The radiation temperature has a default value of 293.15K, and can only be specified when
solving the energy equations. The default value is strongly recommended.
When one or more user-defined scalars are enabled, initial values for the scalars must be specified for the entire compu-
tational domain.
Scalar Value For each user-defined scalar, an initial field value must be provided. By default, all scalars are set to zero.
Boundary Conditions (BCs) are specified in the Boundary conditions task pane.
To define a boundary condition, there must be a region already defined in the Regions Pane.
Boundary conditions are specified over rectangular regions.
Valid BC Regions
• Box regions
• XY-planes (2D simulations only)
Invalid BC Regions
• Any region already used by another IC
• Point regions
• STL regions
Volume Fraction The fluid phase volume fraction has a default value of one. If solids are defined and given volume
fractions greater than zero, the fluid phase volume fraction is automatically calculated by subtracting the sum of the solids
phase volume fractions from one.
Temperature The fluid phase temperature has a default value of 293.15K. Specification of the fluid temperature is
required when the following models are used:
• Solving energy equations
• Fluid density mode is the Ideal Gas Law
• Fluid viscosity model is Sutherland’s Law
Pressure An initial pressure field may be specified. If none is provided, the fluid solver imposes a hydrostatic pressure
drop across the domain if one or more pressure outflow boundary conditions is defined.
Velocity The fluid phase velocity field has a default value of zero.
Species Mass Fractions Species mass fractions must be defined for all components when solving the species transport
equations. By default the species mass fraction of the last defined fluid species is set to one and all others are set to zero.
The total of all species mass fractions must equal one.
Turbulence If solving the mixing length turbulence model, a mixing length scales must be defined for the whole domain.
If solving the k-ε turbulence model, initial values for the turbulent kinetic energy and turbulent dissipation must be
provided.
Radiation Coefficient A radiation coefficient has a default value of zero, and can only be specified when solving the
energy equations. The default value is strongly recommended.
Radiation Temperature The radiation temperature has a default value of 293.15K, and can only be specified when
solving the energy equations. The default value is strongly recommended.
Point sources (PS) are used in place of mass inlets where either the geometry and/or grid resolution prohibit proper bound-
ary condition specification. For example, a point source may be used to model an injector with dimensions smaller than
the grid. Point sources may be defined within a single computational cell, along a plane, or as a volume of computational
cells.
Point sources introduce mass directly into a computational cell unlike a boundary condition which specifies flow along a
cell face. One consequence of this implementation is that point sources are subjected to convection/diffusion forces and
may not travel parallel to the specified directional preference. Directional preference may be specified with a velocity
vector (i.e., PS_U_g, PS_V_g, etc.), however, directional preference is not required.
Examples showing how to setup point sources can be found in: legacy_tutorials/point_source_spiral.
Legacy tutorials can be found by downloading the source tarball. They are meant to provide representative setups for
older versions of MFiX (before the launch of the GUI), and are not guaranteed to run with the latest version of MFiX.
To define a point source, there must be a region already defined in the Regions Pane.
To create a new point source, press the button which will bring up the Region Selection dialog. Select a region to
associate with the new point source and press OK.
Mass flow rate The mass flow rate is the rate of mass introduced for the point source. It has a default value of 0.0 kg/s
Temperature The temperature only applies to cases when energy equations are turned on under Model Setup. It has a
default value of 293.15 K.
Velocity The velocity of the mass introduced by the point source is always available. The default velocity is zero.
4.11 Monitors
A Monitor is a tool for capturing data from the solver about the model.
Data (such as volume fraction, pressure, velocity, etc.) for a given Region Selection is written to a CSV file while the solver
is running.
The number of monitors that can be defined for a project is limited to a maximum of 100.
To define a monitor, there must be a region already defined in the Regions Pane. Click the button at the top, which
will open a popup window for selecting the region. A Monitor region is a single point, plane, or volume. Multiple regions
cannot be combined for a monitor, and STL regions cannot be used for monitors.
Filename The monitor output file will have a default name based on the name of the monitor’s region. You can edit
the filename of a monitor by selecting the monitor from the list of monitors and changing “Filename base”. The
monitor data will be output to the Filename base with the extension .csv.
The monitor output file is in Comma Separated Value (CSV) format. The first line of the file provides header
information. For example, running the Silane Pyrolysis tutorial (SP2D) will generate a file PROBE_SPECIES.
csv:
#
# Run type: NEW
# "Time","x_g(1)","x_g(2)","x_g(3)","x_g(4)","x_g(5)","x_s(1,1)","x_s(1,2)"
0.0000000 , 0.0000000 , 0.0000000 , 0.0000000 , 0.
,→0000000 , 1.0000000 , 0.0000000 , 1.0000000
Write Interval The write interval defines how frequently the monitor data will be written to the output file. It has a
default value of 0.05 seconds of simulation time.
After creating a monitor, use the menus and check boxes to select one or more variables.
There is a monitor variable available for each scalar defined on the Scalars tab.
There is a monitor variable available for each reaction defined on the Chemical Reactions tab.
There are different types of monitors available. A monitor type applies an operator (for example a sum, an area integral
or a volume integral) to the variable. The dimensionality of the region determines which operators can be applied.
The table below summarizes the nomenclature used to describe the monitor operators:
Symbol Description
φijk Variable value at indexed cell
εijk Phase volume fraction at indexed cell
ρjk Phase density at indexed cell
~vjk Phase velocity at indexed cell
Aijk Cross-sectional area of cell
Vijk Volume of indexed cell
Point Region
For a point region, the monitor data value is simply the value of the variable at that point:
Value Returns the value of the field quantity in the selected region.
φijk
The following monitor types are valid for area and volume regions:
Sum The sum is computed by summing all values of the field quantity in the selected region.
X
φijk
ijk
min φijk
ijk
max φijk
ijk
Average Average value of the field quantity in the selected region where N is the total number of observations (cells) in
the selected region.
P
ijk φijk
φ0 =
N
Standard Deviation The standard deviation of the field quantity in the selected region where φ0 is the average of the
variable in the selected region.
sP
ijk (φijk − φ0 )
2
σφ =
N
Surface Integrals
Area-Weighted Average The area-weighted average is computed by dividing the summation of the product of the se-
lected variable and facet area by the total area of the region.
R P
φdA ijk φijk |Aijk |
= P
A ijk |Aijk |
Flow Rate The flow rate of a field variable through a surface is computed by summing the product of the phase volume
fraction, density, the selected field variable, phase velocity normal to the facet vn , and the facet area.
Z X
ερφvn dA = εijk ρijk φijk vn,ijk |Aijk |
ijk
Mass Flow Rate The mass flow rate through a surface is computed by summing the product of the phase volume fraction,
density, phase velocity normal to the facet vn , and the facet area.
Z X
ερvn dA = εijk ρijk vn,ijk |Aijk |
ijk
Mass-Weighted Average FIXME The mass flow rate through a surface is computed by summing the product of the
phase volume fraction, density, phase velocity normal to the facet, and the facet area.
R P
ερφ|vn dA| ijk εijk ρijk φijk |vn,ijk Aijk |
R = P
ερ|vn dA| ijk εijk ρijk |vn,ijk Aijk |
Volume Flow Rate The volume flow rate through a surface is computed by summing the product of the phase volume
fraction, phase velocity normal to the facet vn , and the facet area.
Z X
εvn dA = εijk vn,ijk |Aijk |
ijk
Volume Integrals
Volume Integral The volume integral is computed by summing the product of the selected field variable and the cell
volume.
Z X
φdV = φijk |Vijk |
ijk
Volume-Weighted Average The volume-weighted average is computed by dividing the summation of the product of the
selected field variable and cell volume by the sum of the cell volumes.
R P
φdV φijk |Vijk |
= P
ijk
V ijk |Vijk |
Mass-Weighted Integral The mass-weighted integral is computed by summing the product of phase volume fraction,
density, selected field variable, and cell volume.
Z X
ερφdV = εijk ρijk φijk |Vijk |
ijk
Mass-Weighted Average The mass-weighted average is computed by dividing the sum of the product of phase volume
fraction, density, selected field variable, and cell volume by the summation of the product of the phase volume
fraction, density, and cell volume.
R P
φρεdV ijk εijk ρijk φijk |Vijk |
R = P
ρεdV ijk εijk ρijk |Vijk |
Symbol Description
φp Variable value of the indexed particle
mp Mass of the indexed particle
Vp Volume of the indexed particle
wp Statistical weight of the indexed particle1
General particle properties can be obtained from area (plane) and volume regions. For area regions, all particles in Eulerian
cells that intersect the plane are used in evaluating the average.
Sum The sum of particle property, φp in the selected region is calculated using the following expression.
X
wp φp
p
Min The minimum value of particle property phip is the selected region is obtained using the following expression.
min φp
p
Max The maximum value of particle property phip is the selected region is obtained using the following expression.
max φp
p
Particle properties can be averaged over area (plane) and volume regions. For area regions, all particles in Eulerian cells
that intersect the plane are used in evaluating the average.
Average The average value of particle property, φp in the selected region is calculated using the following expression.
For DEM simulations, the statistical weight of a particle, wp , is one such that the sum of the weights is the total
number of observations in the selected region.
P
p wp φp
φ̄ = P
p wp
Standard Deviation The standard deviation of particle property, phip in the selected region is calculated using the
following expression. φ̄ is the averaged variable in the selected region.
sP
p wp (φp − φ̄)
2
σφ = P
p wp
Mass-weighted average Mass-weighted average value of particle property, φp in the selected region is calculated using
the following expression.
P
p wp mp φp
φ̄m = P
p w p mp
Volume-weighted average Volume-weighted average value of particle property, φp in the selected region is calculated
using the following expression.
P
p w p Vp φ p
φ̄v = P
p w p Vp
Flow rates
Flow rate monitors for Lagrangian particles (DEM/PIC) are only valid for area (plane) regions. The set of particles
crossing the flow plane, Γ is approximated using the height of the plane, h, the position of the particle, xp , and the
particle velocity normal to the plane, vp such that
xp − h
(vp )( )>0
∆t
and
xp − h
|vp | ≥
∆t
Flow rate The net flow rate of a general particle property φp is computed by summing the properties of the set of particles
projected to have crossed the flow plane, Γ.
X vp
wp φp
|vp |
p∈Γ
Mass-weighted flow rate The net mass-weighted flow rate is the sum of the general particle property φp multiplied by
the particle mass, mp of the set of particles projected to have crossed the flow plane, Γ.
X vp
w p mp φ p
|vp |
p∈Γ
Volume-weighted flow rate The net volume-weighted flow rate is the sum of the general particle property φp multiplied
by the particle volume, Vp of the set of particles projected to have crossed the flow plane, Γ.
X vp
φ p w p Vp
|vp |
p∈Γ
Internal surfaces are surfaces defined within the overall boundaries of the model.
To define an internal surface, there must be a region already defined in the Regions Pane.
To add an internal surface, navigate to the ISs pane from the Modeler View, and click the (+) button. A popup dialog
will appear to select region(s) that will define the internal surface. Each region can only be used in a single internal surface.
All regions defined in the regions Pane are listed in the popup, but only the regions of the selected Surface Type are
selectable.
• Plane Regions can be Impermeable internal surfaces.
• Box Regions can be X-Axis, Y-Axis, or Z-Axis Impermeable internal surfaces.
• Plane Regions can be Semi-permeable internal surfaces.
• Box Regions can be X-Axis, Y-Axis, or Z-Axis Semi-permeable internal surfaces.
To remove an internal surface, navigate to the ISs pane from the Modeler View, select the internal surface to remove,
and click the (-) button.
The permeability is only definable for semipermeable regions. The default value is 1.0d32 m².
The internal resistance is only definable for semipermeable regions. The default value is 0.0 m⁻¹.
For each solid phase, specify the velocity of that solid through the surface (in meters/second).
Disabled for Impermeable surface (since by definition the velocity would be zero).
Add Reaction
To add a reaction, click on the button. Initially the new reaction will be invalid, and disabled. This is because
it is empty, with no species defined. Add species for Reactants and Products; make sure the reaction is balanced, and then
the Ok button will be enabled. Click Ok in the bottom right to finish adding the reaction.
To cancel adding an unfinished reaction, either click the button in the upper left, or the Cancel button in the lower
right.
Delete Reaction
To remove an existing reaction, select the row in the table corresponding to that reaction, and click on the button.
Disable/Enable Reaction
To disable an existing reaction (without deleting it), uncheck the checkbox in first column of the reaction table.
To re-enable a disabled reaction, re-check the checkbox.
This checkbox enables the stiff chemistry solver. This selection is always available.
Chemical reaction input is handled different from keyword pair inputs. All homogeneous gas phase chemical reactions
and all heterogeneous gas-tfm solids reactions are specified between @(RXNS) and @(END) in the reaction block. All
heterogeneous gas-dem and gas-pic reactions are specified between @(DES_RXNS) and @(END) in the reaction block.
Users use the globally unique species aliases to specify the chemical reaction equation. Each reaction is specified with a
unique reaction identify.
Reaction Name
This is the name of the currently selected reaction in the reaction table. The reaction name is used by the solver to identify
the reaction. The name of a reaction must start with a letter, contain alphanumeric characters or underscores, contain no
spaces, and is limited to 32 characters.
Reactants
The Reactants are the reactant species for the currently selected reaction. Use the and buttons to add and
remove species.
Products
The Products are the product species for the currently selected reaction. Use the and buttons to add and
remove species.
Coefficients
The values in the Coefficients column for Reactants and Products must be set so that the reaction balances stoichiomet-
rically, otherwise the Ok button to save changes is disabled.
The coefficient must be a positive integer or floating point number.
Species
Use the drop-down menu to select which species to use for the Reactant or Product. Each species can only be used once.
Phase
Each species for Reactants and Products can belong to any of the Phases for the model, Fluid or Solid.
Check this checkbox to optionally specify the user-defined heat of reaction for the currently selected reaction
(Joules/kmol).
The “Fraction assigned to (Fluid, Solid 1, …)” is fraction of that heat of the reaction assigned to each phase. Editing the
Fraction for a phase will automatically adjust the fraction(s) of the other phase(s) to add up to one.
Reaction Restrictions
For heterogeneous reactions referencing three or more phases, either only one phase has a net mass loss or one phase has
a net mass gain. Specifically, two or more phases cannot have a net mass loss while two or more phases have a net mass
gain.
The following examples illustrate valid and invalid reactions. For these examples, FC1, FC2, and sSoot, represent solid
carbon in solids phases 1, 2 and 3, respectively. All other species belong to the gas.
• Example 1: VALID
– 2*FC1 + O2 –> 2CO
– One phase has a net mass loss, one phase has a net mass gain
• Example 2: VALID
– FC1 + FC2 + O2 –> 2CO
– Two phases have a net mass loss, one phase has a net mass gain
• Example 3: VALID
– 2.2*FC1 + O2 –> 2CO + 0.2*sSoot
– One phase has a net mass loss, two phases have a net mass gain
• Example 4: INVALID
– 1.1*FC1 + 1.1*FC2 + O2 –> 2CO + 0.2*sSoot
– Two phases have a net mass loss, two phases have a net mass gain
– The heat of reaction, DH, and how it is distributed between phases, fracDH, must be specified if there are
two or more solids phases listed as either reactants or products.
Chemical reactions are specified in the data file (mfix.dat) by providing species aliases and chemical equations. Rate ex-
pressions are specified in one or two user defined subroutines, usr_rates.f and usr_rates_des.f, respectively.
Heats of reaction are automatically calculated. Optionally, users may specify constant heats of reaction in the data file.
Tip: An overview of using legacy rrates.f files is given at the end of this section. However, this input method is no
longer supported.
Note: Species names must appear exactly as given in the materials database (see the Thermochemical Properties section).
Species names must be exactly characters, and for most species, trailing spaces are needed.
Note: Reactions are limited to homogeneous or two-phase heterogeneous reactions (e.g., species from three separate
phases cannot be referenced by any single chemical reaction).
Species Names
Species Identifiers
Reaction Parameters
Note: A data file can only contain one reaction block of each type, whereas a reaction block must contain one or more
reaction constructs.
• Chemical equations may span several lines by including an ampersand (&) at the end of the line. As the example
below illustrates, each line of the chemical equation is contained in quotation marks and the ampersand is located
to the right of the second quotation mark.
Note: build_mfixsolver preprocesses the data file to generate the species.inc file which is included within
the usr_rates.f and usr_rates_des.f files as code. Therefore changes in the data file may result in the exe-
cutable being out of date.
Extra Notes
Note: If the second index exceeds NRR, a run time error can result from over indexing the array. Using logical checks
can eliminate potential errors!
Note: Legacy species keywords, NMAX(m) and SPECIES_NAME(n), are required when using a legacy rrates.f file.
Current species keywords NMAX_g, NMAX_s, SPECIES_g, and SPECIES_s cannot be used.
Note: The only modification needed for a legacy mfix.dat and rrates.f file combination is the inclusion of
USE_RRATES=.TRUE. in the data file. An example of legacy file usage can be found in: legacy_tutorials/reactor1b
Legacy tutorials can be found by downloading the source tarball. They are meant to provide representative setups for
older versions of MFiX (before the launch of the GUI), and are not guaranteed to run with the latest version of MFiX.
Additional remarks:
• Building with chemical reaction support requires that the data file, mfix.dat, be present in the run directory as the
species aliases and reaction identifiers are needed to construct a species.inc file.
• Species aliases and reaction identifiers must be unique. The build performs a cursory check on the supplied data
and exits if non-unique entries are identified.
• If any species alias or reaction identifier conflicts with an existing global variable in MFiX, an error will be reported
and the code will fail to compile.
A stiff chemistry solver has been fully integrated into MFiX. This approach first solves the convection/diffusion equations
without chemical reaction source terms. A coupled set of ODEs is then directly integrated to impose chemical reactions
effects. This approach may decrease simulation time by permitting larger time steps within the convection/diffusion
model. However, the stiff chemistry solver may increase simulation time, especially if reactions are not stiff. Reactions
are specified using the same approach outlined in the chemical reactions section.
The stiff chemistry solver is invoked by specifying the keywords STIFF_CHEMISTRY and STIFF_CHEM_MAX_STEPS
Note: The stiff chemistry solver does not support legacy rrates.f files
Note: The stiff chemistry solver is not available with DES simulations.
Additional remarks:
• Variables governing ODE convergence criteria are specified as parameters in stiff_chem_mod.f found in
the model/chem directory. Additional information on these parameters and their usage is available in model/
ODEPACK.F.
• Running your simulation in debug mode is recommended for the first time. This will catch some common pro-
grammatic errors in the usr_rates.f file. Additionally, the stiff chemistry solver checks for NaNs calculated
in the usr_rates.f file.
• The tutorial located in tutorials/tfm/silane_pyrolysis_2d shows how to use the stiff chemistry
solver.
A(g)↔R(g)
Notes:
• Species database names and aliases are defined on single lines.
• The forward and backward reactions are defined separately.
• The heats of reaction are defined as zero (athermal) and explicitly assigned to the gas phase.
NMAX_g = 2
Species_g(1) = "A" "R"
Species_Alias_g(1) = "A" "R"
! Database names
! Species aliases
NMAX_s(1) = 2
Species_s(1,1) = "C(GR) REF ELEMENT"
Species_s(1,2) = "Coal Ash"
CO combustion:
CO2 gasification:
Char combustion:
Notes:
• Gas phase species names and aliases are defined on the same line.
• Heats of reaction for all reactions are calculated automatically.
• A TFM reaction block is used for the gas phase homogeneous reaction.
• A DEM reaction block is used for gas/solids reactions.
• Reaction constructs are given in one line.
! Gas phase species data
NMAX_g = 3
Species_g(1) = "O2"
Species_Alias_g(1) = "O2"
Species_g(2) = "CO"
Species_Alias_g(2) = "CO"
Species_g(3) = "CO2"
Species_Alias_g(3) = "CO2"
! DES solids phase species data
NMAX_s(1) = 2
Species_s(1,1) = "C(GR) REF ELEMENT"
Species_s(1,2) = "Coal Ash"
Species_Alias_s(1,1) = "C"
Species_Alias_s(1,2) = "Ash"
! Homogeneous gas phase reactions
@(RXNS)
CO_Combustion { chem_eq = "CO + 0.5O2 --> CO2" }
@(END)
! DES Reaction block
@(DES_RXNS)
CO2_Gasification { chem_eq = "2.0C + O2 --> 2CO" }
Char_Combustion { chem_eq = "C + CO2 --> 2CO" }
@(DES_END)
Additional comments:
• Coal Ash is not a species included in the thermochemical database and would require that its properties be given
in the data file (see Section 8.14 Thermochemical properties).
• One-line reaction constructs are only possible when the heat of reaction is automatically calculated (i.e., the chemical
equation is the only input parameter).
Reaction Rates
Note: Formation and consumption rates are automatically calculated for each species from the reaction rate and chemical
equation.
The rate in terms of reacted moles is related to the rates of formation and consumption through the stoichiometric coef-
ficients. For example, consider the homogeneous gas phase reaction of methane combustion:
The rate in terms of reacted moles is related to the rates of formation and consumption as
where −rCH4 and −rO2 are the rates of consumption of methane and oxygen, and rCO2 and rH2 O are the rates of
formation of carbon dioxide and water vapor, respectively.
Each reaction rate is assigned to the variable RATES(rxn_name), where rxn_name is the reaction identifier used
in the reaction construct. To minimize input errors when specifying reaction rates, species aliases (SPECIES_ALIAS)
defined in the data file should be used in lieu of the associated species index.
For example, if oxygen is defined as gas phase species 2 with an alias of O2, (e.g., SPECIES_ALIAS_g(2)="O2"),
when accessing gas phase species data for oxygen (e.g., molecular weight; MW_g), “O2” should be used and not the
integer index 2, (e.g, MW_g(O2)).
### mfix.dat:
NMAX_g = 4
Species_g(1) = "CH4 ANHARMONIC"
Species_g(2) = "O2"
Species_g(3) = "CO2"
Species_g(4) = "H2O"
Species_Alias_g(1) = "CH4"
Species_Alias_g(2) = "O2"
Species_Alias_g(3) = "CO2"
Species_Alias_g(4) = "H2O"
@(RXNS)
CH4_Combustion { chem_eq = "CH4 + 2O2 --> CO2 + 2H2O" }
@(END)
### usr_rates.f:
SUBROUTINE USR_RATES(IJK, RATES)
INCLUDE 'species.inc'
! Methane Combustion
!-----------------------------------------------------------------//
RATES(CH4_Combustion) = 6.7d12 * exp(-2.4358d4/T_g(IJK)) * &
EP_g(IJK) * (c_O2**1.3) * (c_CH4**0.2)
A(g)↔R(g)
Notes:
• Species database names and alias are defined on the same line.
• The fluid cell index (IJK) is passed as a dummy argument.
• Global field variables are referenced (RO_g, X_g, T_g, and EP_g )
### mfix.dat:
NMAX_g = 2 ! No. of gas phase species
Species_g(1) = "A" "R" ! Database names
Species_Alias_g(1) = "A" "R" ! Species Aliases
usr_rates.f:
SUBROUTINE USR_RATES(IJK, RATES)
INCLUDE 'species.inc'
INCLUDE 'species.inc'
INCLUDE 'usrnlst.inc'
See legacy_tutorials/SpoutedBedCombustor for details on a similar simulation setup. Legacy tutorials can be found by
downloading the source tarball. They are meant to provide representative setups for older versions of MFiX (before the
launch of the GUI), and are not guaranteed to run with the latest version of MFiX.
H2 O(l)→H2 O(g)
Notes:
• Various algebraic expressions in the sample UDF are omitted for brevity.
• The global particle index (NP), phase index (pM), and fluid cell index (IJK) are passed as dummy arguments.
### mfix.dat:
NMAX_g = 2 ! No. of gas phase species
Species_g(1) = "Air" "H2O" ! Database names
Species_Alias_g(1) = "Air" "Vapor" ! Species Aliases
@(DES_RXNS)
Evap { Liquid --> Vapor }
@(DES_END)
###usr_rates_des.f:
SUBROUTINE USR_RATES_DES(NP, pM, IJK, DES_RATES)
DOUBLE PRECISION, INTENT(IN) :: NP ! Global particle index
DOUBLE PRECISION, INTENT(IN) :: pM ! Particle solid phase
DOUBLE PRECISION, INTENT(IN) :: IJK ! Fluid Cell Index
DOUBLE PRECISION, INTENT(OUT) :: DES_RATES(NO_OF_DES_RXNS) ! Reaction Rates
INCLUDE 'species.inc'
!-------------------------------------------------------//
! Calculate the concentration gradient (mole/cm^3)
Cmg_H2O = < expression for calculating gradient >
See legacy_tests/dem-tests/evaporation for additional details. Legacy tests can be found by downloading the source tarball.
They are meant to provide representative setups for older versions of MFiX (before the launch of the GUI), and are not
guaranteed to run with the latest version of MFiX.
Note: Selections on panes may enable or disable widgets based on what input parameters are required or available.
FIVE
If you are just starting with MFiX, you could use the default solver installed with MFiX. It is possible to run most of the
Tutorials with the default solver.
Note: Among the tutorials listed on the New Menu, only the tfm/silane_pyrolysis_2d case has UDFs and requires running
with a custom solver to run correctly.
However, for some cases you may want to use a custom mfixsolver. For instance, when running cases with UDFs (User
Defined Functions, which are defined in Fortran source files in the project directory), it is necessary to build a custom
solver. A custom solver is an mfixsolver executable built in the project directory, specific to that project. This includes
projects with chemical reactions, since those have UDFs.
Press the (Build) button to display the Build Dialog box. Select appropriate compilation options, then press the
“Build Solver” button. It may take a few minutes to compile. See Build Dialog for further details about compilation
options. The “Build Command” of the build dialog will show the equivalent command for Building Custom Interactive
Solver.
After building the custom solver, run a simulation by pressing (Run) to display the Run Dialog. Select the mfixsolver
file you have just built.
You can pause, unpause, stop, or get info from the solver.
For example, the tfm/silane_pyrolysis_2d tutorial has UDFs and will not run with the default solver.
> cd tutorials/tfm/silane_pyrolysis_2d/
> ls
SP2D.mfx usr0.f usr1.f usr_mod.f usr_rates.f
173
MFiX User Guide, Release 21.4
> build_mfixsolver
...build output...
> ls *
build/ lib/ mfixsolver SP2D.mfx usr0.f usr0.o usr1.f usr_mod.f usr_rates.f
The build_mfixsolver command creates a wrapper script mfixsolver, that runs the case-specific MFiX solver
(which is installed in the lib directory).
The build directory can be deleted, and the custom mfixsolver will still run. However, leaving the build directory
will greatly speed up rebuilds if you want to edit the UDFs and run build_mfixsolver again.
The “MFiX Batch Solver” refers to the command line version of MFiX as in MFiX 2016-1 and earlier versions, to contrast
it with the “MFiX Interactive Solver”. The batch solver binary is not installed in the MFiX conda package; it needs to be
compiled before being used (as in previous versions of MFiX).
Using the Batch Solver is appropriate when you do not want to use the interactive features with the GUI. You cannot
pause, unpause, stop, or monitor status from the batch solver.
To build the solver without interactive support, run:
Arguments may be passed to build_mfixsolver to specify various options: compiler, compiler flags, SMP/DMP
support, and other options. All configuration options can be displayed with:
Argument Description
FC=<compiler> Specify the Fortran compiler command
FCFLAGS=<flags> Specify Fortran compiler flags
--dmp Enable distributed memory support (MPI)
--smp Enable shared memory parallel support (OpenMP)
The Fortran compiler is specified by passing the FC argument to build_mfixsolver. If the FC argument is not
specified, the script will search the environment for a Fortran compiler (usually gfortran).
Compiler flags can be specified by passing the FCFLAGS argument to build_mfixsolver. If the FCFLAGS argu-
ment is not specified, the compiler defaults are used.
Running build_mfixsolver will display the flags specified with FCFLAGS, and other compiler flags that are always
defined by the build scripts:
The build_mfixsolver script will test specified Fortran compiler with any specified flags (covered next). If the
compiler is not found or if the compiler doesn’t work with the specified flags, no Makefile will be generated and an error
message will be printed. When posting a question on the forum about build issues, include any error messages.
build_mfixsolver will pass the options -j and -k on to make. Building with -j on multicore systems will speed
up the build process.
> build_mfixsolver --batch -j
5.2.3 Building
To build the MFiX batch solver, run build_mfixsolver with the --batch option.
> cd tutorials/tfm/silane_pyrolysis_2d/
> ls
SP2D.mfx usr0.f usr1.f usr_mod.f usr_rates.f
> build_mfixsolver --batch
...build output...
> ls *
build mfixsolver SP2D.mfx usr0.f usr0.o usr1.f usr1.o usr_mod.f usr_mod.o usr_
,→rates.f usr_rates.o
Note the absence of a lib directory. The lib directory has the Python module for the interactive solver, and therefore
is not present for a batch solver. Also, mfixsolver is a binary executable (not a wrapper script).
To build the MFiX batch solver, with optimized code generated for the curren CPU:
> build_mfixsolver --batch FCFLAGS="-march=native -O3"
This section describes how developers build MFiX packages for distribution. Most users will not need to do this.
Building from source requires the MFiX source tarball, which can be obtained on the MFiX download page. Extract the
tarball and go into the top level source directory:
> tar xf mfix-21.4.tar.gz
> cd mfix-21.4
> pwd
/home/user/mfix-21.4
Folder Description
model Source code for the MFiX solver
post_mfix Source code for the post-processing tool post_mfix
queue_templates Templates to submit jobs on HPC systems
tutorials Examples of simulations ready to run from the GUI
tests Simple simulations used for regression tests
legacy_tutorials Old examples of simulations, meant to be run from command line
legacy_tests Old tets cases meant to be run from command line
Note:
1. The source code is also available from the GUI, from the “Editor” tab. Files are located in the “MFiX Source”
file explorer. Selecting a file will open it in the editor. Users wishing to modify the source code should copy a file
to the project directory. This is accomplished automatically by clicking “Copy” when prompted “Copy to project
directory for editing?”
2. It is recommended to study the simulations files in the “tutorials” folder. These simulations can be loaded in the
GUI from Main menu>New project. Interested users can study files located in the legacy_tutorials and legacy_tests
folders. However, these are provided as examples that are compatible with older versions of MFiX (2016-1 and
prior). They should be run from the command line.
You can build the Batch Solver from source, without the MFiX conda package installed. This is how MFiX was built in
version 2016 and earlier.
For prerequisites, see Linux Build Dependencies or Mac Build Dependencies.
Run cmake to configure MFiX and generate a Makefile, then run make to build the MFiX solver.
Running cmake will generate a CMakeCache.txt file in the directory it is invoked from. Please include
CMakeCache.txt when posting a question about build issues to the forum.
Configuring
The default configuration for MFiX is serial with optimizations and debug symbols (standard optimization; for GFortran
use flags -g -O2):
> pwd
/home/user/mfix-21.4 # actual working directory will vary
> mkdir release-build
> cd release-build
> cmake .. -DCMAKE_BUILD_TYPE=RelWithDebInfo # .. is the relative path to the top-
,→level MFiX source directory
Note: Using an “out of source” build is recommended. Create a new directory, cd to that directory, and run cmake
<path> where <path> is the top-level MFiX source directory (containing CMakeLists.txt). Out of source builds
are convenient for having different solvers built with different configurations. The build directory can be whatever you
want; release-build and debug-build used here are just examples.
To configure the MFiX solver in serial with debug mode (no optimization; for GFortran use flags -g -O0):
If mpifort is your MPI compiler wrapper command, then to configure the MFiX solver with DMP with optimizations
and debug symbols:
If mpifort is your MPI compiler wrapper command, then to configure the MFiX solver with DMP with debug mode:
Example with gfortran, serial optimized solver for current CPU configuration :
Note: For DMP support, defining -DENABLE_MPI=1 is required. Defining CMAKE_Fortran_COMPILER as your
MPI wrapper (mpifort) is recommended, but not strictly required. CMake should automatically detect MPI include
files and libraries for your default compiler, but specifying CMAKE_Fortran_COMPILER is better to ensure you are
using the exact compiler you intend to use.
Note: CMake uses configurations values from both CMakeCache.txt and from command line arguments. Command
line arguments take precedence over CMakeCache.txt, but CMakeCache.txt is used if nothing is specified on the
command line. For instance, if you run cmake .. -DCMAKE_Fortran_FLAGS="-fcheck=all", and then run
cmake .. again (in the same build directory), -fcheck=all will still be used (because it is still in CMakeCache.
txt). If this is not what you want, either edit CMakeCache.txt, or just delete CMakeCache.txt and run cmake
again with different options.
Building
After configuring, build with make. For further details about the make utility, type man make at the prompt.
> make
> make -j # for parallel build jobs
> make VERBOSE=1 # to view the full command lines used for compiling and linking
At the end of a successful build, the MFiX solver will be located in the current directory. The solver is called mfix-
solver on Linux.
To build the conda package of MFiX, you will need to install the build dependencies for your platform. Please see Linux
Build Dependencies or Mac Build Dependencies.
Install conda-build:
The conda package recipes are under conda/. Refer to the conda-build documentation for details.
SIX
The default solver does not need to be compiled, because the binary executable is installed with MFiX. The default
mfixsolver is automatically installed when following the steps in Getting Started.
Start the MFiX GUI from the Anaconda Prompt (Windows) or bash (Mac or Linux):
# Windows
(mfix-21.4) C:\> mfix
# Linux
(mfix-21.4) > mfix
# Mac
(mfix-21.4) > mfix
From the main menu browse to create a new project, or open an existing one.
When running a simulation, press (run) and select the default mfixsolver.
You can pause, unpause, and stop the solver from the toolbar.
If you have a project file <RUN_NAME>.mfx saved in a project directory named <RUN_NAME>, navigate to that project
directory to launch the default solver locally. One can accomplish this with the following commands:
> cd <RUN_NAME>
> mfixsolver -f <RUN_NAME>.mfx
For example, to run the 3D fluidized bed tutorial, with the project file FB3D.mfx created in the GUI and saved in a
directory FB3D:
> cd FB3D
> mfixsolver -f FB3D.mfx
181
MFiX User Guide, Release 21.4
After building the custom solver, run a simulation by pressing (Run) to display the Run Dialog. Select the mfixsolver
file you have just built.
You can pause, unpause, stop, or get info from the solver.
As an example, the tfm/silane_pyrolysis_2d tutorial has UDFs and will not run with the default solver.
After building the solver, on a Linux or Mac system, run the custom solver with the command:
Use ./ in front of mfixsolver to use the solver in the project directory, not the default solver in your PATH.
On Windows, run the custom solver in the project directory with:
The “MFiX Batch Solver” refers to the command line version of MFiX including MFiX 2016-1 and earlier versions. The
“MFiX Interactive Solver” refers to all later releases of MFiX. The batch solver binary is not installed in the MFiX conda
package; it needs to be compiled before being used (as in previous versions of MFiX).
Using the Batch Solver is appropriate when you do not want to use the interactive features with the GUI. You cannot
pause, unpause, stop, or monitor status from the batch solver.
To build the batch solver see Building a Batch Solver.
If you built the solver configured with DMP support, then you can run MPI jobs with the standard MPI wrapper command
mpirun. For instance, to run using 4 cores with the domain divided along the X and Y axes:
The number of MPI processes specified with -np must be equal to the product of the keywords
NODESI*NODESJ*NODESK.
For further details on using mpirun, see the documentation for the MPI implementation for your system.
If you built the solver configured with SMP support, then you can set the number of OpenMP threads using the
OMP_NUM_THREADS environment variable. For instance, to run with four threads:
SEVEN
VISUALIZATION
This section explains how to visualize results in the GUI, with paraview, and with postmfix.
As a means to demonstrate visualization techniques with the MFiX GUI, references within this section are associated
with the dem/hopper_3d case. We advise loading and running this project to get familiar with the results visualization
techniques.
The dem/hopper_3d case will take several minutes to run. On the Run Pane, you can see that the Stop time is 5.0
seconds.
• Click on the (new) button in the upper right corner of the window.
• Click the (play) button in the middle of the top of the VTK results window.
If you don’t see any change, wait a few minutes for more output files to be written.
• Click the (first) button to play the visualization from the beginning.
MFiX can generate output data in several formats for visualization and analysis. The command line tool postmfix is
distributed with MFiX. In addition, the MFiX output file format is supported by the open source GUI tools ParaView
(version 4.1 or later) and VisIt.
The following table lists the files typically associated with an MFiX simulation.
185
MFiX User Guide, Release 21.4
Notes:
1. pvd files only contain information linking the respective .vtu and .vtp files to time- step information.
2. <VTK_REGION >_###.vtp files are binary files. The <RUN_NAME >_DES_###.vtp are ASCII files.
This walk through demonstrates how to use ParaView to visualize the results of the dem/fluid_bed_3d tutorial. It is
assumed that the dem/fluid_bed_3d tutorial was successfully run with default settings and that ParaView is installed on
your system. First, the tutorial demonstrates how to visualize the fluid field; then, the DEM particles are added using
spherical glyphs.
Fluid field results for a standard structured mesh are displayed in ParaView by loading the .RES file. To open the RES
file, click on File/Open (Fig. 7.1), and navigate to your run directory.
Select the DES_FB1.RES file (Fig. 7.2). Do NOT load the DES restart file (DES_FB1_DES.RES). This binary file is
not supported by any visualization software. It only contains restart data and will likely cause ParaView to crash if loaded.
Once the file is loaded, you need to click on the green “Apply” icon to load all of the variables.
Newer versions of ParaView require that you select the appropriate reader. Choose to open the data with “MFiX Un-
structured Grid Files”. (Fig. 7.3)
ParaView typically displays the gas phase volume fraction once the data is loaded. It may be necessary to rescale the
data range as the initial range may only be suitable for displaying the initial conditions. This can be done by clicking the
icon.
DEM and PIC particle simulation data is loaded into ParaView by opening the .pvd file. (Fig. 7.4)
Again, click on the green “Apply” icon to load all of the variables. (Fig. 7.5)
Particles are shown by applying a glyph to the dataset. To apply a glyph filter, either:
• Filters > Alphabetical > Glyph
The postmfix command is used for reading the binary MFiX .SPx output files and outputting data to text files. The
following walk through demonstrates how to run postmfix on the results from the dem/fluid_bed_3d tutorial with the
default settings.
The postmfix executable is built by running build_mfixsolver with the argument postmfix:
From the Anaconda package:
From source:
> cd mfix-21.4
> mkdir build
> cd build/
> cmake .. -DENABLE_POSTMFIX=1
> make postmfix
After building, run the executable and enter the run name:
> ./postmfix
Enter the RUN_NAME to post_process > DES_FB1 ? DES_FB1<Enter>
A simple menu of options is presented. Type 1 to examine/print data and press Enter.
*************************************************
0 - Exit POST_MFIX
1 - Examine/print data
2 - Write .RES from data in .SPx files
3 - Write .RES for a new grid, using old data
4 - Calculate miscellaneous quantities
5 - Print out variables
6 - Call user defined subroutine USR_POST
7 - Write a new SPx file with selected records
8 - Write new SPx files with time averaged data
9 - Perform ORNL calculations
10 - run scavenger code
*********************************** **************
Enter menu selection > 1
Enter a time range for data extraction and analysis. The default simulation has a simulation length of one second, so enter
a range from 0.1 seconds to 0.9 seconds. The next prompt asks if the data should be time averaged. Press Enter to skip
the averaging.
Enter the variable of interest. The default is the gas phase volume fraction, EP_G. A complete list of possible entries is
given by typing ? and Enter. Press Enter to select the gas phase volume fraction.
Next, enter the spatial range to extract the data. This requires an understanding of the I/J/K values for your simulation.
Basic geometric information for the simulation is provided in the .OUT file. For this example, we will take a vertical slice
from the approximate center of the 2D domain.
Specify where to output the data. Press Enter to select the default *, which will send the data to the terminal. Alternatively,
specify a file name to save the data in a data file.
After the output is generated, you will be presented with a prompt to continue data extraction or analysis. Type q and
Enter to return to the main menu. From the main menu, type 0 and Enter to exit .
EIGHT
REFERENCE
The Main toolbar is located at the top of the GUI window. The following table illustrates the icons in the toolbar.
Icon Description
Menu
Pause simulation
Stop simulation
Build Dialog
Parameter Dialog
The interactive solver sends its status during the simulation, and the solver controls will be enabled or disabled, depending
on the solver state.
Solver Controls:
191
MFiX User Guide, Release 21.4
If no MFiX job is currently running, the Start button will open the run dialog where settings for a job can be changed.
The simulation can be started from this dialog. If an MFiX job is running, you can pause it with the pause button and
un-pause it with the start button. You can stop a running MFiX job with the stop button. A stopped job leaves restart
(*.RES) and output files to resume the simulation. Starting a job by pressing the Start button with *.RES files present will
resume the job where it stopped. The Reset button will allow the option to delete the *.RES files and output files from
the project directory. This will allow the simulation to start from the beginning the next time the Start button is pressed.
Run Dialog
The run dialog is used for entering options on starting the solver.
Different solvers can be selected.
If a custom solver is compiled with SMP or DMP support, the following options may be available:
• Threads (number of threads used for OpenMP)
• NODESI (number divisions in X direction)
• NODESJ (number divisions in Y direction)
• NODESK (number divisions in Z direction)
N ODESI × N ODESJ × N ODESK = n where n is the number of MPI processes running. If not using MPI,
N ODESI = N ODESJ = N ODESK = 1.
The GUI supports running both locally as well as submitting to a queue.
Note: SMP and DMP options are disabled for the default solver. You will need to build a custom solver with DMP or
SMP flags to enable these options.
Run Locally
To run locally, select a solver from the drop-down list or click the browse button to specify a solver that is not in the list.
Usually the default installed solver should be sufficient. If running a case with UDFs, you need to first build a case-specific
MFiX as described in the Getting Started. You may want to build your own solver for other reasons, such as specifying
various compiler flags to optimize the executable for your specific hardware.
Make sure the “Submit to queue” check-box is unchecked, and click “Run” in the Run dialog to start the solver.
Submit to Queue
To submit a job to a queue (submit to queuing system, e.g. Grid Engine, PBS, SLURM), select the “Submit to Queue”
tab. Select an executable from the drop-down list or click the browse button to specify an executable that is not in the
list. Next, select a template from the drop-down list or click the browse button to choose a template that is not in the
drop-down list. Based on the selected template, the widgets in the “queue options” section will update automatically.
Once the options are specified, click “submit” in the run dialog to submit the job to the queue.
Custom queue scripts are supported. The format for this script is described in the Queue Templates section.
Build Dialog
The build dialog is used for building custom solvers in project run directories. This is used to build Building Custom
Interactive Solver.
There is a combo box to select the Fortran compiler command. It will be populated with any known Fortran compilers in
PATH. Alternatively, type in the command for the compiler.
There is a field to type in the flags for the Fortran compiler. See your compiler manual for details, such as the GNU
Fortran Manual.
There are checkboxes for building with SMP or DMP support. Note that DMP support requires both checking the DMP
box, and selecting an MPI compiler (such as mpifort). The “Build solver in parallel” checkbox will run make with multiple
jobs. DMP and SMP are not available on Windows.
If “Enable developer mode” is checked in Settings, then there will be a checkbox for building either the interactive solver
or the batch solver.
“Build Command” displays the command line used for building the solver with the selected options.
Reset Dialog
The Reset dialog allows for optional deleting of output files from the run directory. These files include:
*.RES and *.SPx files have to be removed from the run directory before a simulation can be played from the beginning.
It is recommended to remove VTK files from the run directory as well because they will be over-written.
Note: If there are restart files present in the run directory, some widgets will be disabled because certain model param-
eters can not be edited during a resume, or restart state.
Parameter Dialog
The parameter dialog allows users to create parameters, or variables, that can then be referenced in widgets that support
the use of these parameters. This functionality allows user to create relationships among various inputs and change the
values of multiple items by changing the value of a single parameter. In many respects, this is similar to features present
in most commercial CAD packages.
There are six special parameters; xmin, xmax, ymin, ymax, zmin, and zmax that reference the simulation domain
extents, entered on the geometry pane. These parameters make it easy to setup regions that automatically adjust to the
simulation domain if the extents change.
8.1.2 Menu
The main menu allows for opening, creating, copying, and exporting projects as well as viewing project meta data, changing
settings, and viewing available help documentation, including this document.
Project Info
Selecting File > Project Info displays metadata about the current project file. The following table details the content of
the metadata.
Label Description
File name full path to MFiX project file
Project version version number, incremented each time project is saved
Created with MFiX version version of MFiX that project was created with
Author user name who created the project
Modified By list of user names that edited the project
Last modified date and time the project was last modified
Created date and time the project was created
Notes area where the user can record notes about the project
New
Selecting File > New creates a new project file from a template file. When a template is selected, the GUI will ask for
a project name and parent directory to save the project to. A new directory with the project name will be created in the
parent directory. A .mfx file will be created in that directory by copying the contents of the selected template file. Any
other files, such as *.stl files, will also be copied if present. The list of templates can be filtered by selecting one or more
of the following model types:
Icon Description
Chemistry
Open
Selecting File > Open accesses a file dialog where the user can navigate to and select an existing project file both in .mfx
format of the older mfix.dat format. Note that mfix.dat files used with older released versions of MFiX will be saved in
the current .mfx format. The GUI also performs a number of updates, including keyword amendments and CGS to SI
unit conversion. Any user files are not converted. It is strongly suggested that the project be checked after this update.
Save
Selecting File > Save saves the current project files in the current project directory.
Save as
Selecting File > Save as opens a file dialog where the user can navigate to and select a different file location or change the
current file name. Subsequently, the project is opened in that location and with that filename.
Export project
Export the current project to a new directory and/or as a new filename, but keeps the original project opened.
When reporting issues, errors, or questions to the Support Forum, it is helpful to include your project file, UDFs, and any
other files associated with your project, along with the current versions of MFiX and its dependencies, so that we may
reproduce the reported issue.
We offer a convenient way of sending this information in a single file.
Clicking on ‘Submit bug report’ will create a .ZIP file the current directory, containing the relevant project files, and some
version information about your system.
The bug report is not automatically transmitted to the MFiX developers. You are encouraged to open the zipfile and
examine the files, if you have any concern about what information is being shared. Then post the zipfile as an attachment
to https://mfix.netl.doe.gov/forum.
The bug report dialog will also pop up automatically if an exception occurs while using MFiX. This kind of report is
especially helpful to MFiX developers, because it includes the stack trace.
Settings
Choosing File > Settings opens a dialog where the user can change settings that affect how the GUI behaves. Available
options are listed in the following table.
Option Description
Style change the application style
Enable animations enable or disable animated widgets
Animation Speed set the speed at which animations occur
Enable Developer Tools hide/show widgets that are mainly for developers of the GUI
Help
Selecting File > Help opens a dialog linking the user to available documentation (including this document) and tutorials,
both text based and videos (if connected to the Internet) demonstrating features of the GUI.
About
Choosing File > About displays the version of MFiX and the versions of the various dependencies that the GUI is using.
If issues are discovered while using the GUI, it is recommended that any reports include this version information which
can be easily copied by pressing the “copy version info” button.
Quit
Selecting File > Quit exits MFiX. The GUI will ask for confirmation if project is unsaved or if a job is running.
Each pane in the main window allows editing of different options for an MFiX project. The Panes are ordered in a logical
progression for traditional CFD problem setups: Model defines the overall solver type (TFM, DEM, PIC). Geometry and
Mesh define the overall domain space of the solver. Regions are geometrical surfaces and volumes within the overall
domain. Fluid and Solids specify details on the phases the solver deals with. Initial Conditions (ICs), Boundary Condi-
tions (BCs), Point Sources (PSs), and Internal Surfaces (ISs) depend on Regions, Fluid, and Solids, so they come next.
Chemistry provides options for reacting cases, and Numerics specifies details on the Eulerian solver. Output specifies how
output data is written. Monitors provides options to probe the flow field at select locations and compute basic quantities
of interest. Run specifies how long to run the solver for. (Post is not yet implemented).
Note: Selections on panes may enable or disable widgets based on what input parameters are required or available.
Model Setup
The Model pane is used to specify overall options for the project. Depending on what is selected, other panes may be
enabled or disabled. Options that are specified on this pane include:
• Solver (Single Phase, Two-Fluid Model, DEM, PIC, Hybrid)
• Option to disable the fluid phase
• Option to enable thermal energy equations
• Option to enable turbulence, if the fluid phase is enabled
• Gravity in the x, y, and z directions
• Drag Model including parameters for the selected drag model
Other advanced options that can be selected include:
• Momentum formulation (Model a, Model B, Jackson, or Ishii)
• Sub-grid model (only available with TFM, Wen-Yu drag model, etc…)
• Sub-gird filter size
• Sub-grid wall correction
Geometry
Mesh
Regions
Fluid
The fluid pane is used to define the physical properties of the fluid phase. This includes adding fluid phase species which
can either be imported from the BURCAT thermodynamic database or created by the user. The GUI will generate the
correct data format to use thermodynamic data in MFiX.
Solids
The solids pane is used to define the physical properties of each solid(s) phase. Names can be given to each solid. This
name will be used throughout the GUI to reference that solid phase (i.e. when defining initial conditions, boundary
conditions, etc.). The solid phase model (TFM, DEM, or PIC) can also be specified here, however the selectable solid
phase model depends on the solver selected on the model pane.
The selected solver will also enable/disable the TFM, DEM, and PIC sub-panes where various options for those solids
models can be accessed.
The initial conditions pane is used to define initial conditions for a selected Region (defined on each Region pane) for
each phase (defined on Fluid or Solids panes). Initial conditions are required to cover the entire domain and provide
an initial value for certain quantities that the solver will use to start the simulation. Experienced CFD users realize that
providing reasonable initial values for volume fraction, temperature, pressure, and velocity allow simulations to reach/meet
convergence criteria more quickly.
To create a new initial condition, press the button which will bring up the Region Selection dialog. Select a region
to associate with the new initial condition and press OK. Regions that are not volumes or are already used by another
initial condition will not be selectable.
Once the region has been created, values can be edited. Sub-panes will be created dynamically based on model parameters
as well as the number of solid phases.
Note: Initial condition regions may overlap. When an overlap occurs, the initial condition with the higher IC number
will be used at that location.
The boundary conditions pane is used to define boundary conditions for a selected Region (defined on each Region pane)
for each phase (defined on Fluid or Solids panes). This is where inflow, outflow, pressure, walls, and cyclic boundary
conditions are created.
To create a new boundary condition, press the button which will bring up the Region Selection dialog. Next,
select a boundary type from the combo box. Regions will be enabled/disabled based on the selected boundary type and
whether or not the region is already used by a boundary condition. Boundary conditions must be surfaces, either planes
or collections of facets (STL). Pressing OK will create the boundary condition.
The sub-panes are created dynamically for each boundary condition based on the boundary condition type as well as other
model parameters including the number of solid species.
Point sources (PSs) are used in place of mass inlets where either the geometry and/or grid resolution prohibit tradi-
tional boundary condition specification. For example, a point source may be used to model an injector with dimensions
smaller than the grid. Point sources may be defined within a single computational cell, along a plane, or as a volume of
computational cells.
Point sources introduce mass directly into a computational cell unlike a boundary condition which specifies flow along a
cell face. One consequence of this implementation is that point sources are subjected to convection/diffusion forces and
may not travel parallel to the specified directional preference. Directional preference is specified with a velocity vector
(i.e., PS_U_g, PS_V_g, etc.), however, it is not required.
To create a new point source, press the button which will bring up the Region Selection dialog. Select a region to
associate with the new point source and press OK.
The sub-panes are created dynamically for each point source based on the model parameters including the number of
solid species.
Internal surfaces allow the user to create a zero-thickness walls that are normal to one of the coordinate directions and
coincide with one of the faces of the scalar control volume.
Two types of internal surfaces are available: Impermeable, which acts as a free-slip wall for both gas and solids phases,
and Semi-Impermeable, which allows only the gas phase to pass through the internal surface.
To create a new internal surface, press the button which will bring up the Region Selection dialog. Select a region
to associate with the new Internal Surface. Select the type of Internal surface and press OK. For Semi-Impermeable
surfaces, the fluid permeability and Internal Resistance Coefficient must be provided as well.
Typically, the region associated with an Internal Surface will be a plane. To specify a large number of internal surfaces
in a region, a 3D region may be selected. In this case, a prefix (X_, Y_, or Z_) is added to the Internal Surface type to
indicate the direction of the internal surfaces; e.g., X_IMPERMEABLE specifies impermeable internal surfaces parallel
to the X coordinate.
Internal surfaces act as free-slip walls in stress computations. This default condition cannot be changed.
Chemistry
Setting up a project with chemical reactions is a multi-step process that requires coding the reactions rates in
usr_rates.f for TFM or usr_rates_des.f for DEM. The solver needs to be built to take the reaction rates
into account. A brief overview is outlined below. The Silane pyrolysis tutorial is an good way for the user to familiarize
him/herself with setting up chemical reactions in MFiX.
• Check the “Enable user-defined subroutine” check-box in the “Model” pane.
• Check the “Enable Species equations” check-box and define species in the “Fluid” and “Solids” panes.
• In the “Chemistry” pane, define chemical equations by pressing the button. Define the reaction equation
name, and add reactants and products with the button. Select the phase and species from the dropdown
list, and enter the stoichiometric coefficient. Repeat until all products and reactants are defined, and press OK to
validate. Specific heats of reactions are computed automatically, but this setting can be manually overwritten if
needed by checking the “Specify Heat of Reaction” check-box, entering the heat of reaction and assigning the gas
and solids phases fractions.
• (Optional) turn on the stiff chemistry solver in the “Chemistry” pane by checking the “Enable stiff chemistry solver”
check-box.
• Edit and save the usr_rates.f or usr_rates_des.f UDF, and any other UDF needed for the reaction
rates calculation.
Numerics
The Numerics panes defines various numerical parameters, which are grouped in several sub panes:
• Residuals: Defines convergence criteria for each type of equation, as well as the maximum number of iterations
and residual normalization options.
• Discretization: Defines temporal, spatial discretization schemes and relaxation factors for each equation.
• Linear Solver: Defines the Linear Equation solver, tolerance and maximum number of iterations for each equation.
• Preconditioner: Defines the preconditioner options for each equation.
• Advanced: Defines less common parameters, such as the maximum inlet velocity factor, drag and IA theory under-
relaxation factors and fourth order interpolation scheme.
Outputs
A variety of output formats can be written by the solver including restart files (*.RES), VTK files (*.pvd, *.vtp,
*.vtu), and legacy Single Precision files (*.SP?). The VTK files can be read by and displayed in the GUI. Most of
these files can be viewed with the post-processing programs ParaView and VisIt.
The Basic sub-pane is where the restart file write frequency as well as the VTK and SPx outputs can be enabled. Once
these are enabled, the associated sub-pane will be enabled, allowing for specific control over these outputs.
The VTK output has the most flexibility. Selected particle data or cell data variables can be exported at a specific region
and write frequency. To create a new VTK output, press the button which will bring up the Region Selection dialog.
Next, select an output type (particle or cell), select a region, and press OK. The file pattern name, write frequency, and
variables can be selected for the newly created VTK output.
The following table lists the files typically associated with an MFiX run. In addition, their associated file type, data content
and readability by ParaView and VisIt is indicated.
Monitors
Planned.
Run
The Run pane is used to define parameters related to how long the solver runs, time-step controls, as well as options to
cleanly terminate a solver after a certain amount of time. These options are particularly useful when running in a queue
environment because they allow the solver to cleanly exit before the job gets killed by the queuing system. This minimizes
the chance of corrupting output files if the process is killed while writing a file.
The visualization window provides a collection of 3D views and 2D plots for visualizing the model setup and model
outputs. New windows, or tabs, can be created by pressing the button. Once the tab has been added, the type of
view can be selected. A Tab can be closed by pressing the button located in its upper right hand corner.
Model
The Model tab is always present and cannot be closed. This 3D view shows the setup of the project including the back-
ground mesh, geometry, and regions.
The scene can be manipulated with the mouse and the toolbar buttons defined in the following table:
Icon Description
Change to XY view
Change to XZ view
Change to YZ View
The visibility menu allows the user to manipulate objects in the scene by:
Plot Tab(s)
The plot tab(s) can be used to graph live statistics from the solver while it is running. Values such as the time step (dt),
number of iterations (nit), and the simulated time (time) can be plotted. The plot can be manipulated with the mouse,
and a right-click menu provides access to options that can be changed. In addition, export options for saving an
image of the plot or exporting the data to a text file are available in this menu.
VTK Tab(s)
The VTK tab provides a way to quickly view results from the solver. For more complex visualization of solver data,
ParaView or VisIt is recommended.
The tab automatically sets-up VTK pipelines for reading and displaying the content of *.vtu and *.vtp files.
Note: The directory is automatically searched every second for *.pvd files. If a *.pvd file is found, the GUI will read
Results display can be “played” as well as manipulated using the following toolbar:
Icon Description
Change to XY view
Change to XZ view
Change to YZ View
The visibility menu allows for the manipulation of how the objects in the scene represented including:
• visibility
• the data array used to color
• color bars
• transparency
Further options for the points can be adjusted by clicking the button next to the label including:
• Maximum number of particles to be displayed
• The mapper (sprites requires VTK version 7.0+)
• The glyph object
The terminal window displays the output of the solver job that would be displayed when running the solver on the command
line. Error messages and warnings, from both the GUI and a running solver, are displayed and colored in red.
Informational messages from the GUI unrelated to the solver are colored in blue.
The Mode bar allows switching the GUI between various modes including:
• Modeler, used to setup a project
• Nodeworks, future feature to support creation, management, post processing, and optimization of projects.
A status bar is also present, showing the current status of the GUI or a running solver, including a progress bar showing
the current progress of the solver and elapsed time.
MFiX solver jobs can also be submitted to a queue through the Run Dialog. This functionality must be added to the GUI
by the user by creating a Queue Template. This template allows users to customize the functionality of the GUI for their
specific system.
Currently only a queue template that supports queue submissions on Joule (NETL’s supercomputer) is included. Joule
uses gridengine as the queueing system.
If you do not want to use the GUI or interactive features with your batch job, you can build a Batch Solver and run as in
MFiX 2016 and earlier.
Queue Templates
Queue templates are included with the MFiX source code and can be found in the MFIX_HOME\queue_templates
directory. Queue templates are files that contain two sections. The first section is the configuration section that tells the
GUI what widgets to display as well as various options for those widgets. The second section is the actual script that is
executed.
Variables can be used throughout the template, including with the widgets, and are reference by ${my_variable}.
Each template include some built in variables including:
Variable Description
SCRIPT the path of this script, in the run directory
PROJECT_NAME the name of the project
JOB_ID the job id extracted from the submit command
COMMAND the command that executes mfix
The configuration section starts with ## CONFIG and ends with ## END CONFIG. This section uses the Microsoft
Windows INI file format. Sections are defined with a [section] header, followed by a collection of key=value or
key: value entries for defining parameters. For example:
## CONFIG
[My Section]
foodir: %(dir)s/whatever
dir=frob
(continues on next page)
The configuration section has a special section called [options] where the following options can be specified:
Key Description
name name of the template, this is displayed in the template drop-down box in the GUI
job_id_regex regular expression to extract the job id from the output of the submit command
status_regex regular expression to extract the job status from the status command
submit the submission command
delete the job cancel or delete command
status the job status command
[options]
name: Joule
job_id_regex: (\d+)
status_regex: ([rqw])
submit: qsub ${SCRIPT}
delete: qdel ${JOB_ID}
status: qstat -j ${JOB_ID}
To define a new variable and widget to edit that variable in the GUI, create a new section:
[my_value]
The widget and options for that widget can then be selected by specifying various parameters including:
[my_email]
widget: combobox
label: email
value: you@mail.com
items: you@mail.com|
(continues on next page)
The value of this widget can now be referenced throughout the template with ${my_email}
The rest of the configuration file, outside of the ## CONFIG to ## END CONFIG section is the script that needs to
be executed to submit a job to your specific queue system. For example, with Grid Engine on Joule, the following script
specifies the job name, job type, cores, and queue. In addition, it loads the required modules needed for the MFiX run,
and finally runs mfix with ${COMMAND}.
## Change into the current working directory
#$ -cwd
##
## The name for the job. It will be displayed this way on qstat
#$ -N ${JOB_NAME}
##
## Number of cores to request
#$ -pe ${JOB_TYPE} ${CORES}
##
## Queue Name
#$ -q ${QUEUE}
##
##Load Modules
module load ${MODULES}
##Run the job
${COMMAND}
User-Defined Functions (UDFs) are source files in the same directory as the project file that define code that is called by
specific locations in the main MFiX code. UDFs are used to customize the behavior of MFiX. One common usage is for
creating user-specific output files. In many cases, creating a personalized UDF is preferable to using post_mfix.
Because MFiX is open source, users may modify any *.f or *.inc file under the model directory. To modify a file, first
copy it from the model directory into the run directory. All modifications should be made to the file in the run directory.
For example, list the contents of the adiabaticFlame test case located in the legacy_tests directory. Legacy
tests can be found by downloading the source tarball. They are meant to provide representative setups for older versions
of MFiX (before the launch of the GUI), and are not guaranteed to run with the latest version of MFiX.
> cd tutorials/tfm/silane_pyrolysis_2d
> ls
SP2D.mfx usr0.f usr1.f usr_mod.f usr_rates.f
The SP2D.mfx file is the project file, and the usr*.f files are the UDFs used by this project. simulation. After running
build_mfixsolver, a re-examination of the same folder reveals:
> build_mfixsolver
...long output...
> ls
Makefile build mfixsolver usr.mod usr0.f usr1.d usr1.o ␣
,→usr_mod.f usr_rates.d usr_rates.o
SP2D.mfx lib species.inc usr0.d usr0.o usr1.f usr_mod.d ␣
,→usr_mod.o usr_rates.f (continues on next page)
Each UDF has a corresponding dependency (.d) file and object (.o) file.
If a project has a usr_rates.f UDF, an additional species.inc file is generated from the project file during the
reaction preprocessing step of the build.
The .d and .o files are intermediate dependency and object files that are created and linked with the executable, mfix.
The following is a list of MFIX files that are usually modified to include user defined scalars, user defined drag models,
and chemical reactions, physical properties, and source terms for the governing equations:
To activate the calls to the following routines, make sure the “Enable user-defined subroutines” checkbox is checked in
the Model pane.
The following figures illustrate the local call structure for UDFs, for typical TFM/PIC and DEM runs:
DES User-defined subroutines call structure:
Note that the USR_ keywords do not have any explicit behavior. They are only basic input mechanisms to interact with
user-defined functions. For example, specifying USR_X_w does not result in the associated I index, USR_I_W being
calculated. It is upon the user to ensure that all user-hooks are fully specified.
8.3 Keywords
RUN_NAME
DESCRIPTION
PROJECT_VERSION
UNITS
RUN_TYPE
TIME
TSTOP
OPTFLAG1
DT
DT_MAX
DT_MIN
DT_FAC
PERSISTENT_MODE
AUTO_RESTART
MOMENTUM_X_EQ(PHASE)
MOMENTUM_Y_EQ(PHASE)
MOMENTUM_Z_EQ(PHASE)
JACKSON
ISHII
ENERGY_EQ
SPECIES_EQ(PHASE)
TURBULENCE_MODEL
MU_GMAX
DRAG_TYPE
DIFE- G.H. Ganser, A rational approach to drag prediction of spherical and nonspherical
LICE_GANSER particles, Powder Technol. 77 (1993) 143-152. This model requires specification of
a sphericity and a reference length (typically the bed diameter)
USER_DRAG Invoke user-defined drag law. (usr_drag.f)
GIDASPOW_PCF (TFM only). see GIDASPOW
GI- (TFM only). see GIDASPOW_BLEND
DASPOW_BLEND_PCF
WEN_YU_PCF (TFM only). see WEN_YU
KOCH_HILL_PCF (TFM only). see KOCH_HILL
DRAG_C1
DRAG_D1
LAM_HYS
SPHERICITY_DG
REF_LENGTH_DG
SUBGRID_TYPE
FILTER_SIZE_RATIO
SUBGRID_WALL
MODEL_B
NSCALAR
PHASE4SCALAR(SCALAR EQUATION)
PPO
P_REF
P_SCALE
GRAVITY
GRAVITY_X
GRAVITY_Y
GRAVITY_Z
This section contains keywords for defining numerical parameters. Keywords related to solving the governing equations
(e.g., LEQ_IT, DISCRETIZE, UR_FAC, etc.) are dimensioned for the ten types of equations:
For example, LEQ_IT(3) = 10, specifies to use 10 iterations within the linear equation solver for the U Momentum
Equations (of type 3).
MAX_NIT
NORM_G
NORM_S
PPG_DEN
EPP_DEN
TOL_RESID
TOL_RESID_T
TOL_RESID_X
TOL_RESID_TH
TOL_RESID_SCALAR
TOL_RESID_K_EPSILON
TOL_DIVERGE
TOL_SUM_RESID_ABS
DETECT_STALL
LEQ_METHOD(EQUATION ID NUMBER)
LEQ_TOL(EQUATION ID NUMBER)
LEQ_IT(EQUATION ID NUMBER)
LEQ_SWEEP(EQUATION ID NUMBER)
LEQ_PC(EQUATION ID NUMBER)
UR_FAC(EQUATION ID NUMBER)
UR_F_GS
UR_KTH_SML
DISCRETIZE(EQUATION ID NUMBER)
DEF_COR
CHI_SCHEME
CN_ON
MAX_INLET_VEL_FAC
DO_TRANSPOSE
ICHECK_BICGS
OPT_PARALLEL
USE_DOLOOP
IS_SERIAL
DIL_EP_S
ZERO_EP_S
ZERO_X_GS
TMIN
TMAX
COORDINATES
IMAX
DX(CELL)
XMIN
XLENGTH
X_MIN
X_MAX
JMAX
DY(CELL)
YLENGTH
Y_MIN
Y_MAX
NO_K
KMAX
DZ(CELL)
Z_MIN
Z_MAX
ZLENGTH
CYCLIC_X
CYCLIC_X_PD
DELP_X
CYCLIC_Y
CYCLIC_Y_PD
DELP_Y
CYCLIC_Z
CYCLIC_Z_PD
DELP_Z
SHEAR
V_SH
FLUX_G
CYLINDRICAL_2D
I_CYL_NUM
I_CYL_TRANSITION
CPX(CTRL)
NCX(CTRL)
ERX(CTRL)
FIRST_DX(CTRL)
LAST_DX(CTRL)
CPY(CTRL)
NCY(CTRL)
ERY(CTRL)
FIRST_DY(CTRL)
LAST_DY(CTRL)
CPZ(CTRL)
NCZ(CTRL)
ERZ(CTRL)
FIRST_DZ(CTRL)
LAST_DZ(CTRL)
KT_TYPE
FRICTION_MODEL
BLENDING_FUNCTION
YU_STANDISH
FEDORS_LANDEL
RDF_TYPE
ADDED_MASS
M_AM
C_E
R_P(PHASE, PHASE)
E_W
PHIP
PHIP0
C_F
PHI
PHI_W
EPS_F_MIN
EP_S_MAX(PHASE)
SEGREGATION_SLOPE_COEFFICIENT
V_EX
MU_S0(PHASE)
DIF_S0(PHASE)
EP_STAR
CLOSE_PACKED(PHASE)
JENKINS
These are keywords common to Discrete Element Model (DEM) and Particles In Cell (PIC).
PARTICLES
GENER_PART_CONFIG
DES_ONEWAY_COUPLED
DES_INTG_METHOD
DESGRIDSEARCH_IMAX
DESGRIDSEARCH_JMAX
DESGRIDSEARCH_KMAX
DES_INTERP_SCHEME
DES_INTERP_WIDTH
DES_INTERP_ON
DES_INTERP_MEAN_FIELDS
DES_DIFFUSE_WIDTH
DES_EXPLICITLY_COUPLED
NFACTOR
NEIGHBOR_SEARCH_N
DES_NEIGHBOR_SEARCH
NEIGHBOR_SEARCH_RAD_RATIO
FACTOR_RLM
USE_VDH_DEM_MODEL
DES_COLL_MODEL
KN
KT_FAC
KN_W
KT_W_FAC
MEW
MEW_W
MEW_R
MEW_RW
DES_EN_INPUT(INDEX)
DES_EN_WALL_INPUT(INDEX)
DES_ET_INPUT(INDEX)
DES_ET_WALL_INPUT(INDEX)
DES_ETAT_FAC
DES_ETAT_W_FAC
EW_YOUNG
VW_POISSON
E_YOUNG(PHASE)
V_POISSON(PHASE)
USE_COHESION
VAN_DER_WAALS
HAMAKER_CONSTANT
WALL_HAMAKER_CONSTANT
VDW_OUTER_CUTOFF
VDW_INNER_CUTOFF
WALL_VDW_OUTER_CUTOFF
WALL_VDW_INNER_CUTOFF
ASPERITIES
DES_CONV_CORR
DES_MIN_COND_DIST
FLPC
DES_EM(PHASE)
E_YOUNG_ACTUAL(PHASE)
EW_YOUNG_ACTUAL
V_POISSON_ACTUAL(PHASE)
VW_POISSON_ACTUAL
MINIMIZE_DES_FACET_LIST
REMOVE_ROGUE_PARTICLES
DTSOLID_FACTOR
DTSOLID_UPDATE_DT
DES_BUFF_RESIZE_FACTOR
DLB_DT
DLB_EGW
Particles in Cell
These keywords relate to the Particle in Cell model. Please note that the PIC model is currently not supported by the
GUI, because PIC support is undergoing a rewrite in the solver.
FRIC_EXP_PIC
PSFAC_FRIC_PIC
MPPIC_COEFF_EN1
FRIC_NON_SING_FAC
MPPIC_COEFF_EN_WALL
MPPIC_COEFF_ET_WALL
MPPIC_VELFAC_COEFF
PIC_CFL
PIC_CFL_PARCEL_FRACTION
PIC_CFL_CONTROL
PIC_COLLISION_DAMPING
RO_G0
MU_G0
K_G0
C_PG0
DIF_G0
MW_AVG
MW_G(SPECIES)
NMAX_G
SPECIES_G(SPECIES)
SPECIES_ALIAS_G(SPECIES)
SOLIDS_MODEL(PHASE)
MMAX
D_P0(PHASE)
RO_S0(PHASE)
X_S0(PHASE, SPECIES)
RO_XS0(PHASE, SPECIES)
INERT_SPECIES(PHASE)
DIL_INERT_X_VSD(PHASE)
DIL_FACTOR_VSD
K_S0(PHASE)
KS_MODEL(PHASE)
C_PS0(PHASE)
MW_S(PHASE, SPECIES)
NMAX_S(PHASE)
SPECIES_S(PHASE, SPECIES)
SPECIES_ALIAS_S(PHASE, SPECIES)
CGP_STAT_WT(PHASE)
CGP_D_P0(PHASE)
Each initial condition (IC) is specified over a rectangular region (or pie-shaped for cylindrical coordinates) that corresponds
to the scalar numerical grid. These are 3D regions: X_w X_e, Y_s Y_n, and Z_t Z_b. The region is defined by
the constant coordinates of each of the six faces, which may be specified as the physical coordinates or the cell indices.
The physical coordinates are easier to specify than the cell indices. If cell sizes are not small enough to resolve a region
specified using physical coordinates, MFIX will indicate this problem with an error message.
In cylindrical coordinates, when the theta direction crosses the 0 value, split that region into two regions: e.g., Split a
region spanning 1.9 pi to 0.1 pi as 1.9 pi to 2 pi and 0 to 0.1 pi.
Initial condition regions may overlap. When an overlap occurs, MFIX uses the conditions specified for the higher IC
number.
IC_X_W(IC)
IC_X_E(IC)
IC_Y_S(IC)
IC_Y_N(IC)
IC_Z_B(IC)
IC_Z_T(IC)
IC_I_W(IC)
IC_I_E(IC)
IC_J_S(IC)
IC_J_N(IC)
IC_K_B(IC)
IC_K_T(IC)
IC_TYPE(IC)
IC_EP_G(IC)
IC_P_G(IC)
IC_P_STAR(IC)
IC_L_SCALE(IC)
IC_ROP_S(IC, PHASE)
IC_EP_S(IC, PHASE)
IC_PSD_TYPE(IC, PHASE)
IC_PSD_MEAN_DP(IC, PHASE)
IC_PSD_STDEV(IC, PHASE)
IC_PSD_MAX_DP(IC, PHASE)
IC_PSD_MIN_DP(IC, PHASE)
IC_T_G(IC)
IC_T_S(IC, PHASE)
IC_THETA_M(IC, PHASE)
IC_GAMA_RG(IC)
IC_T_RG(IC)
IC_GAMA_RS(IC, PHASE)
IC_T_RS(IC, PHASE)
IC_U_G(IC)
IC_U_S(IC, PHASE)
IC_V_G(IC)
IC_V_S(IC, PHASE)
IC_W_G(IC)
IC_W_S(IC, PHASE)
IC_X_G(IC, SPECIES)
IC_K_TURB_G(IC)
IC_E_TURB_G(IC)
IC_DES_FIT_TO_REGION(IC)
IC_DES_LATTICE(IC, PHASE)
IC_DES_SPACING(IC, PHASE)
IC_DES_SPACE_FACTOR_X(IC, PHASE)
IC_DES_SPACE_FACTOR_Y(IC, PHASE)
IC_DES_SPACE_FACTOR_Z(IC, PHASE)
IC_DES_RAND(IC, PHASE)
IC_DES_RAND_FACTOR_X(IC, PHASE)
IC_DES_RAND_FACTOR_Y(IC, PHASE)
IC_DES_RAND_FACTOR_Z(IC, PHASE)
IC_DES_SM(IC, PHASE)
IC_DES_NP(IC, PHASE)
IC_DES_CHECK_STL_OVERLAP(IC, PHASE)
IC_PIC_CONST_STATWT(IC, PHASE)
Boundary conditions (BC) are specified over flow planes or 2D surfaces that are normal to one of the coordinate directions
and coincide with a face of the scalar control-volume. The values for one of the three pairs of coordinates are equal. The
surface is defined by the constant coordinates of each of the four edges, which can be specified with physical coordinates
or cell indices, and the two equal values for the direction normal to the face, which can only be specified with physical
coordinates. If cell sizes are not small enough to resolve a surface specified using physical coordinates, MFIX will indicate
this problem with an error message.
A flow plane must have a wall cell (or an outside boundary) on one side and a flow cell on the other side. The BC section
is also used to specify obstacles in the flow domain. Obstacles are 3D regions, just as for the IC regions: X_w X_e,
Y_s Y_n, and Z_t Z_b. By default the outside boundary is initialized as no-slip walls. For cylindrical coordinates
the axis is initialized as a free-slip wall.
Two boundary surfaces must not intersect. Two obstacle regions may intersect.
BC_X_W(BC)
BC_X_E(BC)
BC_Y_S(BC)
BC_Y_N(BC)
BC_Z_B(BC)
BC_Z_T(BC)
BC_I_W(BC)
BC_I_E(BC)
BC_J_S(BC)
BC_J_N(BC)
BC_K_B(BC)
BC_K_T(BC)
BC_TYPE(BC)
BC_PSD_TYPE(BC, PHASE)
BC_PSD_MEAN_DP(BC, PHASE)
BC_PSD_STDEV(BC, PHASE)
BC_PSD_MAX_DP(BC, PHASE)
BC_PSD_MIN_DP(BC, PHASE)
BC_MI_START_TIME(BC)
BC_MI_END_TIME(BC)
BC_HW_G(BC)
BC_HW_S(BC, PHASE)
BC_UW_G(BC)
BC_UW_S(BC, PHASE)
BC_VW_G(BC)
BC_VW_S(BC, PHASE)
BC_WW_G(BC)
BC_WW_S(BC, PHASE)
BC_JJ_PS(BC)
BC_JJ_M
BC_THETAW_M(BC, PHASE)
BC_HW_THETA_M(BC, PHASE)
BC_C_THETA_M(BC, PHASE)
BC_HW_T_G(BC)
BC_TW_G(BC)
BC_C_T_G(BC)
BC_HW_T_S(BC, PHASE)
BC_TW_S(BC, PHASE)
BC_C_T_S(BC, PHASE)
BC_HW_X_G(BC, SPECIES)
BC_XW_G(BC, SPECIES)
BC_C_X_G(BC, SPECIES)
BC_EP_G(BC)
BC_P_G(BC)
BC_ROP_S(BC, PHASE)
BC_EP_S(BC, PHASE)
BC_T_G(BC)
BC_T_S(BC, PHASE)
BC_THETA_M(BC, PHASE)
BC_X_G(BC, SPECIES)
BC_U_G(BC)
BC_U_S(BC, PHASE)
BC_V_G(BC)
BC_V_S(BC, PHASE)
BC_W_G(BC)
BC_W_S(BC, PHASE)
BC_VOLFLOW_G(BC)
BC_VOLFLOW_S(BC, PHASE)
BC_MASSFLOW_G(BC)
BC_MASSFLOW_S(BC, PHASE)
BC_DT_0(BC)
BC_JET_G0(BC)
BC_DT_H(BC)
BC_JET_GH(BC)
BC_DT_L(BC)
BC_JET_GL(BC)
BC_K_TURB_G(BC)
BC_E_TURB_G(BC)
BC_PIC_MI_CONST_STATWT(BC, PHASE)
BC_PO_APPLY_TO_DES(BC)
BC_MI_APPLY_TO_DES(BC)
IS_X_W(IS)
IS_X_E(IS)
IS_Y_S(IS)
IS_Y_N(IS)
IS_Z_B(IS)
IS_Z_T(IS)
IS_I_W(IS)
IS_I_E(IS)
IS_J_S(IS)
IS_J_N(IS)
IS_K_B(IS)
IS_K_T(IS)
IS_TYPE(IS)
IS_PC(IS, IDX)
IS_VEL_S(IS, PHASE)
Point sources (PS) are used in place of mass inlets where either the geometry and/or grid resolution prohibit proper bound-
ary condition specification. For example, a point source may be used to model an injector with dimensions smaller than
the grid. Point sources may be defined within a single computational cell, along a plane, or as a volume of computational
cells.
Point sources introduce mass directly into a computational cell unlike a boundary condition which specifies flow along a
cell face. One consequence of this implementation is that point sources are subjected to convection/diffusion forces and
may not travel parallel to the specified directional preference. Directional preference is specified with a velocity vector
(i.e., PS_U_g, PS_V_g, etc.), however, directional preference is not required.
Examples showing how to setup point sources can be found in: legacy_tutorials/point_source_spiral
Legacy tutorials can be found by downloading the source tarball. They are meant to provide representative setups for
older versions of MFiX (before the launch of the GUI), and are not guaranteed to run with the latest version of MFiX.
PS_X_W(PS)
PS_X_E(PS)
PS_Y_S(PS)
PS_Y_N(PS)
PS_Z_B(PS)
PS_Z_T(PS)
PS_I_W(PS)
PS_I_E(PS)
PS_J_S(PS)
PS_J_N(PS)
PS_K_B(PS)
PS_K_T(PS)
PS_U_G(PS)
PS_V_G(PS)
PS_W_G(PS)
PS_MASSFLOW_G(PS)
PS_T_G(PS)
PS_X_G(PS, SPECIES)
PS_U_S(PS, PHASE)
PS_V_S(PS, PHASE)
PS_W_S(PS, PHASE)
PS_MASSFLOW_S(PS, PHASE)
PS_T_S(PS, PHASE)
RES_DT
RES_BACKUP_DT
RES_BACKUPS
SPX_DT(SP VALUE)
NRR
OUT_DT
REPORT_SOLID_INVENTORY
REPORT_SOLID_INVENTORY_DT
BREAKDOWN_SOLID_INVENTORY_BY_PHASE
NLOG
FULL_LOG
RESID_STRING(RESIDUAL INDEX)
GROUP_RESID
REPORT_NEG_DENSITY
REPORT_NEG_SPECIFICHEAT
REPORT_MASS_BALANCE_DT
PHIP_OUT_JJ
BDIST_IO
BSTART_WITH_ONE_RES
MONITOR_X_W(MONITOR)
MONITOR_X_E(MONITOR)
MONITOR_Y_S(MONITOR)
MONITOR_Y_N(MONITOR)
MONITOR_Z_B(MONITOR)
MONITOR_Z_T(MONITOR)
MONITOR_NAME(MONITOR)
MONITOR_DT(MONITOR)
MONITOR_TYPE(MONITOR)
MONITOR_EP_G(MONITOR)
MONITOR_RO_G(MONITOR)
MONITOR_P_G(MONITOR)
MONITOR_U_G(MONITOR)
MONITOR_V_G(MONITOR)
MONITOR_W_G(MONITOR)
MONITOR_T_G(MONITOR)
MONITOR_MW_MIX_G(MONITOR)
MONITOR_X_G(MONITOR, SPECIES)
MONITOR_Y_G(MONITOR, SPECIES)
MONITOR_K_TURB_G(MONITOR)
MONITOR_E_TURB_G(MONITOR)
MONITOR_EP_S(MONITOR, PHASE)
MONITOR_U_S(MONITOR, PHASE)
MONITOR_V_S(MONITOR, PHASE)
MONITOR_W_S(MONITOR, PHASE)
MONITOR_ROP_S(MONITOR, PHASE)
MONITOR_RO_S(MONITOR, PHASE)
MONITOR_P_STAR(MONITOR)
MONITOR_P_S(MONITOR, PHASE)
MONITOR_T_S(MONITOR, PHASE)
MONITOR_THETA_M(MONITOR, PHASE)
MONITOR_RRATE(MONITOR, RATE)
MONITOR_FLUID_RRATE(MONITOR, RATE)
MONITOR_DES_RRATE(MONITOR, RATE)
MONITOR_PART_PHASE(MONITOR, PHASE)
MONITOR_RADIUS(MONITOR)
MONITOR_PMASS(MONITOR)
MONITOR_PVOL(MONITOR)
MONITOR_RO_P(MONITOR)
MONITOR_VEL_X(MONITOR)
MONITOR_VEL_Y(MONITOR)
MONITOR_VEL_Z(MONITOR)
MONITOR_ROT_X(MONITOR)
MONITOR_ROT_Y(MONITOR)
MONITOR_ROT_Z(MONITOR)
MONITOR_T_P(MONITOR)
MONITOR_X_P(MONITOR, SPECIES)
MONITOR_DES_USR_VAR(MONITOR, USR_VAR)
MONITOR_PART_RRATE(MONITOR, RATE)
MONITOR_PART_RESIDENCE_TIME(MONITOR)
WRITE_VTK_FILES
TIME_DEPENDENT_FILENAME
VTK_DT(VTK)
VTK_DBG_FILE(VTK)
VTK_VAR(IDX)
VTK_X_W(VTK)
VTK_X_E(VTK)
VTK_Y_S(VTK)
VTK_Y_N(VTK)
VTK_Z_B(VTK)
VTK_Z_T(VTK)
VTK_FILEBASE(VTK)
VTK_DATA(VTK)
VTK_GEO(VTK, GEO)
VTK_SELECT_MODE(VTK)
VTK_NXS(VTK)
VTK_NYS(VTK)
VTK_NZS(VTK)
VTK_SLICE_TOL(VTK)
VTK_EP_G(VTK)
VTK_P_G(VTK)
VTK_VEL_G(VTK)
VTK_U_G(VTK)
VTK_V_G(VTK)
VTK_W_G(VTK)
VTK_P_STAR(VTK)
VTK_P_S(VTK, PHASE)
VTK_VEL_S(VTK, PHASE)
VTK_U_S(VTK, PHASE)
VTK_V_S(VTK, PHASE)
VTK_W_S(VTK, PHASE)
VTK_ROP_S(VTK, PHASE)
VTK_RO_S(VTK, PHASE)
VTK_EP_S(VTK, PHASE)
VTK_T_G(VTK)
VTK_T_S(VTK, PHASE)
VTK_MW_MIX_G(VTK)
VTK_THETA_M(VTK, PHASE)
VTK_SCALAR(VTK, SCALAR)
VTK_RRATE(VTK, RATE)
VTK_RRATE_LABEL(VTK, RATE)
VTK_FLUID_RRATE(VTK, RATE)
VTK_DES_RRATE(VTK, RATE)
VTK_K_TURB_G(VTK)
VTK_E_TURB_G(VTK)
VTK_VORTICITY(VTK)
VTK_LAMBDA_2(VTK)
VTK_PARTITION(VTK)
VTK_BC_ID(VTK)
VTK_DWALL(VTK)
VTK_FACET_COUNT_DES(VTK)
VTK_NB_FACET_DES(VTK)
VTK_IJK(VTK)
VTK_NORMAL(VTK)
VTK_DEBUG(VTK, IDX)
VTK_PART_DIAMETER(VTK)
VTK_PART_PHYSICAL_DIAMETER(VTK)
VTK_PART_CGP_STAT_WT(VTK)
VTK_PART_VEL(VTK)
VTK_PART_ANGULAR_VEL(VTK)
VTK_PART_ORIENTATION(VTK)
VTK_PART_USR_VAR(VTK, USR_VAR)
VTK_PART_TEMP(VTK)
VTK_PART_X_S(VTK, DES_SPECIES)
VTK_PART_RRATE(VTK, RATE)
VTK_PART_DENSITY(VTK)
VTK_PART_COHESION(VTK)
VTK_PART_RANK(VTK)
VTK_PART_ID(VTK)
VTK_PART_RESIDENCE_TIME(VTK)
VTK_PART_PHASE_ID(VTK)
VTK_PART_PHASE(VTK, PHASE)
VTK_CUTCELL_ONLY(VTK)
FRAME(VTK)
VTU_DIR
DES_REPORT_MASS_INTERP
PRINT_DES_DATA
VTP_DIR
DES_OUTPUT_TYPE
DEBUG_DES
FOCUS_PARTICLE
WRITE_PART_OUT
PART_OUT_ZERO_VEL
PART_OUT_X_MIN
PART_OUT_X_MAX
PART_OUT_X_EXCLUDE
PART_OUT_Y_MIN
PART_OUT_Y_MAX
PART_OUT_Y_EXCLUDE
PART_OUT_Z_MIN
PART_OUT_Z_MAX
PART_OUT_Z_EXCLUDE
PART_OUT_PHASE(PHASE)
PART_OUT_DIAMETER_MIN
PART_OUT_DIAMETER_MAX
PART_OUT_DIAMETER_EXCLUDE
PART_OUT_DENSITY_MIN
PART_OUT_DENSITY_MAX
PART_OUT_DENSITY_EXCLUDE
PART_OUT_U_MIN
PART_OUT_U_MAX
PART_OUT_U_EXCLUDE
PART_OUT_V_MIN
PART_OUT_V_MAX
PART_OUT_V_EXCLUDE
PART_OUT_W_MIN
PART_OUT_W_MAX
PART_OUT_W_EXCLUDE
PART_OUT_TEMP_MIN
PART_OUT_TEMP_MAX
PART_OUT_TEMP_EXCLUDE
PART_OUT_X_S_MIN(INDEX)
PART_OUT_X_S_MAX(INDEX)
PART_OUT_X_S_EXCLUDE(INDEX)
PART_OUT_USR_VAR_MIN(INDEX)
PART_OUT_USR_VAR_MAX(INDEX)
PART_OUT_USR_VAR_EXCLUDE(INDEX)
PART_IN_X_MIN
PART_IN_X_MAX
PART_IN_X_EXCLUDE
PART_IN_Y_MIN
PART_IN_Y_MAX
PART_IN_Y_EXCLUDE
PART_IN_Z_MIN
PART_IN_Z_MAX
PART_IN_Z_EXCLUDE
PART_IN_PHASE(PHASE)
PART_IN_DIAMETER_MIN
PART_IN_DIAMETER_MAX
PART_IN_DIAMETER_EXCLUDE
PART_IN_DENSITY_MIN
PART_IN_DENSITY_MAX
PART_IN_DENSITY_EXCLUDE
PART_IN_U_MIN
PART_IN_U_MAX
PART_IN_U_EXCLUDE
PART_IN_V_MIN
PART_IN_V_MAX
PART_IN_V_EXCLUDE
PART_IN_W_MIN
PART_IN_W_MAX
PART_IN_W_EXCLUDE
PART_IN_TEMP_MIN
PART_IN_TEMP_MAX
PART_IN_TEMP_EXCLUDE
PART_IN_X_S_MIN(INDEX)
PART_IN_X_S_MAX(INDEX)
PART_IN_X_S_EXCLUDE(INDEX)
PART_IN_USR_VAR_MIN(INDEX)
PART_IN_USR_VAR_MAX(INDEX)
PART_IN_USR_VAR_EXCLUDE(INDEX)
CALL_USR
CALL_USR_SOURCE(EQUATION ID NUMBER)
USR_ROG
USR_CPG
USR_KG
USR_DIFG
USR_MUG
USR_ROS(PHASE)
USR_CPS(PHASE)
USR_KS(PHASE)
USR_DIFS(PHASE)
USR_MUS(PHASE)
USR_GAMA(PHASE)
USR_FGS(PHASE)
USR_FSS(PHASE)
C(USER-DEFINED ID)
C_NAME(USER-DEFINED ID)
USR_DT(USR)
USR_X_W(USR)
USR_X_E(USR)
USR_Y_S(USR)
USR_Y_N(USR)
USR_Z_B(USR)
USR_Z_T(USR)
USR_I_W(USR)
USR_I_E(USR)
USR_J_S(USR)
USR_J_N(USR)
USR_K_B(USR)
USR_K_T(USR)
USR_TYPE(USR)
USR_VAR(USR)
USR_FORMAT(USR)
USR_EXT(USR)
DES_USR_VAR_SIZE
See Setting up Chemical Reaction Cases for information on using these keywords.
STIFF_CHEMISTRY
STIFF_CHEM_MAX_STEPS
USE_RRATES
SPECIES_NAME(PHASE)
NMAX(PHASE)
MFiX uses the Burcat or NASA 7-Coefficient polynomials to calculate thermochemical properties of species (not the
NASA 9-Coefficient polynomials). The directory model/thermochemical contains the database of Burcat and
Ruscic (2005) and routines for reading the database. With linkage to this database the users need not manually enter data
for molecular weight, specific heat, and heats of reactions. Instead the users only need to enter the names of the species
(keyword SPECIES_g and SPECIES_s) in the data file. If such information is already provided in either the data file or
a BURCAT.THR file in the run directory then MFiX will not reference the database. That is, MFiX reads the necessary
thermo-chemical data from files in the following order:
1. mfix.dat
2. BURCAT.THR file in the run directory
3. model/thermochemical/BURCAT.THR
The species names are case sensitive and should match the names in BURCAT.THR exactly; alternatively aliases can
be defined for common species, such as O2, in read_therm.f. See tests/thermo for a sample case that accesses
the database. The format of BURCAT.THR file resembles CHEMKIN format, but with several notable differences. To
include thermochemical data in the mfix.dat file then this information must start below a line that starts with THERMO
DATA.
Example dataset from BURCAT.THR with notations:
Each entry in the database starts with a unique CAS identifier (74-82-8) for the species, followed by several lines of com-
ments highlighted in green. The data section starts with the species name in columns 1-18 (CH4 RRHO). Common species
names may be followed by strings (RRHO) that identify the method used to determine the coefficients. Additional infor-
mation follows the species name. The numbers toward the end of the line are the temperature limits (200.000 6000.000)
in degrees Kelvin where the property calculation is valid and the molecular weight (16.04246). Unlike CHEMKIN the
common temperature for the high and low temperature branches are not recorded; it is always 1000 K. The next three
lines give the fourteen coefficients (seven coefficients each for the high and low temperature branches) and the formation
enthalpy at 298 K (which is also not included in CHEMKIN format). All the coefficients and the enthalpy of formation
are normalized with the gas constant R (cal/mol/K). The low temperature coefficients (aL ) should be used for tempera-
tures in the range Tlow to 1000K and the high temperature coefficients (aH ) should be used for temperatures in the range
1000K to Thigh. The coefficients are stored in a fixed format (E15.0) as follows:
Cp
= a1 + a2 T + a3 T 2 + a4 T 3 + a5 T 4 .
R
The coefficients a6 and a7 are not required to calculate Cp . They are used in the HT , ST , and GT polynomials which are
HT a2 T a3 T 2 a4 T 3 a5 T 4 a6
= a1 + + + + +
RT 2 3 4 5 T
ST a3 T 2 a4 T 3 a5 T 4
= a1 ln T + a2 T + + + + a7
R 2 3 4
GT HT ST
= −
RT RT R
Instead, MFiX integrates Cp to determine changes in enthalpy. See Burcat Introduction document for more details, which
is also included in the source, model/thermochemical/intro.pdf.
Additional database comments:
• A number of species in the database have a lower temperature limit of 300K which is 2 degrees above the reference
temperature (298 K) used for formation enthalpy calculation. For those species MFiX relaxes the lower limit for
Cp calculations to 298 K to enable heat of reaction calculation (see read_database.f).
• The database reader is set up such that the database is read only if necessary.
• If you include thermochemical properties in mfix.dat all keywords defined below the line that starts with THERMO
DATA will be ignored!
Parallel performance depends on several things, and one has to evaluate different options before choosing the right strategy
for any problem. For example if the J-direction is the strongest coupled direction, the preconditioning for the linear solver
will be poor if there is decomposition in that direction. However, since decomposing in all the directions reduces the
processor grid surface area, the communication cost will be less for the same computational grid. The preconditioners are
chosen with the keyword LEQ_PC. In addition to LINE relaxation, one can choose the “DIAG” or “NONE” preconditioner
that reduces inter-processor communications but this choice will increase the number of linear equation solver iterations.
The DIAG and NONE choices for preconditioners may be appropriate for all equations except the continuity (or pressure
and volume fraction correction) equations. The parallel performance is greatly dependent on the choices stated here, and
some trial and error may be required to determine the right combination of decomposition direction with the choice of
preconditioners to get the best performance in production runs.
NODESI * NODESJ * NODESK must be the same as the number of processors specified using mpirun (or equivalent
command). Otherwise the code will return with an error.
NODESI
NODESJ
NODESK
DLB_NODESI(LAYOUT)
DLB_NODESJ(LAYOUT)
DLB_NODESK(LAYOUT)
SOLVER_STATISTICS
DEBUG_RESID
ENABLE_DMP_LOG
DBGPRN_LAYOUT
MFiX can be used on systems where code execution is controlled through a batch queue submission system instead of
interactive or background job type methods as shown in the previous section. Usually, the user specifies the wall clock time
duration of the job, and the batch queuing system prioritizes incoming jobs based on their resource allocation requests.
In order for MFiX to avoid abrupt and abnormal termination at the end of the batch job session, several keywords need
to be entered in mfix.dat. Controlled and clean termination in environments with batch queue is important as the system
may terminate the batch job while MFiX is writing out *.SP files, which may corrupt the files or cause loss of data.
For this purpose, MFiX checks whether the user-specified termination criteria is reached at the beginning of each time
step. However, to avoid performance bottlenecks on small systems where the user is running jobs without a batch queue,
this feature is disabled by default. In order to enable this feature the following block of keywords need to be entered into
mfix.dat.
Setting CHK_BATCH_END = .TRUE. in mfix.dat will enable the checking of the termination criteria at the begin-
ning of each time step. In the above example, the user has set the total wall clock time for the duration of the batch session
to 1 hour (this is specified in seconds in mfix.dat) and a buffer of 300 seconds has been set so that MFiX has sufficient
time to terminate cleanly by writing out all *.SP and *.RES files before the batch session terminates. The duration of
the buffer is critical for simulations with large files. MFiX will check if elapsed time >= (BATCH_WALLCLOCK
- TERM_BUFFER) to start clean termination.
Another way to gracefully terminate MFiX as soon as possible is to create an empty file named MFIX.STOP (filename
all uppercase) in the working directory where MFiX runs. At the beginning of each time step if the MFIX.STOP file is
detected, then MFiX will terminate gracefully by saving *.RES files. CHK_BATCHQ_END flag must be set to .TRUE.
in order to activate this feature.
The following terminal command can be used to gracefully terminate MFiX:
Remember to erase the file once MFiX terminates, otherwise the next time MFiX is run
in the same directory it will terminate immediately.
> rm -f -r ./MFIX.STOP
CHK_BATCHQ_END
BATCH_WALLCLOCK
TERM_BUFFER
CARTESIAN_GRID
N_QUADRIC
USE_STL
USE_MSH
USE_POLYGON
N_USR_DEF
QUADRIC_FORM(QUADRIC ID)
QUADRIC_SCALE
LAMBDA_X(QUADRIC ID)
LAMBDA_Y(QUADRIC ID)
LAMBDA_Z(QUADRIC ID)
DQUADRIC(QUADRIC ID)
THETA_X(QUADRIC ID)
THETA_Y(QUADRIC ID)
THETA_Z(QUADRIC ID)
RADIUS(QUADRIC ID)
HALF_ANGLE(QUADRIC ID)
TORUS_R1(QUADRIC ID)
TORUS_R2(QUADRIC ID)
UCOIL_R1(QUADRIC ID)
UCOIL_R2(QUADRIC ID)
UCOIL_Y1(QUADRIC ID)
UCOIL_Y2(QUADRIC ID)
BEND_R1(QUADRIC ID)
BEND_R2(QUADRIC ID)
BEND_THETA1(QUADRIC ID)
BEND_THETA2(QUADRIC ID)
C2C_R1(QUADRIC ID)
C2C_R2(QUADRIC ID)
C2C_Y1(QUADRIC ID)
C2C_Y2(QUADRIC ID)
REACTOR1_R1(QUADRIC ID)
REACTOR1_R2(QUADRIC ID)
REACTOR1_Y1(QUADRIC ID)
REACTOR1_Y2(QUADRIC ID)
REACTOR1_YR1(QUADRIC ID)
REACTOR1_YR2(QUADRIC ID)
REACTOR1_RR1(QUADRIC ID)
REACTOR1_RR2(QUADRIC ID)
REACTOR1_THETA1(QUADRIC ID)
REACTOR1_THETA2(QUADRIC ID)
N_X(QUADRIC ID)
N_Y(QUADRIC ID)
N_Z(QUADRIC ID)
T_X(QUADRIC ID)
T_Y(QUADRIC ID)
T_Z(QUADRIC ID)
CLIP_XMIN(QUADRIC ID)
CLIP_XMAX(QUADRIC ID)
CLIP_YMIN(QUADRIC ID)
CLIP_YMAX(QUADRIC ID)
CLIP_ZMIN(QUADRIC ID)
CLIP_ZMAX(QUADRIC ID)
PIECE_XMIN(QUADRIC ID)
PIECE_XMAX(QUADRIC ID)
PIECE_YMIN(QUADRIC ID)
PIECE_YMAX(QUADRIC ID)
PIECE_ZMIN(QUADRIC ID)
PIECE_ZMAX(QUADRIC ID)
FLUID_IN_CLIPPED_REGION(QUADRIC ID)
BC_ID_Q(QUADRIC ID)
N_GROUP
GROUP_SIZE(GROUP ID)
GROUP_RELATION(GROUP ID)
RELATION_WITH_PREVIOUS(GROUP ID)
TOL_SNAP(DIRECTION)
TOL_DELH
TOL_SMALL_CELL
TOL_MERGE
TOL_SMALL_AREA
ALPHA_MAX
TOL_F
TOL_POLY
ITERMAX_INT
TOL_STL
STL_SMALL_ANGLE
TOL_STL_DP
DIM_FACETS_PER_CELL
OUT_STL_VALUE
FLIP_STL_NORMALS(BC)
STL_BC_ID
TX_STL
TY_STL
TZ_STL
SCALE_STL
TOL_MSH
OUT_MSH_VALUE
TX_MSH
TY_MSH
TZ_MSH
SCALE_MSH
CAD_PROPAGATE_ORDER
RAY_DIR
SET_CORNER_CELLS
FAC_DIM_MAX_CUT_CELL
PG_OPTION
CG_SAFE_MODE
PRINT_WARNINGS
CG_UR_FAC
PRINT_PROGRESS_BAR
BAR_WIDTH
BAR_CHAR
BAR_RESOLUTION
WRITE_DASHBOARD
F_DASHBOARD
RE_INDEXING
ADJUST_PROC_DOMAIN_SIZE
REPORT_BEST_DOMAIN_SIZE
NODESI_REPORT
NODESJ_REPORT
NODESK_REPORT
MINIMIZE_SEND_RECV
DWALL_BRUTE_FORCE
Please send specific questions and feedback regarding the GUI to the support forum. Please include your version info
in all communications (Menu –> About and press the “Copy Version Info” button). Other technical questions regarding
MFiX can be sent to the support forum.
Go to the Settings pane and change the style from the pull down menu.
8.4.3 MFiX (VTK) crashes on RHEL/CentOS 7 with the following error message:
This error message means that the OpenGL driver in RHEL 7.5 does not support the version needed by VTK.
Try using an earlier version of OpenGL:
If this solves the issue for your system, you can add export MESA_GL_VERSION_OVERRIDE=3.2 to your shell
profile.
The custom solver can be built in parallel from the GUI by checking the “Build solver in parallel” check box. This will
pass the -j option to the make command and significantly decrease the time to build the solver.
8.4.5 Play/Pause/Reinit
While the simulation is running, it can be paused by pressing the button. A few settings can be modified, such as
the stop time. Settings that cannot be changed (for example, the grid spacing) will be disabled while the simulation is
paused. To resume the simulation, save the new settings by pressing the button and press the button.
Once a simulation has run to completion, it can be restarted from the current simulation time. Increase the stop time in
the “Run” pane, press the button, and press the button. In the “Run solver” dialog box, check the “Restart”
check box and select “Resume”. Then press the “Run” button.
Once a simulation has run to completion, or if you pressed the button, the simulation can be restarted from the
beginning. This is typically needed if the simulation settings need to be changed and the current results are not needed
anymore. First press the to delete the current results. Next change the simulation settings as needed (if any). Press
Simulations can be setup using the International System of Units (SI). The centimeter-gram-second system (CGS) is no
longer supported.
† The SI unit for energy is the Joule. This is reflected in MFiX through the gas constant. However, entries in the Burcat
database are always specified in terms of calories regardless of the simulation units. MFiX converts the entries to joules
after reading the database when SI units are used.
‡ The SI unit for the amount of a substance is the mole (mol). MFiX uses the kilomole (kmole). These units are needed
when specifying reaction rates:
• amount per time per volume for Eulerian model reactions (kmole.s^{-1}.m^3)
• amount per time for Lagrangian model reactions (kmole.s^{-1})
Initial non-convergence:
Ensure that the initial conditions are physically realistic. If in the initial time step, the run displays NaN (Not-a-Number)
for any residual, reduce the initial time step. If time step reductions do not help, recheck the problem setup.
Holding the time step constant (DT_FAC=1) and ignoring the stalling of iterations (DETECT_STALL=.FALSE.) may
help in overcoming initial nonconvergence. Often a better initial condition will aid convergence. For example, using
a hydrostatic rather than a uniform pressure distribution as the initial condition will aid convergence in fluidized bed
simulations.
Often a better convergence is achieved with ideal gas law than with constant gas density. If poor convergence or failure
to converge is observed while using constant gas density, it is recommended to switch to ideal gas law. In this case the
average molecular weight or individual gas species molecular weights must be defined, and gas pressure and temperature
must be defined in all initial and boundary condition regions.
If there are computational regions where the solids tend to compact (i.e., solids volume fraction less than EP_star),
convergence may be improved by reducing UR_FAC(2) below the default value of 0.5.
Convergence is often difficult with higher order discretization methods. First order upwinding may be used to overcome
initial transients and then the higher order method may be turned on. Also, higher-order methods such as van Leer and
minmod give faster convergence than methods such as superbee and ULTRA-QUICK.
Non-convergence due to bad cut-cell mesh:
When using cut-cells, non-convergence can arise due to a few bad cut cells, typically small cells (in volume) or bad cut
cells coming from poorly resolved geometry in a coarse mesh with geometrical details in the order of one to two cells.
Convergence may be improved by lowering the number of small cut cells. This can be done either by removing small cut
cells or by snapping intersection points to cell corners. The settings are available in the Mesh> Mesher pane in the GUI,
or through keywords in the .mfx file.
To completely remove a small cut cell, increase the “small cell tolerance” (default value is 0.01), or modify the
TOL_SMALL_CELL keyword when editing the .mfx file.
To snap intersection points to a cell corner, increase the “snap tolerance” (default value is 0.00), or modify the TOL_SNAP
keyword when editing the .mfx file.
Increasing the “small area tolerance” (TOL_SMALL_AREA keyword) or Normal distance tolerance (TOL_DELH key-
word) may also help.
We can read the initial particle data from a text file, called particle_input.dat. The format of this file has changed
in the 20.3 release. The old file version can still be used but it is recommended to use the latest format.
To use the file rather than the automatic particle generation (i.e. from Initial Conditions regions), go to the Solids > DEM
pane, and leave the “Enable automatic particle generation” checkbox unchecked. Enter a positive number of particles to
be read in the “Data file particle count”.
Version 2.0 (MFiX 20.3 release)
The new format allows to either read variables or set a constant value for all particles. The file contains a long header
where information about the data is specified. This controls how many columns and which variables are read from the
file. Next, the data section contains the data for each particle. Each column corresponds to a variable. In 3D, the first
3 columns are always the x,y and z coordinates of the particle’s center. In 2D, the first 2 columns are always the x,y
coordinates of the particle’s center. There are two options for the other variables: either read the data for each particle in
the next column, or assign a constant value to all particles.
Below is an example of a particle_input.dat file (the line number is shown on the left and it not part of the data
itself):
• Line 1 : File version. Do not change this line.
• Lines 2-18 : Instructions to use the file.
• Line 19 : This is a 3D geometry. The first 3 columns in the data section will be x,y,z.
• Line 20 : We will read data for 35361 particles.
• Line 24 : We always read coordinates in the first 2 or 3 columns (do not change)
• Line 25 : We do not read particle’s phase ID for each particle. It is assigned a constant value: 1
• Line 26 : We will read the particle’s diameter in the next column (column#4).
• Line 27 : We do not read particle’s density. It is assigned a constant value: 2500.0 kg/m^3
• Line 25 : We do not read particle’s velocity. It is assigned a constant value: (u,v,w) = (0.0,0.0,0.0) m/s
• Lines 29-30: This is a cold, non reacting case, we do not read Temperature or species.
• Line 31 : We do not have user scalars, so we do not read them.
• Lines 32-34: Data header
The data starts on Line 35. Based on the above settings, we need to read, x,y,z, and the diameter of each particles, i.e., 4
columns, for 35361 particles. Only the first few lines of the data is shown.
1 Version 2.0
2 ========================================================================
3 Instructions:
4 Dimension: Enter "2" for 2D, "3" for 3D (Integer)
5 Particles: Number of particles to read from this file (Integer)
6 For each variable, enter whether it will be read from the file
7 ("T" to be read (True), "F" to not be read (False)). When not read, enter the
8 default values assign to all particles.
9 Coordinates are always read (X,Y in 2D, X,Y,Z in 3D)
10 Phase_ID, Diameter, Density, Temperature are scalars
11 Velocity requires U,V in 2D, U,V,W in 3D
12 Temperature is only read/set if the energy equation is solved
13 Species are only read/set if the species equations are solved, and requires
14 all species to be set (if phase 1 has 2 species and phase 2 has 4 species,
15 all particles must have 4 entries, even phase 1 particles (pad list with zeros)
16 User scalars need DES_USR_VAR_SIZE values
17 Data starts at line 35. Each column correspond to a variable.
18 ========================================================================
19 Dimension: 3
20 Particles: 35361
21 ========================================================================
22 Variable Read(T/F) Default value (when Read=F)
23 ========================================================================
24 Coordinates: T Must always be T
25 Phase_ID: F 1
26 Diameter: T
27 Density: F 2500.0
28 Velocity: F 0.0 0.0 0.0
29 Temperature: T (Ignored if energy eq. is not solved)
30 Species: T (Ignored if species eq. are not solved)
31 User_Scalar: T (Ignored if no user scalars are defined)
32 ========================================================================
33 X (m) Y (m) Z (m) Diameter (m)
34 ========================================================================
35 -5.07749E-02 -7.98147E-01 -2.00612E-01 9.71052E-03
36 -4.86164E-02 -8.16202E-01 -2.25035E-01 8.34185E-03
37 -3.16460E-02 -8.13702E-01 -2.19164E-01 1.09747E-02
38 -3.32833E-02 -8.25178E-01 -2.19393E-01 9.67983E-03
39 -2.48844E-02 -8.30159E-01 -2.16423E-01 9.84182E-03
(continues on next page)
The particle_input.dat file can be edited in any text editor, including the GUI editor, and be saved in the project
directory. Please run the 2D DEM fluid bed with central jet tutorial from the GUI, or see the DEM Initial Conditions last
section for an example.
Version 1.0 (Prior to MFiX 20.3 release)
The file stores each particle position, radius, density, and velocity. For 2D geometries, it contains 6 columns: x , y, radius,
density, u, v. In 3D, it contains 8 columns: x , y, z, radius, density, u, v, w. The number of lines correspond to the number
of particles read, and should match the “Data file particle count” defined in the Solids > DEM tab. The check box “Enable
automatic particle generation” must be left unchecked.
Below is an example of a 2D particle_input.dat (only 4 particles shown):
When using an STL file to define the geometry, a normal vector is associated with each facet (triangle). The direction in
which the normal vector points indicates the fluid region. It is important to verify the normal vectors points in the desired
direction before running the simulation.
To show the normal vectors in the Model view, expand the geometry view settings on the right and check “Show Normals”.
It may be necessary to adjust the scale to get a better view. The figure below shows an example of a cylinder with vectors
pointing towards the interior region of the cylinder. This will correspond with an internal flow simulation where the fluid
region is located inside the cylinder and the outside region is not part of the simulation.
If the normal vectors are not pointing in the correct direction, the normals can be flipped by checking the “Flip normal”
box for any selected stl file. To model an external flow using the same geometry as above, flip the normals and the change
will be reflected in the Model view (see figure below). Now the normals points towards the outside of the cylinder, and
the region inside the cylinder will not be part of the computation.
When running a simulation in parallel (DMP) mode, the parallel decomposition is by default uniform in each direction
and the number of partitions is set by NODESI, NODESJ, and NODESK in the x,y and z directions, respectively. The
default partition may not always be the most efficient. For example, a DEM simulation of a fluidized bed where most
particles are at the bottom of the bed may run faster if smaller partitions are set at the bottom, where many particles are
located and a large partition is used in the freeboard. This will better distribute particles among processors, and provide
a better load balance.
Let’s assume the mesh contains 20x100x20 cells (IMAX=20, JMAX=100, KMAX=20) and we use 16 cores with a
2x4x2 partition (NODESI=2, NODESJ=4, NODESK=2). Assume particles are roughly located within the bottom half
of the bed throughout the simulation. With the default (uniform) decomposition, each vertical partition will contain
JMAX/NODESJ=25 cells (Figure 8.6). This means 8 cores will remain mostly idle with respect to particle tracking and
collision.
Instead, we can distribute cells in the y-direction so that the vertical partitions have roughly the same number of particles.
This can be achieved with 10, 10, 10, and 70 cells from bottom to top. (Figure 8.7).
Due to the symmetry of the problem in x and z directions, no adjustment is needed in these directions, and a uniform
distribution is adequate.
Note that the custom partition will provide better load balance for particles but will make the fluid calculation slower
since fluid cells will be unbalanced. However, since a large majority of the time is spent in the DEM loop, it should be
beneficial to customize the partition.
To specify this decomposition, the following gridmap.dat needs to be saved in the project directory:
The first line specifies the values of NODESI, NODESJ, NODESK.
The next two lines (NODESI=2) specify the partition sizes in the x-direction. Here each partition contains 10 cells:
0 10
1 10
The next four lines (NODESJ=4) specify the partition sizes in the y-direction. Here three partitions at the bottom contains
10 cells each, and the last partition contains 70 cells:
0 10
1 10
2 10
3 70
The last two lines (NODESK=2) specify the partition sizes in the z-direction. Here each partition contains 10 cells:
0 10
1 10
This document explains how to setup PIC simulations (statistical weight, PIC parameters, mesh).
One key to creating efficient and accurate particle in cell (PIC) simulations is choosing an appropriate value for the
statistical weight of particles per parcel. The user needs to balance desired solids weight fraction, mesh density and solids
mass error with computational speed and physics.
The PIC statistical weight in MFIX (IC_PIC_CONST_STATWT or BC_PIC_CONST_STATWT) represents how many
particles are represented by each parcel. The parcels themselves must be of discrete number in a simulation, but because
statistical weight is a math construct, partial particles may occur mathematically.
To facilitate statistical weight selection, it is desirable to create a spreadsheet that illustrates how its selection can impact
simulation conditions, or the following logic may be prescribed.
1. Collect the following information:
a. Diameter of an equivalent single spherical particle (m)
b. Mass density of particles (kg/m 3 )
c. Max-pack solids fraction of particles for simulation
2. Choose a mesh for the simulation. Separately, calculate an average cell volume (m 3 ) and a minimum cell volume
(m 3 ).
3. Using max-pack solids fraction (which must be defined for PIC, 1-EP_STAR), calculate an average cellular volume
available for solid (m 3 ) and a minimum cellular volume available for solid (m 3 ).
4. Using particle diameter, calculate the number of spherical particles these average cellular volumes available for
solid represent. Assuming a uniform mesh, this calculated number, as a rounded-down integer, would represent the
maximum statistical weight one can choose in a PIC simulation, although it is highly unlikely one would choose this
value. In a variable mesh, the value associated with the minimum cell volume is the maximum statistical weight.
(Note: using an average cellular volume for this calculation allows a balance of parcel load in both large and small
cells.) Note that a user does not need to know the solids fraction distribution that they expect in a simulation, only
the max-pack solids fraction, which is a constant.
5. Now the balancing act between parcel count, actual solids fraction and mass error begins. First, choose a statistical
weight value. An easy way to make a first approximation is to use the maximum statistical weight from (4) and
divide by an integer which in your mind represents the number of parcels you want per cell. Statistical weights
derived like this will naturally give a solids fraction very close to whatever the original desired value from (1) was,
and minimize mass error in a simulation. The statistical weight does not need to be an integer, because partial
particles make sense in PIC. While the parcel count in an individual cell will initially begin as an integer, there
is no limitation that says an integer number of particles must make up a parcel. Choosing an integer value for
statistical weight does make it simple to imagine the parcels as grouped entities of particles, but it may interfere
with expectations for representative solids volume fraction per cell. Note, however, that regardless of what the user
specifies as a statistical weight, the MFIX program will collect truncated mass values in each cell until enough mass
to represent a full parcel accumulates, whereupon a single extra parcel will be placed in the domain.
6. It is advisable to inspect your fully populated PIC parcel domain to make sure you have not applied a value that does
not make visual or physical sense. This is particularly true for very dilute flow and highly packed flow. For dilute
flows, choosing a statistical weight that is too large will result in a simulation that cannot possibly capture expected
flow dynamics. In a highly packed flow, choosing a statistical weight that is too low may result in non-physical
packing, and an overly large local solids fraction. As such, be certain to note the values reported in the MFIX
output for desired solids fraction and calculated solids fraction, then assure yourself that the numbers are within
some reasonable error band.
During initialization, the user can choose any region to fill with parcels. If a distinct mass of particles is needed in a region
at start-up, the user must pre-conceive an appropriate volume of cells and associated solids fraction to achieve that mass.
For example, if a user wants :
• 0.1 kg of 0.001 m particles with density 1000 kg/m 3
• in a volume that is 0.1 x 0.1 x 0.1 m 3 defined by a 10 x 10 x 10 mesh
• with max-pack of 0.4 (theoretical limit of random packing of spheres is 0.36)
First, calculate the volume of 1 particle: V_particle= π/6 (0.001)3 = 5.236E-10 m 3
Calculate the mass of 1 particle: m_particle=(1000 kg/m 3 )(5.236E-10 m 3 ) = 5.236E-7 kg
Calculate single cellular volume: V_cell=(0.1m) 3 /((10×10×10))=1.0E-6 m 3
Calculate available volume for parcels: (1-0.4)( 1.0E-6 m 3 ) = 6.0E-7 m 3
For simplicity, we assume that the particles are evenly distributed among the 1000 cells. That means, each cell needs
0.100 kg/1000cells = 0.0001 kg of solid. In turn, that means each cell needs 0.0001 kg / 5.236E-7 kg = 190.985 particles.
From this particle loading, you can choose a statistical weight based on the number of particles. For example, you could
choose 190.985 as the statistical weight and get 1 big parcel (unwise), or you could choose, say, a statistical weight of
10 and get 19 parcels with a small local mass error. The small errors are accumulated, and when large enough, an extra
parcel will be placed locally in the mesh to account for the local loss. Note that if the user does not want to fill an initial
area at maximum packing, simply choose a different value for solids fraction and recalculate. Having a preconception of
how “loose” a particle bed should be is very helpful for reducing the transient in a simulation start-up.
Likewise, if a mass inflow boundary is prescribed in the PIC model, a similar logic must be followed. The key is to make
sure that the statistical weight used for the boundary flow condition is reasonable (as in, the number of particles per parcel
will fit into the cell(s) that abut the boundary condition specification). MFIX will control the mass itself by accounting
individual particle mass and randomly assigning parcels through the BC window. Note that smaller statistical weights
produce less local mass error, but the user must choose their own balance between statistical weight and computational
speed.
There are three common mistakes a user may make when setting up a PIC run. The first represents an entire misun-
derstanding of MFIX-PIC which is necessarily a 3-D model. That means, you cannot specify a 2-D simulation with
MFIX-PIC. Second, the interpolation algorithm which undergirds the MFIX-PIC model requires a minimum of 3-cells
in each direction through a geometry to give a robust solution. It is important to check small geometric regions of the
mesh that might pass through an orifice or channel to assure that there are at least 3 cells available for calculations to work
in a hydrodynamically stable way. Smaller cell distributions will not crash the model, but you may get unexpected flow
behavior. Finally, choosing statistical weights that in comparison to mesh give less than one parcel per mesh cell will give
errant solutions. (See section on choosing good statistical weights.) Note that one of the benefits of PIC is that it allows
for a somewhat coarse mesh with a large particle count, but a user needs to balance mesh and parcel count in a reasonable
way.
PIC parcels do not behave like DEM particles. There are no Newtonian physical laws that govern collisions. Instead,
PIC utilizes a solids stress ( τp ) field that influences solids motion through a coupling with the momentum equation.
Specifically, the solids stress is calculated as:
P p γ
p
τp = max[cp −p ,δ(1−p )]
In MFIX, the parameters that the user can control to define this solids stress are an empirical pressure constant (PS-
FAC_FRIC_PIC ( Pp ), a volume fraction exponential scale factor (FRIC_EXP_PIC ( γ), void fraction at maximal close
packing(EP_STAR ( cp ) and a non-singularity constant (FRIC_NON_SING_FAC ( δ). The only other variable at play
within the solids stress model is solids void fraction ( p ) which is calculated dynamically as the simulation progresses.
The parameters used in PIC are very robust. The default values of Pp =100, γ =3, δ =1.0E-7 should work well for most
systems. There should be no reason to change δ. The value for cp will vary depending on your application, although
it is worth noting that there is a theoretical limit of ~0.36 for the random packing of equal spheres. It is important to
note that cp represents the void or gas fraction per cell, and not the solids fraction. The effects of changing the values of
Pp and γ are very problem specific. For example, sedimentation cases (on which the solids model was originally built)
will model best with Pp =1, γ =2 so that gravity has the most effect on the system through the momentum equation.
But, very dynamic cases (U_mf>10) where we expect the solids to more greatly affect the hydrodynamics of the system
may respond better with selections like Pp =1000, γ =3. Essentially, like all CFD models, it may be necessary to tune
the PIC model to your specific case. As a rule of thumb, larger Pp at constant γ will result in particles that move more
dynamically (as the selection will linearly increase the solids stress). But, larger γ at constant Pp will reduce the solids
stress exponentially and dampen overall solids motion. The largest values of solid stress will occur when Pp is large and
γ is small.
Like DEM, the user can control restitution factors that affect parcel motion. MPPIC_COEFF_EN_WALL applies a scale
factor to the normal component of velocity after a parcel interacts with a wall. Likewise, MPPIC_COEFF_ET_WALL
applies a scale factor to the tangential components of velocity after a parcel interacts with a wall. There are two other
empirical factors available in MFIX-PIC. The first is MPPIC_COEFF_EN1 which is an overall scale factor that can
dampen the effect of the entire solids stress model, and MPPIC_VELFAC_COEFF which is a scale factor that effects
the value of bulk solids velocity through an evaluation of gas-solids slip velocity. These last two factors should remain at
default values unless you are working as an advanced user and understand the open source PIC code implicitly.
An empirical collision damping feature has been added to the MFIX-PIC model. The feature includes a calculation
for collision frequency based on statistical likelihood. From this frequency, a small change in velocity is calculated and
applied to parcels locally. The effect is an overall damping of solids velocity, particularly in areas where dense particle
flow is apparent. To invoke the feature, the user must select “Collision Damping” in the GUI (Solids>PIC pane) or set
the keyword is PIC_COLLISION_DAMPING=.TRUE. in the .mfx file.
FAQ: Why can’t I define parcels per cell instead of particles per parcel?
When creating the MFIX-PIC model, programmers chose to define particles per parcel for two reasons.
1. The user has full control over the statistical weights of the PIC parcels and is not reliant on the computer code to
calculate those values without knowledge of the simulation being run.
2. In most CFD simulations, mesh can be highly variable. When a user defines parcels/cell, the smallest cell will limit
the number of parcels that can be placed in any cell at initialization. By defining particles/parcel, the check we
suggest for examining the smallest cell only limits the overall size of the parcel, and a more even solids void fraction
can be achieved at start-up. An argument can be made that multiple initialization regions can be created to smooth
solids void fraction using the parcel/cell method, but this only complicates set-up.
FAQ: What is a good number (or range) for the number of parcels per cells
It depends on the kind of simulation you are trying to run, how many processors you have available to you, and what kind
of fidelity you expect. Avoid going below 3 parcels/cell in a serial run where there is very little dynamic (like settling).
Typically, around 10 parcels/cell works smoothly. If the simulation looks chunky, reduce the number of particles/parcel,
thus upping the parcels/cell count.
FAQ: What solids model parameter values work best for the PIC model when running 2 densities that are roughly
10x different in magnitude?
A density difference like this (say 300 kg/m 3 and 3,000 kg/m 3 ) will cause natural physical separation in most systems.
To capture the best physics in a PIC model where density drives strong gravitational effects, choose Pp =1 and γ =5 to
begin. You may still need to adjust these parameters but these choices will give you a good place to start.
NINE
This section is for MFiX users on NETL’s HPC system Joule. MFiX is installed as an environment module, so installing
it yourself is not necessary. The following sections document which compiler modules to use on Joule to run MFiX and
build the solver.
To build the solver from the GUI with a particular compiler on Joule, you need the environment module for that compiler
loaded when before starting MFiX. If that compiler is not loaded, exit MFiX to go back to your shell, load the appropriate
module, and start MFiX again.
To avoid confusion, use module list and module unload to check that you only have one version (e.g. 8.2, 6.5,
6.4) of one particular compiler (e.g. gnu, intel) loaded at any given time!
> build_mfixsolver
With just mfix/21.4 environment module loaded, you can build the MFiX solver in serial with GCC 4.8 (the CentOS
system compiler). For building the solver with other configurations, see below.
At the time of this writing, Joule has modules for GCC 6.4, 6.5, 8.2, 8.4, and 9.3. GCC 8.2 or newer is recommended.
387
MFiX User Guide, Release 21.4
Load module:
To build the solver from the MFiX source tarball or from a Git repo, you do not need to load the mfix/21.4 module.
Instead, you only need to load the CMake module:
Also load the GCC or Intel module for the compiler you want to use. For complete instructions on building the solver
from source, see Build from Source (for Developers).
[SB1988] Syamlal, M, and O’Brien, T.J. (1988). Simulation of granular layer inversion in liquid fluidized beds,
International Journal of Multiphase Flow, Volume 14, Issue 4, Pages 473-481, https://doi.org/10.1016/
0301-9322(88)90023-7.
[HKL2001] Hill, R., Koch, D., and Ladd, A. (2001). Moderate-Reynolds-number flows in ordered and random
arrays of spheres. Journal of Fluid Mechanics, Volume 448, Pages 243-278. https://doi.org/10.1017/
S0022112001005936
[DG1990] Ding, J. and Gidaspow, D. (1990). A bubbling fluidization model using kinetic theory of granular flow,
AIChE Journal, Volume 36, Issue 4, Pages 523-538, https://doi.org/10.1002/aic.690360404
[LB2000] Lathouwers, D. and Bellan J. (2000). Modeling of dense gas-solid reactive mixtures applied to biomass
pyrolysis in a fluidized bed, Proceedings of the 2000 U.S. DOE Hydrogen Program Review, https://www.
nrel.gov/docs/fy01osti/28890.pdf
[WY1966] Wen C.Y., and Yu Y.H. (1966). Mechanics of fluidization, The Chemical Engineering Progress Symposium
Series, Volume 62, Pages 100-111.
[BVK2007] Beetstra, R., van der Hoef, M.A., and Kuipers, J.A.M. (2007). Numerical study of segregation using a
new drag force correlation for polydisperse systems derived from lattice-Boltzmann simulations, Chemical
Engineering Science, Volume 62, Issues 1–2, Pages 246-255. https://doi.org/10.1016/j.ces.2006.08.054.
[HYS2010] Holloway, W., Yin, X., and Sundaresan, S. (2010). Fluid‐particle drag in inertial polydisperse gas–solid
suspensions, AIChE Journal, Volume 56, Issue 8, Pages 1995-2004. https://doi.org/10.1002/aic.12127
[HBK2005] Hoef, M., Beetstra, R., and Kuipers, J. (2005). Lattice-Boltzmann simulations of low-Reynolds-number
flow past mono- and bidisperse arrays of spheres: Results for the permeability and drag force. Journal of
Fluid Mechanics, Volume 528, Pages 233-254. https://doi.org/10.1017/S0022112004003295
[BVK2007a] Beetstra, R. , van der Hoef, M. A. and Kuipers, J. A. (2007), Drag force of intermediate Reynolds number
flow past mono‐ and bidisperse arrays of spheres. AIChE J., 53: 489-501. https://doi.org/10.1002/aic.
11065
[BVK2007b] (2007), Erratum. AIChE J., 53: 3020-3020. https://doi.org/10.1002/aic.11330
[IPBS2012] Igci, Y., Pannala, S., Benyahia, S., and Sundaresan, S. (2012). Validation studies on filtered model equa-
tions for gas-particle flows in risers, Industrial & Engineering Chemistry Research, Volume 54, Issue 4,
Pages 2094-2103. https://doi.org/10.1021/ie2007278
[MMHAS2013] Milioli, C.C., Milioli, F.E., Holloway, W., Agrawal, K. and Sundaresan, S. (2013), Filtered two‐fluid
models of fluidized gas‐particle flows: New constitutive relations. AIChE J., Volume 59, Issue 9, Pages
3265-3275. https://doi.org/10.1002/aic.14130
389