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

liftDrag

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

Like Tree4Likes
  • 1 Post By matdgonz
  • 1 Post By davemanson
  • 1 Post By rflats
  • 1 Post By ssmeherk

Reply
 
LinkBack Thread Tools Display Modes
Old   May 20, 2010, 02:07
Default liftDrag
  #1
New Member
 
karthik
Join Date: May 2010
Posts: 2
Rep Power: 0
karthik_be is on a distinguished road
Hi to everyone,

I'm quite new to OpenFOAM, for the past 6 months I'm working on NACA4412 project, thing were fine till my case was under Incompressible flow. But as i took Compressible flow the problem started to encounter into my case....
Please i need some help with this regard..

Particulars
Case : NACA4412
Software: OpenFoam
flow solver : sonicFoam
Turbulence model : Std k-epsilon model
Query : I'm not getting liftdrag coeff... I heard through somebody that for sonicFoam lift & drag cant be calculated... Plz help me in this regard... Waiting for the reply..
karthik_be is offline   Reply With Quote

Old   May 21, 2010, 08:22
Default
  #2
Member
 
Ngoc-Minh Truong
Join Date: Feb 2010
Location: Toulouse, France
Posts: 42
Rep Power: 7
truong_nm is on a distinguished road
Send a message via MSN to truong_nm
Add these lines at the end of your controlDict file:
functions
{
forces
{
type forceCoeffs;
functionObjectLibs ( "libforces.so" );
outputControl timeStep;
outputInterval 1;
patches
(
EXTRADOS INTRADOS
);
pName p;
UName U;
log true;
rhoInf 1.1768292;
CofR ( 0 0 0 );
liftDir ( -0.04483992 0 0.99899418 );
dragDir ( 0.99899418 0 0.04483992 );
pitchAxis ( 0 1 0 );
magUInf 208.312257;
lRef .61;
Aref .61;
}
}

And change the values of course
truong_nm is offline   Reply With Quote

Old   May 24, 2010, 05:36
Default liftDrag
  #3
New Member
 
karthik
Join Date: May 2010
Posts: 2
Rep Power: 0
karthik_be is on a distinguished road
Hi,
Thanks for such an wonderful response Mr. Ngoc-Minh Truong,
sorry, I've not mention...

Particulars
Case : NACA4412
Software: OpenFoam 1.4.1
flow solver : sonicFoam
Turbulence model : Std k-epsilon model
Query : I'm not getting liftdrag coeff... I heard through somebody that for sonicFoam lift & drag cant be calculated... Plz help me in this regard... Waiting for the reply..
karthik_be is offline   Reply With Quote

Old   July 5, 2010, 20:25
Default
  #4
Senior Member
 
Jie
Join Date: Jan 2010
Location: Australia
Posts: 123
Rep Power: 7
jiejie is on a distinguished road
Quote:
Originally Posted by truong_nm View Post
Add these lines at the end of your controlDict file:

lRef .61;
Aref .61;

And change the values of course
Hi truong_nm

Can I just ask what is IRef and Aref and what sort of values should we use?

Thanks
jiejie is offline   Reply With Quote

Old   July 6, 2010, 07:41
Default
  #5
New Member
 
Ricardo Flatschart
Join Date: Apr 2010
Posts: 12
Rep Power: 7
rflats is on a distinguished road
Quote:
Originally Posted by jiejie View Post
Hi truong_nm

Can I just ask what is IRef and Aref and what sort of values should we use?

Thanks
Hi Jie,
lRef and ARef are the reference length and area, respectively. This information is necessary for calculating the lift and drag coefficients.
If you are working with a 2D airfoil, you need to specify the chord of the airfoil as reference length and reference area.
rflats is offline   Reply With Quote

Old   July 6, 2010, 08:12
Default
  #6
Senior Member
 
