Quickstart Guide

Installation

Prerequisites

Flexi has been tested for various Linux distributions. This includes Ubuntu 14.04 LTS and 16.04 LTS, OpenSUSE 42.1 and CentOS 7.

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 14.04 Ubuntu 16.04
git x x
cmake x x
cmake-curses-gui x x
liblapack3 x x
liblapack-dev x x
gfortran x x
g++ x x
mpi-default-dev x x
zlib1g-dev x

Table: Required debian packages under Ubuntu.

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:

  • Clone the Flexi repository from Github
    git clone https://github.com/flexi-framework/flexi.git
    
  • Download Flexi from Github:
    wget https://github.com/flexi-framework/flexi/archive/master.tar.gz
    tar xzf master.tar.gz
    

Note that cloning FLEXI from GitHub may not be possible on some machines, as e.g. the machines at the HLRS at the University of Stuttgart due to restricted internet access. Please refer to this section of the user guide for help.

Compiling the code

  • Open a terminal
  • Change into the Flexi directory
  • Create a new subdirectory and use CMake to configure and compile the code
    mkdir build; cd build
    cmake ../
    make
    

The executables flexi and flexi2vtk are contained in your Flexi directory in build/bin/. If desired, environment variables and aliases for the executables can be made available by adding the following line to your .bashrc

. ~/.flexi

and sourcing your .bashrc afterwards in the terminal

. ~/.bashrc

Note that this enables the usage of $FLEXI_TUTORIALS_DIR.

Custom configuration of compiler options may be done using

ccmake ../

For a list of all compiler options see the user guide.

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 $FLEXI_TUTORIALS_DIR/cavity .
    cd cavity
    
  • Run flexi
    $FLEXI_DIR/flexi parameter_flexi.ini
    
  • Converting the output files to the vtu format
    $FLEXI_DIR/flexi2vtk parameter_flexi.ini 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.

Flowchart: Basic modules and files used by Flexi

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://www.hopr-project.org.

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.

FLEXI2VTK tool

To visualize the results e.g. with ParaView, a converter tool is provided. The FLEXI2VTK tool takes the HDF5 files generated by Flexi.

The basic command to run the FLEXI2VTK tool is

mpirun -np [no. processors] $FLEXI_DIR/flexi2vtk 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 user guide for all available options. If you want to visualize some files using only standard options (equidistant visualization nodes and allowing for curved meshes), you can directly specify the degree of the visualization basis on the command line and don’t need to supply a parameter file. The syntax for this command line mode is

mpirun -np [no. processors] $FLEXI_DIR/flexi2vtk --NVisu=INTEGER [flexi_outputfile.h5]

where INTEGER is substituted by the desired degree of the visualization basis. Usually the degree of your visualization basis is chosen higher than in the computation to avoid interpolation errors by supersampling the solution.

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.

Feature list

The currently implemented features of Flexi include

  • Equation systems:
    • compressible Euler equations
    • compressible Navier-Stokes equations
    • linear scalar advection and diffusion
  • Space discretization: DGSEM methode [1][2]
    • Legendre Gauss
    • Legendre Gauss Lobatto
  • Time discretization: explicit Runge-Kutta methods
    • standard RK methods
    • low storage RK methods [3]
    • strong stability preserving RK methods [4]
  • Riemann solvers:
    • local Lax-Friedrichs
    • HLL
    • HLLC
    • Roe-Pike
  • Curved Meshes
  • Nonconforming Meshes via mortar interfaces [5]
  • Boundary conditions
    • Various subsonic inflow and outflow conditions [6]
    • exact boundaries (Dirichlet)
    • periodic boundaries
    • slip wall (Euler wall)
    • non-slip walls (Navier-Stokes wall)
      • adiabatic
      • isothermal
  • Dealiasing [7]
    • filtering
    • overintegration
  • Lifting methods
    • Bassi Rebay 1 [8]
    • Bassi Rebay 2 [8]
  • Sponge zone [9]
  • Time averaging
