CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM (http://www.cfd-online.com/Forums/openfoam/)
-   -   Help! problems in calculating forces with SimpleFoam (http://www.cfd-online.com/Forums/openfoam/84350-help-problems-calculating-forces-simplefoam.html)

DLC January 26, 2011 18:27

Help! problems in calculating forces with SimpleFoam
 
Hello Everyone!

I'm testing simpleFoam (OF 1.7) on the classic NACA 0012. To obtain forces on the airfoil I use the following commands in the controlDict:

functions
(
forces
{
type forces;
functionObjectLibs ("libforces.so"); //Lib to load
patches (wing); // change to your patch name
rhoInf 1.225; //Reference density for fluid
CofR (0.15 0 0); //Origin for moment calculations
outputControl outputTime;
}
forceCoeffs
{
type forceCoeffs;
functionObjectLibs ("libforces.so");
patches (wing); //change to your patch name
rhoInf 1.225;
CofR (0 0 0);
liftDir (0 1 0);
dragDir (1 0 0);
pitchAxis (0 0 0);
magUInf 55.5;
lRef 0.6;
Aref 1;
outputControl outputTime;
}
);




When I launch the run, this warning message is given and no forces/forces.dat is made (the run goes without any problem)
the same commands work perfectly on interFoam..

can anyone help me?
thanks!

Starting time loop

--> FOAM Warning :
From function void forces::read(const dictionary& dict)
in file forces/forces.C at line 277
Could not find U, p or rho in database.
De-activating forces.
--> FOAM Warning :
From function void forces::read(const dictionary& dict)
in file forces/forces.C at line 277
Could not find U, p or rho in database.
De-activating forces.
Time = 1

philippose January 27, 2011 02:23

Hi,

A Good Morning to you :-)!

You are getting this warning, and the force calculations are subsequently disabled because you are missing one line in your forces function definition... you need to change your function definition to:

Code:

functions
(
    forces
    {
        type forces;
        functionObjectLibs ("libforces.so"); //Lib to load
        patches (wing); // change to your patch name
        rhoInf 1.225; //Reference density for fluid
          rhoName rhoInf;
        CofR (0.15 0 0); //Origin for moment calculations
        outputControl outputTime;
    }
    forceCoeffs
    {
        type forceCoeffs;
        functionObjectLibs ("libforces.so");
        patches (wing); //change to your patch name
        rhoInf 1.225;
          rhoName rhoInf; 
        CofR (0 0 0);
        liftDir (0 1 0);
        dragDir (1 0 0);
        pitchAxis (0 0 0);
        magUInf 55.5;
        lRef 0.6;
        Aref 1;
        outputControl outputTime;
    }
);


Hope this helps!

Have a great day ahead!

Philippose

DLC January 27, 2011 19:22

YES!!!!!!!!!!!!!!!!!!!!!!!!!!!!
it works fine now!
thanks a lot!!!!
just wondering why the same lines worked fine on the interFoam solver...

Thanks again!

DL


All times are GMT -4. The time now is 01:32.