Personal tools
You are here: Home Forum Install & build Create face groups in body fitting mesh

Create face groups in body fitting mesh

Up to Install & build

Create face groups in body fitting mesh

Posted by Martin Isack at April 12. 2012

Hello,

I was trying the new body fitting algorithm today. As it is a pure 3D mesher it doesn’t create 2D elements. But I need 2D elements to create boundary conditions on faces. Is it possible to create 2D elements after mesh generation with body fitting?

Regards,

Martin

Re: Create face groups in body fitting mesh

Posted by Saint Michael at April 12. 2012

Hello Martin.

You can create 2D elements using "Create boundary elements" function.

St.Michael

Re: Create face groups in body fitting mesh

Posted by Martin Isack at April 12. 2012

Hello,

thank you for your quick reply. I have these boundary faces now. But how to create groups of them?
My preferred way until now was to create groups in the geometry module and use Create Groups from Geometry in the mesh module. But this doesn’t work anymore when I create boundary faces after meshing.

Best regards,

Martin

Re: Create face groups in body fitting mesh

Posted by Saint Michael at April 12. 2012

You can create your groups via Create Group dialog using options "Group on filter" or "Standalone group" with usage of filter. Use "Belong to Geom" criterion.

I attached a dump of study where 2 groups are created: 'bnd Group' is created by MakeBoundaryElements() command and 'group' is created by GroupOnFilter() command.

St.Michael

Attachments

Re: Create face groups in body fitting mesh

Posted by Martin Isack at April 12. 2012

Thank you very much! I were not able to create the filter because I were not aware of this bug. 

(I’m sorry, I just realized, that I started thread in the wrong section of this forum.)

Re: Create face groups in body fitting mesh

Posted by Joseflash at January 22. 2016

It seems to work while you are in Salome. It can be exported to unv without any problems too. However, when I try to import to Openfoam I get this message (I also meshed without polylhedrons to avoid problems)

Using the 'group on filter' procedure and selecting elements type = face, I get:

Processing tag:2420
Skipping tag 2420 on line 9
Skipping section at line 9.

Processing tag:2411
Starting reading points at line 20.
Read 42406 points.

Processing tag:2412
Starting reading cells at line 84835.
First occurrence of element type 112 for cell 1 at line 84836
First occurrence of element type 115 for cell 2 at line 84838
Read 28303 cells and 0 boundary faces.

Processing tag:2467
Starting reading patches at line 141444.
For group 1 named inlet trying to read 0 patch face indices.
--> FOAM Warning :
    From function readSets(..)
    in file ideasUnvToFoam.C at line 552
    Reading "/home/user/Documents/mesh.unv" at line 141446
    When reading patches expect entity type code 8
    Skipping group code -1


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

FOAM exiting

 

Using the 'group on filter' procedure and selecting elements type = node, I get:

Processing tag:2420
Skipping tag 2420 on line 9
Skipping section at line 9.

Processing tag:2411
Starting reading points at line 20.
Read 42406 points.

Processing tag:2412
Starting reading cells at line 84835.
First occurrence of element type 112 for cell 1 at line 84836
First occurrence of element type 115 for cell 2 at line 84838
Read 28303 cells and 0 boundary faces.

Processing tag:2467
Starting reading patches at line 141444.
For group 7 named Group_1 trying to read 28 patch face indices.
--> FOAM Warning :
    From function readSets(..)
    in file ideasUnvToFoam.C at line 552
    Reading "/home/user/Documents/mesh_2.unv" at line 141460
    When reading patches expect entity type code 8
    Skipping group code 7

Sorting boundary faces according to group (patch)

Constructing mesh with non-default patches of size:

--> FOAM Warning :
    From function polyMesh::polyMesh(... construct from shapes...)
    in file meshes/polyMesh/polyMeshFromShapeMesh.C at line 619
    Found 28549 undefined faces in mesh; adding to default patch.
End

My groups are subshapes that can not be distinguished in the final mesh (some of them are different  parts of a plane), if this information can be useful.

Any suggestions? It is an algorithm that works fairly well, but without being able to take the groups to Openfoam, it would not be very useful for CFD purposes.

Thank you and regards.

Re: Create face groups in body fitting mesh

Posted by Joseflash at January 22. 2016

Previously Saint Michael wrote:

You can create your groups via Create Group dialog using options "Group on filter" or "Standalone group" with usage of filter. Use "Lying on Geom" criterion. But there is a subtle point with threshold shape. For usage of Create Groups from Geometry, the shape should be a sub-shape of the meshed geometry, but in the case of Body fitting it should NOT be a sub-shape of the meshed geometry (it seems to be a bug).

I attached a dump of study where 2 groups are created: 'bnd Group' is created by MakeBoundaryElements() command and 'group' is created by GroupOnFilter() command.

St.Michael

It seems to work while you are in Salome. It can be exported to unv without any problems too. However, when I try to import to Openfoam I get this message (I also meshed without polylhedrons to avoid problems)

Using the 'group on filter' procedure and selecting elements type = face, I get:

Processing tag:2420
Skipping tag 2420 on line 9
Skipping section at line 9.

Processing tag:2411
Starting reading points at line 20.
Read 42406 points.

Processing tag:2412
Starting reading cells at line 84835.
First occurrence of element type 112 for cell 1 at line 84836
First occurrence of element type 115 for cell 2 at line 84838
Read 28303 cells and 0 boundary faces.

Processing tag:2467
Starting reading patches at line 141444.
For group 1 named inlet trying to read 0 patch face indices.
--> FOAM Warning :
    From function readSets(..)
    in file ideasUnvToFoam.C at line 552
    Reading "/home/user/Documents/mesh.unv" at line 141446
    When reading patches expect entity type code 8
    Skipping group code -1


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

FOAM exiting

 

Using the 'group on filter' procedure and selecting elements type = node, I get:

Processing tag:2420
Skipping tag 2420 on line 9
Skipping section at line 9.

Processing tag:2411
Starting reading points at line 20.
Read 42406 points.

Processing tag:2412
Starting reading cells at line 84835.
First occurrence of element type 112 for cell 1 at line 84836
First occurrence of element type 115 for cell 2 at line 84838
Read 28303 cells and 0 boundary faces.

Processing tag:2467
Starting reading patches at line 141444.
For group 7 named Group_1 trying to read 28 patch face indices.
--> FOAM Warning :
    From function readSets(..)
    in file ideasUnvToFoam.C at line 552
    Reading "/home/user/Documents/mesh_2.unv" at line 141460
    When reading patches expect entity type code 8
    Skipping group code 7

Sorting boundary faces according to group (patch)

Constructing mesh with non-default patches of size:

--> FOAM Warning :
    From function polyMesh::polyMesh(... construct from shapes...)
    in file meshes/polyMesh/polyMeshFromShapeMesh.C at line 619
    Found 28549 undefined faces in mesh; adding to default patch.
End

My groups are subshapes that can not be distinguished in the final mesh (some of them are different  parts of a plane), if this information can be useful.

Any suggestions? It is an algorithm that works fairly well, but without being able to take the groups to Openfoam, it would not be very useful for CFD purposes.

Thank you and regards.

 

Re: Create face groups in body fitting mesh

Posted by Saint Michael at January 22. 2016

These errors mean that there are no faces in your mesh.

Have you used "Create boundary elements" function after computing the volume mesh?

St.Michael

Re: Create face groups in body fitting mesh

Posted by Joseflash at January 22. 2016

Thank you for the information.

