CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Pre-Processing (https://www.cfd-online.com/Forums/openfoam-pre-processing/)
-   -   cfMesh creates binary boundary files (https://www.cfd-online.com/Forums/openfoam-pre-processing/227683-cfmesh-creates-binary-boundary-files.html)

ridhwan June 6, 2020 05:28

cfMesh creates binary boundary files
 
2 Attachment(s)
Hello everyone, I am a new OF7 user, and cfMesh is used for mesh generation. I have been able to build a good 2D mesh with cfMesh but struggle to generate a 3D one. I've been doing a lot of testing for weeks but everything went wrong.

I was trying to produce mesh for the head of a men.I seem to be able to produce mesh with cfMesh (head.png) but it gives me an error when it comes to checkMesh. I've found that all of these files (faces, neighbour, owner and points) have been generated in binary when I've been through every files in polymesh directory. Only (boundary and meshMetaDict) were generated in ASCII.

Does anyone have the same problem as I have and how do you solve it?

The checkMesh error messages below:

Create time

Create polyMesh for time = 0



--> FOAM FATAL IO ERROR:
Expected a ')' while reading binaryBlock, found on line 20 an error

file: /home/openfoam/run/cfmesh/tutorials/cartesianMesh/Nik_project/head/constant/polyMesh/faces at line 20.

From function Foam::Istream& Foam::Istream::readEnd(const char*)
in file db/IOstreams/IOstreams/Istream.C at line 109.

FOAM exiting

sadsid December 9, 2021 21:35

Quote:

Originally Posted by ridhwan (Post 773593)
Hello everyone, I am a new OF7 user, and cfMesh is used for mesh generation. I have been able to build a good 2D mesh with cfMesh but struggle to generate a 3D one. I've been doing a lot of testing for weeks but everything went wrong.

I was trying to produce mesh for the head of a men.I seem to be able to produce mesh with cfMesh (head.png) but it gives me an error when it comes to checkMesh. I've found that all of these files (faces, neighbour, owner and points) have been generated in binary when I've been through every files in polymesh directory. Only (boundary and meshMetaDict) were generated in ASCII.

Does anyone have the same problem as I have and how do you solve it?

The checkMesh error messages below:

Create time

Create polyMesh for time = 0



--> FOAM FATAL IO ERROR:
Expected a ')' while reading binaryBlock, found on line 20 an error

file: /home/openfoam/run/cfmesh/tutorials/cartesianMesh/Nik_project/head/constant/polyMesh/faces at line 20.

From function Foam::Istream& Foam::Istream::readEnd(const char*)
in file db/IOstreams/IOstreams/Istream.C at line 109.

FOAM exiting


I am facing the same problem. Did you find out the solution?

olesen December 12, 2021 08:53

Quote:

Originally Posted by sadsid (Post 818270)
I am facing the same problem. Did you find out the solution?

Please check if this issue also occurs with cfmesh bundled with the www.openfoam.com releases. I hope not.

sadsid December 13, 2021 05:23

Quote:

Originally Posted by olesen (Post 818358)
Please check if this issue also occurs with cfmesh bundled with the www.openfoam.com releases. I hope not.


Yes, it wasn't the case with url]www.openfoam.com[/url] releases.!

Thanks for your feedback!

Ship Designer January 3, 2022 22:37

Do you want the polyMesh in binary format intentionally? Does checkMesh work if you write the polyMesh in ascii by changing writeFormat in controlDict? You can also try to use the foamFormatConvert utility but please note that this utility will convert not only the polyMesh but also all the field files in your case.

Ship Designer January 3, 2022 23:31

I now remember to have had a similar problem with cfMesh once and looked through my notes. I looked once again at your screenshot and believe checkMesh crashes due the class type as indicated in the file header. In your screenshot it says class faceList whereas OpenFOAM writes class faceCompactList when set to binary in controlDict. I've looked at the faces file generated with blockMesh for the pitzDaily tutorial case with OF v7, v8, v9 and v1912. All of them write faceCompactList if set to binary format. My suspicion is that checkMesh does not read binary faceList. You could try to run a solver without checking the mesh just to see if the solver can properly read the polyMesh, out of curiosity.

If you really want your polyMesh to be in binary format, one solution would be to have cfMesh write it in ascii and then convert it with foamFormatConvert afterwards. If that still doesn't work, I found a tool somewhere online which I downloaded but never used called compactFaceToFace, maybe that can help. Otherwise if you are concerned about storage space, I suggest writing to ascii in compressed format. The files get smaller than binary and have the advantage that you can always open and human-read them if necessary. Only downside is that writing files is slower.

Hope this helps. Cheers, Claudio

sadsid January 6, 2022 19:14

Quote:

Originally Posted by Ship Designer (Post 819539)
Do you want the polyMesh in binary format intentionally? Does checkMesh work if you write the polyMesh in ascii by changing writeFormat in controlDict? You can also try to use the foamFormatConvert utility but please note that this utility will convert not only the polyMesh but also all the field files in your case.

Thank you for your reply. This is also a solution and it works fine as well. But I shifted my case from of8 to of2106 to avoid any problem!


All times are GMT -4. The time now is 17:03.