CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Meshing & Mesh Conversion

[snappyHexMesh] stl and snappyHexMesh dimensions mismatch

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree23Likes
  • 1 Post By Xabi
  • 6 Post By josp
  • 3 Post By romant
  • 8 Post By fabian_roesler
  • 4 Post By obelix314
  • 1 Post By fabian_roesler

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 6, 2009, 05:00
Default stl and snappyHexMesh dimensions mismatch
  #1
Senior Member
 
romant's Avatar
 
Roman Thiele
Join Date: Aug 2009
Location: Eindhoven, NL
Posts: 374
Rep Power: 19
romant is on a distinguished road
Hej,

I have a problem with the stl fileformat and the snappyHexMesh tool. The dimensions in the stl file format are as always given in mm, because all 3D cad programs (SolidEdge V20 in my case) export the original ISO dimensions. The problem now is that snappyHexMesh uses m as input, is there any way to define a scaling factor for snappyHexMesh?
romant is offline   Reply With Quote

Old   August 6, 2009, 06:26
Default
  #2
New Member
 
Join Date: Mar 2009
Posts: 20
Rep Power: 15
Xabi is on a distinguished road
Hi Roman,

You can use the following command:

transformPoints -scale '(1e-3 1e-3 1e-3)'

I hope it works.
Best regards,

Xabi
ellen13 likes this.
Xabi is offline   Reply With Quote

Old   August 6, 2009, 07:23
Default
  #3
Member
 
Johan Spång
Join Date: Mar 2009
Location: Stockholm, Sweden
Posts: 35
Rep Power: 15
josp is on a distinguished road
Or you can scale the stl files with surfaceConvert when you clean them

surfaceConvert in.stl out.stl -clean -scale 0.001
josp is offline   Reply With Quote

Old   August 6, 2009, 08:03
Default
  #4
Senior Member
 
romant's Avatar
 
Roman Thiele
Join Date: Aug 2009
Location: Eindhoven, NL
Posts: 374
Rep Power: 19
romant is on a distinguished road
Quote:
Originally Posted by Xabi View Post
You can use the following command:

transformPoints -scale '(1e-3 1e-3 1e-3)'
Yeah I was looking at that, and it will work after meshing with the same order of magnitude of the numbers and then converting the mesh.

I will try it as soon as I have my model ready. Thank you

Worked perfectly. Thanks again
nanavati, Caio Martins and ellen13 like this.

Last edited by romant; August 10, 2009 at 04:50.
romant is offline   Reply With Quote

Old   June 30, 2014, 05:09
Default stl scaling in snappyHexMesh
  #5
Senior Member
 
Fabian Roesler
Join Date: Mar 2009
Location: Germany
Posts: 213
Rep Power: 16
fabian_roesler is on a distinguished road
Hi

I know that this is an old thread. However, it might be interesting for some of you, that one does not have to scale stl files before using them as input in snappyHexMesh. Nor does one have to mesh in mm units and scale the total mesh with transformPoints after meshing.
SnappyHexMesh offers a scaling option for geometry and features:

Code:
geometry
{
    cube.stl
    {
        type triSurfaceMesh;
        scale 0.001;
        name cube;
    }
};
Code:
features
(
    {
        file "cube.eMesh";
        scale 0.001;
        level 7;
    }
);
With this option, one can extract features from mm scaled stl files and use both, stl and features in snappy.

Cheers

Fabian
fabian_roesler is offline   Reply With Quote

Old   August 28, 2014, 11:56
Default
  #6
Member
 
Jason G.
Join Date: Sep 2009
Location: St. Louis, IL
Posts: 89
Rep Power: 15
JasonG is on a distinguished road
Am I correct in assuming that the units are only relative? If I have an stl that is in inches and I wish to ultimately solve a case within OpenFOAM in inches, then there should be no converting required correct?
JasonG is offline   Reply With Quote

Old   August 28, 2014, 20:57
Default
  #7
Senior Member
 
kmooney's Avatar
 
Kyle Mooney
Join Date: Jul 2009
Location: San Francisco, CA USA
Posts: 323
Rep Power: 16
kmooney is on a distinguished road
Hi Jason,

You can't make that assumption. All of OF is in metric units which also includes material parameters [K, mu, etc..] and flow dimensions [p, U, T, etc..]. You really just have to do everything in metric and in meters.

Cheers,
Kyle
kmooney is offline   Reply With Quote

