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

[Gmsh] Axisymmetric model from STEP in GMSH

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 7, 2011, 14:43
Default Axisymmetric model from STEP in GMSH
  #1
Member
 
Eric M. Tridas
Join Date: May 2011
Location: Tampa, Florida
Posts: 48
Rep Power: 15
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, 05:39
Default
  #2
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
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, 10:31
Default
  #3
Member
 
Eric M. Tridas
Join Date: May 2011
Location: Tampa, Florida
Posts: 48
Rep Power: 15
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, 13:37
Default
  #4
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
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, 14:00
Default
  #5
Member
 
Eric M. Tridas
Join Date: May 2011
Location: Tampa, Florida
Posts: 48
Rep Power: 15
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, 20:46
Default
  #6
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
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, 08:47
Default
  #7
New Member
 
Punit Walia
Join Date: Jul 2013
Location: Mumbai, India
Posts: 5
Rep Power: 13
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, 62 views)
File Type: zip boundary file.zip (766 Bytes, 30 views)
Punit Walia is offline   Reply With Quote

Old   November 18, 2015, 06:24
Default prism generation for curved surface
  #8
New Member
 
perachiselvi
Join Date: Nov 2015
Posts: 1
Rep Power: 0
PERACHISELVI is on a distinguished road
1) importing file from catia(.stp)
2) merging this step file in .geo file with my required meshing parameters.
3) i got 2d as well as 3d mesh.
4) on the top of the inner parts i need prism, i tried extrude commands, but its telling type 306 error cant extrude these types of surface.
my geometry is a curved one, so i cant extrude my geometry itself to create prism.
PERACHISELVI is offline   Reply With Quote

Reply


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
generate the 3D model from this 2D axisymmetric model mlooti FLUENT 2 June 11, 2018 09:26
pimpleDyMFoam computation randomly stops babapeti OpenFOAM Running, Solving & CFD 5 January 24, 2018 06:28
Wrong flow in ratating domain problem Sanyo CFX 17 August 15, 2015 07:20
Star cd es-ice solver error ernarasimman STAR-CD 2 September 12, 2014 01:01
axisymmetric model issue prc Siemens 4 February 7, 2007 07:42


All times are GMT -4. The time now is 01:31.