Howto importing fluent mesh with internal walls

From OpenFOAMWiki
Jump to: navigation, search

Valid versions: OF version 12.png OF version 14.png

OpenFOAM does not know about internal walls, so if you have a doublesided wall (with cells on both sides) you have to work on the mesh before using fluentMeshToFoam:

1) Change all the internal walls to type "internal" (it's just a marker to find the relevant cellset in OpenFoam). Take care that you don't combine internal and external walls in the same boundary.

2) Save the mesh in Gambit with type "Fluent 5/6" as .msh.

3) Use fluentMeshToFoam:

    fluentMeshToFoam <root> <caseName> <meshFile>

where <meshFile> is the name of the .msh file, including the full or relative path.

Note for OF version 14.png: Starting with this version the writting of the sets has to be explicitly asked for:

   fluentMeshToFoam <root> <caseName> <meshFile> -writeSets

4) Add for the internal wall a pair of empty patches (with zero length) in the <constant><polyMesh> section of your case:

        type            wall;
        startFace       ;
        nFaces          0;
        type            wall;
        startFace       ;
        nFaces          0;

Note for OF version 13.png: In previous versions startFace was implicitly set to the face after the last face. Now it has got to be set to the current number of faces. Otherwise a segmentation fault will occur.

You also need to increase the boundary count at the beginning of the data section accordingly.

5) Apply the splitMesh command:

    splitMesh <root> <caseName> <name_of_internal> <boundary_name_A> <boundary_name_B>

where <name_of_internal> is the name you chose in Gambit for your internal wall, <boundary_name_A> and <boundary_name_B> are the names you added to the boundary file before.

6) Do a checkMesh:

    checkMesh <root> <caseName>

You will end up the mesh check resulting in a lot of

     checkCoords : points xxxxx and xxxxx with coordinates:(x y z) and (x1 y1 z1) ar
     are relatively close to each other. This might be corret in case of e.g. baffles.

(That's what you asked for, isn't it?)

After that you can go on setting your boundaries using FoamX or command line interface and do your simulation.

Note: If this procedure has to be done twice the original splitMesh might not work because it doesn't preserve the information in faceSets. Use splitMeshWithSets instead.