Old   August 28, 2014, 21:16
Default
  #8
Member
 
Jason G.
Join Date: Sep 2009
Location: St. Louis, IL
Posts: 89
Rep Power: 15
JasonG is on a distinguished road
Hi Kyle,

I have always understood the unit system to be relative, meaning you only need to make certain the dimension vector for a given parameter agrees with the unit system for the mesh and other parameters utilized. I have been using USCS units with inches for steady-steady incompressible flow models.

I believe section 4.2.6 of the following link addresses this.

http://www.openfoam.org/docs/user/ba...18-1000004.2.6


-Jason
JasonG is offline   Reply With Quote

Old   August 28, 2014, 21:22
Default
  #9
Senior Member
 
kmooney's Avatar
 
Kyle Mooney
Join Date: Jul 2009
Location: San Francisco, CA USA
Posts: 323
Rep Power: 16
kmooney is on a distinguished road
Hi Jason,

Its true you can operate outside of metric if you change all of the constants and material properties. I was under the impression you were planning on switching only your lengths from metric to US while leaving things like viscosity and the other constants in metric.

Its impressive though! I've never heard of anyone actually running OF in a non-metric mode.

Cheers,
Kyle
kmooney is offline   Reply With Quote

Old   August 28, 2014, 21:31
Default
  #10
Member
 
Jason G.
Join Date: Sep 2009
Location: St. Louis, IL
Posts: 89
Rep Power: 15
JasonG is on a distinguished road
I resisted as much as I could to not use it, the largest pain with USCS is wrapping your head around slugs and super-slugs when dealing with converting the viscosity and density.

I doubt the aerospace industry in the US will ever convert to a proper system

Getting my viscous layers to properly form in snappyhexmesh is proving to be more of a challenge, currently.
JasonG is offline   Reply With Quote

Old   April 30, 2015, 09:32
Default Scaling features not working
  #11
New Member
 
Tom
Join Date: Oct 2014
Posts: 1
Rep Power: 0
obelix314 is on a distinguished road
Hallo Fabian,

Quote:
Originally Posted by fabian_roesler View Post

Code:
geometry
{
    cube.stl
    {
        type triSurfaceMesh;
        scale 0.001;
        name cube;
    }
};
Code:
features
(
    {
        file "cube.eMesh";
        scale 0.001;
        level 7;
    }
);
With this option, one can extract features from mm scaled stl files and use both, stl and features in snappy.
Have you actually tried this ? For the stl-files it is working but not for the .eMesh-files. sHM simply ignores the scaling for the features. This can also be seen from the log during meshing, when looking at the bounding box of the Feature line extraction.

Thomas
obelix314 is offline   Reply With Quote

Old   May 4, 2015, 10:44
Default
  #12
Senior Member
 
Fabian Roesler
Join Date: Mar 2009
Location: Germany
Posts: 213
Rep Power: 16
fabian_roesler is on a distinguished road
You are absolutely right. I tried with a simple STL where the feature is at (0, 0) and thus stays there even without scaling. So I posted my findings here. After proceeding with a more complex geometry I recognized what you posted but simply forgot posting the correct answer here.
So thank you for correcting the wrong info in the thread. For those who still want to use the scaling there are two methods to go on:
1. Scale the eMesh files manual
2. Change snappyHexMesh code to use scaling as I posted

Cheers

Fabian
M.W.G. likes this.
fabian_roesler is offline   Reply With Quote

Reply

Tags
dimension, snappyhexmesh, stl, units

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
[snappyHexMesh] snappyHexMesh is not using the stl file a_habib OpenFOAM Meshing & Mesh Conversion 9 June 12, 2020 18:36
[CAD formats] Creating waterproof STL using snappyHexMesh or salome Tobi OpenFOAM Meshing & Mesh Conversion 58 May 13, 2020 07:01
[snappyHexMesh] What types of stl files are needed in snappyhexmesh? phandy OpenFOAM Meshing & Mesh Conversion 1 February 19, 2015 06:36
[snappyHexMesh] Experimentally obtained STL file for internal Flow SnappyHexMesh Irish09 OpenFOAM Meshing & Mesh Conversion 9 April 7, 2012 09:50
[snappyHexMesh] Patch Names in STL file for snappyHexMesh Kattie OpenFOAM Meshing & Mesh Conversion 11 October 18, 2011 12:05


All times are GMT -4. The time now is 17:02.