CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Open Source Meshers: Gmsh, Netgen, CGNS, ...

Axisymmetric model from STEP in GMSH

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

Reply
 
LinkBack Thread Tools Display Modes
Old   November 7, 2011, 13:43
Default Axisymmetric model from STEP in GMSH
  #1
Member
 
Eric M. Tridas
Join Date: May 2011
Location: Tampa, Florida
Posts: 48
Rep Power: 5
eric.m.tridas is on a distinguished road
Hey Foamers,

I'm trying to create an axisymmetric model in GMSH for OpenFOAM using complex geometry created with SolidWorks and saved as a STEP file. I am able to import everything successfully to GMSH unfortunately I seem to be stuck trying to figure out how to generate a single cell thick mesh.

I've made several axisymmetric models using the CAD functions in GMSH (and thanks to the tutorial I found on this site) but the geometry I am working with now is too complex to create directly. I am assuming there is some function within GMSH to create a mirrored mesh on either side of the "wedge" and use the "recombine" and "layers{1}" commands to make the model 1 element thick.

If anyone has any ideas how to do this it'd be greatly appreciated! Thanks in advance.

-Eric
eric.m.tridas is offline   Reply With Quote

Old   November 8, 2011, 04:39
Default
  #2
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,803
Rep Power: 38
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by eric.m.tridas View Post
Hey Foamers,

I'm trying to create an axisymmetric model in GMSH for OpenFOAM using complex geometry created with SolidWorks and saved as a STEP file. I am able to import everything successfully to GMSH unfortunately I seem to be stuck trying to figure out how to generate a single cell thick mesh.

I've made several axisymmetric models using the CAD functions in GMSH (and thanks to the tutorial I found on this site) but the geometry I am working with now is too complex to create directly. I am assuming there is some function within GMSH to create a mirrored mesh on either side of the "wedge" and use the "recombine" and "layers{1}" commands to make the model 1 element thick.

If anyone has any ideas how to do this it'd be greatly appreciated! Thanks in advance.

-Eric
Maybe this is a typical instance of "if you have a hammer, every problem looks like a nail" on my side, but if I understand you correctly it would be sufficient for you to generate the axial mesh from a 2D-cut through the geometry. Just generate a 2D-polyMesh (which is one cell thick) using the mesh-converter of your choice (I think there is one for gmsh). Then use one of these 2 utilities:
  1. extrudeMesh (which comes with OF) allows you to generate a mesh with more than one layer using one of the boundary patches. If I remember it correctly it can do rotational
  2. makeAxialMesh (look for it on the openfoamwiki) which generates an axial mesh from a 2D-mesh.

Bernhard
gschaider is offline   Reply With Quote

Old   November 8, 2011, 09:31
Default
  #3
Member
 
Eric M. Tridas
Join Date: May 2011
Location: Tampa, Florida
Posts: 48
Rep Power: 5
eric.m.tridas is on a distinguished road
Hey Bernhard,

Thanks for your quick response.

I was thinking the same thing that you suggested. My problem now is getting the 2D mesh out of SolidWorks. I've reduced the geometry to a single 2D sketch but when I attempt to save this as any of the formats GMSH accepts (STL, IGS, STEP) it tells me I do not have any 3D data to export.

So, I'm thinking I don't I quite understand your statement:

Quote:
Just generate a 2D-polyMesh (which is one cell thick) using the mesh-converter of your choice (I think there is one for gmsh)
If you could elaborate a little more on this I would appreciate it. Thanks again!

-Eric
eric.m.tridas is offline   Reply With Quote

Old   November 9, 2011, 12:37
Default
  #4
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,803
Rep Power: 38
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by eric.m.tridas View Post
Hey Bernhard,

Thanks for your quick response.

I was thinking the same thing that you suggested. My problem now is getting the 2D mesh out of SolidWorks. I've reduced the geometry to a single 2D sketch but when I attempt to save this as any of the formats GMSH accepts (STL, IGS, STEP) it tells me I do not have any 3D data to export.

So, I'm thinking I don't I quite understand your statement:



If you could elaborate a little more on this I would appreciate it. Thanks again!

