CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Native Meshers: snappyHexMesh and Others

stl and snappyHexMesh dimensions mismatch

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

Like Tree3Likes
  • 1 Post By josp
  • 1 Post By romant
  • 1 Post By obelix314

Reply
 
LinkBack Thread Tools Display Modes
Old   August 6, 2009, 04:00
Default stl and snappyHexMesh dimensions mismatch
  #1
Senior Member
 
romant's Avatar
 
Roman Thiele
Join Date: Aug 2009
Location: Stockholm, Sweden
Posts: 360
Rep Power: 12
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, 05:26
Default
  #2
New Member
 
Join Date: Mar 2009
Posts: 20
Rep Power: 8
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
Xabi is offline   Reply With Quote

Old   August 6, 2009, 06:23
Default
  #3
Member
 
Johan Spång
Join Date: Mar 2009
Location: Stockholm, Sweden
Posts: 35
Rep Power: 8
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
Saideep likes this.
josp is offline   Reply With Quote

Old   August 6, 2009, 07:03
Default
  #4
Senior Member
 
romant's Avatar
 
Roman Thiele
Join Date: Aug 2009
Location: Stockholm, Sweden
Posts: 360
Rep Power: 12
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 likes this.

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

Old   June 30, 2014, 04:09
Default stl scaling in snappyHexMesh
  #5
Senior Member
 
fabian_roesler's Avatar
 
Fabian Roesler
Join Date: Mar 2009
Location: Bad Friedrichshall, Germany
Posts: 164
Rep Power: 8
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, 10:56
Default
  #6
Member
 
Jason G.
Join Date: Sep 2009
Location: Clemmons, NC
Posts: 76
Rep Power: 7
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, 19:57
Default
  #7
Senior Member
 
kmooney's Avatar
 
Kyle Mooney
Join Date: Jul 2009
Location: Amherst, MA USA - San Diego, CA USA
Posts: 285
Rep Power: 9
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, 20:16
Default
  #8
Member
 
Jason G.
Join Date: Sep 2009
Location: Clemmons, NC
Posts: 76
Rep Power: 7
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, 20:22
Default
  #9
Senior Member
 
kmooney's Avatar
 
Kyle Mooney
Join Date: Jul 2009
Location: Amherst, MA USA - San Diego, CA USA
Posts: 285
Rep Power: 9
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, 20:31
Default
  #10
Member
 
Jason G.
Join Date: Sep 2009
Location: Clemmons, NC
Posts: 76
Rep Power: 7
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, 08: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
fabian_roesler likes this.
obelix314 is offline   Reply With Quote

Old   May 4, 2015, 09:44
Default
  #12
Senior Member
 
fabian_roesler's Avatar
 
Fabian Roesler
Join Date: Mar 2009
Location: Bad Friedrichshall, Germany
Posts: 164
Rep Power: 8
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
fabian_roesler is offline   Reply With Quote

Reply

Tags
dimension, snappyhexmesh, stl, units

Thread Tools
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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to make boundary patches in STL file nzy102 OpenFOAM Mesh Utilities 3 January 8, 2015 08:56
SnappyHexMesh meshes inside and outside of an STL geometry villier OpenFOAM Mesh Utilities 17 June 15, 2010 19:51
SnappyHexMesh not generate mesh first time mavimo OpenFOAM Mesh Utilities 4 August 26, 2008 07:08
SnappyHexMesh and planar STL surfaces hannes OpenFOAM Bugs 1 August 1, 2008 08:47
SnappyHexMesh STL patch naming gregorv OpenFOAM Mesh Utilities 1 July 23, 2008 07:05


All times are GMT -4. The time now is 19:10.