Fluent3DMeshToFoam

From OpenFOAMWiki

1 Name

fluent3DMeshToFoam - Converts a Fluent mesh (in ASCII format) to foam format

Valid versions: OF Version 21.png

2 Synopsis

fluent3DMeshToFoam [OPTIONS] FLUENT_MESH

3 Description

Convert a mesh file FLUENT_MESH from Fluent format to foam format.

-scale factor

Scale the mesh geometry by factor. If not provided, use 1

-case DIR

Execute the command on the case directory DIR. If not provided, use the current directory

-noFunctionObjects

Skip the execution of the functionObjects

-help

Display the help and exit

4 Comparison between fluentMeshToFoam and fluent3DMeshToFoam

From the release notes for OpenFOAM 1.4.1:

 New fluent3DMeshToFoam converter for 3D meshes from Fluent format to OpenFOAM format including full support for all BCs, zones etc.;

Comparing the source code for fluentMeshToFoam and fluent3DMeshToFoam in OpenFOAM 1.4.1 and 1.5, the following main differences can be found:


5 Step by step example

Convert a mesh generated by Fluent/Gambit to OpenFOAM.

1. Save the file in Fluent/Gambit in ASCII format (uncheck the "Write Binary Files" option).

If the .msh file was generated in Windows then dos2unix command should be used, before proceeding further.

     dos2unix fluent.msh 

2. Create a new case (e.g. Beispiel) for OpenFOAM (easy option: copy the following files from a comparable tutorial, e.g. icoFoam)

 a. Create case directory: mkdir Beispiel
 b. Create the following directories inside Beispiel folder (or copy the directories from the icoFoam or another appropriate tutorial)
    mkdir Beispiel/system
    mkdir Beispiel/constant
    mkdir Beispiel/constant/polymesh
    mkdir Beispiel/0
 c. Create the following files: (or copy from icoFoam tutorial)
    Beispiel/system/controlDict
    Beispiel/system/fvScheme
    Beispiel/system/fvSolution
    Beispiel/constant/transportProperties

3. Copy the fluent.msh file into Beispiel folder.

4. Run the fluent3DMeshToFoam converter (within the Beispiel folder)

  without scaling:  
                  fluent3DMeshToFoam fluent.msh 
  OR
  with appropriate scaling if required (e.g. from millimeters to meters):
                  fluent3DMeshToFoam fluent.msh -scale 0.001 


4. Edit the Beispiel/constant/polyMesh/boundary file and set proper names. Typically every surface might be a wall. If one needs inlet, outlet, etc as boundary condition, change wall to patch.

5. Run checkMesh(from Beispiel root folder) to check if the mesh has been converted properly.

  checkMesh 
  OR 
  checkMesh -fullTopology 

6. Copy the initial/boundary condition files into Beispiel/0 folder and edit them appropriately.

  e.g. Beispiel/0/U and Beispiel/0/p from icoFoam tutorial.

7. Make further appropriate changes (e.g. nu in Beispiel/constant/transportProperties )

8. The case is ready to run (from Beispiel root folder):

   icoFoam
   or
   foamJob icoFoam