# OpenFOAM® v1612+: New data conversion utilities

23/12/2016

## Updated conversion to ensight format

The entire core of the utility was redesigned and refactored into a library, which is used by the foamToEnsight and foamToEnsightParts utilities, and the new ensightWrite function object.

The output format has been simplified to a new structure:

Example of NEW file structure:

EnSight/verticalChannel.case        # case name
EnSight/geometry                    # for non-moving geometry

EnSight/data/                       # time-varying data
EnSight/data/00000000/
EnSight/data/00000001/
...
Fields are stored by name within the data/********/ directories:

EnSight/data/00000001/time          # human-readable time info
EnSight/data/00000001/U
EnSight/data/00000001/p
...
EnSight/data/00000001/geometry      # for moving geometry
Clouds are stored at the next sub-directory level:

EnSight/data/00000001/lagrangian/<cloudName>/positions
EnSight/data/00000001/lagrangian/<cloudName>/U
...

Additional enhancements include

• More intelligent querying reduced the conversion times from 20s to 4s per per step (factor 5x)
• Storing of additional time information enables reconstruction of the data using external tools, e.g. scripting
• Cloud data can now be reconstructed in parallel, and output in binary format
• the new noLagrangian option is available to the foamToEnsight and foamToEnsightParts utilities to suppress conversion of cloud data.

Building on the ensight conversion updates, the new ensightWrite function object to convert to ensight format during the simulation, used as follows:

ensightWrite
{
type    ensightWrite;
libs    ("libutilityFunctionObjects.so");
log     true;

// Fields to output (words or regex)
fields  (U p "(k|epsilon|omega)");

writeControl writeTime;
writeIterval 1;
}

The ensight case file is flushed after each write, enabling the case to be post-processed while the simulation is still running. Note that at this stage, cloud data are not yet supported by this function object.

Source code
$FOAM_SRC/functionObjects/utilities/ensightWrite$FOAM_UTILITIES/postProcessing/dataConversion/foamToEnsight
$FOAM_UTILITIES/postProcessing/dataConversion/foamToEnsightParts Examples$FOAM_TUTORIALS/incompressible/simpleFoam/motorBike

## Updated foamToVTK

A new -noLagrangian suppresses the conversion of Lagrangian fields, and the start-up time has been reduced significantly

Old code:

Found 10990 time steps
Search for moving mesh ... no moving mesh detected.
Startup in 329.09 s

Updated:

Found 10990 time steps
Search for moving mesh ... no moving mesh detected.
Startup in 1.6 s

The example above shows that the start up time reduced from more than 300s to 2s (factor 100x).

## Updated conversion for STAR-CD and CCM+

The entire support for STAR-CD and CCM+ meshes has been refactored.

• Old star3ToFoam and sammToFoam utilities have been deprecated since these formats are no longer provided by the original software supplier
• To convert mesh from and to STAR-CD format, users should use star4ToFoam and foamToStarMesh
• Support for PROSTAR/STARCCM .ccmg meshes has been updated. For import users may use ccmToFoam; for export foamToCcm. The ccm26ToFoam utility remains available, but has been deprecated in favour of the newer versions.

The new library is the basis for conversion to and from CCM+ geometries, able to handle multiple regions, conformal interfaces etc., but does not support film or 2-D shell geometries.

## Updated foamToTecplot

The utility now compiles with the latest tecio library, but has not received any update in functionality.