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

[snappyHexMesh] Catia to snappyHexMesh

Register Blogs Community New Posts Updated Threads Search

Like Tree9Likes
  • 1 Post By wyldckat
  • 1 Post By wyldckat
  • 1 Post By wyldckat
  • 1 Post By bgarrood
  • 3 Post By bgarrood
  • 2 Post By snowygrouch

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 4, 2012, 16:36
Default Catia to snappyHexMesh
  #1
New Member
 
Barney Garrood
Join Date: Jan 2012
Posts: 7
Rep Power: 14
bgarrood is on a distinguished road
Hello,
I am teaching myself Foam, and want to import geometry from Catia. Catia can export stl files but in doing so loses the naming of surfaces. Names are maintained in stp files but I can't find a way to get stp to stl in a way that preserves surface names-of obvious benefit for defining boundary conditions etc

Can anyone suggest a workaround? I am aware of Salome, netgen, discretised but am trying to avoid over complicating things unless I have to. sHM has advantages of being easily script able etc.

Many thanks in advance. Barney
bgarrood is offline   Reply With Quote

Old   January 4, 2012, 16:53
Default
  #2
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,975
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Greetings Barney and welcome to the forum!

If you still have access to Catia, try exporting to OBJ Wavefront instead of STL. In OpenFOAM 2.1.0 you should be able to see that this is the new preferred geometry format, simply because it doesn't need that the geometry to be decomposed in triangles, making it a lot easier to properly process the geometry!

Let us know how it goes! Best regards,
Bruno
ashishmagar600 likes this.
__________________
wyldckat is offline   Reply With Quote

Old   January 4, 2012, 17:13
Default
  #3
New Member
 
Barney Garrood
Join Date: Jan 2012
Posts: 7
Rep Power: 14
bgarrood is on a distinguished road
Great, thanks for such a quick reply!
I'll have a look at that. Can sHM use obj files instead of stl then?
Many thanks again. Barney
bgarrood is offline   Reply With Quote

Old   January 4, 2012, 17:20
Default
  #4
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,975
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Hi Barney,

It slices, it dices and it even cuts! - No, wait, wrong ad... This is what I meant to say:
Quote:
Originally Posted by wyldckat View Post
Example:
Code:
surfaceTransformPoints  constant/triSurface/cube.stl constant/triSurface/cube.obj -translate '(1  0 0)'
You might ask "Why cube.obj?" - this might come in handy because the Obj files (Wavefront format) are in ASCII format (useful for visually debugging the file itself), have a better definition of vertices and how they interconnect... and can also be opened in ParaView.
In other words, you can even convert between formats when using the right OpenFOAM utility!

Best regards,
Bruno
elvis likes this.
__________________
wyldckat is offline   Reply With Quote

Old   January 6, 2012, 01:20
Default
  #5
New Member
 
Barney Garrood
Join Date: Jan 2012
Posts: 7
Rep Power: 14
bgarrood is on a distinguished road
Hi Bruno,

So Catia can only export igs and stp files other than stl which loses the surface names (plus 3dxml, cgr, hcg and wrl but I havent heard of these before). Neither of these is supported by surfaceTransform.

Do you have any recommendation for a way forward? I cant imagine that I am the only person trying to get data from Catia to snappyHexMesh (as directly as possible, ideally scriptable).

Best regards, and thanks again for your help!

Barney
bgarrood is offline   Reply With Quote

Old   January 6, 2012, 08:01
Default
  #6
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,975
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Hi Barney,

Sorry about that. I did a fast search on Google about "catia export wavefront obj" and it looked like on the surface that it was able to handle that format.

AFAIK, there are at least a few other options:
  • Export to STL in binary format using colour coding. This is something that some 3D plotters allow in binary STL files. You'll loose names per-say, but at least you still have some good references.
  • Export the geometry in parts to STL in ASCII format. Might be painful, but perhaps CATIA provides a macro/scripting system that can ease the problem. Then properly name each solid and then finish each solid with "end solid"; then concatenate all STL files into a single one, to make it easier for processing in sHM.
  • There is also pythonOCC: http://www.pythonocc.org/ - this is sort-of Salome in purely programming form. Very useful/powerful for those parametric geometries, such as turbomachine blades (example), but it should also allow importing STEP files and export them in the same file formats as Salome... or at least this is what I'm expecting, according to the information available.
