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

[Netgen] Dealing with stl files from Calculix in Netgen

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 12, 2009, 09:03
Default Dealing with stl files from Calculix in Netgen
  #1
Senior Member
 
Pawel Sosnowski
Join Date: Mar 2009
Location: Munich, Germany
Posts: 105
Rep Power: 18
psosnows is on a distinguished road
Hello Foamers,

since my work required creating tetragonal mesh, as advised on this forum I went on with installing Calculix-1.7 (for geometry) and Natgen-4.9.5 (for meshing).
After a lot of effort I managed to make it running.

Now I am trying to get some basic experience with creating a tetragonal mesh with those tools. And (as suspected) some problems appeared.

I created geometry in Calculix (simple, ordinary cube with 4 points on each edge):

PNT P000 -0.00000 -0.00000 -0.00000
PNT P001 -0.00000 1.00000 -0.00000
PNT P002 1.00000 1.00000 -0.00000
PNT P003 1.00000 -0.00000 -0.00000
PNT P004 -0.00000 -0.00000 1.00000
PNT P005 -0.00000 1.00000 1.00000
PNT P006 1.00000 1.00000 1.00000
PNT P007 1.00000 -0.00000 1.00000
LINE L000 P000 P001 4
LINE L001 P001 P002 4
LINE L002 P002 P003 4
LINE L003 P003 P000 4
LINE L005 P004 P005 4
LINE L006 P005 P006 4
LINE L007 P006 P007 4
LINE L009 P007 P004 4
LINE L00A P000 P004 4
LINE L00B P001 P005 4
LINE L00C P002 P006 4
LINE L00D P003 P007 4
GSUR A000 + BLEND + L000 + L001 + L002 + L003
GSUR A001 + BLEND + L005 + L006 + L007 + L009
GSUR A002 + BLEND - L00A + L000 + L00B - L005
GSUR A003 + BLEND - L00B + L001 + L00C - L006
GSUR A005 + BLEND - L00C + L002 + L00D - L007
GSUR A006 + BLEND - L00D + L003 + L00A - L009
GBOD B000 NORM + A000 - A001 - A005 - A006 - A002 - A003
ELTY ALL be2
ELTY ALL tr3

After that I performed:
mesh all
send all stl

This created 2 files:
all.stl (with stl triangles) and all.nod (with edges)

I opened Netgen and read the geometry.
And got this error message:
ERROR: 64 wrong oriented neighbourtriangles found!
ERROR: try to correct it (with stldoctor)!

I belive that this is due to wrong surface orientation.

As expected, any attempt of meshing results Netgen to dump.

Unfortunately I could not find manual to stldoctor (it is not provided yet). I simply do not know what is wrong and how to fix this.

Do any of You have some ideas how to overcome this problem?

Thanks in advance!
Pawel
psosnows is offline   Reply With Quote

Old   February 12, 2009, 14:38
Default Hello Pawel :-)! Looks like
  #2
Senior Member
 
Philippose Rajan
Join Date: Mar 2009
Location: Germany
Posts: 552
Rep Power: 25
philippose will become famous soon enough
Hello Pawel :-)!

Looks like I end up catching you here too :-)! A Very good evening to you :-)!

So you are having trouble with STL Files exported from Calculix into Netgen....

Try the following:

1. Open the STL file in Netgen

2. Turn around the geometry in the GUI, and see if you can find triangles which are "light" or "bright" blue....
... In Netgen, triangles which are oriented with their normals facing outwards are always brighter coloured than triangles whose normals point inwards into the geometry

3. Now... In the "Geometry" menu, choose the "STL-Doctor", and change the "Double click selects" option to "triangle"

4. Switch to the "Edit Topology" tab

5. Double click on one of the triangles on the geometry which is coloured bright blue.

6. Once the triangle is selected, click on the "orient after selected trig" button in the STL Doctor window

Now, all the other triangles should also turn bright blue....

As a check, if you choose the "STL Info" menu option under the "Geometry" menu, you should see "Status: Good"

If you are having more trouble.... send me the STL file that you generated using calculix, and I could have a look...

Have a great day!

Philippose
philippose is offline   Reply With Quote

Old   February 12, 2009, 16:42
Default Hi Phillipose! It just as t
  #3
Senior Member
 
Pawel Sosnowski
Join Date: Mar 2009
Location: Munich, Germany
Posts: 105
Rep Power: 18
psosnows is on a distinguished road
Hi Phillipose!

It just as the old saying tells: the World is small ;-) especially when you deal with some speciallistic field, and I belive open-software numerical simulations are one of them.

Your guide works great- the geometry is loaded correctly.
(to be honest I needed half an hour to find it myself, but hope this topic will help someone in the future)

In the end, I have a question very close to the last one:

Lets get back to the geometry I described in the first post. Before I send it to stl file, I mesh it with triangles. I get 2 files: .stl .ned.
After loading .stl to Netgen I follow steps described by you and get correct geometry.
The question is about the triangular surface mesh generated by Calculix. I found two ways of applying that surface mesh as "pre-mesh" for Netgen to calculate 3D mesh:

