CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM

Calculating Drag

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 4, 2011, 01:00
Default Calculating Drag
  #1
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:

functions
{
forces
{
type forces;
functionObjectLibs ("libforces.so"); //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
}
forceCoeffs
{
type forceCoeffs;
functionObjectLibs ("libforces.so");
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, 06:02
Default
  #2
Member
 
Join Date: Nov 2010
Posts: 41
Rep Power: 16
grjmell is on a distinguished road
Try this:

Code:
    forces
    {
        type        forceCoeffs;
        functionObjectLibs ( "libforces.so" );
        outputControl timeStep;
        outputInterval 10;
        patches
        (
            cylinder
        );
        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, 14:01
Default
  #3
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

Reply


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 Off
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 23:57.