Jie
Join Date: Jan 2010
Location: Australia
Posts: 123
Rep Power: 7
jiejie is on a distinguished road
Quote:
Originally Posted by rflats View Post
Hi Jie,
lRef and ARef are the reference length and area, respectively. This information is necessary for calculating the lift and drag coefficients.
If you are working with a 2D airfoil, you need to specify the chord of the airfoil as reference length and reference area.
Thank you for your reply truong_nm

I got some quick questions as follows:

1. If we look at 2D cases:

For a 2D aerofoil with chord length of 1, can we assume the area is 1 as well or it is better to calculate it?

For a 2D cylinder flow, lRef = diameter of the cylinder and ARef is the area of the cylinder?

2. If we look at 3D cases:

Will lRef and ARef same as the 2D cases?
jiejie is offline   Reply With Quote

Old   July 6, 2010, 08:56
Default
  #7
New Member
 
Ricardo Flatschart
Join Date: Apr 2010
Posts: 12
Rep Power: 7
rflats is on a distinguished road
Answering your questions:

1. For a 2D airfoil, you can simply put Aref=lRef=chord length.
In the case of a 2D cylinder, Aref=lRef=diameter

2. For 3D cases, you have to put reference dimensions that are compatible with your problem. For instance, if you are studying a 3D wing, it makes sense to put lRef equal to the mean aerodynamic chord of the wing, and Aref as the planform area of the wing.
rflats is offline   Reply With Quote

Old   July 6, 2010, 19:46
Default
  #8
Senior Member
 
Jie
Join Date: Jan 2010
Location: Australia
Posts: 123
Rep Power: 7
jiejie is on a distinguished road
Quote:
Originally Posted by rflats View Post
Answering your questions:

1. For a 2D airfoil, you can simply put Aref=lRef=chord length.
In the case of a 2D cylinder, Aref=lRef=diameter

2. For 3D cases, you have to put reference dimensions that are compatible with your problem. For instance, if you are studying a 3D wing, it makes sense to put lRef equal to the mean aerodynamic chord of the wing, and Aref as the planform area of the wing.
Hi Rflats

For a 2D cylinder case, why whould Aref = diameter?

For 3D aerofoil, the planform area = spanwise area (projected aera from top view)?

Thank you

Last edited by jiejie; July 7, 2010 at 02:54.
jiejie is offline   Reply With Quote

Old   July 7, 2010, 03:46
Default
  #9
Member
 
Ngoc-Minh Truong
Join Date: Feb 2010
Location: Toulouse, France
Posts: 42
Rep Power: 7
truong_nm is on a distinguished road
Send a message via MSN to truong_nm
For a cylinder, it would be PI/4 * diamater * diameter otherwise it is not a surface. No ?
truong_nm is offline   Reply With Quote

Old   July 7, 2010, 03:48
Default
  #10
Senior Member
 
Jie
Join Date: Jan 2010
Location: Australia
Posts: 123
Rep Power: 7
jiejie is on a distinguished road
Quote:
Originally Posted by truong_nm View Post
For a cylinder, it would be PI/4 * diamater * diameter otherwise it is not a surface. No ?
That's what I am thinking, or it is the projected surface from top view?
jiejie is offline   Reply With Quote

Old   July 7, 2010, 11:01
Default
  #11
New Member
 
Ricardo Flatschart
Join Date: Apr 2010
Posts: 12
Rep Power: 7
rflats is on a distinguished road
When calculating the drag coefficient, one has to choose what are the geometrical parameters that make sense for each particular case. In the case of 3D bluff bodies (e.g. a passenger car, or a sphere), the drag is related mainly to the transversal dimensions w.r.t. the flow. So, for a car, normally one use the maximum cross sectional area as a reference area. For a sphere, normally one uses pi*r^2 (note that it is not the surface area 4*pi*r^2). For streamlined 3D bodies, the drag is mainly governed by skin friction, so it makes sense using the surface area as reference area. In the particular case of wings, the planform area is not so different of the wing surface area, so it is used in the adimensionalization. For 2D bodies, the same ideas apply. So, for a 2D cylinder you can use the diameter as a reference "area". For profiles, you can use the chord length as a reference "area"
rflats is offline   Reply With Quote