[1] D. A. Kopriva and G. Gassner, “On the quadrature and weak form choices in collocation type discontinuous galerkin spectral element methods,” Journal of scientific computing, vol. 44, pp. 136-155, 2010.
[Bibtex]
@ARTICLE{KoprivaGassner2010,
author = {Kopriva, David A. and Gassner, Gregor},
title = {On the Quadrature and Weak Form Choices in Collocation Type Discontinuous
Galerkin Spectral Element Methods},
journal = {Journal of Scientific Computing},
year = {2010},
volume = {44},
pages = {136-155},
issue = {2},
keywords = {Spectral element; Discontinuous Galerkin; Collocation}
}
[2] F. Hindenlang, G. J. Gassner, C. Altmann, A. Beck, M. Staudenmaier, and C. Munz, “Explicit discontinuous galerkin methods for unsteady problems,” Computers & fluids, vol. 61, pp. 86-93, 2012.
[Bibtex]
@article{hindenlang2012explicit,
title={Explicit discontinuous Galerkin methods for unsteady problems},
author={Hindenlang, Florian and Gassner, Gregor J and Altmann, Christoph and Beck, Andrea and Staudenmaier, Marc and Munz, Claus-Dieter},
journal={Computers \& Fluids},
volume={61},
pages={86--93},
year={2012},
publisher={Elsevier}
}
[3] M. Carpenter and C. Kennedy, “Fourth-order 2N-storage Runge-Kutta schemes,” , NASA TM 109111, 1994.
[Bibtex]
@TECHREPORT{Carpenter1994,
author = {M. Carpenter and C. Kennedy},
title = {Fourth-Order 2{N}-Storage {R}unge-{K}utta Schemes},
year = {1994},
number = {NASA TM 109111}
}
[4] J. Niegemann, R. Diehl, and K. Busch, “Efficient low-storage runge–kutta schemes with optimized stability regions,” Journal of computational physics, vol. 231, iss. 2, pp. 364-372, 2012.
[Bibtex]
@article{niegemann2012efficient,
title={Efficient low-storage Runge--Kutta schemes with optimized stability regions},
author={Niegemann, Jens and Diehl, Richard and Busch, Kurt},
journal={Journal of Computational Physics},
volume={231},
number={2},
pages={364--372},
year={2012},
publisher={Elsevier}
}
[5] D. A. Kopriva, S. L. Woodruff, and Y. M. Hussaini, “Computation of electromagnetic scattering with a non-conforming discontinuous spectral element method,” International journal for numerical methods in engineering, vol. 53, iss. 1, pp. 105-122, 2002.
[Bibtex]
@article{koprivamortar2002,
title={Computation of electromagnetic scattering with a non-conforming discontinuous spectral element method},
author={Kopriva, David A and Woodruff, Stephen L and Hussaini, M Yousuff},
journal={International journal for numerical methods in engineering},
volume={53},
number={1},
pages={105--122},
year={2002},
publisher={Wiley Online Library}
}
[6] J. Carlson, “Inflow/outflow boundary conditions with application to fun3d,” , 2011.
[Bibtex]
@article{carlson2011inflow,
title={Inflow/outflow boundary conditions with application to FUN3D},
author={Carlson, Jan-Rene{\'e}},
year={2011}
}
[7] G. J. Gassner and A. D. Beck, “On the accuracy of high-order discretizations for underresolved turbulence simulations,” Theoretical and computational fluid dynamics, vol. 27, iss. 3-4, pp. 221-237, 2013.
[Bibtex]
@ARTICLE{gassner2013accuracy,
author = {Gassner, Gregor J and Beck, Andrea D},
title = {On the accuracy of high-order discretizations for underresolved turbulence
simulations},
journal = {Theoretical and Computational Fluid Dynamics},
year = {2013},
volume = {27},
pages = {221--237},
number = {3-4},
publisher = {Springer}
}
[8] F. Bassi and S. Rebay, “A high-order accurate discontinuous finite element method for the numerical solution of the compressible Navier-Stokes equations,” J. comput. phys., vol. 131, pp. 267-279, 1997.
[Bibtex]
@ARTICLE{BR1,
author = {F. Bassi and S. Rebay},
title = {A High-Order Accurate Discontinuous Finite Element Method for the
Numerical Solution of the Compressible {Navier}-{Stokes} Equations},
journal = {J. Comput. Phys.},
year = {1997},
volume = {131},
pages = {267-279}
}
[9] D. Flad, H. Frank, A. D. Beck, and C. Munz, “A discontinuous galerkin spectral element method for the direct numerical simulation of aeroacoustics,” in 20th aiaa/ceas aeroacoustics conference, 2014, p. 2740.
[Bibtex]
@inproceedings{flad2014discontinuous,
title={A Discontinuous Galerkin Spectral Element Method for the direct numerical simulation of aeroacoustics},
author={Flad, David and Frank, Hannes and Beck, Andrea D and Munz, Claus-Dieter},
booktitle={20th AIAA/CEAS Aeroacoustics Conference},
pages={2740},
year={2014}
}