CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Post-Processing (http://www.cfd-online.com/Forums/openfoam-post-processing/)
-   -   Forces calulated through pressure (http://www.cfd-online.com/Forums/openfoam-post-processing/72430-forces-calulated-through-pressure.html)

LVDH February 5, 2010 05:50

Forces calulated through pressure
 
Hello my fellow Foamers,
I have to address something I find confusing:

I have found two ways to calculate forces.
The first one is with the help out of this forum. Someone suggested to hang this piece of code to the controlDict

Code:

functions
{
forces
{
type forces;
functionObjectLibs ("libforces.so"); //Lib to load
patches (wall); // change to your patch name
rhoName rhoInf;
rhoInf 1.205; //Reference density for fluid
CofR (4.5 1.5 2.125); //Origin for moment calculations
        outputControl  timeStep;
        outputInterval  50;
}
forceCoeffs
{
// rhoInf - reference density
// CofR - Centre of rotation
// dragDir - Direction of drag coefficient
// liftDir - Direction of lift coefficient
// pitchAxis - Pitching moment axis
// magUinf - free stream velocity magnitude
// lRef - reference length
// Aref - reference area
type forceCoeffs;
functionObjectLibs ("libforces.so");
patches (wall);
rhoName rhoInf;
rhoInf 1.205;
CofR (2 0 0);
liftDir (0 1 0);
dragDir (1 0 0);
pitchAxis (0 0 1);
magUInf 50;
lRef 4.245; // sphere diameter
Aref 2.2555; //1/2 * projected area = pi*r/2

        outputControl  timeStep;
        outputInterval  50;
}

}

This does seem to work. I do get a folder containing the forces.

My second way of calculating the forces is by using the command patchIntegrate. If I use this command with the p field and the wall it should (thats what I thought) give me the forces resulting through pressuredifferences.

My problem is that the two methodes come to different solutions. If I run the simpleFoam/airfoil tutorial in timestep 500 I get these two solutions:

controlDict: (-97.6164 755.598 -6.01592e-14)
patchIntegrate: (-81.0095 627.052 -4.99247e-14)

The two solutions are not completly different, but still the question remains:
Why are they different?

naval February 25, 2010 07:27

Hi Andre,

Your forces differ all by the factor 1.205 - which is exactly the value of your reference density rhoInf.

If you check out the 2D-Airfoil tutorial you will notice, that the pressure dimension is set to m/s, which means you actually deal with p/rho (that's at least my assumption).
And so does of course patchIntegrate.

Cheers,
naval

edit: In the transportProperties dictionary rho is set to 1 kg/m. Changing that to your reference density will also produce matching results.

LVDH February 26, 2010 04:15

You are right.
Thanks.


All times are GMT -4. The time now is 15:53.