CFD Online Discussion Forums

CFD Online Discussion Forums (
-   Open Source Meshers: Gmsh, Netgen, CGNS, ... (
-   -   Generating a parabolic profile in gmsh (

matt.mech.eng March 12, 2012 04:57

Generating a parabolic profile in gmsh
2 Attachment(s)

I am trying to generate a parabolic profile (on the xy plane to be extruded along the z-direction) of a tank, to model the flow of fluid inside the tank with bubbleFoam. My issue is I have tried many ways to get such a geometry into openfoam.

My first try was to import an igs file with the geometry into gmsh, netgen or salome however none of these seemed to work..

I decided to generate the mesh from scratch, so I wrote a script to generate points along a parabola and join them all with straight lines (see attached image).
Then I try to generate a 2d surface mesh and I get the following error: "Error : Identical points in triangulation: increase element size or Mesh.RandomFactor"
and gmsh crashes.

How do I specify element size in gmsh? And what is Mesh.RandomFactor?


GregorS March 12, 2012 08:59

From Gmsh documentation:
Random factor used in the 2D meshing algorithm (should be increased if RandomFactor * size(triangle)/size(model) approaches machine accuracy)
Default value: 1e-09

When generating mesh, position of every point is perturbated by small random value to avoid 3 aligned points. So for beginning you can set Mesh.RandomFactor=1e-7 (or something like that) in your .geo file and try again.

All times are GMT -4. The time now is 08:26.