
[Sponsors] 
May 20, 2010, 02:07 
liftDrag

#1 
New Member
karthik
Join Date: May 2010
Posts: 2
Rep Power: 0 
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 kepsilon 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.. 

May 21, 2010, 08:22 

#2 
Member

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 

May 24, 2010, 05:36 
liftDrag

#3 
New Member
karthik
Join Date: May 2010
Posts: 2
Rep Power: 0 
Hi,
Thanks for such an wonderful response Mr. NgocMinh Truong, sorry, I've not mention... Particulars Case : NACA4412 Software: OpenFoam 1.4.1 flow solver : sonicFoam Turbulence model : Std kepsilon 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.. 

July 5, 2010, 20:25 

#4 
Senior Member
Jie
Join Date: Jan 2010
Location: Australia
Posts: 123
Rep Power: 9 

July 6, 2010, 07:41 

#5  
New Member
Ricardo Flatschart
Join Date: Apr 2010
Posts: 12
Rep Power: 9 
Quote:
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. 

July 6, 2010, 08:12 

#6  
Senior Member
Jie
Join Date: Jan 2010
Location: Australia
Posts: 123
Rep Power: 9 
Quote:
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? 

July 6, 2010, 08:56 

#7 
New Member
Ricardo Flatschart
Join Date: Apr 2010
Posts: 12
Rep Power: 9 
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. 

July 6, 2010, 19:46 

#8  
Senior Member
Jie
Join Date: Jan 2010
Location: Australia
Posts: 123
Rep Power: 9 
Quote:
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. 

July 7, 2010, 03:46 

#9 
Member

For a cylinder, it would be PI/4 * diamater * diameter otherwise it is not a surface. No ?


July 7, 2010, 03:48 

#10 
Senior Member
Jie
Join Date: Jan 2010
Location: Australia
Posts: 123
Rep Power: 9 

July 7, 2010, 11:01 

#11 
New Member
Ricardo Flatschart
Join Date: Apr 2010
Posts: 12
Rep Power: 9 
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"


July 7, 2010, 19:55 

#12  
Senior Member
Jie
Join Date: Jan 2010
Location: Australia
Posts: 123
Rep Power: 9 
Quote:
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? 

September 13, 2010, 11:48 

#13 
Senior Member
Mads Reck
Join Date: Aug 2009
Location: Copenhagen, Denmark
Posts: 175
Rep Power: 10 
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 airfoilmesher for OpenFOAM here 

October 7, 2010, 06:28 

#14  
Senior Member
Vesselin Krastev
Join Date: Jan 2010
Location: University of Tor Vergata, Rome
Posts: 364
Rep Power: 12 
Quote:
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. 

October 7, 2010, 08:32 

#15 
New Member
Ricardo Flatschart
Join Date: Apr 2010
Posts: 12
Rep Power: 9 
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 

October 7, 2010, 09:59 

#16  
Senior Member
Vesselin Krastev
Join Date: Jan 2010
Location: University of Tor Vergata, Rome
Posts: 364
Rep Power: 12 
Quote:
thanks for the clarification: I've changed the settings in my controlDict and now all seems to work properly. Regards V. 

February 17, 2013, 13:33 
Drag coef of cylinder

#17 
New Member
Matt
Join Date: Oct 2012
Posts: 3
Rep Power: 6 
hi, quite new to openfoam, im using pisoFoam, ke 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? 

February 21, 2013, 19:49 

#18 
New Member
dave
Join Date: Feb 2013
Posts: 3
Rep Power: 6 
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; } 

February 21, 2013, 20:15 

#19 
New Member
Ricardo Flatschart
Join Date: Apr 2010
Posts: 12
Rep Power: 9 
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 

February 7, 2014, 08:53 

#20 
New Member
Meher
Join Date: Jan 2014
Posts: 11
Rep Power: 5 
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 spanwise direction in case of 2D flow around a cylinder ? I opened the geometry in ParaFoam and checked the zdirection length and supplied the same value as input for length of spanwise direction. Please help me where I am doing wrong. Thanks in advance, Meher. 

Thread Tools  
Display Modes  


Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
Question to liftDrag  hoochie  OpenFOAM PostProcessing  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 PreProcessing  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 