Skip to content
Thomas Engels edited this page Dec 16, 2018 · 20 revisions

Welcome to the FLUSI/MHD wiki!

FLUSI
discreet and discrete

Install guide

The first thing to do is to install the code and its dependencies. Please follow the install guide. For M2P2 users, we have also cluster specific how-to's. https://github.com/pseudospectators/FLUSI/wiki/FLUSI-general-install-guide

Unit tests

FLUSI/MHD offer unit tests, e.g a collection of predefined parameter files with known output values. After installing and compiling the code, you can go into the tests/ folder, unpack the necessary files (tar -xzf tests_data.tar.gz), and execute ./unittest.sh. This script calls individual unit-testing scripts, and tells you if everything seems to be okay. The output messages are dumped in *.log files. You need to be able to execute the compiled binary file locally, which might be kind of tricky on some supercomputers (IDRIS/turing for example)

Running flusi and mhd

Now that you know you properly installed FLUSI/MHD, you can run a simulation. In general, you need the executable binary file and a suitable parameter file. The latter contains run-time parameters, such as the resolution, the domain size or what geometry you want to set. Note the distinction between MHD and FSI is made by choosing the appropriate executable (./mhd or ./flusi) FLUSI/MHD are MPI programs, normally run via commands like

mpirun -n 12 ./mhd params.ini
mpirun -n 12 ./flusi PARAMS_insect.ini

but they can also run in serial (monoprocessor).

The parameters for the run are specified in the params file, examples of which are available in the extra_files branch. Two complete parameter files, PARAMS_test_fsi.ini and PARAMS_test_mhd.ini are also in the master branch.

The code will produce three sorts of output:

  1. The messages printed on the screen about it's current state
  2. The fields data (e.g. the velocity vectors for all lattice points) in *.h5 files. Please note the file naming convention is very important. These *.h5 files can be visualized with paraview (free open source software), see next section
  3. Time series of some quantities (e.g. lift/drag force, kinetic energy, time step size...) are stored in *.t files, which are ordinary ascii text files

Postprocess generated data

You can run flusi also in postprocessing mode, with a variety of tools available, e.g.

./flusi --postprocess --vorticity ux_000.h5 uy_000.h5 uz_000.h5 --second-order

the first argument can be -p or --postprocess, or -h resp. --help. The -h mode shows some help about the selected module. Just running ./flusi -h shows different options, then you can see details e.g. with ./flusi -h --vorticity

Viewing and understanding the output

3D visualization is done by using mpi2vis, which converts the metadata associated with the HDF output into a format which can be used by Paraview. Note that HDF5 is a very generic file format and not specific to any application. It is hence so generic that one needs to explain to Paraview what is stored in the files. One needs to define a *.xmf file that desribes the data. This can be done using the hdf2xml.sh script in the mpi2vis repository. The hdf2xml.sh script calls a smal FORTRAN program which will generate the *.xmf file. This FORTRAN program needs to be compiled. The installation should work just as for FLUSI, so if you can compile FLUSI, you can probably hit make in the directory where you cloned mpi2vis.

An more modern alternative is the hdf2xmf.py python-script from the PYTHON-TOOLS repository. You can simply download it and there is no need to compile it. Note you need to have python3 installed, and you need to add the directory where hdf2xmf.py is to both $PATH and $PYTHONPATH in order to run the script anywhere on your machine. You will likely want to add that to your .bashrc. The hdf2xmf.py script requires the h5py module, which one can usually install using

 pip3 install --user h5py

Once installed, you can go to your simulation directory (which contains *.h5 files) and just hit:

hdf2xml.sh

or

hdf2xmf.py

and either one should generate and *.xmf file in the directory. Both tools have some options you can use to select only a couple of files etc. Use hdf2xmf.py -h to get a compelete help on what options are available.

Output of the *.t files is done with MATLAB or PYTHON, or any other plotting tools.

Cluster Specific Tips & Tricks

can be found here: https://github.com/pseudospectators/FLUSI/wiki/Cluster-specific-settings-for-flusi

Compiler specific options

Options for debugging, optimization and so on for ifort and gfortran are collected here: https://github.com/pseudospectators/FLUSI/wiki/Compiler-Options

Validation cases

Two-dimensional validation cases include:

  • Taylor-Green vortices
  • Couette flow between rotating cylinders
  • Flow past a circular cylinder

Download link: https://drive.google.com/file/d/0B4Bm4KeLodhUMEVLNnl0MTM5RTg/view?usp=sharing