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

[Salome] mesh conversion Salome --> OpenFoam

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 21, 2010, 10:19
Default mesh conversion Salome --> OpenFoam
  #1
Senior Member
 
Join Date: Feb 2010
Posts: 213
Rep Power: 17
vaina74 is on a distinguished road
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
STEP6 Check mesh. run:
Code:
checkMesh
STEP7 If checkMesh reports no error, change dimensions. To convert from mm to m, we must type
Code:
transformPoints -scale '(0.001 0.001 0.001)'
STEP8 Change physical boundaris: enter file constant/polyMesh/boundaries and edit entries according to your case

I have a problem. At STEP5 I obtain:

Code:
/*---------------------------------------------------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  1.6                                   |
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
Build  : 1.6-53b7f692aa41
Exec   : ideasUnvToFoam mesh.unv
Date   : Mar 21 2010
Time   : 14:40:56
Host   : giulia-laptop
PID    : 7755
Case   : /home/giulia/OpenFOAM/OpenFOAM-1.6/run/hydrofoil
nProcs : 1
SigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time



cannot open file

file: /home/giulia/OpenFOAM/OpenFOAM-1.6/run/hydrofoil/system/controlDict at line 0.

    From function regIOobject::readStream()
    in file db/regIOobject/regIOobjectRead.C at line 62.

FOAM exiting
Can you help me, please?
vaina74 is offline   Reply With Quote

Old   March 21, 2010, 10:52
Default
  #2
Senior Member
 
Philippose Rajan
Join Date: Mar 2009
Location: Germany
Posts: 552
Rep Power: 25
philippose will become famous soon enough
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:
<case name>
|
|--> 0
| |--> p
| |--> U
| |--> ... <the folder could also be left empty>
|
|--> constant
| |--> transportProperties
| |--> RASProperties
| |--> ... <the folder could also be left empty>
|
|--> system
| |--> controlDict <this file must be present>
| |--> fvSolution
| |--> fvSchemes
| |--> ...
|
|--> ...
Once this structure is available, you can run the mesh conversion routine, and this will create a folder called polyMesh within the constant folder, with the mesh in OpenFOAM format.

Hope this helps...

Philippose
philippose is offline   Reply With Quote

Old   March 21, 2010, 12:19
Default
  #3
Senior Member
 
Join Date: Feb 2010
Posts: 213
Rep Power: 17
vaina74 is on a distinguished road
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
vaina74 is offline   Reply With Quote

Old   March 21, 2010, 14:13
Default
  #4
Senior Member
 
Philippose Rajan
Join Date: Mar 2009
Location: Germany
Posts: 552
Rep Power: 25
philippose will become famous soon enough
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:
<case name>
|
|--> system
| |
| |--> controlDict <basic simulation run information - mandatory>
| |--> fvSolution <solver selection / solver settings for the various solved variables (p, U, k, omega, etc...) - mandatory>
| |--> fvSchemes <Numerical schemes for interpolation / div / laplacian / etc... - mandatory>
|
|--> constant
| |
| |--> polyMesh <folder containing the mesh - mandatory>
| | |--> boundary <boundary specifications for mesh patches - mandatory>
| | |--> points <co-ordinates of the points which make up the mesh - mandatory>
| | |--> faces <faces (specified as point IDs) which make up the mesh - mandatory>
| | |--> owner <owner cell of each face - mandatory>
| | |--> neighbour <neighbour cell of each face - mandatory>
| |
| |--> RASProperties <settings related to the turbulence model - mandatory (for RANS based turbulence models)>
| |--> transportProperties <settings related to the fluid medium - mandatory>
| |
| |--> 0
| | |--> p <BCs and initialisation of the pressure field for mesh interior and boundary patches - mandatory>
| | |--> U <BCs and initialisation of the velocity field for mesh interior and boundary patches - mandatory>
| | |--> k <BCs and initialisation of the turbulent kinetic energy (k) field for mesh interior and boundary patches - mandatory>
| | |--> epsilon/omega <BCs and initialisation of the turbulent dissipation field for mesh interior and boundary patches - mandatory>
Usually, the folder polyMesh and its contents are automatically generated by the mesh conversion tool that you use. The rest of the files need to be either created by the user, or copied from a similar case (such as a tutorial case).

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
philippose is offline   Reply With Quote

Old   March 22, 2010, 06:13
Default
  #5
Senior Member
 
Join Date: Feb 2010
Posts: 213
Rep Power: 17
vaina74 is on a distinguished road
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.
vaina74 is offline   Reply With Quote

Old   October 17, 2010, 08:13
Default
  #6
Senior Member
 
maysmech's Avatar
 
Join Date: Jan 2010
Posts: 347
Blog Entries: 2
Rep Power: 17
maysmech is on a distinguished road
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?
maysmech is offline   Reply With Quote

Old   October 18, 2010, 08:34
Default
  #7
Senior Member
 
Elvis
Join Date: Mar 2009
Location: Sindelfingen, Germany
Posts: 620
Blog Entries: 6
Rep Power: 24
elvis will become famous soon enough
Quote:
Originally Posted by maysmech View Post
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?
you mean groups for inlet outlet etc.

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
elvis is offline   Reply With Quote

Old   October 19, 2010, 03:10
Default
  #8
Senior Member
 
maysmech's Avatar
 
Join Date: Jan 2010
Posts: 347
Blog Entries: 2
Rep Power: 17
maysmech is on a distinguished road
Thanks Elvis,
I'll check it
maysmech is offline   Reply With Quote

Old   October 19, 2010, 03:35
Default
  #9
Senior Member
 
maysmech's Avatar
 
Join Date: Jan 2010
Posts: 347
Blog Entries: 2
Rep Power: 17
maysmech is on a distinguished road
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?
maysmech is offline   Reply With Quote

Old   November 3, 2010, 06:46
Default
  #10
Member
 
hamdi
Join Date: Mar 2009
Posts: 75
Rep Power: 17
hamcer is on a distinguished road
Quote:
Originally Posted by maysmech View Post
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?

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
hamcer is offline   Reply With Quote

Old   November 3, 2010, 10:35
Default
  #11
Senior Member
 
maysmech's Avatar
 
Join Date: Jan 2010
Posts: 347
Blog Entries: 2
Rep Power: 17
maysmech is on a distinguished road
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 .
maysmech is offline   Reply With Quote

Old   November 3, 2010, 13:03
Default
  #12
Member
 
hamdi
Join Date: Mar 2009
Posts: 75
Rep Power: 17
hamcer is on a distinguished road
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
hamcer is offline   Reply With Quote

Old   January 5, 2011, 09:41
Default
  #13
Senior Member
 
Francois Beaubert
Join Date: Mar 2009
Location: Lille, France
Posts: 147
Rep Power: 17
francois is on a distinguished road
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

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.
Cheers

François
Attached Images
File Type: jpg mesh_before_merging_nodes.jpg (47.8 KB, 292 views)
File Type: jpg mesh_selected_nodes_for_merging.jpg (45.7 KB, 186 views)
File Type: jpg mesh_after_merging_nodes.jpg (47.5 KB, 200 views)
File Type: jpg 3D_mesh_non-uniform4.jpg (30.7 KB, 161 views)
Attached Files
File Type: zip test_import_OF_extrusion.hdf.zip (46.5 KB, 20 views)
francois is offline   Reply With Quote

Old   March 3, 2011, 12:17
Default
  #14
New Member
 
Alexey Kochevsky
Join Date: Nov 2010
Location: Munich, Germany
Posts: 16
Rep Power: 16
alkochevsky is on a distinguished road
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
alkochevsky is offline   Reply With Quote

Old   March 3, 2011, 13:58
Default
  #15
Senior Member
 
Join Date: Feb 2010
Posts: 213
Rep Power: 17
vaina74 is on a distinguished road
I had the same problem some time ago and I was explained that:
Quote:
pyramid elements may be generated by SMESH, and exist in the MED format, but do not exist in the UNV format specification, so converters could either export them as degenerate hexahadra (with 4 merged vertices), or ignore them. Most choose to ignore them, as is the case here, which means you are more or less stuck, unless you can find a way not to generate pyramid elements (either not using quadrangle mapping, or doing full blocking, but not mixing both, as this will require pyramids for the transition at some point).
The best solution for OpenFoam would be to add a MEDtoFoam converter, as the MED format can handle pyramids, polyhedra,... but this would require someone working with OpenFoam contributing it...
If you really need pyramids for the transition, take a look at this thread on the SALOME users forum and try some tricky procedures through MED meshes and gmsh OpenFOAM converter.
vaina74 is offline   Reply With Quote

Old   March 9, 2011, 04:52
Default
  #16
New Member
 
Alexey Kochevsky
Join Date: Nov 2010
Location: Munich, Germany
Posts: 16
Rep Power: 16
alkochevsky is on a distinguished road
Thank you for the explanation and the link, I have just tried the procedure described over there, the conversion was successful.
alkochevsky is offline   Reply With Quote

Old   May 2, 2011, 10:08
Default
  #17
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,711
Blog Entries: 6
Rep Power: 52
Tobi has a spectacular aura aboutTobi has a spectacular aura aboutTobi has a spectacular aura about
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
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
/*---------------------------------------------------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  1.7.x                                 |
|   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
Build  : 1.7.x-2d00769395fa
Exec   : ideasUnvToFoam Mesh_1.unv
Date   : May 02 2011
Time   : 15:03:39
Host   : shorty
PID    : 6882
Case   : /home/tobi/OpenFOAM/tobi-1.7.x/run/test
nProcs : 1
SigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time

Processing tag:2411
Starting reading points at line 3.
Read 10562 points.

Processing tag:2412
Starting reading cells at line 21130.
First occurrence of element type 22 for cell 1 at line 21131
--> FOAM Warning : 
    From function readCells(IFstream&, label&)
    in file ideasUnvToFoam.C at line 461
    Reading "Mesh_1.unv" at line 21131
    Cell type 22 not supported


--> FOAM FATAL IO ERROR: 
Attempt to get back from bad stream

file: IStringStream.sourceFile at line 0.

    From function void Istream::getBack(token&)
    in file db/IOstreams/IOstreams/Istream.C at line 38.

FOAM exiting
What did i get wrong ?


Regards Tobi
Attached Images
File Type: jpg salomeMesh.jpg (63.5 KB, 220 views)
Tobi is offline   Reply With Quote

Old   May 2, 2011, 11:02
Default
  #18
Senior Member
 
Join Date: Feb 2010
Posts: 213
Rep Power: 17
vaina74 is on a distinguished road
I think something is wrong in your mesh creation: the openFOAM converter cannot manage some elements. Could you attach your case or dump it?
vaina74 is offline   Reply With Quote

Old   May 2, 2011, 12:12
Default
  #19
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,711
Blog Entries: 6
Rep Power: 52
Tobi has a spectacular aura aboutTobi has a spectacular aura aboutTobi has a spectacular aura about
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
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
Tobi is offline   Reply With Quote

Old   May 2, 2011, 13:23
Default
  #20
Senior Member
 
Join Date: Feb 2010
Posts: 213
Rep Power: 17
vaina74 is on a distinguished road
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.
lth likes this.
vaina74 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
[Salome] Problems for creating mesh in salome to OPENFOAM bye bye my blue OpenFOAM Meshing & Mesh Conversion 8 December 5, 2023 01:57
decomposePar problem: Cell 0contains face labels out of range vaina74 OpenFOAM Pre-Processing 37 July 20, 2020 06:38
[Commercial meshers] Mesh conversion .gtm to OpenFOAM ansab OpenFOAM Meshing & Mesh Conversion 2 December 6, 2016 14:48
[Commercial meshers] Problems with ANSYS mesh conversion tdog OpenFOAM Meshing & Mesh Conversion 1 March 31, 2016 18:36
fluent add additional zones for the mesh file SSL FLUENT 2 January 26, 2008 12:55


All times are GMT -4. The time now is 06:02.