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

[CAD formats] Recommended way of generating mesh from cad

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 2, 2005, 11:44
Default Recommended way of generating mesh from cad
  #1
Tobias Prousa (Prousa)
Guest
 
Posts: n/a
Hi, is there a open source soloution you can recommend to generate a openFOAM compatible mesh from cad objects. A compatible open source cad program would interest me as well. Any suggestions? What programs do you use to generate your meshes? Thanks, Tobi
  Reply With Quote

Old   February 2, 2005, 13:08
Default Anybody? We haven't come a
  #2
Mattijs Janssens (Mattijs)
Guest
 
Posts: n/a
Anybody?

We haven't come across any really good public domain meshing program (but we haven't looked too hard).

If you are really not interested in accuracy there are some really good tet meshers: tetgen, netgen.

For multiblock hex and lots more: gmsh.

All these generate meshes that can be converted to OpenFoam.

Most of these interface with cad data through an stl file.

There are various public domain cad packages (Open-Cascade, Orcan, Brl-CAD). I have used AC3D (not really cad, more polygon editor).

We haven't generated many meshes in house. Lots of blockMesh, some AC3D in combination with extrudeMesh (not trivial). There is some experimental undocumented hex-refinement stuff in meshing/advanced: autoRefineMesh, selectCells, snapMesh.

I'm really interesed in what other people use / have used.

Mattijs
  Reply With Quote

Old   February 8, 2005, 06:32
Default Hi, I'm trying to use netgen
  #3
Wolfgang Fuetterer (Fuetterer)
Guest
 
Posts: n/a
Hi, I'm trying to use netgen to generate my meshes.
Everything works fine. My CAD-Data areimported very well and the mesh generation also works fine.
(I use a fluent Mesh)

But I have a little problem:
How can I get different boundary conditions to my boundary faces?
I only get a wall patch type for all boundary faces, when converting the fluent mesh to Openfoam with fluentMeshToFoam.

Can anyone help me?
thanks, Wolfgang
  Reply With Quote

Old   February 8, 2005, 07:02
Default Hello Wolfgang, I had a si
  #4
Mattijs Janssens (Mattijs)
Guest
 
Posts: n/a
Hello Wolfgang,

I had a similar problem and noticed that the boundary info is not exported in the fluent file. I wrote another converter that reads the Netgen neutral format which does not have this problem.

If you want it send me an email (m.janssens at opencfd.co.uk) and I'll pack it up and send it.

Mattijs
  Reply With Quote

Old   February 8, 2005, 08:50
Default Surely, you can open FoamX an
  #5
Hrvoje Jasak (Hjasak)
Guest
 
Posts: n/a
Surely, you can open FoamX and change the boundary conditions there, right? Or, even better, edit the boundary file by hand and change the type of boundary that way. Also, there should be a re-patching tool that will even allow you to move faces from one patch to the other (and add new patches?).

The issue is that Fluent defines boundary conditions as "flow conditions" and some of them have absolutely no reasonable mapping to"physical" conditions in the boundary file - note that things like symmetry planes and empty patches are grabbed properly. Foam specifies the flow boundary condition on a per-field basis (with the help of FoamX).

As an illustration, please consider what to do with a boundary type defined in Fluent as a rotational fan when I'm trying to do interface tracking: does not make sense, right?

The main purpose of the mesh converters is to get the mesh into the Foam format and then you can massage it to your heart's content with the Foam manipulation tools.

Enjoy,

Hrv
  Reply With Quote

Old   May 4, 2005, 14:09
Default Hello! I'm trying to genera
  #6
New Member
 
stefan
Join Date: Mar 2009
Posts: 5
Rep Power: 17
stefan is on a distinguished road
Hello!

I'm trying to generate a mesh with tetgen1.3.3 and it doesn't work.
In tetgenToFoam.C there is an example cube.smesh file.

tetgen -pqAz cube.smesh RET

this produces cube.1.ele, .node, .face

tetgenToFoam -startAt0 <root> <case> cube.1

produces a seg.fault

