liftDrag
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.. 
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 :cool: 
liftDrag
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.. 
Quote:
Can I just ask what is IRef and Aref and what sort of values should we use? Thanks 
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. 
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? 
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. 
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 
For a cylinder, it would be PI/4 * diamater * diameter otherwise it is not a surface. No ? :o

Quote:

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"

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? 
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 
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. 
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 
Quote:
thanks for the clarification: I've changed the settings in my controlDict and now all seems to work properly. Regards V. 
Drag coef of cylinder
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? 
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; } 
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 
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. 
All times are GMT 4. The time now is 03:19. 