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

Implementation of the drag coefficient Formula

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

Like Tree1Likes
  • 1 Post By Artur

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 23, 2013, 06:00
Default Implementation of the drag coefficient Formula
  #1
Member
 
Amin
Join Date: May 2013
Posts: 76
Rep Power: 12
Mirage12 is on a distinguished road
Hello Foamers

I am trying to simulate a flow around a half-cylinder.In order to evaluate my result and i need calculate some coefficients non-dimensional numbers , like Nussel-number and the drag coefficient:

For the calculation of the drag coefficient of the geometry i should use this Formula :


with




I am using ParaView and Ensight as a Post-Processing Tool.

Can anybody explain to me, how and where should implement this Formula, in order to calculate the drag coefficient for every time step ?

Thx for the support

PS: I am using OpenFOAM 2.2.0
Mirage12 is offline   Reply With Quote

Old   July 23, 2013, 07:57
Default solved :)
  #2
Member
 
Amin
Join Date: May 2013
Posts: 76
Rep Power: 12
Mirage12 is on a distinguished road
So...

Just write this Code in your controlDict-File

Code:
functions
(
forces
{
type forces;
functionObjectLibs ("libforces.so"); //Lib to load -> dylib on Mac and so on Linux
rhoInf 1.0; //Reference density for fluid - can be changed later ...
patches (fixedWalls); //Name of patche to integrate forces
CofR (0 0 0); //Origin for moment calculations
outputControl timeStep;
outputInterval 1;
}
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 (fixedWalls);
rhoName rhoInf;
rhoInf 1000;
CofR (2 0 0);
liftDir (0 1 0);
dragDir (1 0 0);
pitchAxis (0 0 1);
magUInf 1e-7;
lRef 0.06; // sphere diameter
Aref 0.0014137; //1/2 * projected area = pi*rē/2

        outputControl   timeStep;
        outputInterval  1;
}


);


The Folder postProcessing will be created, there you will find the values of Lift, Drag for every time step saved in the forceCoeffs.dat file

For more information :

http://www.cfd-online.com/Forums/ope...efficient.html
http://ww3.cad.de/foren/ubb/Forum527...000069-2.shtml
Mirage12 is offline   Reply With Quote

Old   July 24, 2013, 01:06
Default
  #3
Member
 
Amin
Join Date: May 2013
Posts: 76
Rep Power: 12
Mirage12 is on a distinguished road
Hello


i did a little mistake

The simulation was running and the OpenFOAM calculated the drag , lift....and that is why i thought every is perfect ....

but

i did not calculate the forces properly :

Code:
--> FOAM Warning : 
    From function void forces::read(const dictionary&)
    in file forces/forces.C at line 449
    Could not find U, p or rho in database.
    De-activating forces.
Do you know, how to fix this warning ??

Thx
Mirage12 is offline   Reply With Quote

Old   July 26, 2013, 04:56
Default
  #4
Senior Member
 
Artur's Avatar
 
Artur
Join Date: May 2013
Location: Southampton, UK
Posts: 372
Rep Power: 19
Artur will become famous soon enough
You didn't mention what solver you were using but I think the problem might be that you didn't specify the field names in your controlDict file. Here's how I do it with interFoam and pimpleDyMFoam and it works:

Code:
    forces
    {
        type        forces;
        functionObjectLibs ( "libforces.so" );
        outputControl timeStep;
        outputInterval 1;
        patches
        (
           "hull.*"
        );
        rhoName     rho;        
        pName       p;
        UName       U;
        log         true
        rhoInf      1;
        CofR        (-5.95 -0.518 -0.5705);
    }
Mirage12 likes this.
Artur is offline   Reply With Quote

Old   August 5, 2013, 01:11
Default
  #5
Member
 
Amin
Join Date: May 2013
Posts: 76
Rep Power: 12
Mirage12 is on a distinguished road
thanks !!
Mirage12 is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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 Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Drag Coefficient Convergence Problem John FLUENT 18 June 24, 2023 09:22
problem with saving drag coefficient colopolo FLUENT 5 April 12, 2013 10:59
Calculation of Drag Coefficient, Help Please teek22 CFX 1 April 26, 2012 18:41
Drag coefficient for parcels in dieselFoam sebastian_vogl OpenFOAM Running, Solving & CFD 5 December 31, 2008 12:19
Automotive test case vinz OpenFOAM Running, Solving & CFD 98 October 27, 2008 08:43


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