Good luck! And let us know how it goes!
Bruno
GM_XIII likes this.
__________________
wyldckat is offline   Reply With Quote

Old   February 3, 2012, 09:55
Default Problem solved!
  #7
New Member
 
Barney Garrood
Join Date: Jan 2012
Posts: 7
Rep Power: 14
bgarrood is on a distinguished road
Hi Bruno,

I have solved the problem so thought I should post it.
Catia provides a vba based scripting capability, so I used this to export each surface separately and combine them into a single stl file exactly as you suggest. Works like a charm.
If anyone else has the same problem I am happy to post the script - surely it must be something that a lot of people have to do!

Thanks again for all your help.
Best regards,
Barney
wyldckat likes this.
bgarrood is offline   Reply With Quote

Old   February 10, 2012, 03:55
Default
  #8
New Member
 
Join Date: Feb 2012
Posts: 6
Rep Power: 14
hayes is on a distinguished road
Hi Barney,

I'm also trying to set up a more complex case that needs a lot more boundary patches for inlet and also refinement levels. I tried to export different parts from CATIA to STL and put those surfaces together in a single STL File. Works quite well but i guess it is no really the best way to do it.

I'm not familiar with vba based scripting in CATIA, so it would be a big help if you could post your script. I'd like to test it with my case.

Thanks in advance and best regards,
Chris
hayes is offline   Reply With Quote

Old   February 14, 2012, 01:36
Default STL export script
  #9
New Member
 
Barney Garrood
Join Date: Jan 2012
Posts: 7
Rep Power: 14
bgarrood is on a distinguished road
Hi Chris,

Attached is the script.
It works like this:
-Put all surfaces you want to export into a geometric set called "EXPORT".
-Hide everything, including everything in your EXPORT set.
-Run the macro.

It unhides each surface, exports it to a file, then hides it again. it then takes all of the stl files and combines them into a single file with the same name as your CATPart.

Let me know if you have any trouble.

One quick note: stl export is at same resolution as screen display, so make sure your display is at max resolution in CATIA - tools-options-display-performance, and turn the 3D accuracy sliders all the way to the right. I dont think the other options here do anything, but may be just as well to turn them up to the max.

Regards,
Barney
Attached Files
File Type: txt STLExport.txt (2.3 KB, 281 views)
wyldckat, shackur and abkahraman like this.
bgarrood is offline   Reply With Quote

Old   February 22, 2012, 10:28
Default
  #10
New Member
 
Join Date: Feb 2012
Posts: 6
Rep Power: 14
hayes is on a distinguished road
Hi Barney,

thanks a lot. I finally found some time to try it. First I had some trouble getting the CATIA file to work, but now its all good. The display-accuracy really does have a huge impact on the STL-quality!!

Thanks again and best regards,
Chris
hayes is offline   Reply With Quote

Old   April 6, 2012, 02:54
Default
  #11
Member
 
Join Date: Apr 2012
Location: France
Posts: 72
Rep Power: 14
Rider is on a distinguished road
Just to complete the answer, CATIA can export geometrie to OpenFOAM.

The exporte format is ".stl". To do this, you can follow this method :
- For a "CATPart" => Save as ".stl"
- For a "CATProduct" => Save as ".igs", then open the ".igs" and save as this in ".stl".

I don't now if it's a good solution but it correctly works.
Rider is offline   Reply With Quote

Old   April 16, 2015, 04:10
Default Problems with nodes
  #12
New Member
 
Join Date: Mar 2015
Posts: 1
Rep Power: 0
Marcus Blomberg is on a distinguished road
Quote:
Originally Posted by bgarrood View Post
Hi Chris,

Attached is the script.
It works like this:
-Put all surfaces you want to export into a geometric set called "EXPORT".
-Hide everything, including everything in your EXPORT set.
-Run the macro.

It unhides each surface, exports it to a file, then hides it again. it then takes all of the stl files and combines them into a single file with the same name as your CATPart.

Let me know if you have any trouble.

