CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM (http://www.cfd-online.com/Forums/openfoam/)
-   -   Error with forces computation in 1.5 (http://www.cfd-online.com/Forums/openfoam/66650-error-forces-computation-1-5-a.html)

aaurouss July 21, 2009 03:54

Error with forces computation in 1.5
 
Hello everyone

I tried to use the function described in some posts about forces, but i get an error.

Here is what's written in the log file :
************************************************** *****************
attempt to read beyond EOF


file:..............................;/system/controlDict::functions at line 60.


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


FOAM exiting
************************************************** *******************
It seems that there's a library missing or smthg like that

Any idea ?
Here is my code :

***************************************

functions
(
forces
{
type forces;
functionObjectLibs ("libforces.so");
patches (turbine);
rhoInf 1.225;
CofR (0 0 0);
}
);

henrik July 21, 2009 04:29

Dear aaurouss,

Please post the complete controlDict. What's in line 60?

Henrik

aaurouss July 21, 2009 04:53

Dear Henrik,


Here is my controlDict: line 60 is about loading the library



*****************************************

application simpleFoam;
startFrom startTime;
startTime 0;
stopAt endTime;
endTime 1000;
deltaT 1;
writeControl timeStep;
writeInterval 100;
purgeWrite 0;
writeFormat ascii;
writePrecision 6;
writeCompression uncompressed;
timeFormat general;
timePrecision 6;
runTimeModifiable yes;
functions
(
forces
{
type forces;
functionObjectLibs("libforces.so");
patches(HULL);
rhoInf 1000;
CofR (0 0 0);
}
forceCoeffs
{
type forceCoeffs;
functionObjectLibs("libforces.so"); // LINE 60
patches(HULL);
rhoInf 1000;
CofR (0 0 0);
liftDir (0 1 0);
dragDir (1 0 0);
pitchAxis (0 0 0);
magUInf 1;
lRef 1;
Aref 1;
}


);




Regards

henrik July 21, 2009 05:08

Try putting a space here

functionObjectLibs[SPACE]("libforces.so");

Henrik

aaurouss July 21, 2009 05:47

Thanks, this error is gone now. But i got another one:

************************************************** *******
keyword patches is undefined in dictionary "/system/controlDict::functions"


system/controlDict::functions from line 59 to line 69.


From function dictionary::lookupEntry(const word& keyword) const
in file db/dictionary/dictionary.C at line 213.


FOAM exiting
***************************************

It seems that the "patches()" doesn't get a correct argument. I actually don't know what to put here. Is this the name of a BC or its type ? "
HULL" is a wall boundary condition on which I want to calculate the drag.

Here is my boundar file :


************************************************** *****************

FoamFile
{
version 2.0;
format ascii;
class polyBoundaryMesh;
location "constant/polyMesh";
object boundary;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //


5
(
HULL
{
type wall;
nFaces 3743;
startFace 651641;
}
SYM
{
type symmetryPlane;
nFaces 15143;
startFace 655384;
}
INLET
{
type patch;
nFaces 120;
startFace 670527;
}
OUTLET
{
type patch;
nFaces 120;
startFace 670647;
}
WALL
{
type patch;
nFaces 4216;
startFace 670767;
}
)

aaurouss July 21, 2009 05:53

Dear Henrik,

I finally solved the problem for the patch: it just also needed a space between "patches" and "()". So it was all about syntax ....

Thank you very much for your help !

Best regards

Antoine


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