Old   July 7, 2010, 19:55
Default
  #12
Senior Member
 
Jie
Join Date: Jan 2010
Location: Australia
Posts: 123
Rep Power: 7
jiejie is on a distinguished road
Quote:
Originally Posted by rflats View Post
When calculating the drag coefficient, one has to choose what are the geometrical parameters that make sense for each particular case. In the case of 3D bluff bodies (e.g. a passenger car, or a sphere), the drag is related mainly to the transversal dimensions w.r.t. the flow. So, for a car, normally one use the maximum cross sectional area as a reference area. For a sphere, normally one uses pi*r^2 (note that it is not the surface area 4*pi*r^2). For streamlined 3D bodies, the drag is mainly governed by skin friction, so it makes sense using the surface area as reference area. In the particular case of wings, the planform area is not so different of the wing surface area, so it is used in the adimensionalization. For 2D bodies, the same ideas apply. So, for a 2D cylinder you can use the diameter as a reference "area". For profiles, you can use the chord length as a reference "area"
Hi rflats Thanks for your explanation

I think I got your point, it is the planform area governs the drag and lift coefficients in both 2D and 3D cases. Hence, Aref = diameter for 2D cylinder as there is not spanwise length, and Aref = diameter x spanwise length for 3D cylinder case. Am I right?
jiejie is offline   Reply With Quote

Old   September 13, 2010, 11:48
Default
  #13
Senior Member
 
MadsR's Avatar
 
Mads Reck
Join Date: Aug 2009
Location: Copenhagen, Denmark
Posts: 175
Rep Power: 9
MadsR is on a distinguished road
So for an airfoil with a chord of 1.0 and a span of 0.5 you would set

lRef = 1.0
Aref = 0.5

right? It would make sense since the lift and drag forces need the area and the corresponding coefficients require the chord length (for airfoils).

/Mads
__________________
Online free airfoil-mesher for OpenFOAM here
MadsR is offline   Reply With Quote

Old   October 7, 2010, 06:28
Default
  #14
Senior Member
 
Vesselin Krastev
Join Date: Jan 2010
Location: University of Tor Vergata, Rome
Posts: 361
Rep Power: 10
vkrastev is on a distinguished road
Quote:
Originally Posted by rflats View Post
When calculating the drag coefficient, one has to choose what are the geometrical parameters that make sense for each particular case. In the case of 3D bluff bodies (e.g. a passenger car, or a sphere), the drag is related mainly to the transversal dimensions w.r.t. the flow. So, for a car, normally one use the maximum cross sectional area as a reference area. For a sphere, normally one uses pi*r^2 (note that it is not the surface area 4*pi*r^2). For streamlined 3D bodies, the drag is mainly governed by skin friction, so it makes sense using the surface area as reference area. In the particular case of wings, the planform area is not so different of the wing surface area, so it is used in the adimensionalization. For 2D bodies, the same ideas apply. So, for a 2D cylinder you can use the diameter as a reference "area". For profiles, you can use the chord length as a reference "area"
Hi Rflats,

I'm sorry for posing another time such a trivial question, but I'm trying to calculate the drag coefficient for a flow on a 2D cylinder and, following your suggestion of setting Aref=lref=cylinder diameter, my preliminar esults are completely wrong...
The testcase which I'm referring to is a very low Re case (Re=33), and I'm using the pimpleFoam transient solver (OpenFOAM 1.6) with turbulence switched off. The solution converges well, but the drag coefficient printed by the forceCoeffs goes to about 0.1, when the effective drag coefficient at this Re number should be of about 1.5. Here I post some additional information about the case in question

Cylinder diameter = 1m
Free stream velocity magnitude = 1m/s
Kinematic viscosity = 0.03 m^2/s

controlDict setting:


application pimpleFoam;

startFrom startTime;

startTime 0;

stopAt endTime;

endTime 10;

deltaT 0.002;

writeControl adjustableRunTime;

writeInterval 0.2;

purgeWrite 0;

writeFormat ascii;

writePrecision 6;

writeCompression uncompressed;

timeFormat general;

timePrecision 6;

runTimeModifiable yes;

adjustTimeStep no;

maxCo 0.8;

functions
{

// forces
// {
// type forces;
// functionObjectLibs ("libforces.so"); //Lib to load
// patches (ala); // change to your patch name
// rhoName rhoInf;
// rhoInf 1.184; //Reference density for fluid
// CofR (1 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 (cylinder);
rhoName rhoInf;
rhoInf 1.184;
CofR (0.1 0 0);
liftDir (0 1 0);
dragDir (1 0 0);
pitchAxis (0 0 1);
magUInf 1;
lRef 1;
Aref 1;

outputControl timeStep;
outputInterval 50;
}
}

Any help or suggestions would be really appreciated...
Thank you in advance

V.
vkrastev is offline   Reply With Quote

Old   October 7, 2010, 08:32
Default
  #15
New Member
 
Ricardo Flatschart
Join Date: Apr 2010
Posts: 12
Rep Power: 7
rflats is on a distinguished road
Hi Vesselin,
This occurs because OpenFOAM is not a "pure" 2D solver. In fact, it always uses 3D meshes, and the 2D simulation is made by a special treatment of the boundary conditions in the spanwise direction.
So, in a purely 2D solver, my statement is correct. But, if using OpenFoam, you have to set Aref as (cylinder diameter)*(length in the spanwise direction).
Sorry for the confusion...
Regards,
Ricardo
rflats is offline   Reply With Quote

Old   October 7, 2010, 09:59
Default
  #16
Senior Member
 
Vesselin Krastev
Join Date: Jan 2010
Location: University of Tor Vergata, Rome
Posts: 361
Rep Power: 10
vkrastev is on a distinguished road
Quote:
Originally Posted by rflats View Post
Hi Vesselin,
This occurs because OpenFOAM is not a "pure" 2D solver. In fact, it always uses 3D meshes, and the 2D simulation is made by a special treatment of the boundary conditions in the spanwise direction.
So, in a purely 2D solver, my statement is correct. But, if using OpenFoam, you have to set Aref as (cylinder diameter)*(length in the spanwise direction).
Sorry for the confusion...
Regards,
Ricardo
Hi Ricardo,
thanks for the clarification: I've changed the settings in my controlDict and now all seems to work properly.

Regards

V.
vkrastev is offline   Reply With Quote

Old   February 17, 2013, 13:33
Default Drag coef of cylinder
  #17
New Member
 
Matt
Join Date: Oct 2012
Posts: 3
Rep Power: 4
matdgonz is on a distinguished road
hi, quite new to openfoam, im using pisoFoam, k-e turbulence model, Re=10,000. However, i get a Cd of around 0.9 instead of somthin higher aroudn 1.4 (according to book)

I was reading the above threads regarding the drag coefficient of a cylinder.

this is my controlDic;


application pisoFoam;

startFrom startTime;

startTime 0;

stopAt endTime;

endTime 600;

deltaT 1;

writeControl timeStep;

writeInterval 10;

purgeWrite 0;

writeFormat ascii;

writePrecision 6;

writeCompression uncompressed;

timeFormat general;

timePrecision 6;

runTimeModifiable yes;