One quick note: stl export is at same resolution as screen display, so make sure your display is at max resolution in CATIA - tools-options-display-performance, and turn the 3D accuracy sliders all the way to the right. I dont think the other options here do anything, but may be just as well to turn them up to the max.

Regards,
Barney
This was great, thank you.
The only problem I have is that the nodes between the different surfaces do not necessesarily have to add up, i.e. they do not match. Did you have any trouble with this or way on how to fix it?
Marcus Blomberg is offline   Reply With Quote

Old   May 30, 2015, 04:53
Default CATIA STL quality
  #13
New Member
 
Calum Douglas
Join Date: Apr 2013
Location: Coventry, UK
Posts: 26
Rep Power: 12
snowygrouch is on a distinguished road
Hi Everyone,
Just in case you were interested, I will share here what I have done
in the past in this case. It requires that you have "STL Rapid Prototyping"
workbench in CATIA....

1) From here you can select your surface, click "Tesselation" Icon then by
entering different values into the "sag" box you can directly define
any resolution at all you may wish for your STL. I usually use a figure
of 0.05, or 0.02 if I`m being really fussy (0.02 gives incredibly fine resolution and also big files !).

2) Then "Apply", "Ok".

3) Then select the tesselelations and click on "STL Export" Icon.

This exports as BINARY, you wont get the patch names inside the files.

What I do then is import each surface into Meshlab in Linux - scale it to meters, and do save-as - then in the dialog box you can un-tick "binary" format....this is its silly way of saying "I want ASCII" - haha.

Then I open up each file in gedit and rename the text manually to each name I want to have. Then I use "cat" command to join together all my ASCII files.

I believe that cleverer people can work out how to do pretty much all of that with 2 scripts...its a real pain, but for me well worth it, as I can have literally ANY stl resolution I want (its 100% independant of screen resolution or any other graphics card settings if you export in this workbench).

Regards
wyldckat and Harak like this.
__________________
Calum Douglas
Director
Scorpion Dynamics Ltd
Email: calum.douglas@scorpion-dynamics.com
Web: www.scorpion-dynamics.com
snowygrouch is offline   Reply With Quote

Old   April 4, 2018, 19:43
Default Does snappyhexmesh work with stp files?
  #14
New Member
 
Sri Harsha Maddila
Join Date: Mar 2018
Posts: 10
Rep Power: 8
harsha2398 is on a distinguished road
I have a doubt regarding the usability of .STP files with the snappyHexMesh utility. Is it possible? Because, simflow, a GUI based on openfoam accepts .STP formats as geometries. Or does OpenFoam work only with .STL and nastran files?
harsha2398 is offline   Reply With Quote

Old   April 12, 2018, 19:06
Default
  #15
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,975
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Quote:
Originally Posted by harsha2398 View Post
I have a doubt regarding the usability of .STP files with the snappyHexMesh utility. Is it possible? Because, simflow, a GUI based on openfoam accepts .STP formats as geometries. Or does OpenFoam work only with .STL and nastran files?
Quick answer:
  • snappyHexMesh cannot use STP files.
  • Simflow likely uses OpenCascade to process the Step file.
  • You can use Salome to import the STP file and then export it to STL.
__________________
wyldckat is offline   Reply With Quote

Reply

Tags
catia, patches, snappyhexmesh, stl, stp


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
[CAD formats] Creating waterproof STL using snappyHexMesh or salome Tobi OpenFOAM Meshing & Mesh Conversion 58 May 13, 2020 06:01
[snappyHexMesh] Running snappyHexMesh in parallel - optimizing peterhess OpenFOAM Meshing & Mesh Conversion 2 January 3, 2018 02:54
Thermal analysis using Catia Frakkel79 Main CFD Forum 0 October 29, 2014 01:53
[snappyHexMesh] STL exported from CATIA and snappyHexMesh ma- OpenFOAM Meshing & Mesh Conversion 3 April 9, 2012 14:06
[snappyHexMesh] stitchMesh and snappyHexMesh gdbaldw OpenFOAM Meshing & Mesh Conversion 0 December 23, 2009 02:09


All times are GMT -4. The time now is 05:36.