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

Mesh to points cells faces and boundaries files

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

Reply
 
LinkBack Thread Tools Display Modes
Old   April 28, 2005, 12:36
Default Hi, Is there any visual too
  #1
Senior Member
 
Billy
Join Date: Mar 2009
Posts: 167
Rep Power: 8
billy is on a distinguished road
Hi,

Is there any visual tool to build the initial geometry for blockMesh?

I have noticed that OpenFOAM mesh data is very structured. The internal faces come first and then boundary faces come last. Also boundary faces are sequential for a given patch. I think this is to help create the patches.

My question is how do I translate a mesh with only a list of nodes and and a list of elements (completly unstrucutured) into OpenFOAM. I can develop a program to find the points, faces and cells but how do I extract the patches from this information?
billy is offline   Reply With Quote

Old   April 28, 2005, 13:08
Default Try gmsh. It allows you to do
  #2
Super Moderator
 
Mattijs Janssens
Join Date: Mar 2009
Posts: 1,416
Rep Power: 16
mattijs is on a distinguished road
Try gmsh. It allows you to do put coordinates in space (not very interactively though) and can also generate a mesh from it. Or you can probably extract the points from its .geo to use inside blockMesh.

I once used a cad package and put blocks where I wanted the blockMesh blocks and then took over the point locations. If you come across any interesting other way please let us know.

To translate those meshes have a look at one of the existing converters. Almost all use a format like you describe (i.e. cell shape and vertices) E.g. gmshToFoam.

Boundaries are usually input as a list of faces (i.e. triangles or quads using boundary points)

The polyMesh constructor in e.g. gmshToFoam will automatically convert this format into the OpenFOAM face based format.
mattijs is offline   Reply With Quote

Old   April 28, 2005, 14:53
Default Heya, I have noticed that O
  #3
Senior Member
 
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,758
Rep Power: 21
hjasak will become famous soon enough
Heya,

Quote:
I have noticed that OpenFOAM mesh data is very structured
Yes, that's right - I like my life well organised and it helps with the efficiency as well :-)

If you happen to have an external mesh format in terms of points, cell shapes and boundary faces, I've got just the thing for you. Have a look at:

OpenFOAM-1.1/src/OpenFOAM/lnInclude/polyMesh.H

(for me around line 288):

//- Construct from cell shapes
polyMesh
(
const IOobject& io,
const pointField& points,
const cellShapeList& shapes,
const faceListList& boundaryFaces,
const wordList& boundaryPatchNames,
const wordList& boundaryPatchTypes,
const word& defaultBoundaryPatchType,
const wordList& boundaryPatchPhysicalTypes
);


This constructor will take a list of points, cell shapes and a list of lists of boundary faces and make a foam mesh. In other words, it will calculate and re-order the faces for you. If you haven't got the boundary faces, you can keep the list empty and all external faces will end up in the default patch + you can re-patch the mesh later.

This is how some of the simpler mesh converters are written, have a look at the fluent and gambit converter for examples of use.

Enjoy,

Hrv
__________________
Hrvoje Jasak
Providing commercial FOAM/OpenFOAM and CFD Consulting: http://wikki.co.uk
hjasak is offline   Reply With Quote

Old   April 28, 2005, 15:08
Default Thank you very much for your r
  #4
Senior Member
 
Billy
Join Date: Mar 2009
Posts: 167
Rep Power: 8
billy is on a distinguished road
Thank you very much for your reply.

I will look into gmsh.

About the meshing, I thought of developing a tool for translating the mesh and discovering the patches (initial guess based on the connectivity and angles between boundary faces). Do you think this would be useful?

Why does the ideasToFoam translator convert ansys files and not the universal (*.unv) file?
billy is offline   Reply With Quote

Old   April 28, 2005, 15:17
Default As for the discovering of patc
  #5
Super Moderator
 
Mattijs Janssens
Join Date: Mar 2009
Posts: 1,416
Rep Power: 16
mattijs is on a distinguished road
As for the discovering of patches: have a look at autoPatch (in the utilities/mesh/manipulation directory) which does exactly what you describe.
mattijs is offline   Reply With Quote

Old   April 28, 2005, 15:24
Default > Why does the ideasToFoam tra
  #6
Senior Member
 
Join Date: Mar 2009
Posts: 854
Rep Power: 13
henry is on a distinguished road
> Why does the ideasToFoam translator convert ansys files and not the universal (*.unv) file?

Because that is what we were given by the people who asked for the converter and it was easier.
henry is offline   Reply With Quote

