Installation and Quickstart Guide
Installation
Prerequisites
FLEXI has been tested for various Linux distributions. This includes Ubuntu 18.04 LTS, 20.04 LTS and 22.04 LTS, OpenSUSE 42.1 and CentOS 7.
The suggested packages in this section can of course be replaced by self compiled versions.
The required packages for the Ubuntu Linux distributions are listed in the following table. Under Ubuntu, they can be obtained using the apt environment:
sudo apt-get install git
Package |
Ubuntu 18.04 |
Ubuntu 20.04 |
Ubuntu 22.04 |
git |
x |
x |
x |
cmake |
x |
x |
x |
cmake-curses-gui |
o |
o |
o |
liblapack3 |
x |
x |
x |
liblapack-dev |
x |
x |
x |
gfortran |
x |
x |
x |
g++ |
x |
x |
x |
mpi-default-dev |
x |
x |
x |
zlib1g-dev |
x |
x |
x |
exuberant-ctags |
o |
o |
o |
Table: Ubuntu packages. x: required, o: optional, -: not available
The required packages for OpenSUSE and CentOS are listed in the following table.
Under OpenSUSE, packages are installed by the following command.
sudo zypper install git
The PATH
variable must be extended by the openmpi path
export PATH=$PATH:/usr/lib64/mpi/gcc/openmpi/bin
Under CentOS, packages are installed by the following command.
sudo yum install git
Additionally, the PATH
variable must be extended by the openmpi path
export PATH=$PATH:/usr/lib64/openmpi/bin
Package |
OpenSUSE 42.1 |
CentOS 7 |
git |
x |
x |
cmake |
x |
x |
lapack-devel |
x |
x |
openmpi |
x |
x |
openmpi-devel |
x |
x |
zlib-devel |
x |
x |
gcc-fortran |
x |
x |
gcc |
x |
– |
gcc-c++ |
x |
x |
Table: Required Red Hat packages under OpenSUSE and CentOS.
On some systems it may be necessary to increase the size of the stack (part of the memory used to store information about active subroutines) in order to execute FLEXI correctly. This is done using the command
ulimit -s unlimited
from the command line. For convenience, you can add this line to your .bashrc
.
Obtaining the source
The FLEXI repository is available at GitHub. To obtain the most recent version you have two possibilities:
Compiling the code
The executables flexi and posti_visu are contained in your FLEXI directory in build/bin/
.
Custom configuration of compiler options may be done using
ccmake ../
For a list of all compiler options see the user guide.
Directory Paths
In the following, we write $FLEXIROOT
as a substitute for the path to the FLEXI repository. Please replace $FLEXIROOT
in all following commands with the path to your FLEXI repository or add an environment variable $FLEXIROOT
.
Furthermore, the path to executables is omitted in the following, so for example, we write flexi
instead of $FLEXIROOT/build/bin/flexi
.
Here is some explanation for Linux beginners:
In order to execute a file, you have to enter the full path to it in the terminal. There are two different ways to enable typing flexi
instead of the whole path:
- You can add an alias for the path to your executable. Add a command of the form
alias flexi='$FLEXIROOT/build/bin/flexi'
to the bottom of the file ~/.bashrc
. Source your ~/.bashrc
afterwards with
. ~/.bashrc
-
You can add the FLEXI binary directory to your
$PATH
environment variable by adding
export PATH=$PATH:$FLEXIROOT/build/bin
to the bottom of the file ~/.bashrc
and sourcing your ~/.bashrc
afterwards.
Running the code
The following examples assume that the FLEXI environment variables have been made available, see the user guide.
- Open a terminal
- Navigate to a directory and copy a case folder
cd temp
- Copy the cavity tutorial folder
cp -r $FLEXIROOT/tutorials/cavity/Basic_Re100
cd cavity
- Run flexi
$FLEXI_DIR/flexi parameter_flexi.ini
- Convert the output files to the vtu format
posti_visu cavity_State_0000000.200000000.h5
- Visualize using e.g. ParaView.
Basic Usage
For a basic overview of the framework and the single components of the flow solver a flowchart is given in the following Figure.
HOPR
A standalone high-order preprocessor HOPR has been developed to generate high-order meshes from input data from external linear mesh generators.
Different file formats are supported. HOPR has been recently made open source under the GPLv3 license. It generates a FLEXI conform mesh
format in HDF5 for efficient parallel initialization.
For a complete overview of HOPR, see https://github.com/hopr-framework/hopr.
HOPR can be compiled in the same way as FLEXI. The basic command to run HOPR is
hopr parameter.ini
FLEXI
FLEXI, a high order DGSEM based CFD solver, is the core module in the tool chain. Generally FLEXI requires two main files as input, a mesh file in HDF5 format generated by HOPR and a parameter file where the main settings for the CFD simulation are set. The results files generated by FLEXI are also HDF5 files.
The basic command to run FLEXI is
mpirun -np [no. processors] flexi parameter.ini
Parameter file
The parameter.ini
file contains the main settings for the CFD simulation. The parameter file defines e.g.
- CFL number (Courant-Friedrichs-Lewy)
- polynomial degree,
- simulation end time and dump/analyze intervals
- boundary conditions
- Initial and boundary states
A complete list of all runtime options that can be set in the parameter file is supplied in the user guide.
posti_visu tool
To visualize the results e.g. with ParaView, a converter tool is provided. The posti_visu tool takes the HDF5 files generated by FLEXI.
The basic command to run the posti_visu tool is
mpirun -np [no. processors] posti_visu parameter.ini [flexi_outputfile.h5]
In this case a parameter file is specified in which options like the type and amount of the visualization nodes and mesh options are defined – see the respective section of the userguide for all available options. You can also omit the parameter file argument:
mpirun -np [no. processors] posti_visu [flexi_outputfile.h5]
This runs posti_visu using only standard options, i.e.
- equidistant visualization nodes
- amount of visualizaion nodes equals number of collocation points per element
- allowing for curved meshes
- visualizing the conservative variables
HDF5
HDF5 is a data model, library, and file format for storing and managing data. It supports an unlimited variety of datatypes, and is designed for flexible and efficient I/O and for high volume and complex data. For further information and to download the software, visit the HDF5 website at https://www.hdfgroup.org.