CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM (https://www.cfd-online.com/Forums/openfoam/)
-   -   FOAM FATAL IO ERROR: attempt to read beyond EOF (https://www.cfd-online.com/Forums/openfoam/252187-foam-fatal-io-error-attempt-read-beyond-eof.html)

Dcn October 3, 2023 00:47

FOAM FATAL IO ERROR: attempt to read beyond EOF
 
Hi everyone i am using OpenFOAM-2.3.0 tutorial case called motorbike
i try to run it using rapidCFD but i get the error as shown below

Code:

file: /home/urban/DL-workspace/OpenFOAM/OpenFOAM-2.3.0/tutorials/incompressible/simpleFoam/motorBike_test_rapidCFD/system/controlDict.functions.readFields.fields at line 18.

    From function ITstream::read(token&)
    in file db/IOstreams/Tstreams/ITstream.C at line 83.

FOAM exiting

This is the control dictionary file

Code:

/*--------------------------------*- C++ -*----------------------------------*\
| =========                |                                                |
| \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox          |
|  \\    /  O peration    | Version:  2.3.0                                |
|  \\  /    A nd          | Web:      www.OpenFOAM.org                      |
|    \\/    M anipulation  |                                                |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version    2.0;
    format      ascii;
    class      dictionary;
    object      controlDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

libs
(
    "libOpenFOAM.so"
    "libincompressibleTurbulenceModel.so"
    "libincompressibleRASModels.so"
);

application    simpleFoam;

startFrom      startTime; // latestTime;

startTime      0;

stopAt          endTime;

endTime        500;

deltaT          1;

writeControl    timeStep;

writeInterval  100;

purgeWrite      0;


//- Uncomment to have regular (every 2 hours of run time) restart files
//secondaryWriteControl    cpuTime; // runtime
//secondaryWriteInterval  7200;    // seconds
//secondaryPurgeWrite      1;      // keep all but last dump


writeFormat    binary;

writePrecision  6;

writeCompression uncompressed;

timeFormat      general;

timePrecision  6;

runTimeModifiable true;

functions
{
    #include "readFields"
    #include "streamLines"
    #include "wallBoundedStreamLines"
    #include "cuttingPlane"
    #include "forceCoeffs"
}


// ************************************************************************* //

what changes shall i make in controlDict file to solve the error of "attempt to read beyond EOF"

thank you

AtoHM October 4, 2023 05:09

OF tells you where the error appears:
Code:

controlDict.functions.readFields.fields at line 18.
Check for unbalanced brackets, missing semicolons ...

Dcn October 6, 2023 08:19

Hi i have resolved the above issue but now i am faced with new issue as shown below
Code:

--> FOAM FATAL ERROR:
Unknown function type readFields

Valid functions are :

7
(
fieldAverage
fieldCoordinateSystemTransform
fieldValueDelta
patchProbes
probes
sets
surfaces
)



    From function functionObject::New(const word& name, const Time&, const dictionary&)
    in file db/functionObjects/functionObject/functionObject.C at line 92.

FOAM exiting

it seems it is related with the controlDict but i can't figure it out
my controlDict is shown below
Code:

/*--------------------------------*- C++ -*----------------------------------*\
| =========                |                                                |
| \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox          |
|  \\    /  O peration    | Version:  2.3.0                                |
|  \\  /    A nd          | Web:      www.OpenFOAM.org                      |
|    \\/    M anipulation  |                                                |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version    2.0;
    format      ascii;
    class      dictionary;
    object      controlDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

libs
(
    "libOpenFOAM.so"
    "libincompressibleTurbulenceModel.so"
    "libincompressibleRASModels.so"
);

application    simpleFoam;

startFrom      startTime; // latestTime;

startTime      0;

stopAt          endTime;

endTime        500;

deltaT          1;

writeControl    timeStep;

writeInterval  100;

purgeWrite      0;


//- Uncomment to have regular (every 2 hours of run time) restart files
//secondaryWriteControl    cpuTime; // runtime
//secondaryWriteInterval  7200;    // seconds
//secondaryPurgeWrite      1;      // keep all but last dump


writeFormat    binary;

writePrecision  6;

writeCompression uncompressed;

timeFormat      general;

timePrecision  6;

runTimeModifiable true;

functions
{
    #include "readFields"
    #include "streamLines"
    #include "wallBoundedStreamLines"
    #include "cuttingPlane"
    #include "forceCoeffs"
}


// ************************************************************************* //


LuckyTran October 6, 2023 09:39

You need the fieldFunctionObjects library for readFields

Dcn October 9, 2023 00:52

Hi thank you for your reply now i am getting the error as shown below
Code:

--> FOAM FATAL ERROR:
Unknown function type readFields

Valid functions are :

7
(
fieldAverage
fieldCoordinateSystemTransform
fieldValueDelta
patchProbes
probes
sets
surfaces
)



    From function functionObject::New(const word& name, const Time&, const dictionary&)
    in file db/functionObjects/functionObject/functionObject.C at line 92.

FOAM exiting

where do i need to put those valid functions in which file

thank you


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