Old   April 28, 2005, 15:27
Default One more thing!! I have be
  #7
Senior Member
 
Billy
Join Date: Mar 2009
Posts: 167
Rep Power: 8
billy is on a distinguished road
One more thing!!

I have been searching for a tool to some way help me import / build geometries and visualize models with OpenFOAM.

I have looked and I can't find anyhting simple and easy to use. I thought about programming something myself using:

- Qt and QGLWidget,
- KDE-based with QGLWidget,
- GLUI and GLUT. I like this one problem is that I can't seem to get GLUI working correctly.

I don't know about Java 3D, has anyone used it? Is is easy to install and learn? I am open to suggestions.
billy is offline   Reply With Quote

Old   April 28, 2005, 15:44
Default A fourth one: the fox toolkit.
  #8
Super Moderator
 
Mattijs Janssens
Join Date: Mar 2009
Posts: 1,416
Rep Power: 16
mattijs is on a distinguished road
A fourth one: the fox toolkit. Ports very nicely and has nice OpenGL demo.

Java3D is quite nice but very hard to couple to C++ (if you would like to use OpenFOAM mesh routines or dictionary handling). Have a look at the patchTool in the mesh/manipulation directory.

Wasn't Guiseppe also trying to make some visual tool? (have a search on this site)
mattijs is offline   Reply With Quote

Old   April 29, 2005, 08:46
Default I have downloaded gmsh and it
  #9
Senior Member
 
Billy
Join Date: Mar 2009
Posts: 167
Rep Power: 8
billy is on a distinguished road
I have downloaded gmsh and it seems very good. I am having problems to model complex shapes. Does anyone know of a good CAD tool for linux for solid modelling and meshing? I have seen OpenCASCADE and SALOME but I can't get them installed properly.

Fox toolkit is also very nice and comes with great examples. I will try to learn more about it.

Thanks for the tips.
billy is offline   Reply With Quote

Old   April 29, 2005, 13:33
Default Hi, Billy, I have been usin
  #10
Senior Member
 
Pei-Ying Hsieh
Join Date: Mar 2009
Posts: 317
Rep Power: 9
hsieh is on a distinguished road
Hi, Billy,

I have been using netgen (with step format generated using SolidWorks). I have built complex geometry meshes without any problem. There are two drawbacks assoicated with netgen:

1. only supports Tet elements.
2. can have only one volume.

pei
hsieh is offline   Reply With Quote

Old   April 30, 2005, 12:02
Default Hello everyone, I finally i
  #11
Senior Member
 
Billy
Join Date: Mar 2009
Posts: 167
Rep Power: 8
billy is on a distinguished road
Hello everyone,

I finally imported my meshes into OpenFOAM. I converted all of them into gmsh format (list of nodes and elements) and then used gmshToFoam utility as suggested here. It worked great, organized all the data and wrote the points, faces and cells files. Then I ran the autoPatch utility and it reconstructed the boundary patches automatically. This also worked very well.

The funny thing is that I still can't translate the meshes built using gmsh. It gives an error about missing a face or something. However, this doesn't matter for now because the other method works very well.

I am very impressed with OpenFOAM capabilities. I wish that I can also contribute to OpenFOAM development some day.

Thank you very much.
billy is offline   Reply With Quote

Old   April 30, 2005, 12:18
Default Hi Billy, Did you use the l
  #12
Super Moderator
 
Mattijs Janssens
Join Date: Mar 2009
Posts: 1,416
Rep Power: 16
mattijs is on a distinguished road
Hi Billy,

Did you use the latest gmshToFoam.C? It has some additional commandline options (-invertHex, -invertPrism) and you'll need to run checkMesh afterwards on the resulting OpenFOAM mesh until you figured out the correct option.

This gmshToFoam.C is posted somewhere. Have a search.
mattijs is offline   Reply With Quote

Old   April 30, 2005, 18:20
Default Hi Mattijs, Maybe it is not
  #13
Senior Member
 
Billy
Join Date: Mar 2009
Posts: 167
Rep Power: 8
billy is on a distinguished road
Hi Mattijs,

Maybe it is not the latest version, since I am using OpenFOAM 1.0.2. I will check that out. Thanks.
billy is offline   Reply With Quote

Old   May 4, 2005, 10:32
Default Hi, Mattijs, Can you give a
  #14
Senior Member
 
Pei-Ying Hsieh
Join Date: Mar 2009
Posts: 317
Rep Power: 9
hsieh is on a distinguished road
Hi, Mattijs,