I have done it now. I have then exported to unv (everything seems to be OK inside Salome). When importing toce Openfoam, these errors are found (I have set the groups now as faces, since I have created the boundary elements, doing it as nodes doesn't produce any changes at all within Salome):

--> FOAM Warning :
    From function polyMesh::polyMesh(... construct from shapes...)
    in file meshes/polyMesh/polyMeshFromShapeMesh.C at line 619
    Found 28265 undefined faces in mesh; adding to default patch.
Adding cell and face zones
 Cell Zone wall     468
 Cell Zone wedge2     14508
 Cell Zone wedge1     14508
 Cell Zone inlet_2     208

End

After that, checking the mesh, many errors appear, I just paste some of them (the same error is repeated) and the last part of the message:

 

--> FOAM Serious Error :
    From function bool zone::checkDefinition(const label maxSize, const bool report) const
    in file meshes/polyMesh/zones/zone/zone.C at line 211
    Zone wedge2 contains invalid index label 28505
Valid index labels are 0..28302
--> FOAM Serious Error :
    From function bool zone::checkDefinition(const label maxSize, const bool report) const
    in file meshes/polyMesh/zones/zone/zone.C at line 211
    Zone wedge2 contains invalid index label 28506
Valid index labels are 0..28302
--> FOAM Serious Error :
    From function bool zone::checkDefinition(const label maxSize, const bool report) const
    in file meshes/polyMesh/zones/zone/zone.C at line 211
    Zone wedge2 contains invalid index label 28507
Valid index labels are 0..28302
--> FOAM Serious Error :
    From function bool zone::checkDefinition(const label maxSize, const bool report) const
    in file meshes/polyMesh/zones/zone/zone.C at line 211
    Zone wedge2 contains invalid index label 28508
Valid index labels are 0..28302
--> FOAM Serious Error :
    From function bool zone::checkDefinition(const label maxSize, const bool report) const
    in file meshes/polyMesh/zones/zone/zone.C at line 211
    Zone wedge2 contains invalid index label 28509
Valid index labels are 0..28302
--> FOAM Serious Error :
    From function bool zone::checkDefinition(const label maxSize, const bool report) const
    in file meshes/polyMesh/zones/zone/zone.C at line 211
    Zone wedge2 contains invalid index label 28510
Valid index labels are 0..28302
--> FOAM Serious Error :
    From function bool zone::checkDefinition(const label maxSize, const bool report) const

    in file meshes/polyMesh/zones/zone/zone.C at line 211
    Zone wedge2 contains invalid index label 28511

Valid index labels are 0..28302
--> FOAM FATAL ERROR:
--> FOAM Serious Error :
Too many errors

    From function messageStream::operator OSstream&()
    in file lnInclude/messageStream.C at line 200.

FOAM aborting

    From function bool zone::checkDefinition(const label maxSize, const bool report) const
    in file meshes/polyMesh/zones/zone/zone.C at line 211
    Zone wedge2 contains invalid index label 28512
Valid index labels are 0..28302
--> FOAM Serious Error :
    From function bool zone::checkDefinition(const label maxSize, const bool report) const
    in file meshes/polyMesh/zones/zone/zone.C at line 211
    Zone wedge2 contains invalid index label 28513
Valid index labels are 0..28302
--> FOAM Serious Error :
    From function bool zone::checkDefinition(const label maxSize, const bool report) const
    in file meshes/polyMesh/zones/zone/zone.C at line 211
    Zone wedge2 contains invalid index label 28514
Valid index labels are 0..28302
--> FOAM Serious Error :
    From function bool zone::checkDefinition(const label maxSize, const bool report) const
    in file meshes/polyMesh/zones/zone/zone.C at line 211
    Zone wedge2 contains invalid index label 28515
Valid index labels are 0..28302
--> FOAM Serious Error :
    From function bool zone::checkDefinition(const label maxSize, const bool report) const
    in file meshes/polyMesh/zones/zone/zone.C at line 211
    Zone wedge2 contains invalid index label 28516
Valid index labels are 0..28302
#0  Foam::error::printStack(Foam::Ostream&;) in "/opt/openfoam211/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#1  Foam::error::abort() in "/opt/openfoam211/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#2  Foam::messageStream::operator Foam::OSstream&() in "/opt/openfoam211/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#3  Foam::messageStream::operator()(char const*, char const*, int) in "/opt/openfoam211/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#4  Foam::zone::checkDefinition(int, bool) const in "/opt/openfoam211/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#5 
 in "/opt/openfoam211/platforms/linux64GccDPOpt/bin/checkMesh"
#6 
 in "/opt/openfoam211/platforms/linux64GccDPOpt/bin/checkMesh"
#7  __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6"
#8 
 in "/opt/openfoam211/platforms/linux64GccDPOpt/bin/checkMesh"
--> FOAM Serious Error :

 

After that, I have tried to remove all groups, export without them and importing again to Openfoam. This message appeared:

 

Processing tag:2420
Skipping tag 2420 on line 9
Skipping section at line 9.

Processing tag:2411
Starting reading points at line 20.
Read 42406 points.

Processing tag:2412
Starting reading cells at line 84835.
First occurrence of element type 41 for cell 28304 at line 84836
First occurrence of element type 44 for cell 28305 at line 84838
First occurrence of element type 112 for cell 1 at line 141934
First occurrence of element type 115 for cell 2 at line 141936
Read 28303 cells and 28549 boundary faces.

Processing tag:2467
Starting reading patches at line 198542.
For group 1 named inlet_1 trying to read 154 patch face indices.
--> FOAM Warning :
    From function readSets(..)
    in file ideasUnvToFoam.C at line 552
    Reading "/home/user/Documents/mesh3.unv" at line 198621
    When reading patches expect entity type code 8
    Skipping group code 7
For group 2 named Group_1 trying to read 28 patch face indices.
--> FOAM Warning :
    From function readSets(..)
    in file ideasUnvToFoam.C at line 552
    Reading "/home//user/Documents/mesh3.unv" at line 198637
    When reading patches expect entity type code 8
    Skipping group code 7
For group 3 named Group_2 trying to read 154 patch face indices.
--> FOAM Warning :
    From function readSets(..)
    in file ideasUnvToFoam.C at line 552
    Reading "/home//user/Documents/mesh3.unv" at line 198716
    When reading patches expect entity type code 8
    Skipping group code 7

Sorting boundary faces according to group (patch)

Constructing mesh with non-default patches of size:

--> FOAM Warning :
    From function polyMesh::polyMesh(... construct from shapes...)
    in file meshes/polyMesh/polyMeshFromShapeMesh.C at line 619
    Found 28549 undefined faces in mesh; adding to default patch.
End

It is strange because there were no groups in the tree for it within Salome. I have then drawn again the geometry and meshed it again in a different file without groups, and same errors:

--> FOAM Serious Error :
    From function bool zone::checkDefinition(const label maxSize, const bool report) const
    in file meshes/polyMesh/zones/zone/zone.C at line 211
    Zone wedge2 contains invalid index label 28513
Valid index labels are 0..28303
--> FOAM Serious Error :
    From function bool zone::checkDefinition(const label maxSize, const bool report) const
    in file meshes/polyMesh/zones/zone/zone.C at line 211
    Zone wedge2 contains invalid index label 28514
Valid index labels are 0..28303
--> FOAM Serious Error :
    From function bool zone::checkDefinition(const label maxSize, const bool report) const
    in file meshes/polyMesh/zones/zone/zone.C at line 211
    Zone wedge2 contains invalid index label 28515
Valid index labels are 0..28303
--> FOAM Serious Error :
    From function bool zone::checkDefinition(const label maxSize, const bool report) const
    in file meshes/polyMesh/zones/zone/zone.C at line 211
    Zone wedge2 contains invalid index label 28516
Valid index labels are 0..28303
#0  Foam::error::printStack(Foam::Ostream&;) in "/opt/openfoam211/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#1  Foam::error::abort() in "/opt/openfoam211/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#2  Foam::messageStream::operator Foam::OSstream&() in "/opt/openfoam211/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#3  Foam::messageStream::operator()(char const*, char const*, int) in "/opt/openfoam211/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#4  Foam::zone::checkDefinition(int, bool) const in "/opt/openfoam211/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#5 
 in "/opt/openfoam211/platforms/linux64GccDPOpt/bin/checkMesh"
#6 
 in "/opt/openfoam211/platforms/linux64GccDPOpt/bin/checkMesh"
#7  __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6"
#8 
 in "/opt/openfoam211/platforms/linux64GccDPOpt/bin/checkMesh"
--> FOAM Serious Error :

 

Any suggestions? I have used Salome 7.7.1

Thanks and regards.

Re: Create face groups in body fitting mesh

Posted by Joseflash at January 30. 2016

I have repeated all the process from the beggining and the problem was that Salome didn't set the groups properly on the desired face, selected using 'lying on geometry', independently on the value set as tolerance for it, Salome always took elements from two different faces.

Hence, i have had to select and discard nodes manually, which I don't recommend unless there is no other option (and in this case I couldn't find any other way that chose the correct elements).

I exported to Openfoam format using this script (there were several polyhedrons, being the unv path not suitable).

https://github.com/nicolasedh/salomeToOpenFOAM

After that, when running in OpenFOAM, it writes that the two wedge faces are not planar (I did everything in Salome, including the geometry, and there it was planar).

Where could be the problem?

Thanks.

Re: Create face groups in body fitting mesh

Posted by Saint Michael at Monday 14:17

I have repeated all the process from the beggining and the problem was that Salome didn't set the groups properly on the desired face, selected using 'lying on geometry', independently on the value set as tolerance for it, Salome always took elements from two different faces.

It's necessary to use "Belong To Geom" rather than "Lying on Geom" criterion to get a desired result.

St.Michael

 

Powered by Ploneboard
Document Actions