Output

AMPHIBIOUS generates log and output files, and can also compute at runtime basic time-averaged flow statistics.

Log files

preproc produces its own log file preproc-log.dat, that is created in the case directory and contains useful information on the various stages of pre-processing, some warnings when the number of points is modified to make it even, and important information that is needed later, as the values of nDecompCubes and nTotCubes.

The shared file general-info.dat is human-readable, and contains useful information too.

There is no log file produced by solver. Its default screen output is minimal, and is meant to be customized through the case-specific file (like specifics-channel.cpl and specifics-nose.cpl for the tutorial examples). One can then log it by redirecting the standard output.

Output files

A complete restart file is periodically written by solver, if the flag saveRestart is set in settings.in, section INPUT_OUTPUT. The writing frequency, as well as the initial time for the first restart (useful e.g. when there an initial transient has to be discarded) can be specified. Similarly, one can have solver build a database made by one or more snapshots of the entire flow field. For maximum efficiency, both restart and snapshots are written in binary.

Name Values Description
useRestart YES/NO Specifies whether to start the simulation from
restart files or from scratch.
useStatsRestart YES/NO Specifies whether statistics are accumulated
on already available stats files or from scratch.
saveRestart YES/NO Specifies whether to save restart files.
saveField YES/NO Specifies whether to save snapshots of the flow field.
calcStats YES/NO Specifies whether statistics are computed or not.
writeRestartFreq <it> Sets how often (in iterations) restart files are written to disk.
writeFieldFreq <it> Sets how often (in iterations) flow field files are written to disk.
updateStatsFreq <it> Sets how often (in iterations) statistics are updated.
tFirstRestart <t> Sets the delay time of the first restart write.
tFirstField <t> Sets the delay time of the first snapshot write.
tStartStatsCalc <t> Sets the delay time of the first statistics accumulation iteration.
statsNames Described
later
Statistics to be computed.

Table: options of section INPUT_OUTPUT of the settings file

Flow statistics

solver contains code for computing simple flow statistics runtime, namely first- and second-order moments of velocity and pressure fluctuations. More complex statistics can be computed a posteriori, by re-reading the snapshots database.

Since the code is general, only time-averaging is employed, and averaging over homogeneous direction needs to be done a posteriori. This makes computing the full set of statistics quite memory- and disk-intensive even in simple cases. For this reason, one can specify in settings.in only some components of the statistics array, that has 13 fields when complete, by filling in the variable statsNames. Some statistics may require the computation of other statistics to be computed (e.g. needs ). In this case, a runtime error is triggered if the required statistic is not given as input by the user.

Statistic ID Dependency
1 um -
2 vm -
3 wm -
4 pm -
5 uv
6 uw
7 vw
8 u2
9 v2
10 w2
11 p2
12 km
13 dm -

Table: list of currently available statistics along with their ID and other statistics dependency.

Post processing

AMPHIBIOUS comes with a separate utility called createVTK.cpl, which resides in the utilities/ folder. The utility is CPU-parallel, works with the same logic of solver (indeed, it USEs the same io.cpl to carry out most of its input-output operations), and creates VTK files (legacy format) starting from the binaries produced by solver. Currently, it supports both rectilinear and unstructured VTK formats, for statistics and flow fields. Similarly to solver, createVTK is compiled as:

make VTK

and run as:

mpirun -n <N> utilities/createVTK <caseDir>

The same limitations on the integer <N> as those described for solver apply. As for other parts of the program, createVTK has a dedicated section VTK in the file settings.in, where its output can be configured. Currently, one can set the vtkFileType to r (rectilinear) or u (unstructured), and choose whether to convert the binary files for statistics, and/or the binary files of the entire snapshots database.

Name Values Description
generateStatsVtk YES/NO Specifies wheter to generate statistics VTK files
generateFieldVtk YES/NO Specifies wheter to generate snapshots VTK files
(note: if set to YES all the snapshots are converted to VTK)
generateAveragedStatsDat YES/NO Specifies wheter to generate .dat files of averaged
statistics in homogeneous directions set by homogeneousDirs
statsVtkFileType r/u Sets the type of statistics VTK file to rectilinear (r)
or unstructured (u)
fieldVtkFileType r/u Sets the type of snaptshots VTK file to rectilinear (r)
or unstructured (u)
homogeneousDirs <v> <v> <v> Sets which directions are homogeneous (<v>=1)
and which are not (v=0)

Table: options of section VTK of the settings file

Statistics

When using generateStatsVtk=YES, createVTK reads statsNames from section INPUT_OUTPUT of the settings file and verifies that these match with the statistics actually saved in the binary files stored in the stats/binary folder. If this is not the case, an error is triggered. To avoid this, statsNames must not be changed between the execution of solver and createVTK. createVTK also gives the options of averaging statistics in homogeneous directions. createVTK then converts all the statistics listed in statsNames to .vtk files.

createVTK also gives the option of averaging statistics in homogeneous directions. When using generateAveragedStatsDat=YES, .dat files are generated in the stats/ directory (note: the files are tab-separated). createVTK accepts any combination of homogeneous directions except homogeneous in 3 directions (homogeneousDirs= 1 1 1, currently returns an error in this case, work in progress) and no homogeneous directions (.dat files are not generated) The files can come in two formats based on how many directions are homogeneous. In the case of two homogeneous directions (e.g. homogeneousDirs= 1 1 0) statistics only depend on one directions and therefore, all the statistics are saved to one .dat file. The file contains a header with the IDs of the statistics presented in Flow statistics section. In the case of one homogenous direction (e.g. homogeneousDirs= 1 0 0) the statistics are bidimensional and each statistic is saved in a different .dat file. Files are named as averaged_<statID>.dat where <statID> is once again the corresponding statistic's ID. Also, in this case, the first non homogenous direction is saved along line and the second along columns.

Flow field database

When solver generates snapshots, the flowfield are stored in folder database/binary and they are organized in different folders, one for each snapshot. Each folder is named as count-000<iFlow> and contains the flowfield files of each subdomain. When using generateFieldVtk=YES, createVTK converts every snapshot it finds in directory database/binary to .vtk files and replicates the same folder structure in directory database/vtk. Unfortunately, this folder structure does not allow common visualization tools like Paraview to immediately recognize that each folder containt multiple subdomains of one time step. To solve this issue, createVTK also generates .vtk.series JSON files for each subdomain. The files are stored in directory database/vtk/series and allow to load all the snapshots of a single subdomain in single load. Series files can be merged through Merge Datasets in Paraview for the visualization of the whole domain. Loading .series files requires Paraview 5.5.0 or later version.