CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Pre-Processing

Import geometry from CAD

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

Reply
 
LinkBack Thread Tools Display Modes
Old   February 13, 2005, 07:55
Default Is there any tool to import g
  #1
Giuseppe (Giuseppe)
Guest
 
Posts: n/a
Is there any tool to import geometry from CAD ?
I mean, is it possible to import geometry from PRO/E, UG or from IGES, STL and so on ?
In my opinion, it is very hard to define the geometry in blockMeshDict file for complex domains: it should be very important to have a tool to model the geometry in an user friendly way or, alternatively, to have the possibility to import geometry modelled in CAD.

Thank you

Giuseppe
  Reply With Quote

Old   February 13, 2005, 08:28
Default OpenFOAM has several unitliti
  #2
Eugene de Villiers (Eugene)
Guest
 
Posts: n/a
OpenFOAM has several unitlities to convert all the major mesh formats (Fluent, STAR, gridgen and many more) into Foam format. So your best bet is to use one of these 3rd party meshers to convert the CAD geometry and then to import it into OpenFOAM.

While a CAD-> mesh tool would obviously be very usefull, development of such a utility is difficult, costly and time consuming. Given that OpenFOAM is open source, it pretty much has to be written in someone's spare time.

As a free option, netgen or tetgen are probably your best options. Both produce all tetrahedral meshes from STL surfaces.
  Reply With Quote

Old   February 13, 2005, 08:48
Default HI, I think Netgen is the
  #3
Pei-Ying Hsieh (Hsieh)
Guest
 
Posts: n/a
HI,

I think Netgen is the best tool because the latest version can import STEP format. IGES format is somewhat problematic. Another good thing about Netgen is that "it is open source". I have not played with it enough. I do not know how good its mesh control is (dense elements in one area and coarse elements in other areas).

Pei
  Reply With Quote

Old   February 13, 2005, 09:38
Default For those wanting to avoid tet
  #4
Henry Weller (Henry)
Guest
 
Posts: n/a
For those wanting to avoid tet-meshes (as I do) gmsh is an interesting opern-source mesher: http://www.geuz.org/gmsh/
  Reply With Quote

Old   February 13, 2005, 10:22
Default I'm developing a software usi
  #5
Giuseppe (Giuseppe)
Guest
 
Posts: n/a
I'm developing a software using java + VTK .
This software reads a STL geometry and produces a tetrahedral mesh using both the adventure and Tetgen meshers.
I'm at early stage of development but my software can mesh very complex geometry (with automatic mesh refinement based upon local curvature of stl geometry). My target was to make a preprocessor and meshing tool for tochnog (I have alredy performed stress analysis calculation): the postprocess is done by paraview. I tried to convert a .msh file with the conversion utility mshToFoam but the it seems that the program requires also the blockMeshDict file: is it correct ?
If this is true the problem is to convert the cad geometry to a blockMeshDict file.
Now I see that OpenFoam performs also stress analysis (only plane stress or plane strain ??) computation and so I'm planning to use also OpenFoam engine to integrate my program.
I tried Netgen: it seems to fail or require hepic meshing times with complex geometry.
Tetgen is not bad.
In my opinion the best mesher is the Adventure one.
gmsh fails with complex geometry and does not work with stl (even if it reads stl).

Giuseppe
  Reply With Quote

Old   February 13, 2005, 10:39
Default Hi Guiseppe, sounds very i
  #6
Mattijs Janssens (Mattijs)
Guest
 
Posts: n/a
Hi Guiseppe,

sounds very interesting the work you are doing! Will this be an open source tool?

About mshToFoam: it should not need a blockMeshDict. Could be a bug. What kind of error are you getting?

Will your tool allow you to select sets of faces to create a patch from? Would be great to scrap patchTool and use your tool.

We also have the need for a tool to select arbitrary faces / cells or points inside a mesh. We work a lot with faceSets, cellSets and pointSets to do various things but they are hard to select at the moment.

Mattijs
  Reply With Quote

Old   February 13, 2005, 10:56
Default Hi MattiJs, I am not used to
  #7
Giuseppe (Giuseppe)
Guest
 
Posts: n/a
Hi MattiJs,
I am not used to law and licenses: I don't know if my software could be a open source one because one of the developing language is java (I use Netbeans IDE) and java is licensed under the Sun public licence. If someone could explain me the details I do not have problem to share my job.
I must say that my work progresses very slow: I do not have much time to work.
By now in my software a can pick points to assign boundary conditions: i was planning to develop an algorithm to select areas or lines but it seems an hard question.

