CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM Meshing & Mesh Conversion (
-   -   [Gmsh] Gmsh units? (

bgoeppner February 2, 2010 11:04

Gmsh units?
Hi guys,

can you tell me which units gmsh is using? I couldn't find any information about this...:confused: Would be nice if I could tell gmsh to set mm as default unit...


ericnutsch February 17, 2010 14:14

Dimensionless or Meters
I believe its units are non-dimensional and depend on what your solver loads it as. For the sake of dimensional sanity, I believe most every solver uses meters. I always just use meters from the beginning, but there are some utilities to help scale your already present numbers.

For scaling inside of gmsh: (have not used)
Dilate { { expression-list }, expression } { transform-list }

In OpenFOAM you might look into transformPoints(have not used)

In OpenFOAM's blockmesh the convertToMeters function will preform scaling.

Hope that helps!

bgoeppner March 10, 2010 17:02

Just in case someone runs into the same problem: The Gmsh-default unit seems to be meters. I found two ways solving my problem to change this default-unit for usage with OpenFoam:

First option uses the Gmsh default-settings. Create your geometry, mesh everything and save the mesh. Import that mesh into your foam-case by

gmshToFoam <name.msh>
. After that use the

util to get your desired unit:

# gmshToFoam untitled.msh
# transformPoints -scale '(0.001 0.001 0.001)'

Second options changes the default-settings of gmsh by

. As I found this option, this is what I prefer as I do not have to execute two commands, just import mesh...

Hope that helps.

J_Berthellemy May 18, 2022 08:09

[Gmsh] Gmsh units?Reply to Thread
Hi !
I always thought I was alone responsable for choosing a coherent set of units :
USI for example :cool:

All times are GMT -4. The time now is 18:40.