From OpenFOAMWiki
Revision as of 15:23, 25 November 2009 by CeeKay (Talk | contribs)

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)

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

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

  without scaling:  
                  fluent3DMeshToFoam fluent.msh 
  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 -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):

   foamJob icoFoam