This is the error from mshToFoam:

/*---------------------------------------------------------------------------*\
| ========= | |
| \ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \ / O peration | Version: 1.0.2 |
| \ / A nd | Web: http://www.openfoam.org |
| \/ M anipulation | |
\*---------------------------------------------------------------------------*/

Exec : mshToFoam /home/giuseppe/Desktop/win_d/backup-29012005/prove7 stl2pch-14 uno.1.ele.msh
Date : Feb 13 2005
Time : 15:00:07
Host : localhost
PID : 5406
Root : /home/giuseppe/Desktop/win_d/backup-29012005/prove7
Case : stl2pch-14
Nprocs : 1
Create database


--> FOAM FATAL IO ERROR : cannot open file

file: /home/giuseppe/Desktop/win_d/backup-29012005/prove7/stl2pch-14/system/controlDict at line 0.

Function: regIOobject::readStream(const word&)
in file: db/regIOobject/regIOobjectRead.C at line: 68.

FOAM exiting


Giuseppe
  Reply With Quote

Old   February 14, 2005, 05:51
Default Hi Guiseppe, mshToFoam req
  #8
Mattijs Janssens (Mattijs)
Guest
 
Posts: n/a
Hi Guiseppe,

mshToFoam requires a system/controlDict file. This file determines among others where and how the mesh files (from converting .msh data) are written.

It does not require a blockMeshDict (the input file for the blockMesh utility).

Matijs
  Reply With Quote

Old   February 14, 2005, 17:01
Default Hi MattiJs, you are right.
  #9
Giuseppe (Giuseppe)
Guest
 
Posts: n/a
Hi MattiJs,
you are right.
I'm new to OpenFoam and as you can see I make trivial errors.
Anyway mshToFoam works: I meshed with 4 node tetrahedrons a 3d complex domain with my software and then I used mshToFoam.
What I understand at a first sight is that all the surface faces are considered as default patches.
Now I need a little time to understand more deeply the OpenFoam system to see if it is possible to develop a gui to apply boundary condition and loads in a user frindly fashion.
Some questions:
1) does Open foam perform stress analysis in 3D domains ?
2)Is it possible to perform thermo-fluidodynamic simulation of a fluid with phase change (e.g: solidification of metal in a mould)

Thank you


Giuseppe
  Reply With Quote

Old   February 15, 2005, 04:11
Default Hi Guiseppe, the problem i
  #10
Mattijs Janssens (Mattijs)
Guest
 
Posts: n/a
Hi Guiseppe,

the problem is that Adventure/msh does not seem to output any patch information. (correct me if I'm wrong)

1) yes, stressedFoam (finite volume stress) or stressedFemFoam (finite element stress)

Mattijs
  Reply With Quote

Old   February 15, 2005, 05:02
Default 2) Yes but we don't yet inclu
  #11
Henry Weller (Henry)
Guest
 
Posts: n/a
2) Yes but we don't yet include a sample application for this. However, if you have the model for the process you should be able to adapt the example codes we do supply for your purpose.
  Reply With Quote

Old   February 15, 2005, 17:26
Default Mattijs, it is correct what
  #12
Giuseppe (Giuseppe)
Guest
 
Posts: n/a
Mattijs,
it is correct what you say.
Anyway during the conversion mshToFoam produces the points, faces, cells files.
It also produces a boundary file with all the surface triangles.
The problem I want to solve is the following: the patches can be the union of one ore more boundary faces of the mesh.
I would like to develop a program to select the faces, apply the boundary condition and create a corrected boundary file and initial values directory.

Question

1) does stressedFoam or stressedFemFoam perform only plane stress or plane strain analysis or it is possible to perform also generic structural analysis ?

Henry, I will try to adapt some example to fit my need to simulate casting process.


Giuseppe
  Reply With Quote

Old   February 15, 2005, 17:47
Default Hi, Giuseppe, For the limi
  #13
Pei-Ying Hsieh (Hsieh)
Guest
 
Posts: n/a
Hi, Giuseppe,

For the limited time that I played with Netgen, it allows you to select the face(s) and set a boundary condition number (1, 2 , 3 ..etc.). Using netgenToFoam utility, the boundary file can be edited to the correct physical boundary conditions (such as inlet, outlet..).

In this CAD to foam topic, I think that the strongest point of Netgen is that it can import STEP format. I think STEP is much better(easier?) than IGES and stl.

I think that based on what you describe, your tool will be very cool (similar to gambit, but, gambit does not let the users define initial condition). Is there a possibility add STEP conversion into your tool?

Pei
  Reply With Quote