1) go to stldoctor, select "Edit Edges", set "double click marks as confirmed" and double click on each and every line corresponding to each triangle. After that, save the edgedata

2) I wrote a simple program which extracts all different lines witch are parts of triangles in .stl and writes it in .ned format.

The first approach is terrible even for simple geometries. As for the second, I am not sure will the program work correctly for more complex meshing (I did not worry about the order of the two points which describe the lines).

Did I miss some simple method of sellecting edges? Or is there some other way?
ps
This question refers only importing triangular mesh from Calculix ;-)
psosnows is offline   Reply With Quote

Old   February 12, 2009, 17:58
Default Hello again Pawel, Great to
  #4
Senior Member
 
Philippose Rajan
Join Date: Mar 2009
Location: Germany
Posts: 552
Rep Power: 25
philippose will become famous soon enough
Hello again Pawel,

Great to hear that you were able to get the geometry into Netgen :-)!

As for Calculix... I must say... have never used to software before!

What information does the ".ned" file actually store? Is it the size of the mesh at each co-ordinate or something similar?

Philippose
philippose is offline   Reply With Quote

Old   February 12, 2009, 18:54
Default Greetings once again Philippos
  #5
Senior Member
 
Pawel Sosnowski
Join Date: Mar 2009
Location: Munich, Germany
Posts: 105
Rep Power: 18
psosnows is on a distinguished road
Greetings once again Philippose,

the .ned file seems to have very simple structure:
in the first line you find number of data lines,
and it is followed by that number of lines. Each of them has 6 numbers divided by white characters. First three give xyz coordinates of first point of the edge, second triplet describes xyz of the second point.

This is the beggining of .ned file generated by Calculix for my simple cube case:
24
2 -2.775558e-17 -2.775558e-17 -2.775558e-17 -2.775558e-17 5.000000e-01 -2.775558e-17
2 -2.775558e-17 5.000000e-01 -2.775558e-17 -2.775558e-17 1.000000e+00 -2.775558e-17
(...)

My concern is that as I remember, different generators and solvers use different orders in numbering points (so line AB differs from line BA). As I mentioned before, if I use my own generated .ned file which does not use any rule to keep order between points, for simple cases it works ok.

As for Calculix, I found some opinion (even on this forum) that it is really great tool for geometry and hexagonal mesh generation. It also allows to export mesh and geometry to OF. In fact I find it quite pleasent to work with. Unfortunately it does not support tetragonal meshing (this explains Netgen).

Btw, I looked around Netgen a little more, and now I am sure that even without this edge transfer routine I will be able to generate mesh siutable for my case (refining makes wonders ;-) )

Pawel
psosnows is offline   Reply With Quote

Old   February 12, 2009, 19:06
Default ahh, as for the second questio
  #6
Senior Member
 
Pawel Sosnowski
Join Date: Mar 2009
Location: Munich, Germany
Posts: 105
Rep Power: 18
psosnows is on a distinguished road
ahh, as for the second question (it is getting late...):

the .ned file can be loaded/saved by Netgen in stlDoctor (in EditEdges: "load edgedata"/"save edgedata"). In my opinion it describes the edges that Netgen sould consider while mesh generation. That is why I think if one wants to use "pre-mesh" created in stl, he has to load the stl triangles and "confirm" each edge of each triangle to be used. After this "confirmation" and saving, they are added to .ned file and used by Netgen in mesh generation.

Please correct me if I am wrong.

Thanks!

Pawel
psosnows is offline   Reply With Quote

Old   June 25, 2011, 04:50
Default Hello
  #7
Member
 
s.rasoul_varedi
Join Date: Feb 2010
Posts: 82
Rep Power: 15
desert_1250 is an unknown quantity at this point
Send a message via Yahoo to desert_1250
Hi fomers
why can't open the .stl file with GAMBIT, i created .stl file with MATLAB, but when i import it into GAMBIT or other vitualized software such az NETGEN or STL viewer,cant open it i am very confused that why this happen. can every one help or guide me. tnx
desert_1250 is offline   Reply With Quote

Old   July 11, 2011, 12:17
Default
  #8
New Member
 
vikraman
Join Date: Mar 2011
Posts: 2
Rep Power: 0
vikramanvikraman is on a distinguished road
dear Philippose rajan this is vikraman
i sent u a mandible mesh u hav not replied me yet
about it ..pls... reply still i am unable to creat a volume mesh for FEA with it
hope u reply
vikramanvikraman is offline   Reply With Quote

Reply

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
Blender: generate stl files student666 OpenFOAM Pre-Processing 0 June 6, 2017 03:45
How to create inlet/outlet/wall STL files from a STL CAD model Gentible Mesh Generation & Pre-Processing 1 June 23, 2015 11:18
Reading in and Manipulating STL files prapanj Mesh Generation & Pre-Processing 0 December 9, 2013 06:37
[snappyHexMesh] Gap/holes in STL Files m.ehlen OpenFOAM Meshing & Mesh Conversion 0 August 27, 2013 14:33
Results saving in CFD hawk Main CFD Forum 16 July 21, 2005 21:51


All times are GMT -4. The time now is 21:25.