CFD Online Discussion Forums

CFD Online Discussion Forums (
-   Open Source Meshers: Gmsh, Netgen, CGNS, ... (
-   -   [STL->GMSH->simpleFoam] (

huitetquatre January 24, 2013 09:28


I'm looking for a simple example in which:
- the mesh is generated with gmsh using an STL object;
- the computation is made with simpleFoam.

In practice, my attempts always lead to a "Floating point exception"...

wyldckat January 24, 2013 17:34

Greetings David,

Have you tried to replicate one of OpenFOAM's tutorials for simpleFoam, but using a mesh generated with Gmsh?

Have you checked the validity of your mesh after conversion? Try:

checkMesh -allGeometry -allTopology

Best regards,

huitetquatre January 25, 2013 06:37

In fact, the simple "checkMesh" is Ok, the Topology (-allTopology) is also OK, but the the geometry check (-allGeometry) failed.

How can I modify the gmsh file to solve this kind of problem ?


>    Face tets OK.
>    Min/max edge length = 0.168466 10.198 OK.
>    All angles in faces OK.
>    All face flatness OK.
>    Cell determinant (wellposedness) : minimum: 0 average: 1.34053
>  ***Cells with small determinant found, number of cells: 646
>  <<Writing 646 under-determined cells to set underdeterminedCells
>    Concave cell check OK.

wyldckat January 26, 2013 15:51

Hi David,

Mmm... cell determinant zero can lead to some problems... Run the following command:

foamToVTK -cellSet underdeterminedCells
Then open the file "underdeterminedCells*.vtk" which should be inside the folder "VTK". It will show you where the cells with very small determinant are located.

edit: sorry, I forgot to mention that once you see the bad cells, you try and increase refinement or orientation on the zone where those cells are having problems.

Best regards,

All times are GMT -4. The time now is 05:30.