Old   February 15, 2005, 18:00
Default Hi Pei, I agree with you abo
  #14
Giuseppe (Giuseppe)
Guest
 
Posts: n/a
Hi Pei,
I agree with you about Netgen possibilities.
There is a problem: I tried to import and mesh complex geometry (stl, stp, igs) in Netgen: generally Netgen is not able to mesh them (perhaps I don't make the correct setup).
The possibility of Netgen to import igs and stp relies on the fact that Netgen uses the OpenCascade modules.
I tried to understand how to use OpenCascade in my program: the problem is to make the java Wrappers.
For Python exists PythoCascade (OpenCascade wrappers for Python).
For Java (my program uses Java) I don't know if exist OpenCascade wrappers or if I have to use the JNI.

Giuseppe
  Reply With Quote

Old   February 15, 2005, 18:07
Default I think many people and espec
  #15
Eugene de Villiers (Eugene)
Guest
 
Posts: n/a
I think many people and especially those just starting out with OpenFOAM would find an integrated mesher/pre-processor useful.

Re your questions:
Both stress solvers are 3D.

If you want to modify a code for casting, I suggest starting from the two-phase VOF codes interFoam.
  Reply With Quote

Old   February 16, 2005, 04:59
Default To create boundary regions (p
  #16
Mattijs Janssens (Mattijs)
Guest
 
Posts: n/a
To create boundary regions (patches) you can

- use the mesh/manipulation/patchTool/runPatchTool
utility. It allows you to select faces, collect them in a set and create a patch from them. It is not very nice though and I'd love to scrap it (though the auto-patch facility is nice)

- use the autoPatch utility. It will generate patches on all regions separated by feature edges. Works great for simple geometries like lid-driven cavity

- createPatch can add patches together or take a faceSet (list of face labels) and create a patch from that. faceSets can be created using the faceSet utility.

- if you have a surface with the correct region information (e.g. 'SOLID..ENDSOLID' in stl) you can apply that information using surfaceToPatch which will take over the region information onto the nearest boundary face.

- if you're feeling adventurous: you can edit the patch names and types in the polyMesh/boundary by hand. Do not change the start and size parameters since they should be consistent with the mesh itself.

Mattijs
  Reply With Quote

Old   February 17, 2005, 09:52
Default Thank you Mattijs. For Pei
  #17
Giuseppe (Giuseppe)
Guest
 
Posts: n/a
Thank you Mattijs.

For Pei:
were is located the netgenToFoam utility ?


Giuseppe
  Reply With Quote

Old   February 17, 2005, 18:32
Default HI, Giuseppe I got the netg
  #18
Pei-Ying Hsieh (Hsieh)
Guest
 
Posts: n/a
HI, Giuseppe

I got the netgenToFOam utility from Mattijs. Please send me your email address so that I can email you.

Pei

peiying2003@yahoo.com
  Reply With Quote

Old   February 20, 2005, 07:13
Default Hi Pei, I sent you an e-mail.
  #19
Giuseppe (Giuseppe)
Guest
 
Posts: n/a
Hi Pei,
I sent you an e-mail.
Than you in advance.

Giuseppe

P.S.: I have seen that a new release of Salome is ready(http://www.salome-platform.org/). My first impression is that this is a very powerfull tool for pre and post processing.

Also OpenCascade 5.2 is ready (http://www.opencascade.org/)
  Reply With Quote

Old   August 8, 2005, 10:30
Default Hi Pei, Mattijs, Giuseppe
  #20
New Member
 
G Gruber
Join Date: Mar 2009
Location: Bavaria, Germany
Posts: 22
Rep Power: 8
gruber2 is on a distinguished road
Hi Pei, Mattijs, Giuseppe

We are a Heating Company and want to Import 3D-Models from our CATIA System to OpenFOAM.
As it is described, I want to Export the 3D-Models from CATIA as STEP-Files, import and mesh it in netgen and transfer it with 'netgenToFoam' to OpenFOAM.

Please send me the 'netgenToFoam'-Tool or tell me where i can download it.

My email address is: gerhard.gruber@wolf-heiztechnik.de
gruber2 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
Mesh and geometry import in cfx-pre Francesco CFX 7 May 30, 2012 08:04
import geometry circle CFX 0 December 15, 2008 15:27
Import geometry Cristiano CFX 2 April 14, 2008 21:44
Import 2D Geometry to Gambit Nathan Main CFD Forum 2 March 29, 2008 11:31
Import geometry from .stl cad format Tino CD-adapco 1 October 4, 2001 08:26


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