This utility is made to convert the Lagrangian and Eulerian output .h5 data files generated by PARTIES to standard .vtk format or .xmf format.
step 1 - clone repository
https://github.com/metialex/h5ToVTK.git
step 2 - run python file python3 h5ToVTK.py
There are different flags which can be chosen as an input arguments:
-e -l -el
corresponds to different output files. With the first flag -e
only Eulerian data (Data_x.h5) will be processed, while -l
corresponds to Lagrangian data (Particle_x.h5), and with the flag -el
both output data types will be processed
-x
by using this flag you will create corresponding .xmf output files instead of creating VTK files. It is much faster to create .xmf reading files, so try to use this flag all the time. The only disadvantage it has by comparison with .vtk files is the fact that vectors are represented as three scalars for velocity, that is why it would be impossible to visualize 3D streamlines using .xmf output files.
-i
provides to choose the range of the anylized files, e.g. with -e -i 2:5
files Data_2.h5, Data_3.h5, Data_4.h5, Data_5.h5 will be converted to .vtk format.
-d
used to extract certain data from Lagrangian particles and save it to the corresponding .dat file. For example, -d F
will extract the force F from all Particle_x.h5 files and save it to three files F0.dat, F1.dat, F2.dat. These files contain three vector components for each particle over time.
-h
help flag shows all possible flags.
Pay attention that .vtk files are saved in ASCII format.
Right now it is impossible to specify several variables with -d
flag, so if you want to extract several quantities from Lagrangian data files you have to run this application several times.
Eulerian files must satisfy the following name pattern Data_%i.h5 while Lagrangian files also have to match the similar pattern Particle_%i.h5
This script introduces new variables, "floc_size" and "floc_id", within "Particles_*.h5" files. "floc_size" variable denotes the size of the aggregate to which each particle is currently connected, while "floc_id" correspond to the index of floc. A single flag, "-d" or "--cutoff_distance", enables the specification of a maximum distance between particles, determining their inclusion within a shared aggregate. If the distance between particles falls below the prescribed threshold following the "-d" flag, they are deemed constituent elements of a singular floc. Additionally, the script accounts for periodic boundary conditions when computing inter-particle distances.