CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Meshing & Mesh Conversion (https://www.cfd-online.com/Forums/openfoam-meshing/)
-   -   [Gmsh] Gmsh units? (https://www.cfd-online.com/Forums/openfoam-meshing/72332-gmsh-units.html)

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...

Thanks,
Ben

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)
http://www.cfd-online.com/Forums/openfoam-meshing-gmsh/61881-gmshtofoam-gmsh2tofoam-amp-gmsh-sudden-disappear.html#post204111

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
Code:

gmshToFoam <name.msh>
. After that use the
Code:

transformPoints
util to get your desired unit:
Code:

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

Second options changes the default-settings of gmsh by
Code:

Mesh.ScalingFactor=0.001
. 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 08:01.