In tetgenToFoam.C there is also mentioned that one should use the -f switch, but tetgen1.3.3 doesn't have an -f switch (although it should have, according to the output of "tetgen -h").

Can anybody help me?
--Stefan
stefan is offline   Reply With Quote

Old   May 5, 2005, 12:59
Default The segmentation fault occured
  #7
New Member
 
stefan
Join Date: Mar 2009
Posts: 5
Rep Power: 17
stefan is on a distinguished road
The segmentation fault occured because I used the -startAt0 option. I did this, because without this option there was a FatalError referring to a wrong numbering of nodes.

This happend although the nodes where numbered from 1, and I did not use the -startAt0 option.

I am a beginner of C++, but I think there is a typo in line 201. It's an "if" condition that always evaluates to TRUE.

Shouldn't it be
(startAt1 && nodeI != pointI+1)
|| (startAt1 && nodeI-1 != pointI)

--Stefan
stefan is offline   Reply With Quote

Old   May 5, 2005, 13:35
Default Ok, to get this straight, my f
  #8
New Member
 
stefan
Join Date: Mar 2009
Posts: 5
Rep Power: 17
stefan is on a distinguished road
Ok, to get this straight, my first post doesn't really have to do with the problem, since the -z switch in "tetgen -pqAz cube.smesh" shouldn't be used for a .smesh file that starts numbering at 1 anyways.
See the Bug Report page for a proper description of the Problem.
--Stefan
stefan is offline   Reply With Quote

Old   November 29, 2005, 09:53
Default Hi! Is there any example inpu
  #9
Member
 
Masashi IMANO
Join Date: Mar 2009
Location: Tokyo, Japan
Posts: 34
Rep Power: 17
imano is on a distinguished road
Hi!
Is there any example input files for autoRefineMesh utility in mesh/advanced?
Thanks,

Imano
imano is offline   Reply With Quote

Old   December 26, 2005, 10:49
Default Hello! I succeed in generat
  #10
Member
 
Masashi IMANO
Join Date: Mar 2009
Location: Tokyo, Japan
Posts: 34
Rep Power: 17
imano is on a distinguished road
Hello!

I succeed in generating a body-fitted cartesian mesh automatically from a geometry file in STL format as far as the geomety is very simple.

I took the following steps.

1. Use blockMesh to generate an initial base mesh.

2. Refine the base mesh with autoRefineMesh until the mesh fits the geometry.
In this step I didn't remove inside cells, i.e. nCutLayers was set to be 0 in autoRefineMeshDict.

3. Use insideCells to pick up cells inside the surface of the geometry.

4. Use cellSet to remove the inside cells.

In order to make a body-fitted cartesian mesh from a more complex geomety, I would have to project cell's face onto surfaces of the geometry as suggested in autoRefineMeshDict, but I could not find the way to do that.

Can anybody help me?

Thanks,
Masashi.
imano is offline   Reply With Quote

Old   December 31, 2005, 07:09
Default Hi everybody, maybe somebody
  #11
New Member
 
Christian Hubbauer
Join Date: Mar 2009
Location: Neuburg/Do., Germany
Posts: 4
Rep Power: 17
christian67 is on a distinguished road
Hi everybody,
maybe somebody might be interested:

There is a 3D CAD software called GraphiteOne 3D CAD which is free for non-commercial use.

With this CAD you can export stl and step files (e.g. for netgen).
It's also possible to export 3D dxf files (e.g. to make wireframes for dxf3geo ==> gmsh).

They seem to use the OpenCascade libraries, but there are pre-compiled binaries for some distributions, that can be installed by normal human beeings.

www.graphiteone-cad.com

Good luck,

Christian
christian67 is offline   Reply With Quote

Old   January 2, 2006, 14:27
Default So you import the geometry to
  #12
unoder
Guest
 
Posts: n/a
So you import the geometry to foam from netgen?
  Reply With Quote

Old   January 4, 2006, 13:50
Default Normally I prefer to use hex m
  #13
New Member
 
Christian Hubbauer
Join Date: Mar 2009
Location: Neuburg/Do., Germany
Posts: 4
Rep Power: 17
christian67 is on a distinguished road
Normally I prefer to use hex meshes made with gmsh.