functions
{
forces
{
type forces;
functionObjectLibs ("libforces.so"); //Lib to load
patches (cylinder); // change to your patch name
rhoName rhoInf;
rhoInf 1.1614; //Reference density for fluid
CofR (-0.5 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 (cylinder);
rhoName rhoInf;
rhoInf 1.1614;
CofR (-0.5 0 0);
liftDir (0 1 0);
dragDir (1 0 0);
pitchAxis (0 0 1);
magUInf 0.1;
lRef 1; //
Aref 1; //

outputControl timeStep;
outputInterval 1;
}

As such i don't think it could be wrong values within the ControDic file.

Should i increase the Mesh close to the cylinder? That should give a much btr result or would it just be more accurate around 0.9?
xerxes92005 likes this.
matdgonz is offline   Reply With Quote

Old   February 21, 2013, 19:49
Default
  #18
New Member
 
dave
Join Date: Feb 2013
Posts: 3
Rep Power: 4
davemanson is on a distinguished road
Hi,

I am just curious as to how to actually get realistic values of lift and drag coefficients using this script added into my controlDict for a 2D airfoil. The airfoil points in my geometry suggest that the Lref would be 1 and hence so would the Aref, however my coeff of lift and drag are around 10^-8 etc.

To try and correct this I changed my RhoInf from 1000 to 1.184 as it was a mistake. and also changed Lref and Aref to 0.001 as I noticed in the blockmesh it seems to convert interpret the input values in mm. Does anyone know if I am doing anything severely wrong?

Thank you,
Dave

/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.7.0 |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "system";
object controlDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

application simpleFoam;

startFrom latestTime;

startTime 0;

stopAt endTime;

endTime 1000;

deltaT 1;

writeControl timeStep;

writeInterval 50;

purgeWrite 0;

writeFormat ascii;

writePrecision 6;

writeCompression uncompressed;

timeFormat general;

timePrecision 6;

runTimeModifiable yes;

functions
{
totalDrag
{
// 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 (airfoil);
rhoName rhoInf;
rhoInf 1.184;
CofR (0 0 0);
liftDir (0 1 0);
dragDir (1 0 0);
pitchAxis (0 0 1);
magUInf 50;
lRef 0.001;
Aref 0.001;

outputControl timeStep;
outputInterval 5;
}
xerxes92005 likes this.
davemanson is offline   Reply With Quote

Old   February 21, 2013, 20:15
Default
  #19
New Member
 
Ricardo Flatschart
Join Date: Apr 2010
Posts: 12
Rep Power: 7
rflats is on a distinguished road
Please try setting the reference area as Aref=(airfoil chord length)*(length in the spanwise direction of your 2D domain). See the postings above for the explanation.

Cheers,
Ricardo
xerxes92005 likes this.
rflats is offline   Reply With Quote

Old   February 7, 2014, 08:53
Post
  #20
New Member
 
Meher
Join Date: Jan 2014
Posts: 4
Rep Power: 3
ssmeherk is on a distinguished road
Hi,

I am having a set of benchmark results for 2D case of flow over cylinder and am trying to match my Cd and Cl values with the benchmarked ones but in vain. I am getting an error of 14% which is clearly unacceptable.

On what basis one should decide the length of span-wise direction in case of 2D flow around a cylinder ? I opened the geometry in ParaFoam and checked the z-direction length and supplied the same value as input for length of span-wise direction.

Please help me where I am doing wrong.

Thanks in advance,
Meher.
xerxes92005 likes this.
ssmeherk is offline   Reply With Quote

Reply

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
Question to liftDrag hoochie OpenFOAM Post-Processing 29 September 19, 2014 03:38
Adding liftDrag to Openfoam141 srinath OpenFOAM Running, Solving & CFD 9 August 25, 2009 13:39
LiftDrag for 141 ryan_m OpenFOAM Running, Solving & CFD 2 August 24, 2009 21:26
LiftDrag compiling problem vdb OpenFOAM Pre-Processing 2 June 16, 2008 09:45
Compiling liftDrag crashed with initc%3cIMG SRC%3d%22httpopenfoamcfdonlinecomforumclipartsadgif%22 ALT%3d%22%22 BORDER%3d0%3etext0x20 undefined reference to %60mainb sponiar OpenFOAM Running, Solving & CFD 2 January 17, 2008 05:00


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