It is possible to use Fluent as a post-processor for the cases run in OpenFOAM.
Two converters are supplied for the purpose: foamMeshToFluent which
converts the OpenFOAM mesh into Fluent format and writes it out as a .msh file;
and, foamDataToFluent converts the OpenFOAM results data into a .dat file
readable by Fluent. foamMeshToFluent is used by typing the following:
foamMeshToFluent<root><caseName>
The resulting mesh is written out in a fluentInterface subdirectory of the case
directory, i.e. <caseName>/fluentInterface/<caseName>.msh
foamDataToFluent converts the OpenFOAM data results into the Fluent format. The
conversion is controlled by two files. First, the controlDict dictionary specifies
startTime, giving the set of results to be converted. If you want to convert the
latest result, startFrom can be set to latestTime. The second file which specifies
the translation is the foamDataToFluentDict dictionary, located in the
constant directory. An example foamDataToFluentDict dictionary is given
below:
1 // The OpenFOAM Project // File: foamDataToFluentDict 2 /* 3 ------------------------------------------------------------------------------- 4 ========= | dictionary 5 \\ / | 6 \\ / | Name: foamDataToFluentDict 7 \\ / | Family: FoamX configuration file 8 \\/ | 9 F ield | OpenFOAM version: 2.3 10 O peration | Product of Nabla Ltd. 11 A and | 12 M anipulation | Email: Enquiries@Nabla.co.uk 13 ------------------------------------------------------------------------------- 14 */ 15 // FoamX Case Dictionary. 16 17 FoamFile 18 { 19 version 2.0; 20 format ascii; 21 22 root ""; 23 case ""; 24 instance ""; 25 local ""; 26 27 class dictionary; 28 object foamDataToFluentDict; 29 } 30 31 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 32 33 34 p 1; 35 36 U 2; 37 38 T 3; 39 40 h 4; 41 42 k 5; 43 44 epsilon 6; 45 46 gamma 150; 47 48 49 // ************************************************************************* //
The dictionary contains entries of the form
<fieldName><fluentUnitNumber>
The <fluentUnitNumber> is a label used by the Fluent post-processor that only
recognises a fixed set of fields. The basic set of <fluentUnitNumber> numbers are
quoted in Table 7.5.
Fluent name
Unit number
Common OpenFOAM name
PRESSURE
1
p
MOMENTUM
2
U
TEMPERATURE
3
T
ENTHALPY
4
h
TKE
5
k
TED
6
epsilon
SPECIES
7
--
G
8
--
XF_RF_DATA_VOF
150
gamma
TOTAL_PRESSURE
192
--
TOTAL_TEMPERATURE
193
--
Table 7.5:
Fluent unit numbers for post-processing.
The dictionary must contain all the entries the user requires to post-process,
e.g. in our example we have entries for pressure p and velocity U. If the
user runs foamDataToFluent through FoamX, he/she will be provided
with a dictionary with a list of default entries described in Table 7.5.
To run foamDataToFluent from the command line the user should type
foamDataToFluent<root><caseName>
To view the results using Fluent, go to the fluentInterface subdirectory
of the case directory and start a 3 dimensional version of Fluent with
fluent 3d
The mesh and data files can be loaded in and the results visualised. The mesh is
read by selecting Read Case from the File menu. Support items should be
selected to read certain data types, e.g. to read turbulence data for k and
epsilon, the user would select k-epsilon from the Define->Models->Viscous
menu. The data can then be read by selecting Read Data from the File
menu.
A note of caution: users MUST NOT try to use an original Fluent mesh file
that has been converted to OpenFOAM format in conjunction with the OpenFOAM solution
that has been converted to Fluent format since the alignment of zone numbering
cannot be guaranteed.