-Eric
Sorry. I'm not really mesher and I havn't worked with the tools you mention. My best guess would be to extrude the 2D-Sketch to a thin "board" export that to Gmsh. Either mesh it there with prisms or get rid of everything except one side of the board, mesh that patch in 2D and extrude the mesh to a prism mesh (don't know if that is possible in Gmsh). That's as far as I can help you here
gschaider is offline   Reply With Quote

Old   November 10, 2011, 13:00
Default
  #5
Member
 
Eric M. Tridas
Join Date: May 2011
Location: Tampa, Florida
Posts: 48
Rep Power: 5
eric.m.tridas is on a distinguished road
Hey Bernhard,

I was actually able to figure my problem out.

The first issue I was having with exporting a 2D sketch from SolidWorks was resolved when I changed some of the export settings. I disabled the export of surfaces and instead exported only 3D curves which worked "fine".

After doing this another problem arose where I was not able to define a plane out of this imported 2D sketch. I merged the STEP file in GMSh and re-saved it as a *.geo file. After examining the points within the file I realized that none of my points were in the same plane. Each point was at a different depth in the z-axis (although very close to zero, ~+-1e-16) as well as many duplicate points.

I manually went in and changed each z coordinate to 0 and put the "Coherence" command in the *.geo file to remove any duplicate points. I then redrew all of the lines, defined my plane, rotated and extruded and finally meshed.

Although I was able to solve the problem it was by no means elegant and was very time consuming. I'm sure that there is some easier way to fix this (or maybe there isn't and SolidWorks just isn't good when it comes to exporting STEP files.)

I don't think this will be the last complex axisymmetric geometry I'll work with so if there is some way that you (or anyone else) knows how to remove these extra points and get them all in plane easily in GMSH I'd really like to know. Thanks for your help thus far!

-Eric
eric.m.tridas is offline   Reply With Quote

Old   November 10, 2011, 19:46
Default
  #6
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,803
Rep Power: 38
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by eric.m.tridas View Post
Hey Bernhard,

I was actually able to figure my problem out.

The first issue I was having with exporting a 2D sketch from SolidWorks was resolved when I changed some of the export settings. I disabled the export of surfaces and instead exported only 3D curves which worked "fine".

After doing this another problem arose where I was not able to define a plane out of this imported 2D sketch. I merged the STEP file in GMSh and re-saved it as a *.geo file. After examining the points within the file I realized that none of my points were in the same plane. Each point was at a different depth in the z-axis (although very close to zero, ~+-1e-16) as well as many duplicate points.

I manually went in and changed each z coordinate to 0 and put the "Coherence" command in the *.geo file to remove any duplicate points. I then redrew all of the lines, defined my plane, rotated and extruded and finally meshed.

Although I was able to solve the problem it was by no means elegant and was very time consuming. I'm sure that there is some easier way to fix this (or maybe there isn't and SolidWorks just isn't good when it comes to exporting STEP files.)

I don't think this will be the last complex axisymmetric geometry I'll work with so if there is some way that you (or anyone else) knows how to remove these extra points and get them all in plane easily in GMSH I'd really like to know. Thanks for your help thus far!

-Eric
As I said: meshing is not my strong foot. Just one idea: did you try to NOT edit the 1e-16-coordinates away. Because they are basically zero and in a lot of programs they will be treated as 0. And even if these "amost 0"-values propagate to OpenFOAM OF won't care
gschaider is offline   Reply With Quote

Old   September 20, 2013, 07:47
Default
  #7
New Member
 
Punit Walia
Join Date: Jul 2013
Location: Mumbai, India
Posts: 5
Rep Power: 3
Punit Walia is on a distinguished road
Hi,
I created an axisymmetric cd-nozzle geometry in Gmsh using this technique:-
1. Make a 2D sketch of your problem
2. Rotate the sketch -2.5 in radian (-0.04363323129985824)
3. Extrude (revolve) 5 in radian (0.08726646259971647)
4. save mesh
5. Type
$ gmshToFoam yormesh.msh

CheckMesh is okay when i have not changed the original boundary file generated after giving gmshToFoam command. But all the boundary surfaces in the original file are type "patch". So, when i am changing the front and back faces to type "wedge", it shows this error on checkMesh:-
Create polyMesh for time = 0

Time = 0

Mesh stats
points: 16996
faces: 67960
internal faces: 45032
cells: 22816
faces per cell: 4.95231
boundary patches: 5
point zones: 0
face zones: 0
cell zones: 1

Overall number of cells of each type:
hexahedra: 0
prisms: 21440
wedges: 0
pyramids: 288
tet wedges: 0
tetrahedra: 1088
polyhedra: 0

Checking topology...
Boundary definition OK.
Cell to face addressing OK.
Point usage OK.
Upper triangular ordering OK.
Face vertices OK.
Number of regions: 1 (OK).

Checking patch topology for multiply connected surfaces...
Patch Faces Points Surface topology
back 11264 5797 ok (non-closed singly connected)
outlet 96 144 ok (non-closed singly connected)
inlet 24 36 ok (non-closed singly connected)
front 11264 5797 ok (non-closed singly connected)
top 280 423 ok (non-closed singly connected)

Checking geometry...
Overall domain bounding box (-0.7438 0 -0.218097) (12.1005 5 0.218097)
Mesh (non-empty, non-wedge) directions (1 1 0)
Mesh (non-empty) directions (1 1 1)
Wedge back with angle 2.50001 degrees
***Wedge patch back not planar. Point (2.56934 0.241647 -0.0105505) is not in patch plane by 6.36005e-08 meter.
Boundary openness (-5.60725e-17 1.39206e-16 2.691e-15) OK.
Max cell openness = 3.01524e-16 OK.
Max aspect ratio = 3.0152 OK.
Minimum face area = 0.000175677. Maximum face area = 0.0287618. Face area magnitudes OK.
Min volume = 4.15765e-06. Max volume = 0.00113603. Total volume = 6.86392. Cell volumes OK.
Mesh non-orthogonality Max: 84.3209 average: 13.3594
*Number of severely non-orthogonal faces: 832.
Non-orthogonality check OK.
<<Writing 832 non-orthogonal faces to set nonOrthoFaces
Face pyramids OK.
Max skewness = 0.505184 OK.
Coupled point location match (average 0) OK.

Failed 1 mesh checks.

----------------------------------------------------------------------------------
Please someone help me out with this problem.
Thanks
Attached Files
File Type: zip gmsh_file.zip (2.6 KB, 11 views)
File Type: zip boundary file.zip (766 Bytes, 6 views)
Punit Walia is offline   Reply With Quote

Reply

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
Axisymmetric pipe model confusion Ahmed FLUENT 5 May 26, 2014 07:41
very small time step in GMO model shyam FLOW-3D 1 December 12, 2011 00:26
error using combination of step function xujjun CFX 1 January 15, 2008 16:46
axisymmetric model issue prc CD-adapco 4 February 7, 2007 06:42
Time Step Size for Airfoil Model - Fluent Prateek Main CFD Forum 0 November 4, 2004 18:42


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