The foamToEnsight utility converts data from OpenFOAM to EnSight file
format. For a given case, foamToEnsight is executed like any normal application.
foamToEnsight creates a directory named Ensight in the case directory, deletingany existing Ensight directory in the process. The converter reads the data in all
time directories and writes into a case file and a set of data files. The case file is
named EnSight_Case and contains details of the data file names. Each data
file has a name of the form EnSight_nn.ext, where nn is an incremental
counter starting from 1 for the first time directory, 2 for the second and
so on and ext is a file extension of the name of the field that the data
refers to, as described in the case file, e.g.T for temperature, mesh for the
mesh. Once converted, the data can be read into EnSight by the normal
means:
from the EnSight GUI, the user should select Data (Reader) from the
File menu;
the appropriate EnSight_Case file should be highlighted in the Files box;
the Format selector should be set to Case, the EnSight default setting;
EnSight provides the capability of using a user-defined module to read data
from a format other than the standard EnSight format. OpenFOAM includes its
own reader module ensight74FoamExec that is compiled into a library named
libuserd-foam. It is this library that EnSight needs to use which means that it
must be able to locate it on the filing system as described in the following
section.
In order to run the EnSight reader, it is necessary to set some environment
variables correctly. The settings are made in the bashrc (or cshrc) file in the
$WM_PROJECT_DIR/etc/apps/ensightFoam directory. The environment variables
associated with EnSight are prefixed by $CEI_ or $ENSIGHT7_ and listed in 6.2.
With a standard user setup, only $CEI_HOME may need to be set manually, to
the path of the EnSight installation.
Environment variable
Description and options
$CEI_HOME
Path where EnSight is installed, eg /usr/local/ensight, added
to the system path by default
$CEI_ARCH
Machine architecture, from a choice of names corresponding
to the
machine directory names in $CEI_HOME/ensight74/machines;
default settings include linux_2.4 and sgi_6.5_n32
$ENSIGHT7_READER
Path that EnSight searches for the user defined libuserd-foam
reader library, set by default to $FOAM_LIBBIN
The principal difficulty in using the EnSight reader lies in the fact that EnSight
expects that a case to be defined by the contents of a particular file, rather than a
directory as it is in OpenFOAM. Therefore in following the instructions for the
using the reader below, the user should pay particular attention to the details
of case selection, since EnSight does not permit selection of a directory
name.
from the EnSight GUI, the user should select Data (Reader) from the
File menu;
The user should now be able to select the OpenFOAM from the Format
menu; if not, there is a problem with the configuration described above.
The user should find their case directory from the File Selection window,
highlight one of top 2 entries in the Directories box ending in /. or /..
and click (Set) Geometry.
The path field should now contain an entry for the case. The (Set)Geometry text box should contain a ‘/’.
The user may now click Okay and EnSight will begin reading the data.
When the data is read, a new Data Part Loader window will appear,
asking which part(s) are to be read. The user should select Load all.
When the mesh is displayed in the EnSight window the user should
close the Data Part Loader window, since some features of EnSight will
not work with this window open.