CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Meshing & Mesh Conversion (https://www.cfd-online.com/Forums/openfoam-meshing/)
-   -   [Salome] Salome -> OpenFoam ( Export as unv) Problems encountered (https://www.cfd-online.com/Forums/openfoam-meshing/84741-salome-openfoam-export-unv-problems-encountered.html)

tibo11 February 7, 2011 18:24

Salome -> OpenFoam ( Export as unv) Problems encountered
 
Hi,
I am in Bsc of European Engineering
For my final year project , I use Salome and OpenFoam.

The problem is: the file BlockMeshDict ( in PolyMesh) is not created but all the others such as boundary,faces,neighbour,owner and point are created.
and I think that is why , I am not able to run ParaFoam

The geometry and the Mesh have been created with Salome.
I have deleted the Polymesh in the directory CONSTANT.
And I have used the terminal like that:

maillet@macbookThibault:~/OpenFOAM/Project/cavity$ ideasUnvToFoam /home/maillet/OpenFOAM/Project/GroupMesh_20.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-3776603e4c6c
Exec : ideasUnvToFoam /home/maillet/OpenFOAM/Project/GroupMesh_20.unv
Date : Feb 07 2011
Time : 23:09:06
Host : macbookThibault
PID : 2796
Case : /home/maillet/OpenFOAM/Project/cavity
nProcs : 1
SigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).

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

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

Processing tag:2412
Starting reading cells at line 24290.
First occurrence of element type 11 for cell 1 at line 24291
First occurrence of element type 41 for cell 365 at line 25383
First occurrence of element type 111 for cell 10567 at line 45787
Read 55577 cells and 10202 boundary faces.

Processing tag:2467
Starting reading patches at line 156943.
For group 1 named Top trying to read 1785 patch face indices.
For group 2 named Wall trying to read 4548 patch face indices.
For group 3 named Bottom trying to read 1786 patch face indices.
For group 4 named Inlet trying to read 9 patch face indices.
For group 5 named Outlet trying to read 14 patch face indices.
For group 6 named Pipe trying to read 1684 patch face indices.
For group 7 named Ext_Pipe trying to read 376 patch face indices.

Sorting boundary faces according to group (patch)
Constructing mesh with non-default patches of size:
Top 1785
Wall 4548
Bottom 1786
Inlet 9
Outlet 14
Pipe 1684
Ext_Pipe 376

End

[COLOR="rgb(255, 140, 0)"] maillet@macbookThibault:~/OpenFOAM/Project/cavity$ blockMesh [/COLOR]
/*---------------------------------------------------------------------------*\
| ========= | |
| \\ / 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-3776603e4c6c
Exec : blockMesh
Date : Feb 07 2011
Time : 23:10:00
Host : macbookThibault
PID : 2798
Case : /home/maillet/OpenFOAM/Project/cavity
nProcs : 1
SigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).

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



--> FOAM FATAL ERROR:
Cannot open mesh description file
"/home/maillet/OpenFOAM/Project/cavity/constant/polyMesh/blockMeshDict"


From function blockMesh
in file blockMeshApp.C at line 141.

FOAM exiting









So, If you know what is my mistake...and why the file blockMeshDict is not created
Thank you very much

Thibault

MartinB February 8, 2011 05:16

Hi Thibault,

a blockMeshDict file is only needed, if you don't have a mesh written by a mesh generator (like Salome in your case). The blockMeshDict file is not written by a mesh generator.

With the blockMesh tool from OpenFOAM you can create very good meshes for geometries with a simple topology. In most of the OpenFOAM tutorial cases the blockMesh tool is used, because it doesn't take much disk space, the mesh quality is fine, the usage is easy...

In your case just export the mesh as you did, convert it the way you did, set up your case appropriately and run your simulation. There is no blockMesh command in the sequence.

Have fun

Martin

yasmil January 8, 2013 15:42

Quote:

Originally Posted by MartinB (Post 294154)
Hi Thibault,

a blockMeshDict file is only needed, if you don't have a mesh written by a mesh generator (like Salome in your case). The blockMeshDict file is not written by a mesh generator.

With the blockMesh tool from OpenFOAM you can create very good meshes for geometries with a simple topology. In most of the OpenFOAM tutorial cases the blockMesh tool is used, because it doesn't take much disk space, the mesh quality is fine, the usage is easy...

In your case just export the mesh as you did, convert it the way you did, set up your case appropriately and run your simulation. There is no blockMesh command in the sequence.

Have fun

Martin

Hello,

I had a question regarding salome and the blockmeshdict file. As was suggested before, I dont think that the blockmeshdict file is necessary to solve the case.

I used salome to generate the mesh. The mesh was correctly created but there's no blockmeshdict file. Is it up to the user to create it after having generated the mesh?

If the user chooses not to create the blockmeshdict file, how can we postprocess the case? I would like to use Salome, since i'm familiar with it..are there any tutorials about how to export results from openfoam to salome?

wouter January 8, 2013 17:13

hello

As MartinB wrote: To run a case you do not need a blockMeshDict file. Only if you do not have a 'meshcreator' than you can use blockMesh to create a mesh. But Salome creates a mesh for you, so you do not need blockMesh and so you do not need blockMeshDict.
If you convert .unv to foam you do need to examine constant/polymesh/boundary to check if the boundaries are of the right type (eg type wall is not created you have to edit this yourself)

hope this clears things up
regards
Wouter

yasmil January 8, 2013 17:43

postprocess with Salome?
 
Quote:

Originally Posted by wouter (Post 400825)
hello

As MartinB wrote: To run a case you do not need a blockMeshDict file. Only if you do not have a 'meshcreator' than you can use blockMesh to create a mesh. But Salome creates a mesh for you, so you do not need blockMesh and so you do not need blockMeshDict.
If you convert .unv to foam you do need to examine constant/polymesh/boundary to check if the boundaries are of the right type (eg type wall is not created you have to edit this yourself)

hope this clears things up
regards
Wouter

Thanks for your response Wouter but my question was more about the postprocessing part of the work:
once I've run the case and OpenFOAM has solved the problem, since I did not create a blockmeshdict file, how can I use paraFoam to postprocess the results?

My guess is that I can't do it since there's no blockMeshDict file, is this right? If I'm right, can I export the result files from OpenFOAM to Salome? I prefer to work with Salome...

Do you know of any tutorials?

or is it better to just write the blockMeshDict file and use paraFoam?

wouter January 8, 2013 18:10

hello,

For paraFoam the same applies, it does not need blockMeshDict, it can read the created files during the run. I use it often and I do not understand what problem you have

Best
Wouter

yasmil January 8, 2013 18:26

blockmeshdict and parafoam
 
Hi wouter,

thanks for your time and responses. I am accostumed to using paraFoam after typing the blockMesh command on the terminal...in those cases I have the blockmeshdict file and paraFoam starts...

if I try do it for cases that do not have the blockMeshDict file, i get an error that says it's missing:
Cannot open mesh description file
"/home/gwen/OpenFOAM/gwen-2.1.1/run/tutorials/incompressible/icoFoam/case2heat/constant/polyMesh/blockMeshDict"

So I figured that I needed it for using paraFoam, if this is not the case, then could you please explain how I can see the mesh imported from Salome to paraFoam without it?

And once I solved the case, how can I postprocess the resultsusing paraFoam without it?

Best regards

wouter January 8, 2013 18:49

hello yasmil,

after you run ideasUnvToFoam you get all the files paraFoam need. you just type paraFoam. You then get a list with fields on the left where you must the first time remove all the selection because you did not change the boundary names yet(maybe) otherwise no problem. you say apply and you select surface or wireframe you can even select the boundary names and see them in paraFoam. It goes the same during and after the run. If you start paraFoam from a different terminal you can use update times so you can see the progress.

Best regards
Wouter



yasmil January 9, 2013 06:39

Ok, I finally got it, thank you wouter:)!

Raza Javed April 29, 2019 13:07

Hi everyone,


I have almost the similar problem. I have created one geometry and its mesh in Salome, and then I imported that in OpenFoam using "ideasUnvToFoam" utility.


Now, my case doesn't have blockMeshDict file in it because I created Mesh in Salome, But I need a blockMeshDict file because I need to create to cellSets for my geometry using topoSet.


Actually, my geometry consists of three regions (hot box, cold box and pipe) and I want to create a heat source on one face of hot box using fvOption file, and for that I need to generate a cellSet.



How can we create a blockMeshDict file in this case? OR Is there anyway to create topoSetDict file without blockMeshDict file?


I shall be very thankful for your help.


Thank you

wouter April 29, 2019 17:14

hello raza Javed,
I do not think you need a blockmeshDict to make a toposetdict, why do you think so?


hope this helps
Wouter

Raza Javed April 30, 2019 03:07

Hi.


Thank you so much for your reply.


I think so because I found a sample code for "topoSetDict" which I think is useful for my case. The sample code is below:


Code:

source faceToCell;                     

sourceInfo                       

{                       

    set f0;            // Name of faceSet                     
    option neighbour; // cell with neighbour in faceSet                     

    option owner;    //  ,,      owner                     

    option any;        // cell with any face in faceSet                     

    option all;      // cell with all faces in faceSet                     

 }

From this sample code, it seems like I need to have faceSet to make cellSet. and I read on forum that I can define faceSet using blockMeshDict. Is there any way to define a faceSet without blockMeshDict?



OR


Can I directly write the name of the face I want to use. for example, "hotFace" in place of "f0" in the line below:



Code:

set f0;            // Name of faceSet

Thank you

wouter April 30, 2019 17:23

from tutorials/incompressible/simpleFoam/pipeCyclic/topoSetDict:
Code:

{
        name    f0;
        type    faceSet;
        action  new;
        source  patchToFace;
        sourceInfo
        {
            name "side1";
        }
    }

here the sourceInfo let you use a name that you created in salome and you can see in the boundary file in polyMesh that is created with ideasUnvToFoam.


hope this helps
Wouter


Raza Javed May 1, 2019 07:21

Thank you so much for your help.



Now I can use topoSet to make cellSet, and the log file of topoSet shows that it is generating the cellSet, as you can see below:


Code:

Reading topoSetDict

Time = 0
    mesh not changed.
Created faceSet hot
    Applying source patchToFace
    Adding all faces of patch hotFace ...
    Found matching patch hotFace with 253 faces.
    faceSet hot now size 253
Created cellSet hotcell
    Applying source faceToCell
    Adding cells according to faceSet hot ...
    cellSet hotcell now size 253
End

But I am getting the following error:
Code:


--> FOAM FATAL ERROR:
Illegal content 8200 of set:hotcell of type cellSet
Value should be between 0 and 6396

    From function void Foam::topoSet::check(Foam::label)
    in file sets/topoSets/topoSet.C at line 189.

FOAM aborting

#0  Foam::error::printStack(Foam::Ostream&) at ??:?
#1  Foam::error::abort() at ??:?
#2  Foam::topoSet::check(int) at ??:?
#3  Foam::cellSet::cellSet(Foam::polyMesh const&, Foam::word const&, Foam::IOobject::readOption, Foam::IOobject::writeOption) at ??:?
#4  Foam::fv::cellSetOption::setCellSet() at ??:?
#5  Foam::fv::cellSetOption::cellSetOption(Foam::word const&, Foam::word const&, Foam::dictionary const&, Foam::fvMesh const&) at ??:?
#6  Foam::fv::option::adddictionaryConstructorToTable<Foam::fv::SemiImplicitSource<double> >::New(Foam::word const&, Foam::word const&, Foam::dictionary const&, Foam::fvMesh const&) at ??:?
#7  Foam::fv::option::New(Foam::word const&, Foam::dictionary const&, Foam::fvMesh const&) at ??:?
#8  Foam::fv::optionList::reset(Foam::dictionary const&) at ??:?
#9  Foam::fv::optionList::optionList(Foam::fvMesh const&, Foam::dictionary const&) at ??:?
#10  Foam::fv::options::options(Foam::fvMesh const&) at ??:?
#11  ? at ??:?
#12  __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6"
#13  ? at ??:?
Aborted (core dumped)

I don't know why I am getting this error? Am I doing mistake in writing topoSet file?



My topoSet file is given below:


Code:

actions
(
    {
        name    hot;
        type    faceSet;
        action  new;
        source  patchToFace;
        sourceInfo
        {
            name "hotFace";
        }
    }
// Select based on faceSet
    {
        name    hotcell;
        type    cellSet;
        action  new;
        source  faceToCell;
        sourceInfo
        {
            set hot;            // Name of faceSet

      //option neighbour; // cell with neighbour in faceSet
        //option owner;    //  ,,      owner
        option any;        // cell with any face in faceSet
      //option all;      // cell with all faces in faceSet
        }
    }
 );


I shall be very thankful if you can you please help me out in this?


Thank you


All times are GMT -4. The time now is 20:50.