CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Post-Processing (https://www.cfd-online.com/Forums/openfoam-post-processing/)
-   -   sample surface from binary U, k and P (https://www.cfd-online.com/Forums/openfoam-post-processing/168150-sample-surface-binary-u-k-p.html)

kingjewel1 March 16, 2016 11:09

sample surface from binary U, k and P
 
I accidentally let OF write binary output instead of ASCII and now sample doesn't work. Is there a way around this?

Code:

[8] --> FOAM FATAL IO ERROR:
[8] Expected a ')' while reading binaryBlock, found on line 20 the label 0
[8]
[8] file: /array_SAS/processor8/constant/polyMesh/faces at line 20.
[8]
[8]    From function Istream::readEnd(const char*)
[8]    in file db/IOstreams/IOstreams/Istream.C at line 111.
[8]


TobM March 17, 2016 03:42

Hi, unfortunately I know this error.
In my case this always happens with T files... but only sometimes...
Workaround is to convert the binary files to ascii. Use the tool foamFormatConvert, this converts all files to the format you have specified in your controlDict.

kingjewel1 March 17, 2016 04:41

Quote:

Originally Posted by TobM (Post 590223)
Hi, unfortunately I know this error.
In my case this always happens with T files... but only sometimes...
Workaround is to convert the binary files to ascii. Use the tool foamFormatConvert, this converts all files to the format you have specified in your controlDict.

I get the following error complaining of the same problem... what do you think?:

Code:

$ foamFormatConvert -latestTime
/*---------------------------------------------------------------------------*\
| =========                |                                                |
| \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox          |
|  \\    /  O peration    | Version:  3.0.0                                |
|  \\  /    A nd          | Web:      www.OpenFOAM.org                      |
|    \\/    M anipulation  |                                                |
\*---------------------------------------------------------------------------*/
Build  : 3.0.0-6abec57f5449
Exec  : foamFormatConvert -latestTime
Date  : Mar 17 2016
Time  : 09:38:02
Host  : "login2.comp1235-125"
PID    : 7015
Case  : array_SAS
nProcs : 1
sigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).
fileModificationChecking : Monitoring run-time modified files using timeStampMaster
allowSystemOperations : Allowing user-supplied system call operations

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

Time = constant
        Reading labelList : owner


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

file: array_SAS/constant/polyMesh/owner at line 21.

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

FOAM exiting


TobM March 17, 2016 07:07

I have to correct myself. I had this issue when opening the case in paraview, although it looks very similar. Since the mesh is concerned maybe you create a new mesh and save it in ascii.

jdchristopher24 February 27, 2018 16:37

Unable to convert binary to ascii
 
I'm trying to use the foamFormatConvert utility, but that also has an issue w/ my binary file. Thoughts on how to fix this? (edit: I realized if I postProcess on the machine where data was created it works, but if I move to a different machine it doesn't work so I'll just postProcess before moving it local).


user:~/Documents/Research/case$ foamFormatConvert
/*---------------------------------------------------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 4.x |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
Build : 4.x-d5dd04e0a63b
Exec : foamFormatConvert
Date : Feb 27 2018
Time : 14:34:08
Host : "user:
PID : 8712
Case : /home/user/Documents/Research/case/
nProcs : 1
sigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).
fileModificationChecking : Monitoring run-time modified files using timeStampMaster
allowSystemOperations : Allowing user-supplied system call operations

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

Time = constant
Reading labelList : owner
Writing owner
Reading labelList : neighbour
Writing neighbour
Reading faceList : faces
Writing faces
Reading vectorField : points
Writing points
Reading regIOobject : cellZones
Writing cellZones
Reading regIOobject : faceZones
Writing faceZones
Reading regIOobject : pointZones
Writing pointZones

Time = 0.05
Reading labelList : owner


--> FOAM FATAL IO ERROR:
Expected a ')' while reading binaryBlock, found on line 21 the word 'u&'

file: /home/user/Documents/Research/Case/0.05/polyMesh/owner at line 21.

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

FOAM exiting

nskelly April 13, 2018 06:09

jdchristopher24,

Did you manage to solve the problem? I am getting similar error messages.

Tsinuel February 15, 2020 14:46

Check file writing
 
I faced the same problem when file writing is aborted for some reason (for example HPC job may time out while OpenFOAM is writing the file). Check the log file if that time step is the last one. I hope this helps.

Cheers,
Tsinuel


All times are GMT -4. The time now is 23:57.