CFD Online Logo CFD Online URL
Home > Forums > OpenFOAM

Calculating Drag

Register Blogs Members List Search Today's Posts Mark Forums Read

LinkBack Thread Tools Display Modes
Old   April 4, 2011, 00:00
Default Calculating Drag
New Member
Join Date: Apr 2011
Posts: 2
Rep Power: 0
digitalcubano is on a distinguished road
Hi Foamers,

First, I am brand new to OpenFoam. In fact, its been many years since I've dipped my toes in the CFD waters (right now I feel like I'm drowning!). So, I apologize for my inevitable noobness. For reference, I'm running openFoam v1.7.1.

Second, as indicated by the thread title, I'm interested in using openFoam to estimate the drag on an arbitrary body. To that end, I decided to edit the controlDict file in the cavity example by adding the following chunk of code:

type forces;
functionObjectLibs (""); //Lib to load
outputControl timeStep;
outputInterval 1;
patches (fixedWalls); // change to your patch name
rhoInf 1.225; //Reference density for fluid
CofR (0.25 0 0); //Origin for moment calculations
type forceCoeffs;
functionObjectLibs ("");
patches (fixedWalls); //change to your patch name
outputControl timeStep;
outputInterval 1;
rhoInf 1.225;
CofR (0 0 0);
liftDir (0 1 0);
dragDir (1 0 0);
pitchAxis (0.25 0 0);
magUInf 10.0;
lRef 1;
Aref 1;

However, when I run icoFoam, I don't get any force outputs anywhere. What am I doing wrong?
digitalcubano is offline   Reply With Quote

Old   April 4, 2011, 05:02
Greg Melling
Join Date: Nov 2010
Posts: 41
Rep Power: 7
grjmell is on a distinguished road
Try this:

        type        forceCoeffs;
        functionObjectLibs ( "" );
        outputControl timeStep;
        outputInterval 10;
        pName       p;
        UName       U;
	rhoName	    rhoInf;
        rhoInf      1000;		//freestream rho
        log         true;
        CofR        ( 0 0 0 );
        liftDir     ( 0 0 1 );
        dragDir     ( 1 0 0 );
        pitchAxis   ( 0 0 0 );
        magUInf     0.441;		//freestream velocity
        lRef        0.1;
        Aref        0.035;
This works.
grjmell is offline   Reply With Quote

Old   April 4, 2011, 13:01
New Member
Join Date: Apr 2011
Posts: 2
Rep Power: 0
digitalcubano is on a distinguished road
Yes it does! Thanks for the quick reply. It seems that the culprit was that I was missing the rhoName rhoInf field.

I understand that rhoInf is the free stream density, but what does the rhoName rhoInf field do?

Thanks again.
digitalcubano is offline   Reply With Quote


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
calculating drag and lift in fluent morteza08 FLUENT 4 December 13, 2012 16:34
Calculating Drag Ajay Rao FLUENT 8 February 15, 2010 10:15
calculating drag at low Re no over FX airfoil M. Essuri FLUENT 1 November 1, 2006 16:55
Which kind of pressure use calculating Drag? Fer Main CFD Forum 5 January 27, 2006 13:32
How to update polyPatchbs localPoints liu OpenFOAM Running, Solving & CFD 6 December 30, 2005 18:27

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