CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Post-Processing (https://www.cfd-online.com/Forums/openfoam-post-processing/)
-   -   tracking graphs of Cl and Cd (https://www.cfd-online.com/Forums/openfoam-post-processing/168204-tracking-graphs-cl-cd.html)

giammy92 March 17, 2016 07:40

tracking graphs of Cl and Cd
 
hi guys, i have a case of a flux on an airfoil and i need plot graphs of dimensionless coefficients Cl and Cd. Do you know a way to make them?

Bazinga March 17, 2016 11:23

You need to define cl and cd as a functionObject in the controlDict file. The data of the coefficients and the timesteps is then stored in the postProcessing folder and can be plotted with any software that can read the .dat file (Excel, Matlab, gnuplot, etc..).

giammy92 March 17, 2016 11:37

thanks man, now i have already defined the function in controlDict and after running the directory postProcessing is been created, in which there is forces.dat. But now when i type "gnuplot forces -" shows this:
Cannot open load file 'forces'
"forces", line 0: util.c: No such file or directory

Where am i wrong?

giammy92 March 17, 2016 11:56

Quote:

Originally Posted by Bazinga (Post 590319)
You need to define cl and cd as a functionObject in the controlDict file. The data of the coefficients and the timesteps is then stored in the postProcessing folder and can be plotted with any software that can read the .dat file (Excel, Matlab, gnuplot, etc..).

thanks man, now i have already defined the function in controlDict and after running the directory postProcessing is been created, in which there is forces.dat. But now when i type "gnuplot forces -" shows this:
Cannot open load file 'forces'
"forces", line 0: util.c: No such file or directory

Where am i wrong?

Bazinga March 17, 2016 13:13

note that lift and drag coefficients are stored in the forceCoeffs folder.
I can not help with gnuplot because iam doing it with matlab.

agarwa58 March 18, 2016 08:22

giammy92,

Using function objects in OpenFOAM by adding lines to the controldict file generates corresponding output in the postProcessing/forceCoeffs/time-instant/ directory. In your case the results will be generated in a file called 'forceCoeffs.dat'.
Once this file is generated, there are multiple ways of plotting it. You can either use gnuplot to plot Cd and Cl vs iteration (stored as 3 diff columns in the forceCoeffs file). Alternatively, you can use a software utility called 'xmgrace' that you'll need to install which automatically plots the fields generated by OpenFOAM. I find more convenient to use xmgrace for monitoring data generated by function objects.

giammy92 March 18, 2016 08:56

Thanks men but i had already resolved. But now i have a problem with Aref and lRef :mad:

Bazinga March 18, 2016 09:41

ARef is the reference reference area and lref is the reference length.
Maybe the following links help:
http://www.cfd-online.com/Forums/flu...-analysis.html

https://en.wikipedia.org/wiki/Drag_coefficient

giammy92 March 18, 2016 09:51

Thank you so much :)

giammy92 March 18, 2016 10:07

and about dragdir? because it is in opposite to flux, for an angle of attack >0 and then with airfoil in horizontal position and y component of U >0, dragdir is (-cos(alpha) -sin(alpha) 0) ???

Bazinga March 18, 2016 10:38

Keep the flow direction, drag direction and the coordinate system constant and change the model angle.

giammy92 March 18, 2016 11:12

Quote:

Originally Posted by Bazinga (Post 590465)
Keep the flow direction, drag direction and the coordinate system constant and change the model angle.

sorry but i don't understand. Dragdir is in opposite or in the same direction of flux? because now i just run airfoil2D tutorial for angle of attack 0 and if i choose dragdir (-1 0 0) (opposite direction) Cd is negative at the end of iterations, while if i choose dragdir (1 0 0) Cd is positive. Cd can only be positive?

Bazinga March 18, 2016 11:18

cd is in the main flow direction and lift is upwards perpendicular to it: For example:
http://weblab.open.ac.uk/firstflight.../ld_forces.gif

Just change the rotation of the geometry if you want a different angle of attack and keep the cd direction the same.

giammy92 March 18, 2016 11:27

Oh damn! I have had a big confusion about it! Because someone in other post wrote that dirdrag is opposite to flux :mad:!

Bazinga March 18, 2016 11:45

Just checked two text books to be sure and in both the definition of the drag force is in the main flow direction

giammy92 March 18, 2016 11:51

very useful man! Thanks a lot! ;)


All times are GMT -4. The time now is 07:36.