mesh conversion Salome --> OpenFoam
I generated a grid around a blade section with Salome and I want to import it in OpenFOAM. I set the domain boundaries, as in this procedure definition (from the Salome forum):
STEP1 Create groups of faces for all patches (undefined sufaces will became in OpenFOAM as defaultFaces patch). For example, for internal simulation, we need 3 groups: inlet, outlet and walls. STEP2 Mesh geometry. STEP3 Create group of faces for mesh. This is done by using Create group command in SMESH module and selecting checkbox faces. In the appeared dialog box we must enter name for group (or patch in OpenFOAM), e.g., inlet, outlet, walls. Then, we must select Group using geometry option and click on interesting group in tree view of meshed solid. STEP4 Export your mesh to I-DEAS format file (filename.unv). This file should be saved to the root of OpenFOAM case (where directories 0, constant, system). STEP5 Run utility ideasUnvToFoam. For example, if we are using terminal in case root, we should type: Code:
ideasUnvToFoam filename.unv Code:
checkMesh Code:
transformPoints -scale '(0.001 0.001 0.001)' I have a problem. At STEP5 I obtain: Code:
/*---------------------------------------------------------------------------*\ |
Hello,
A Good Afternoon to you! In order to get: ideasUnvToFoam <filename>.unv working, you need to have a valid controlDict file present in the <case name>/system folder. Usually what is done, is to create a skeleton OpenFOAM case, with the following structure: Quote:
Hope this helps... Philippose |
Thank you for your reply. I can't believe someone would help me on sunday :)
I read about creating a new case in the user guide, but I found 3 tutorials for SimpleFoam. The subdirectories are not all the same ones, so i got confused. For example, I could copy the pitzDaily tutorial and edit the case files, but I don't know which subdirectories or files are to be deleted. My case is about a blade section (a 'hydro' foil) and I'll apply a turbulent model. I'm a beginner, as you can see ;) |
Hello again :-)!
So... as you rightly noticed, the file structure for the different OpenFOAM cases are not always the same.... however, I am sure you would have noticed some folders and files to be always present in most OpenFOAM cases. In essence, there is a minimal setup required for running most OpenFOAM cases. In addition to this minimal setup, some special solvers or configurations may require additional files. The typical structure of an OpenFOAM case used for an incompressible, turbulent simulation (for example, simpleFoam) is as given below: Quote:
The contents of the 0 time-step folder also has to be modified depending on the boundary conditions for a particular simulation. For a specific family of simulations (such as incompressible, turbulent using simpleFoam), usually the contents of the system and constant (except for the polyMesh folder of course) folders will need only minimal modifications across simulations. For further information regarding the folder structure of an OpenFOAM simulation, and the various files used, refer to the OpenFOAM User Manual. Have a nice evening ahead! Philippose |
Thanks a lot, I got it. I create a new case and the mesh seems ok :)
Now I'm going to edit the configuration files for my simulation. |
hello,
i've created a mesh in Salome but i don't know how can i create a group. my case is a simple lid-drive cavity. can anyone who know about creation of group in Salome help me? |
Quote:
http://www.caelinux.org/wiki/downloads/docs/Pipe2007/PipeMesh.htm http://www.caelinux.org/wiki/index.p...ELinux_2007.29 tutorial is for a older version of Salome but easy to transfer to new version |
Thanks Elvis,
I'll check it :) |
i've succeeded to create group and export it to OpenFOAM.
But i don't know how to define cyclic B.C for two face for example front and back of a backward facing step case. Any idea about this problem? |
Quote:
Hi, you can find an example which use the kind of cyclic boundary in these tutorials: ~ OpenFOAM/hamdi-1.7.1/run/tutorials/incompressible/simpleSRFFoam/mixer/0 OR ~ OpenFOAM/hamdi-1.7.1/run/tutorials/incompressible/channelFoam/channel395 OR ~ OpenFOAM/hamdi-1.7.1/run/tutorials/incompressible/boundaryFoam/boundaryWallFunctions etc... hope that you help you Hamcer |
Thanks Hamdi,
I checked your mentioned cases. all of their meshes were created by blockMeshDict file. they are not conversion from other softwares like Salome. And as you know when we convert from other softwares, the mesh is imported and there is no need to blockMeshDict and blockMesh command. and in this situation (when importing from Salome) it doesn't understand which faces should be cyclic together . |
hi maysam
here is an example that uses cyclic boundary. Test cases are in the folder tubomachinery (especially turboMachinery/tutorials/cgnsConverters/test123 the original mesh is made with CGNS you must install the utility cgnsTofoam, see: http://openfoamwiki.net/index.php/Si...GNS_Converters or if you have Ubuntu you can install it with synaptic (also OpenFOAM, OpenFOAM-dev, and paraview openfoamparaview) and do not forget m4 pakage hope that help you. hamdi |
5 Attachment(s)
Hi all,
Happy new year to everybody ! I'm trying to do my best to learn Salome but I'm now facing a point where I can't go any further and need some kind help http://www.salome-platform.org/forum...iley_smile.png The goal is simple: try to build a 3D mesh with a non-uniform revolution of 2D elements. It looks rather simple isn't it ? But I can't do it ... My workflow is as follow: 1. I build a Face 2. I use an Arc as a path for the extrusion 3. I mesh the Face with Quadrangle Mapping 4. I mesh the Arc with a Wire discretisation and a non-uniform 1D hypothesis 5. I mesh the volume using the 3D extrusion algorithm: Then menu Modification > Extrusion along a path I select the 2D elements of my Face then the path mesh, the starting node and the base point The 3D mesh is created and looks like OK but in fact it contains no Prisms (only Hexahedrons) . The suggested procedure consists of merging the duplicate nodes.This creates prisms elements but the numbers of prisms doesn't seems to be wrong. I've made a very basic mesh to illustrate this problem: * It's a square face meshed with Quadrangle Mapping which is extruded along an Arc. * I mesh the Arc with a Wire discretization and a non-uniform 1D hypothesis. * I mesh the volume using the 3D extrusion algorithm. In the screenshot of the resulting mesh using the Extrusion along the non-uniform meshed Arc before merging the duplicate nodes you can see some "holes" in the mesh: don't know if it's graphical or not. There is no prisms before merging duplicated nodes. You can see that 16 prisms were created after merging the duplicate nodes BUT this number seems to be wrong I think the correct prisms number should rather be 6*4=24 but I may be wrong here. There is still some "holes" in the mesh. The mesh shown in wireframe mode is also strange. It looks like some prisms are indeed missing. You will find the corresponding hdf file before merging duplicate nodes. What's wrong here ? I'm using the Salome_5.1.4 32 bits Universal Package Any help/advice will be greatly appreciate.:D Cheers François |
Hi all,
it is to be mentioned that pyramid-shaped cells are missed by exporting a mesh in an I-DEAS format file (filename.unv) (I use SALOME 5.1.5). It's a pity, otherwise I would have some success in generation of nice hexa-shaped boundary cells near walls, with tetra-cells for the core flow. Unfortunately, pyramid cells seem to be inevitably needed for transition between hexa and tetra cells. Is it possible to get pyramid cells somehow saved in the unv-file? Regards, Alexey |
I had the same problem some time ago and I was explained that:
Quote:
|
Thank you for the explanation and the link, I have just tried the procedure described over there, the conversion was successful.
|
1 Attachment(s)
hey all,
i 've meshed a simple geometry like the steps below. after i export the mesh (unv) and start ideasUnvToFoam i get these error message Code:
tobi@shorty:~/OpenFOAM/tobi-1.7.x/run/test$ ideasUnvToFoam Mesh_1.unv Regards Tobi |
I think something is wrong in your mesh creation: the openFOAM converter cannot manage some elements. Could you attach your case or dump it?
|
Hi,
its the first time i make the mesh with Salome. I am usally using sHM but i wanna get a 2D - mesh and thats not possible with snappyHexMesh. Here my Salome hdf - file http://www.file-upload.net/download-...st.tar.gz.html Don 't know if i get everything correct. Maybe someone could help me ? Thanks for your help :) Regards Tobi |
I think you're a bit confused about meshing in SALOME and in openFOAM. About SALOME, I suggest to try the tutorials first. About openFOAM, you should read again the pre-processing section in the User Guide. You cannot manage 2D meshes, as in your case: in OpenFOAM you always have a third dimension. Anyway, you can do a lot of things with blockMesh, snappyHexMesh and other openFOAM meshing tools. When you are ready, you can follow the above procedure (and apply colours when creating mesh groups).
Hope this helps, regards. |
hi,
i am using sHM just for complex geometrys with good results. never meshed in Salome befor ... the tutorials ? thats a good idea, where did i get those tutorials ? regards tobi,... PS: sure, you get 3D-geometrys ;) but if you got just one cell in the z-direction you can use the empty patch, ... but i know what you wanna say to me :) I 've found the tutorials - thx for that advice |
I linked the tutorials I refer to in the previous post. OK, you know empty patches, but you didn't create an appropriate 3D mesh in SALOME. For your purposes, you must apply a 3D algorithm on a solid or generate a 2D mesh and then extrude it. Otherwise you can't convert anything.
|
okay thx.
i always using Catia V5 and convert it to an STL ... split it into the boundarys in Salome and mesh it with sHM. So thx for your advice. I wll have a look at the tutorials. nice evening, tobi |
Hi,..
now its working. I did something wrong in the meshing tool in Salome :) thx to you. Tobi |
Quote:
Geometry creation: #G1 In geometry module it is possible to define the airfoil via polynomial equations: New entity - Basic - Curve - Analytical and then enter the polynomial for the NACA00xx like the one described here: http://en.wikipedia.org/wiki/NACA_airfoil This creates the single side of the NACA00xx profile, the other side you can mirror, or multiply the polynomial with -1. #G2 From the two polynomial curves, create a wire. #G3 From the wire, create a face. #G4 Create a circle that encompasses the airfoil face. #G5 Create a frace from this circle. #G6 Cut the circle face with the polynomial face to get the basis for the mesh: NACA0015-CircleCut in the .hdf file. Then I've tried to generate the mesh in 2 ways: M1 : extrusion of a planar mesh #M1.1 Mesh NACA0015-CircleCut to create a planar triangular mesh. #M1.2. Extrude the mesh #M1.3 Filter based selection of face groups: There are filters now in the new version of Salome which can be superimposed. They may be based on various criteria (parametric, relationships with other geometry, and similar). Example of selecting the inletOutlet group using filters: Mesh -> Create Group -> Filter Based For a filter, if you select the Geometry to be Quadrangle, and add another filter (plus button to the right with logical AND option for the composition of filters) that states that the faces are Free faces, the result is the ring of quadrangle faces that define the inletOutlet patch. The empty patches and the airfoil have their own settings, check them out with right click to the group, and edit. #M1.4 Once this is done (the groups are there, and the mesh is extruded), I export to .unv, and see the same error you had. M2 Three dimensional extrusion algorithm, on a 3D extruded geometry #M2.1 This procedure is different from M1 in the fact that extruded geometry is produced first by extruding NACA0015-CircleCut. #M2.2 Explosion of extruded geometry into faces: unfortunately, with analytical function that represents the polynomial, if it is linear interpolated between the points, this results with like 1000 faces. I've grouped the faces that will be used for quadrangle mapping and triangle meshing. #M2.3. Create mesh on extruded geometry: 3D Extrusion algorithm #M2.4 Create submesh: extruded ring (inletOutlet of the previous mesh) is submeshed with Quadrangle (mapping) and no hypothesis is set. #M2.5 Create submesh: 2D Projection algorithm on two triangle faces (create .hdf) M2 results in an algorithm faliure. The procedure is explained for a simpler geometry here: http://www.caelinux.org/wiki/index.p...ELinux_2008.29 Obviously, I'm breaking my back here :confused:.... if anyone can tell me where I did a wrong step, it would be great! I couldn't attach the .hdf because of its size, here is where you can download it: http://www.2shared.com/file/3Yn6lIHI/NACA0015.html |
hi,
i have had a look at your file and tried a bit. Would you like to have a 2D mesh with hexaedrals? Well I think its not as simple as in ANSYS. I meshed a lot of geometrys with salome using hexaedrals but thats not easy with your geometry couse salome always wants to have "a box with four lines" to create the hexaedrals (like in Ansys cfx mesher)... well, i think you are not able to make a 2D mesh with tetraedrals. The problem is, that your airfoil has a lot of lines. Every line have to enclose a box with four lines (hope you understand me). Tobi |
Quote:
thanks a lot for your advice... I've used an .igs/.brep CAD model of an airfoil, and then the algorithm worked properly... I'll upload the .hdf again as soon as I get to my home PC. It would be great to have a structured NACA0015 airfoil mesh if you can spare one, because of the drag coefficients computation as well... Thanks again, Tomislav |
ufff i was a bit confused :)
First of all. If I mention 2D - mesh I mean a 3D mesh with one cell in one directory so you can use empty patches to do like a 2D mesh. You are creating a planar 2D triangular mesh and then you wanted to extrude it to a 3D mesh using 1 cell in the direction of extrude, right? :) I thought you wanna mesh it with hexaedrals only - sorry for miss understanding. Tobi |
Quote:
A hex mesh would be much better than triangular prism (extruded triangles), have you done something like this in Salome? |
Quote:
Hi, yes I did it very often,... Unfortunately I am not on my desk computer and have no hdf file to show you how to mesh with hex. I ll upload one on monday evening! Tobi Referencing to salome tutorials: http://www.salome-platform.org/user-...edf-exercise-1 |
First of all, i want to thank everybody who keeps up this forum :) i am studying mechanical engineering and i try to learn CDF simulation. i created simple construction elements with salome 6.5.0, created a mesh and exported it to a unv file. My problem is that i just can simulate symmetric elements like a t shaped pipe, but once my element is asymmetric nothing happens when i start paraFoam. A Friend of mine told me i should use local coordinates; could that be the mistake? and how to use local coordinates in Salome and mesh it?
Thanks |
Hi Sebastian and welcome to the forum,
I am not so familiar with the paraview code but in my case every geometrie is working. Maybe try the following: 1. create a file with the ending *.foam like Code:
touch paraview.foam Code:
paraview Tobi |
Quote:
|
Hi,
like your case I think you mean, that you can not visualize your results. You mesh is very coarse but with the right settings its possible to get a solution. I wrote you an Email. Tobi |
Hello foamers...
I have a very similiar problem. But a bit different. I exported the .unv file from salome Im using 6.6. and I create B-C and everything in OF folders. I tried to convert mesh to OF (2.1.1) mesh but I obtained this error code: Code:
/*---------------------------------------------------------------------------*\ Thx for help. Regards Roman |
Hi Roman,
like your output told you, OF can not find your file. Is your *.unv file in your case folder? |
Thank you Tobi
I had my .unv file in constant folder...after that I moved it to OF case root folder and now it works...Thank you again :) Roman |
Same problem to convert
Quote:
Code:
/*---------------------------------------------------------------------------*\ Thank you |
Just a minor hint, as most of you seem to prefer the unv-method: If you google for salomeToOpenFOAM.py you should find a short python-script which can be started from within Salome and which will export the marked mesh into a complete polyMesh-folder. For me it worked including pyramids as well...
|
Salome mesh having pyramids to openfoam
In my salome generated mesh I have some pyramids, but while exporting to UNV format salome ignores pyramid elements. Actually I need those pyramid cells so is there any way by which I can export that mesh to openfoam without removing pyramids?
|
All times are GMT -4. The time now is 12:06. |