CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM (http://www.cfd-online.com/Forums/openfoam/)
-   -   How to get forces and forceCoeffs in v2.0.0 (http://www.cfd-online.com/Forums/openfoam/90540-how-get-forces-forcecoeffs-v2-0-0-a.html)

bigbang July 13, 2011 09:38

How to get forces and forceCoeffs in v2.0.0
 
Add this to the end of your <case>/system/controlDict file.

Replace patchname with your patches.

Then get your scalar constants sorted out (i.e.: lRef, Aref, magUInf) and vector constants (i.e.: liftDir, dragDir, pitchAxis)

Code:

functions
{
    forces
    {
        type            forceCoeffs;
        functionObjectLibs ( "libforces.so" );
        outputControl  timeStep;
        outputInterval  1;

        patches
        (
            patchname
        );

        pName      p;
        UName      U;
        rhoName            rhoInf;
       
        log        true;
        rhoInf      1.225;
        CofR        ( 0 0 0 );
        liftDir    ( 0 1 0 );
        dragDir    ( 1 0 0 );
        pitchAxis  ( 0 0 0 );
        magUInf    50;
        lRef        1;
        Aref        1;
    }
}

Note: In 2.0.0 (vs 1.7.1) you need to define rhoName as rhoInf, otherwise you will get this error

Code:

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



All times are GMT -4. The time now is 21:11.