CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM (
-   -   lift and drag (

nicchani July 14, 2009 08:02

lift and drag
Hi, I was searching the forum to find some help to get the lift and drag tool and I finally downloaded the files from the third post in this thread:

I compiled and now it seems to be ok but I don't know what library i have to call in the controldict file :S

nicchani July 14, 2009 10:45

this is what I am using:

type liftDrag;
functionObjectLibs ("");

and when I run it I get this error:

--> FOAM FATAL ERROR : Unknown functiont type liftDrag

Valid functions are :


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

FOAM exiting

I don't know why the liftDrag function isn't valid.

hansel July 14, 2009 11:10

I'm getting force and torque with this, although in the recent 1.5-dev there might be a problem with this library.

functions // this one!
type forces;
functionObjectLibs (""); //Lib to load
patches (turbine); // change to your patch name
rhoInf 1.225; //Reference density for fluid
CofR (0 0 0); //Origin for moment calculations

nicchani July 14, 2009 11:26

I am using openfoam 1.4.1 so I don't have that library. If I use turbulentforceandtorque as a force I get some forces on the screen, but what I want is the lift and drag and I have no idea how to get it or if the forces I get on the screen are those. I don't even know what force and torque is. I'm obviously new at this :confused:

when I use turbulentforceandtorque I get these forces on screen:

Pressure forces = 1((0 0 0))
Pressure moments = 1((0 0 0))
Viscous forces = 1((0 0 0))
Viscous moments = 1((0 0 0))
Total forces = 1((0 0 0))
Total moments = 1((0 0 0))

nicchani July 15, 2009 07:01

I have an exe called liftDrag which I guess is the tool for postprocessing. I run the simulation with simplefoam and when it's finished I have run liftDrag but I get all these errors and I don't know what's the problem. Can someone help me with this please? Thanks.

Create mesh for time = 0

Time = 0
Reading U

Reading p

Inlet velocity: (73.45 0 0)
Wall patch 0 named AEROFOIL :
Reference area: 31082.9 Reference length: 500.232 Drag coefficient: 0 Lift coefficient: (0 0 0) Moment coefficient: (0 0 0)
#0 Foam::error::printStack(Foam::Ostream&) in "/home/nicky/OpenFOAM/OpenFOAM-1.4.1/lib/linuxGccDPOpt/"
#1 Foam::sigFpe::sigFpeHandler(int) in "/home/nicky/OpenFOAM/OpenFOAM-1.4.1/lib/linuxGccDPOpt/"
#2 Uninterpreted: [0xffffe420]
#3 Foam::liftDrag::momentCoefficient(Foam::GeometricF ield<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh> const&, Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> const&, Foam::dimensioned<double> const&, Foam::word const&, Foam::Vector<double> const&, double const&, double const&) in "/home/nicky/OpenFOAM/OpenFOAM-1.4.1/lib/linuxGccDPOpt/"
#4 main in "/home/nicky/OpenFOAM/OpenFOAM-1.4.1/applications/bin/linuxGccDPOpt/liftDrag"
#5 __libc_start_main in "/lib/i686/"
#6 __gxx_personality_v0 in "/home/nicky/OpenFOAM/OpenFOAM-1.4.1/applications/bin/linuxGccDPOpt/liftDrag"
Floating point exception

aaurouss July 20, 2009 08:56

Hi everyone

I tried to use the function described in Hansel's post, but I get an error using it.
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 ?

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