Can you give a brief explaination how autoPatch works? I took a look at it. It requires input of an angle. Does it mean that it will try to find the boundary faces with the specified angle? What if I have a curved boundary patch (the angles of the boundary faces of this boundary patch may vary)? Thanks!

Pei
hsieh is offline   Reply With Quote

Old   May 4, 2005, 17:20
Default IIRC autoPatch groups faces in
  #15
Senior Member
 
Eugene de Villiers
Join Date: Mar 2009
Posts: 725
Rep Power: 12
eugene is on a distinguished road
IIRC autoPatch groups faces in boundary regions that are not seperated by a corner of the specified angle (i.e. feature lines). Note autoPatch will replace all old patches with feature line delineated patches.
eugene is offline   Reply With Quote

Old   May 13, 2005, 14:20
Default hello Billy ; i am Trying
  #16
New Member
 
alain nguenkem kamgang
Join Date: Mar 2009
Location: Stuttgart, Baden würtemberg, Germany
Posts: 3
Rep Power: 8
akamgang is on a distinguished road
hello Billy ;

i am Trying to do a volume Mesh but i will like to know if there are some Basich ron rules concerning the Volume Mesh ???
And Please tell hoe to view a file after Exporting on MED Format ??? i have tried to export a file after meshind and i could not open it after , please tell me how to do it.
thanks.
akamgang is offline   Reply With Quote

Old   May 14, 2005, 06:49
Default Hi Alain, I do not recogniz
  #17
Senior Member
 
Billy
Join Date: Mar 2009
Posts: 167
Rep Power: 8
billy is on a distinguished road
Hi Alain,

I do not recognize the MED format. Do you mean MSH format?

Until now, I have only used the MSH format of GMSH + autoPatch utility to import meshes into OpenFOAM.
billy is offline   Reply With Quote

Old   May 17, 2005, 18:34
Default Hi Billy ; Do you know the
  #18
New Member
 
alain nguenkem kamgang
Join Date: Mar 2009
Location: Stuttgart, Baden würtemberg, Germany
Posts: 3
Rep Power: 8
akamgang is on a distinguished road
Hi Billy ;

Do you know the Open souce Programm Salome
that which i have been asking you is a specific format base on Salom , and i have not found any ook where i can get information concerning Salome.Please if you have any information about this please just tell .
Alain.
Thanks
akamgang is offline   Reply With Quote

Old   April 18, 2006, 15:00
Default Hi, Billy, It looked like y
  #19
Senior Member
 
Pei-Ying Hsieh
Join Date: Mar 2009
Posts: 317
Rep Power: 9
hsieh is on a distinguished road
Hi, Billy,

It looked like you have successfully converted your mesh to gmsh format and then converted to OpenFOAM format using gmshToFoam. I have a mesh exported to Ansys format from I-DEAS. I might be able to convert the Ansys format to gmesh and do exactly what you did. In the gmsh format, do you know what reg-phys and reg-elem are?

reg-phys: the number of the physical entity to which the element belongs.
reg-element: the number of the elementary entity to which the element belongs.

I do not understant these definitions. What is elementary entity?

It will be appreciated if you can shed some light on this.

pei
hsieh is offline   Reply With Quote

Old   April 18, 2006, 15:38
Default Hi, Billy, I just found out
  #20
Senior Member
 
Pei-Ying Hsieh
Join Date: Mar 2009
Posts: 317
Rep Power: 9
hsieh is on a distinguished road
Hi, Billy,

I just found out that I-DEAS does not support pyramid. I have a part with two volumes, one volume was meshed with Hex and one volume was meshed with Tet. So, on one face of some Hex elements, the Quad face was split into two triangles (this occurs on the Hex element that has Tet neighbours). Can OpenFOAM handle this situation?

Pei
hsieh 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
About OpenFOAM and concave faces or cells mbeaudoin OpenFOAM Mesh Utilities 2 March 29, 2015 07:53
Interpolation between faces and points of a polyPatch hartinger OpenFOAM Running, Solving & CFD 8 January 27, 2015 18:55
interpolation on faces and wall boundaries ca Main CFD Forum 0 September 2, 2008 12:42
Mesh hard points on faces Ashton Peters FLUENT 4 March 15, 2005 16:43
Beginner: cell faces of surface cells Sunlight007 CD-adapco 0 August 24, 2003 17:19


All times are GMT -4. The time now is 12:16.