CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Meshing & Mesh Conversion (http://www.cfd-online.com/Forums/openfoam-meshing/)
-   -   cgnsToFoam error when converting ICEM mesh (http://www.cfd-online.com/Forums/openfoam-meshing/117743-cgnstofoam-error-when-converting-icem-mesh.html)

glasenapp May 14, 2013 12:09

cgnsToFoam error when converting ICEM mesh
 
Hello foamers,

I am currently working with cgnsToFoam on OpenFOAM-2.1.1. I created a simple unstructured mesh in Ansys ICEM with an inlet on one side, an outlet on the other side, the 4 remaining sides are walls (see https://www.dropbox.com/s/n77yvcy9f3vxuz0/mesh.jpg). I converted the .msh file using fluent3DMeshToFoam and ran checkMesh with no errors (see https://www.dropbox.com/s/h4ui0lyg10tz77v/checkMesh). In order to test the cgns-converters, I ran foamToCGNS which works well. Then I ran cgnsToFoam in order to convert the cgns-file back to the OpenFOAM format which produces this error:

--> FOAM FATAL ERROR:
Trying to specify a boundary face .. on the face on cell ... which is either an internal face or already belongs to some other patch. This is face ... of patch ... named .
From function polyMesh::setTopology
(
const cellShapeList& cellsAsShapes,
const faceListList& boundaryFaces,
const wordList& boundaryPatchNames,
labelList& patchSizes,
labelList& patchStarts,
label& defaultPatchStart,
label& nFaces,
cellList& cells
)
in file meshes/polyMesh/polyMeshFromShapeMesh.C at line 360.

FOAM aborting

#0 Foam::error::printStack(Foam::Ostream&) in "/home/user/OpenFOAM/OpenFOAM-2.1.x/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#1 Foam::error::abort() in "/home/user/OpenFOAM/OpenFOAM-2.1.x/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#2 Foam::polyMesh::setTopology(Foam::List<Foam::cellS hape> const&, Foam::List<Foam::List<Foam::face> > const&, Foam::List<Foam::word> const&, Foam::List<int>&, Foam::List<int>&, int&, int&, Foam::List<Foam::cell>&) in "/home/user/OpenFOAM/OpenFOAM-2.1.x/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#3 Foam::polyMesh::polyMesh(Foam::IOobject const&, Foam::Xfer<Foam::Field<Foam::Vector<double> > > const&, Foam::List<Foam::cellShape> const&, Foam::List<Foam::List<Foam::face> > const&, Foam::List<Foam::word> const&, Foam::List<Foam::word> const&, Foam::word const&, Foam::word const&, Foam::List<Foam::word> const&, bool) in "/home/user/OpenFOAM/OpenFOAM-2.1.x/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#4
in "/home/user/OpenFOAM/user-2.1.1/platforms/linux64GccDPOpt/bin/cgnsToFoam"
#5
in "/home/user/OpenFOAM/user-2.1.1/platforms/linux64GccDPOpt/bin/cgnsToFoam"
#6 __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6"
#7
in "/home/user/OpenFOAM/user-2.1.1/platforms/linux64GccDPOpt/bin/cgnsToFoam"
Aborted (core dumped)

Some people have had this error before (see http://www.cfd-online.com/Forums/ope...tml#post217883 and http://www.cfd-online.com/Forums/ope...tml#post212333), but I couldn't find how they solved the problem.

I have tried to use the cgnsToFoam options -cfxCompatibility and -separatePatches, but the error still occurs. I checked which cell produces the error. It is the cell which is located between "outlet" and "wall". To be more exact: one face of the tetra cell is located on the "outlet" and another face on the "wall", the other 2 faces are inside the geometry (see https://www.dropbox.com/s/f59rabvi5o...error_cell.jpg). The error does not occur when I create a mesh in ICEM that contains only "wall" (no "inlet" or "outlet").

Moreover, I tried the converters on the mesh from the pitzDaily case, which gives no errors (after changing the number of cells in z-direction to at least 2). Does that mean that cgnsToFoam has problems with meshes created with ICEM? For my application, I have to use ICEM to create the mesh which is why I need to come up with a solution. Does anybody know whether I have to make any changes to the mesh before exporting it from ICEM or before converting it with foamToCGNS?
I uploaded my boundary file (https://www.dropbox.com/s/g83js4285vo7v0t/boundary) as well as the cgns-file (https://www.dropbox.com/s/at9hripgsgnx02t/0.cgns), althought it seems fine when I look at it with adfviewer.
Any suggestions? Thanks a lot in advance for your help!

Cheers,

Tobias

OpenF May 15, 2013 10:29

Hi Tobias,

I'm sorry I can't answer, but I'm looking for all the .tar to install CgnsToFoam and FoamToCgns. Could you give me that please ?

Thanks
Anselme

glasenapp May 16, 2013 09:57

Hi Anselme,

since the converters are part of the OpenFOAM Extend Project, you should check their website and download it from there.
I will write a quick description on the changes that have to be made in order to use the converters on OpenFOAM-2.1.x as soon as I've got a little more time.

By the way, I tried converting a mesh created by gmsh using foamToCGNS and cgnsToFoam and it worked fine. When I try to convert a mesh created by snappyHexMesh, however, I get the following error:

"--> FOAM FATAL ERROR:
Wrong number of vertices in cell
expected 4,5,6, or 8, found 0

From function foamToCGNS
in file writeCGNS.H at line 219.

FOAM aborting"

Again, I am not the first one who is facing this problem (http://www.cfd-online.com/Forums/ope...ices-cell.html), but I couldn't find a solution in the forum.
Any suggestions about how to get the converters to work for a mesh either created by Ansys ICEM or snappyHexMesh?

Tobias

OpenF May 16, 2013 10:21

Hi,

I have a lot of available converter in OpenFOAM but I don't have CgnsToFoam and I can't find the sources on http://www.extend-project.de/ or on internet. They aren't available anymore and there is a raison but it seems that it's not officiel : http://openfoamwiki.net/index.php/Main_Page

Do you have an idee how could I get the sources ?

Thanks
Anselme

mbeaudoin May 17, 2013 12:46

Hello,

"--> FOAM FATAL ERROR:
Wrong number of vertices in cell
expected 4,5,6, or 8, found 0

Basically, snappyHexMesh has generated cells with zero vertices in your mesh. The CGNS converter does not know what to do with those cells.

Try cleaning up your mesh in order to remove these problematic or useless cells, or report the problem to the developpers of snappyHexMesh in order to remove the problem at the source.

Martin


Quote:

Originally Posted by glasenapp (Post 428039)
Hi Anselme,

since the converters are part of the OpenFOAM Extend Project, you should check their website and download it from there.
I will write a quick description on the changes that have to be made in order to use the converters on OpenFOAM-2.1.x as soon as I've got a little more time.

By the way, I tried converting a mesh created by gmsh using foamToCGNS and cgnsToFoam and it worked fine. When I try to convert a mesh created by snappyHexMesh, however, I get the following error:

"--> FOAM FATAL ERROR:
Wrong number of vertices in cell
expected 4,5,6, or 8, found 0

From function foamToCGNS
in file writeCGNS.H at line 219.

FOAM aborting"

Again, I am not the first one who is facing this problem (http://www.cfd-online.com/Forums/ope...ices-cell.html), but I couldn't find a solution in the forum.
Any suggestions about how to get the converters to work for a mesh either created by Ansys ICEM or snappyHexMesh?

Tobias



All times are GMT -4. The time now is 05:58.