Therefore you can use GraphiteOne to create points,lines and arcs in 3D (as a preprocessor to gmsh), as the geometry editing is more comfortable for me.

But yes - I admit- sometimes I create netgen tet-meshes for foam.
christian67 is offline   Reply With Quote

Old   January 4, 2006, 18:09
Default Hi, I tried to donwload Gra
  #14
Senior Member
 
Billy
Join Date: Mar 2009
Posts: 167
Rep Power: 17
billy is on a distinguished road
Hi,

I tried to donwload GraphiteOne but all the links are broken.
billy is offline   Reply With Quote

Old   May 5, 2008, 06:15
Default Is autoRefineMesh working in O
  #15
Member
 
Terry Barnaby
Join Date: Mar 2009
Location: Beam Ltd, UK
Posts: 44
Rep Power: 17
terrybarnaby is on a distinguished road
Is autoRefineMesh working in OpenFOAM 1.4.1 ?
I am trying to use it to create a "wind tunnel" mesh
around an STL defined object.
I have tried various options in blockMeshDict and
autoRefineMeshDict but the program always seems to crash with me with various segment fault errors.
terrybarnaby is offline   Reply With Quote

Old   May 6, 2008, 18:06
Default Haven't used it for a while. W
  #16
Senior Member
 
Mattijs Janssens
Join Date: Mar 2009
Posts: 1,419
Rep Power: 26
mattijs is on a distinguished road
Haven't used it for a while. What errors? What is your blockMeshDict? What your autoRefineDict?
mattijs is offline   Reply With Quote

Old   May 7, 2008, 05:20
Default Thanks for the reply. The err
  #17
Member
 
Terry Barnaby
Join Date: Mar 2009
Location: Beam Ltd, UK
Posts: 44
Rep Power: 17
terrybarnaby is on a distinguished road
Thanks for the reply.
The error I get from OpenFOAM 1.4.1 is:

#0 Foam::error::printStack(Foam:stream&) in "/home/terry/OpenFOAM/OpenFOAM-1.4.1/lib/linuxGccDPOpt/libOpenFOAM.so"
#1 Foam::sigSegv::sigSegvHandler(int) in "/home/terry/OpenFOAM/OpenFOAM-1.4.1/lib/linuxGccDPOpt/libOpenFOAM.so"
#2 Uninterpreted: [0x110420]
#3 doRefinement(Foam::polyMesh&, Foam::dictionary const&, Foam::HashSet<int,> > const&, Foam::List<int>&) in "/home/terry/OpenFOAM/OpenFOAM-1.4.1/applications/bin/linuxGccDPOpt/autoRefineMe sh"
#4 main in "/home/terry/OpenFOAM/OpenFOAM-1.4.1/applications/bin/linuxGccDPOpt/autoRefineMe sh"
#5 __libc_start_main in "/lib/libc.so.6"
#6 Foam::regIOobject::readIfModified() in "/home/terry/OpenFOAM/OpenFOAM-1.4.1/applications/bin/linuxGccDPOpt/autoRefineMe sh"
make: *** [mesh2] Segmentation fault

I have put my test case at:
ftp://portal.beam.ltd.uk/pub/meshTest2.tar.gz

If you do "make clean mesh2" it attempts to create a mesh using autoRefineMesh to improve it near the
imported CAD object.

Using OpenFOAM 1.4.1_patch from SVN I get the error:

--> FOAM FATAL ERROR : face:1283 centre-0.6 -0.8 0.75) verts:5(533 764 2597 765 534) point levels:5{0} own:448 ownLevel:0#0 Foam::error::printStack(Foam:stream&) in "/home/terry/OpenFOAM/OpenFOAM-1.4.1/lib/linuxGccDPOpt/libOpenFOAM.so"
#1 Foam::error::abort() in "/home/terry/OpenFOAM/OpenFOAM-1.4.1/lib/linuxGccDPOpt/libOpenFOAM.so"
#2 Foam::hexRef8::getAnchorLevel(int) const in "/home/terry/OpenFOAM/OpenFOAM-1.4.1/lib/linuxGccDPOpt/libdynamicMesh.so"
#3 Foam::hexRef8::setRefinement(Foam::List<int> const&, Foam::polyTopoChange&) in "/home/terry/OpenFOAM/OpenFOAM-1.4.1/lib/linuxGccDPOpt/libdynamicMesh.so"
#4 Foam::multiDirRefinement::refineHex8(Foam::polyMes h&, Foam::List<int> const&, bool) in "/home/terry/OpenFOAM/OpenFOAM-1.4.1/lib/linuxGccDPOpt/libdynamicMesh.so"
#5 Foam::multiDirRefinement::multiDirRefinement(Foam: :polyMesh&, Foam::List<int> const&, Foam::dictionary const&) in "/home/terry/OpenFOAM/OpenFOAM-1.4.1/lib/linuxGccDPOpt/libdynamicMesh.so"
#6 doRefinement(Foam::polyMesh&, Foam::dictionary const&, Foam::HashSet<int,> > const&, Foam::List<int>&) in "/home/terry/OpenFOAM/OpenFOAM-1.4.1/applications/bin/linuxGccDPOpt/autoRefineMe sh"
#7 main in "/home/terry/OpenFOAM/OpenFOAM-1.4.1/applications/bin/linuxGccDPOpt/autoRefineMe sh"
#8 __libc_start_main in "/lib/libc.so.6"
#9 Foam::regIOobject::readIfModified() in "/home/terry/OpenFOAM/OpenFOAM-1.4.1/applications/bin/linuxGccDPOpt/autoRefineMe sh"


From function hexRef8::getAnchorLevel(const label) const
in file polyTopoChange/polyTopoChange/hexRef8.C at line 580.

FOAM aborting

-------------

Any pointers or other help would be appreciated.
My setup is: Fedora 8, OpenFOAM 1.4.1 and OpenFOAM 1.4.1_patch, paraview 3.2.1 with updated FOAM extensions for 1.4.1.

Cheers


Terry
terrybarnaby is offline   Reply With Quote

Old   May 8, 2008, 17:50
Default I backported some stuff but au
  #18
Senior Member
 
Mattijs Janssens
Join Date: Mar 2009
Posts: 1,419
Rep Power: 26
mattijs is on a distinguished road
I backported some stuff but autoRefineMesh now seems to run through till the end. (Had to move the 0/ directory to 1/ to have foamToVTK pick it up but that is a different issue)


autoRefineMesh.tgz
mattijs is offline   Reply With Quote

Old   May 9, 2008, 02:48
Default Thank you very much for this,
  #19
Member
 
Terry Barnaby
Join Date: Mar 2009
Location: Beam Ltd, UK
Posts: 44
Rep Power: 17
terrybarnaby is on a distinguished road
Thank you very much for this, I was not expecting updated code !
You state that you have back ported the code. Is this from an SVN source development tree and if so would it be worth me using that tree in the future ?

I will have a go with the updated autoRefineMesh,

Thanks again

Terry
terrybarnaby is offline   Reply With Quote

Old   May 9, 2008, 05:30
Default Hi Terry! As Eugene pointed
  #20
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
Hi Terry!

As Eugene pointed out in another thread the SVN-dev-version is NOT what is going to be OF 1.5.

I'll include the new version in the branch at the SVN that collects all the bugfixes if that is alright with Mattijs?

Bernhard
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request
gschaider 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
[snappyHexMesh] Add Mesh Layers doesnt work on the whole surface Kryo OpenFOAM Meshing & Mesh Conversion 13 February 17, 2022 08:34
A high order curvilinear mesh generation(converting) tool is strongly recommended hyperman Main CFD Forum 2 August 7, 2018 18:30
A high order curvilinear mesh generation(converting) tool is strongly recommended! hyperman Mesh Generation & Pre-Processing 0 June 22, 2018 09:04
[ICEM] Generating mesh for modified parts in ICEM without changing mesh of other parts a.habibi ANSYS Meshing & Geometry 5 October 4, 2012 06:10
How to control Minximum mesh space? hung FLUENT 7 April 18, 2005 10:38


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